All of lore.kernel.org
 help / color / mirror / Atom feed
* long-term regression with some usb mass storage devices
@ 2009-02-20  6:47 Mike Lampard
  2009-02-20  7:41 ` Mike Lampard
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Lampard @ 2009-02-20  6:47 UTC (permalink / raw)
  To: linux-kernel

Hi All,

I recently plonked a dvd into my usb-attached Pioneer DVR-107d only to find 
that the current kernels no longer saw the drive as DVD capable.  In fact, the 
kernel no longer saw _any_ features of the drive: sr0: scsi3-mmc drive: 0x/0x 
caddy.  After much bisecting and even more blind luck I narrowed the problem 
down to this commit:

commit bdb2b8cab4392ce41ddfbd6773a3da3334daf836
Author: Alan Stern <stern@rowland.harvard.edu>
Date:   Tue Jun 24 14:03:14 2008 -0400

    [SCSI] erase invalid data returned by device

    This patch (as1108) fixes a problem that can occur with certain USB
    mass-storage devices: They return invalid data together with a residue
    indicating that the data should be ignored.  Rather than leave the
    invalid data in a transfer buffer, where it can get misinterpreted,
    the patch clears the invalid portion of the buffer.

    This solves a problem (wrong write-protect setting detected) reported
    by Maciej Rutecki and Peter Teoh.

Regards
Mike

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: long-term regression with some usb mass storage devices
  2009-02-20  6:47 long-term regression with some usb mass storage devices Mike Lampard
@ 2009-02-20  7:41 ` Mike Lampard
  2009-02-20 15:15   ` Alan Stern
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Lampard @ 2009-02-20  7:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: stern


added CC

On Fri, 20 Feb 2009 05:17:42 pm Mike Lampard wrote:
> Hi All,
>
> I recently plonked a dvd into my usb-attached Pioneer DVR-107d only to find
> that the current kernels no longer saw the drive as DVD capable.  In fact,
> the kernel no longer saw _any_ features of the drive: sr0: scsi3-mmc drive:
> 0x/0x caddy.  After much bisecting and even more blind luck I narrowed the
> problem down to this commit:
>
> commit bdb2b8cab4392ce41ddfbd6773a3da3334daf836
> Author: Alan Stern <stern@rowland.harvard.edu>
> Date:   Tue Jun 24 14:03:14 2008 -0400
>
>     [SCSI] erase invalid data returned by device
>
>     This patch (as1108) fixes a problem that can occur with certain USB
>     mass-storage devices: They return invalid data together with a residue
>     indicating that the data should be ignored.  Rather than leave the
>     invalid data in a transfer buffer, where it can get misinterpreted,
>     the patch clears the invalid portion of the buffer.
>
>     This solves a problem (wrong write-protect setting detected) reported
>     by Maciej Rutecki and Peter Teoh.
>
> Regards
> Mike
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: long-term regression with some usb mass storage devices
  2009-02-20  7:41 ` Mike Lampard
@ 2009-02-20 15:15   ` Alan Stern
  2009-02-20 15:42     ` Mike Lampard
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Stern @ 2009-02-20 15:15 UTC (permalink / raw)
  To: Mike Lampard; +Cc: USB list, Kernel development list

On Fri, 20 Feb 2009, Mike Lampard wrote:

> On Fri, 20 Feb 2009 05:17:42 pm Mike Lampard wrote:
> > Hi All,
> >
> > I recently plonked a dvd into my usb-attached Pioneer DVR-107d only to find
> > that the current kernels no longer saw the drive as DVD capable.  In fact,
> > the kernel no longer saw _any_ features of the drive: sr0: scsi3-mmc drive:
> > 0x/0x caddy.  After much bisecting and even more blind luck I narrowed the
> > problem down to this commit:
> >
> > commit bdb2b8cab4392ce41ddfbd6773a3da3334daf836
> > Author: Alan Stern <stern@rowland.harvard.edu>
> > Date:   Tue Jun 24 14:03:14 2008 -0400
> >
> >     [SCSI] erase invalid data returned by device
> >
> >     This patch (as1108) fixes a problem that can occur with certain USB
> >     mass-storage devices: They return invalid data together with a residue
> >     indicating that the data should be ignored.  Rather than leave the
> >     invalid data in a transfer buffer, where it can get misinterpreted,
> >     the patch clears the invalid portion of the buffer.
> >
> >     This solves a problem (wrong write-protect setting detected) reported
> >     by Maciej Rutecki and Peter Teoh.

If this affected your device then the device must not report residues 
correctly.  If you provide the device's entry in /proc/bus/usb/devices, 
I'll write a patch adding a blacklist entry for it.

It would help if you could also provide a usbmon trace showing what 
happens when you plug the drive in.  Instructions are in the kernel 
source file Documentation/usb/usbmon.txt.

Alan Stern


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: long-term regression with some usb mass storage devices
  2009-02-20 15:15   ` Alan Stern
@ 2009-02-20 15:42     ` Mike Lampard
  2009-02-20 19:15       ` Alan Stern
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Lampard @ 2009-02-20 15:42 UTC (permalink / raw)
  To: Alan Stern; +Cc: USB list, Kernel development list

On Sat, 21 Feb 2009 01:45:37 am Alan Stern wrote:
> On Fri, 20 Feb 2009, Mike Lampard wrote:
> > On Fri, 20 Feb 2009 05:17:42 pm Mike Lampard wrote:
> > > Hi All,
> > >
> > > I recently plonked a dvd into my usb-attached Pioneer DVR-107d only to
> > > find that the current kernels no longer saw the drive as DVD capable. 
> > > In fact, the kernel no longer saw _any_ features of the drive: sr0:
> > > scsi3-mmc drive: 0x/0x caddy.  After much bisecting and even more blind
> > > luck I narrowed the problem down to this commit:
> > >
> > > commit bdb2b8cab4392ce41ddfbd6773a3da3334daf836
> > > Author: Alan Stern <stern@rowland.harvard.edu>
> > > Date:   Tue Jun 24 14:03:14 2008 -0400
> > >
> > >     [SCSI] erase invalid data returned by device
> > >
> > >     This patch (as1108) fixes a problem that can occur with certain USB
> > >     mass-storage devices: They return invalid data together with a
> > > residue indicating that the data should be ignored.  Rather than leave
> > > the invalid data in a transfer buffer, where it can get misinterpreted,
> > > the patch clears the invalid portion of the buffer.
> > >
> > >     This solves a problem (wrong write-protect setting detected)
> > > reported by Maciej Rutecki and Peter Teoh.
>
> If this affected your device then the device must not report residues
> correctly.  If you provide the device's entry in /proc/bus/usb/devices,
> I'll write a patch adding a blacklist entry for it.

Many thanks.

> It would help if you could also provide a usbmon trace showing what
> happens when you plug the drive in.  Instructions are in the kernel
> source file Documentation/usb/usbmon.txt.

/proc/bus/usb/devices: 
T:  Bus=01 Lev=01 Prnt=01 Port=06 Cnt=01 Dev#=  3 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=05e3 ProdID=0701 Rev= 0.02
S:  Manufacturer=Genesyslogic
S:  Product=USB Mass Storage Device
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 96mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=125us

I'll email the usbmod log directly, to save spamming the list with a 100kb 
attachment.

Mike

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: long-term regression with some usb mass storage devices
  2009-02-20 15:42     ` Mike Lampard
@ 2009-02-20 19:15       ` Alan Stern
  2009-02-21  6:43         ` Mike Lampard
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Stern @ 2009-02-20 19:15 UTC (permalink / raw)
  To: Mike Lampard; +Cc: USB list, Kernel development list

On Sat, 21 Feb 2009, Mike Lampard wrote:

> > If this affected your device then the device must not report residues
> > correctly.  If you provide the device's entry in /proc/bus/usb/devices,
> > I'll write a patch adding a blacklist entry for it.
> 
> Many thanks.
> 
> > It would help if you could also provide a usbmon trace showing what
> > happens when you plug the drive in.  Instructions are in the kernel
> > source file Documentation/usb/usbmon.txt.
> 
> /proc/bus/usb/devices: 
> T:  Bus=01 Lev=01 Prnt=01 Port=06 Cnt=01 Dev#=  3 Spd=480 MxCh= 0
> D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
> P:  Vendor=05e3 ProdID=0701 Rev= 0.02
> S:  Manufacturer=Genesyslogic
> S:  Product=USB Mass Storage Device
> C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 96mA
> I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
> E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=125us

Ah, more fun from our friends at Genesys Logic.  :-(

> I'll email the usbmod log directly, to save spamming the list with a 100kb 
> attachment.

This seems to be the critical part:

ffff88002ad42300 1207042173 S Bo:1:009:2 -115 31 = 55534243 08000000 80000000 80000a5a 002a0000 00000080 00000000 000000
ffff88002ad42300 1207042287 C Bo:1:009:2 0 31 >
ffff88001dc5e780 1207042452 S Bi:1:009:1 -115 128 <
ffff88001dc5e780 1207046917 C Bi:1:009:1 -121 72 = 00467000 00000000 2a3e3f17 f1632923 1b900100 07d01b90 00001089 10890001
ffff88002ad42300 1207048482 S Bi:1:009:1 -115 13 <
ffff88002ad42300 1207048917 C Bi:1:009:1 -32 0
ffff88002ad42300 1207049111 S Co:1:009:0 s 02 01 0000 0081 0000 0
ffff88002ad42300 1207050037 C Co:1:009:0 0 0
ffff88002ad42300 1207050269 S Bi:1:009:1 -115 13 <
ffff88002ad42300 1207050910 C Bi:1:009:1 0 13 = 55534253 08000000 80000000 00

This shows the computer sending a MODE SENSE command for page 0x2a (the
MultiMedia Capabilities and Mechanical Status page), asking for 128
bytes of information.  The drive sent back 72 bytes followed by a
residue of 128, indicating that none of the data was valid.

Presumably the data really was valid and the residue should have been
56.  On the other hand, we have never had any other reports of invalid
residues from a Genesys Logic controller.  Maybe the error actually
came from the attached Pioneer drive instead of the controller; there's
no way to tell unless you attach a different kind of drive to the 
controller.

Anyway, this patch may fix the problem.  Let me know what happens with
it.  I'm a little hesitant to add it to the kernel, because of the
significant probability that the Genesys Logic controller itself is
okay.

Starting with 2.6.29 you'll be able to add special flags like this at 
runtime without the need for any patches, by means of a module 
parameter for usb-storage.

Alan Stern



Index: usb-2.6/drivers/usb/storage/unusual_devs.h
===================================================================
--- usb-2.6.orig/drivers/usb/storage/unusual_devs.h
+++ usb-2.6/drivers/usb/storage/unusual_devs.h
@@ -802,13 +802,13 @@ UNUSUAL_DEV(  0x05e3, 0x0701, 0x0000, 0x
 		"Genesys Logic",
 		"USB to IDE Optical",
 		US_SC_DEVICE, US_PR_DEVICE, NULL,
-		US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ),
+		US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 | US_FL_IGNORE_RESIDUE ),
 
 UNUSUAL_DEV(  0x05e3, 0x0702, 0x0000, 0xffff,
 		"Genesys Logic",
 		"USB to IDE Disk",
 		US_SC_DEVICE, US_PR_DEVICE, NULL,
-		US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ),
+		US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 | US_FL_IGNORE_RESIDUE ),
 
 /* Reported by Ben Efros <ben@pc-doctor.com> */
 UNUSUAL_DEV(  0x05e3, 0x0723, 0x9451, 0x9451,


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: long-term regression with some usb mass storage devices
  2009-02-20 19:15       ` Alan Stern
@ 2009-02-21  6:43         ` Mike Lampard
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Lampard @ 2009-02-21  6:43 UTC (permalink / raw)
  To: Alan Stern; +Cc: USB list, Kernel development list

On Sat, 21 Feb 2009 05:45:36 am Alan Stern wrote:
> On Sat, 21 Feb 2009, Mike Lampard wrote:
> > > If this affected your device then the device must not report residues
> > > correctly.  If you provide the device's entry in /proc/bus/usb/devices,
> > > I'll write a patch adding a blacklist entry for it.
> >
> > Many thanks.
> >
> > > It would help if you could also provide a usbmon trace showing what
> > > happens when you plug the drive in.  Instructions are in the kernel
> > > source file Documentation/usb/usbmon.txt.
> >
> > /proc/bus/usb/devices:
> > T:  Bus=01 Lev=01 Prnt=01 Port=06 Cnt=01 Dev#=  3 Spd=480 MxCh= 0
> > D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
> > P:  Vendor=05e3 ProdID=0701 Rev= 0.02
> > S:  Manufacturer=Genesyslogic
> > S:  Product=USB Mass Storage Device
> > C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 96mA
> > I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
> > E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> > E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=125us
>
> Ah, more fun from our friends at Genesys Logic.  :-(
>
> > I'll email the usbmod log directly, to save spamming the list with a
> > 100kb attachment.
>
> This seems to be the critical part:
>
> ffff88002ad42300 1207042173 S Bo:1:009:2 -115 31 = 55534243 08000000
> 80000000 80000a5a 002a0000 00000080 00000000 000000 ffff88002ad42300
> 1207042287 C Bo:1:009:2 0 31 >
> ffff88001dc5e780 1207042452 S Bi:1:009:1 -115 128 <
> ffff88001dc5e780 1207046917 C Bi:1:009:1 -121 72 = 00467000 00000000
> 2a3e3f17 f1632923 1b900100 07d01b90 00001089 10890001 ffff88002ad42300
> 1207048482 S Bi:1:009:1 -115 13 <
> ffff88002ad42300 1207048917 C Bi:1:009:1 -32 0
> ffff88002ad42300 1207049111 S Co:1:009:0 s 02 01 0000 0081 0000 0
> ffff88002ad42300 1207050037 C Co:1:009:0 0 0
> ffff88002ad42300 1207050269 S Bi:1:009:1 -115 13 <
> ffff88002ad42300 1207050910 C Bi:1:009:1 0 13 = 55534253 08000000 80000000
> 00
>
> This shows the computer sending a MODE SENSE command for page 0x2a (the
> MultiMedia Capabilities and Mechanical Status page), asking for 128
> bytes of information.  The drive sent back 72 bytes followed by a
> residue of 128, indicating that none of the data was valid.
>
> Presumably the data really was valid and the residue should have been
> 56.  On the other hand, we have never had any other reports of invalid
> residues from a Genesys Logic controller.  Maybe the error actually
> came from the attached Pioneer drive instead of the controller; there's
> no way to tell unless you attach a different kind of drive to the
> controller.

I've now tested two other DVD writers in this adapter without the patch - one 
LG and the other a much newer Pioneer.  Both exhibit the identical symptoms.

> Anyway, this patch may fix the problem.  Let me know what happens with
> it.  I'm a little hesitant to add it to the kernel, because of the
> significant probability that the Genesys Logic controller itself is
> okay.

The patch worked flawlessly with all devices I tested it on.  I also tested a 
HDD in the cradle to ensure there were no obvious regressions in that regard, 
it too worked as it should.

> Starting with 2.6.29 you'll be able to add special flags like this at
> runtime without the need for any patches, by means of a module
> parameter for usb-storage.

If you do decide to commit the change to the kernel, any chance you could mark 
it for the stable releases?

Cheers
Mike


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-02-21  6:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-20  6:47 long-term regression with some usb mass storage devices Mike Lampard
2009-02-20  7:41 ` Mike Lampard
2009-02-20 15:15   ` Alan Stern
2009-02-20 15:42     ` Mike Lampard
2009-02-20 19:15       ` Alan Stern
2009-02-21  6:43         ` Mike Lampard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.