Hi, Was anybody able to reproduce the bug I am running into? Did these changes also help?
Thanks, mbuhl > On 4. Oct 2018, at 13:16, Moritz Buhl <mb...@moritzbuhl.de> wrote: > > Hi, > > when rebooting a PowerBook G4, the kernel sometimes paniced while > detaching the disk. > Additionallly, during boot it was noted that / is not clean. > The following patch special cases polling to not return early anymore > and adds polling to all previous elements in the queue. > Please tell me if this is not the right way to address the problem. > > Thanks, > mbuhl > > Index: dev/ic/wdc.c > =================================================================== > RCS file: /cvs/src/sys/dev/ic/wdc.c,v > retrieving revision 1.134 > diff -u -p -r1.134 wdc.c > --- dev/ic/wdc.c 30 Dec 2017 23:08:29 -0000 1.134 > +++ dev/ic/wdc.c 2 Oct 2018 14:01:04 -0000 > @@ -888,7 +888,8 @@ wdcstart(struct channel_softc *chp) > /* adjust chp, in case we have a shared queue */ > chp = xfer->chp; > > - if ((chp->ch_flags & WDCF_ACTIVE) != 0 ) { > + if ((chp->ch_flags & WDCF_ACTIVE) != 0 && > + (xfer->c_flags & C_POLL) == 0) { > return; /* channel already active */ > } > #ifdef DIAGNOSTIC > @@ -1905,6 +1906,7 @@ wdccommandshort(struct channel_softc *ch > void > wdc_exec_xfer(struct channel_softc *chp, struct wdc_xfer *xfer) > { > + struct wdc_xfer *iter; > WDCDEBUG_PRINT(("wdc_exec_xfer %p flags 0x%x channel %d drive %d\n", > xfer, xfer->c_flags, chp->channel, xfer->drive), DEBUG_XFERS); > > @@ -1918,7 +1920,8 @@ wdc_exec_xfer(struct channel_softc *chp, > */ > if ((xfer->c_flags & C_POLL) != 0 && > !TAILQ_EMPTY(&chp->ch_queue->sc_xfer)) { > - TAILQ_INIT(&chp->ch_queue->sc_xfer); > + TAILQ_FOREACH(iter, &chp->ch_queue->sc_xfer, c_xferchain) > + iter->c_flags |= C_POLL; > } > /* insert at the end of command list */ > TAILQ_INSERT_TAIL(&chp->ch_queue->sc_xfer,xfer , c_xferchain); >