Port-i386 archive

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

Re: NetBSD-5 against my DVD/CD drive



On Wed, Dec 16, 2009 at 10:23:45PM +0200, Aleksey Cheusov wrote:
> 
>  >> > With SCSIDEBUG enabled it says
>  >> > 
>  >> >  Dec 15 22:28:11 chen /netbsd: cd0(viaide0:1:0): undecodable sense 
> error for opcode 0x28, data= 0x44 0x00 0x00 0x00
>  >> > 
>  >> 
>  >> Hmm, a READ_10 command.  And this isn't a normal sense error code,
>  >> it's a wdc(4) atapi error code. 0x44 means
>  >> (SKEY_HARDWARE_ERROR<<4)|WDCE_ABRT.
>  >> That translates to "non-media hardware failure".
>  >> 
>  >> It seems the wrong sense interpreter is being used to me.
> 
> > I think the driver did really issue a 
> > REQUEST_SENSE and got this as reply (or got no data at all as reply),
> > which is wrong.
> > I wonder if this error code is a responce from the drive to
> > the REQUEST_SENSE command.
> > Can you apply the attached patch and report messages printed by the
> > kernel ?
> 
> REQUEST_SENSE failed, error 0x64, previous 0x0
> REQUEST_SENSE failed, error 0x44, previous 0x0
> cd0(viaide0:1:0): undecodable sense error for opcode 0x28, data= 0x44 0x00 
> 0x00 0x00

Hum of course this is a new command, so the previous value will
always be 0. The fist error is a unit attention, which makes sense.

I guess adding a PQUIRK_NOSENSE entry for this device would work,
but I wonder if we could find a way to handle this automatically.
Could you see if the attached diff makes a difference for you ?
It didn't break my CD drive at last :)

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--
Index: scsipi_base.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/scsipi_base.c,v
retrieving revision 1.148
diff -u -p -u -r1.148 scsipi_base.c
--- scsipi_base.c       11 May 2008 05:17:23 -0000      1.148
+++ scsipi_base.c       16 Dec 2009 20:50:29 -0000
@@ -1658,12 +1658,22 @@ scsipi_request_sense(struct scsipi_xfer 
                xs->error = XS_RESET;
                return;
        case EIO:
-                /* request sense coudn't be performed */
                /*
-                * XXX this isn't quite right but we don't have anything
-                * better for now
+                * request sense coudn't be performed
+                * If we already have a shortsense, use it.
                 */
-               xs->error = XS_DRIVER_STUFFUP;
+               scsipi_printaddr(periph);
+               printf("request sense failed");
+               if (xs->error == XS_SHORTSENSE) {
+                       printf(", using short sense 0x%x\n",
+                           xs->sense.atapi_sense);
+               } else {
+                       /*
+                        * XXX this isn't quite right but we don't have anything
+                        * better for now
+                        */
+                       xs->error = XS_DRIVER_STUFFUP;
+               }
                return;
        default:
                 /* Notify that request sense failed. */


Home | Main Index | Thread Index | Old Index