NetBSD-Bugs archive

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

Re: kern/55682: siisata sometimes-panic when starting smartd

The following reply was made to PR kern/55682; it has been noted by GNATS.

From: (Michael van Elst)
Subject: Re: kern/55682: siisata sometimes-panic when starting smartd
Date: Fri, 25 Sep 2020 06:06:32 -0000 (UTC) writes:
 >                                /* read in specific information about error */
 >                                uint32_t prbfis = bus_space_read_stream_4(
 >                                    sc->sc_prt, sc->sc_prh,
 >                                    PRSX(chp->ch_channel, xfer->c_slot,
 >                                    PRSO_FIS));
 ata_queue_get_active_xfer might return NULL in case of an active NCQ
 transfer. The previous check of the ATACH_NCQ flag should probably
 avoid that case, but the flag looks bogus to me.
 This is set by atastart:
 >         if (ISSET(xfer->c_flags, C_NCQ))
 >                 SET(chp->ch_flags, ATACH_NCQ);
 >         else
 >                 CLR(chp->ch_flags, ATACH_NCQ);
 So it reflects the last transfer started, but not the transfer that
 has caused the error and I don't think it is cleared when a NCQ
 transfer is done.
 It's probably easier to ignore ATACH_NCQ and rely on the C_NCQ flag
 of the active transfer. E.g. make siisata skip reading the error
 condition when ata_queue_get_active_xfer returns NULL.
                                 Michael van Elst
                                 "A potential Snark may lurk in every tree."

Home | Main Index | Thread Index | Old Index