NetBSD-Users archive

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

Re: USB regression in 10.1



gdt%lexort.com@localhost (Greg Troxel) writes:

>  parse/recognize:
>     [    60.795168] sd1(umass1:0:0:0):  Check Condition on CDB: 0x00 00 00 00 00 00
>     [    60.795168]     SENSE KEY:  Not Ready
>     [    60.795168]      ASC/ASCQ:  Logical Unit Is In Process Of Becoming Ready
>  instead of logging it like an error.

>  figure out if there is some sort of notification that it becomes ready


There is no notification, it's an error response to a command.

The driver already has a handler for such responses, in particular
it detects this condition and issues a retry after 5 seconds,
as well as another condition that explicitely asks for an
initialization command and then it issues the start command.

That handler is currently skipped until the device is opened.
For our purpose however it is necessary that this happens
before the device is opened.

This patch makes it handle either event (retry or start)
already when attaching.

Index: sd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/sd.c,v
retrieving revision 1.337
diff -p -u -r1.337 sd.c
--- sd.c        28 Sep 2024 08:57:47 -0000      1.337
+++ sd.c        26 Jan 2025 15:50:23 -0000
@@ -1091,12 +1091,13 @@ sd_interpret_sense(struct scsipi_xfer *x
        }
 
 
-
+#if 0
        /*
         * If the device is not open yet, let the generic code handle it.
         */
        if ((periph->periph_flags & PERIPH_MEDIA_LOADED) == 0)
                return (retval);
+#endif
 
        /*
         * If it isn't a extended or extended/deferred error, let

Since the handler tests specifically for a device at startup,
it shouldn't impact devices that stay offline due to e.g. missing
media (and it works fine with my SD card readers).

It would be interesting if this helps with the WD elements drive
and if it creates side effects for e.g. SCSI or Fibre Channel
controllers.



Home | Main Index | Thread Index | Old Index