tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: mfii hanging on boot



On 2022/06/23 18:33, Edgar Fuß wrote:
>> I committed the change yesterday.
> I don't get what the #if defined(__LP64__) && 0 is for.

It's just to make the same line as of bus_space_write_8().
I don't know why it's "&& 0"ed.

-----------
static void
mfii_start(struct mfii_softc *sc, struct mfii_ccb *ccb)
{
#if defined(__LP64__) && 0
	u_long *r = (u_long *)&ccb->ccb_req;
#else
	uint32_t *r = (uint32_t *)&ccb->ccb_req;
#endif

	bus_dmamap_sync(sc->sc_dmat, MFII_DMA_MAP(sc->sc_requests),
	    ccb->ccb_request_offset, MFII_REQUEST_SIZE,
	    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);

#if defined(__LP64__) && 0
	bus_space_write_8(sc->sc_iot, sc->sc_ioh, MFI_IQPL, *r);
#else
	mutex_enter(&sc->sc_post_mtx);
	bus_space_write_4(sc->sc_iot, sc->sc_ioh, MFI_IQPL, r[0]);
	bus_space_barrier(sc->sc_iot, sc->sc_ioh,
	    MFI_IQPL, 8, BUS_SPACE_BARRIER_WRITE);

	bus_space_write_4(sc->sc_iot, sc->sc_ioh, MFI_IQPH, r[1]);
	bus_space_barrier(sc->sc_iot, sc->sc_ioh,
	    MFI_IQPH, 8, BUS_SPACE_BARRIER_WRITE);
	mutex_exit(&sc->sc_post_mtx);
#endif
}
-----------

-- 
-----------------------------------------------
                SAITOH Masanobu (msaitoh%execsw.org@localhost
                                 msaitoh%netbsd.org@localhost)


Home | Main Index | Thread Index | Old Index