LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Re: [linux-usb-devel] 2.6.20-rc6 SCSI error: I/O error - trouble with mass storage devices ?!
       [not found] <1169909796.2462.56.camel@localhost>
@ 2007-01-30 18:08 ` Alan Stern
  2007-01-31  9:12   ` Soeren Sonnenburg
  2007-02-01 21:37   ` Andrew Morton
  0 siblings, 2 replies; 7+ messages in thread
From: Alan Stern @ 2007-01-30 18:08 UTC (permalink / raw)
  To: Soeren Sonnenburg; +Cc: Linux Kernel, linux-usb-devel

On Sat, 27 Jan 2007, Soeren Sonnenburg wrote:

> Dear all,
> 
> I am trying to use a P990 phone in via mass storage under linux. I was
> able to copy data to/from the phone without trouble under winxp but
> receive millions of I/O errors (see below (*), basically on any sector).
> As this was also happening on a casio camera (and working on winxp) I
> tried a couple of things to nail this down:

...

> 4) I enabled usb mass storage verbose debug output and collected 2 runs
> of I/O once with the sandisk and one with the P990 (attached as sandisk
> and p990)

...

> Now I am clueless what could have gone wrong (as I *think* this was all
> working at some point at least before firmware updates) and what the
> difference between these mass storage devices is.

The log revealed that the phone's firmware returns garbage values in the 
Residue field for some WRITEs.  This patch should take care of it.

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
@@ -1318,12 +1318,13 @@ UNUSUAL_DEV(  0x0fce, 0xe031, 0x0000, 0x
 		US_SC_DEVICE, US_PR_DEVICE, NULL,
 		US_FL_FIX_CAPACITY ),
 
-/* Reported by Jan Mate <mate@fiit.stuba.sk> */
+/* Reported by Jan Mate <mate@fiit.stuba.sk>
+ * and by Soeren Sonnenburg <kernel@nn7.de> */
 UNUSUAL_DEV(  0x0fce, 0xe030, 0x0000, 0x0000,
 		"Sony Ericsson",
 		"P990i",
 		US_SC_DEVICE, US_PR_DEVICE, NULL,
-		US_FL_FIX_CAPACITY ),
+		US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ),
 
 /* Reported by Kevin Cernekee <kpc-usbdev@gelato.uiuc.edu>
  * Tested on hardware version 1.10.


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

* Re: [linux-usb-devel] 2.6.20-rc6 SCSI error: I/O error - trouble with mass storage devices ?!
  2007-01-30 18:08 ` [linux-usb-devel] 2.6.20-rc6 SCSI error: I/O error - trouble with mass storage devices ?! Alan Stern
@ 2007-01-31  9:12   ` Soeren Sonnenburg
  2007-02-01 21:37   ` Andrew Morton
  1 sibling, 0 replies; 7+ messages in thread
From: Soeren Sonnenburg @ 2007-01-31  9:12 UTC (permalink / raw)
  To: Alan Stern; +Cc: Linux Kernel, linux-usb-devel

On Tue, 2007-01-30 at 13:08 -0500, Alan Stern wrote:
> On Sat, 27 Jan 2007, Soeren Sonnenburg wrote:

[P990 mass storage trouble]
> > Now I am clueless what could have gone wrong (as I *think* this was all
> > working at some point at least before firmware updates) and what the
> > difference between these mass storage devices is.
> 
> The log revealed that the phone's firmware returns garbage values in the 
> Residue field for some WRITEs.  This patch should take care of it.

I can confirm that this fixes the problem.

Thank you *very* much - you've made my day.

Soeren
-- 
Sometimes, there's a moment as you're waking, when you become aware of
the real world around you, but you're still dreaming.

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

* Re: [linux-usb-devel] 2.6.20-rc6 SCSI error: I/O error - trouble with mass storage devices ?!
  2007-01-30 18:08 ` [linux-usb-devel] 2.6.20-rc6 SCSI error: I/O error - trouble with mass storage devices ?! Alan Stern
  2007-01-31  9:12   ` Soeren Sonnenburg
@ 2007-02-01 21:37   ` Andrew Morton
  1 sibling, 0 replies; 7+ messages in thread
From: Andrew Morton @ 2007-02-01 21:37 UTC (permalink / raw)
  To: Alan Stern; +Cc: Soeren Sonnenburg, Linux Kernel, linux-usb-devel

On Tue, 30 Jan 2007 13:08:19 -0500 (EST)
Alan Stern <stern@rowland.harvard.edu> wrote:

> On Sat, 27 Jan 2007, Soeren Sonnenburg wrote:
> 
> > Dear all,
> > 
> > I am trying to use a P990 phone in via mass storage under linux. I was
> > able to copy data to/from the phone without trouble under winxp but
> > receive millions of I/O errors (see below (*), basically on any sector).
> > As this was also happening on a casio camera (and working on winxp) I
> > tried a couple of things to nail this down:
> 
> ...
> 
> > 4) I enabled usb mass storage verbose debug output and collected 2 runs
> > of I/O once with the sandisk and one with the P990 (attached as sandisk
> > and p990)
> 
> ...
> 
> > Now I am clueless what could have gone wrong (as I *think* this was all
> > working at some point at least before firmware updates) and what the
> > difference between these mass storage devices is.
> 
> The log revealed that the phone's firmware returns garbage values in the 
> Residue field for some WRITEs.  This patch should take care of it.
> 
> 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
> @@ -1318,12 +1318,13 @@ UNUSUAL_DEV(  0x0fce, 0xe031, 0x0000, 0x
>  		US_SC_DEVICE, US_PR_DEVICE, NULL,
>  		US_FL_FIX_CAPACITY ),
>  
> -/* Reported by Jan Mate <mate@fiit.stuba.sk> */
> +/* Reported by Jan Mate <mate@fiit.stuba.sk>
> + * and by Soeren Sonnenburg <kernel@nn7.de> */
>  UNUSUAL_DEV(  0x0fce, 0xe030, 0x0000, 0x0000,
>  		"Sony Ericsson",
>  		"P990i",
>  		US_SC_DEVICE, US_PR_DEVICE, NULL,
> -		US_FL_FIX_CAPACITY ),
> +		US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ),
>  
>  /* Reported by Kevin Cernekee <kpc-usbdev@gelato.uiuc.edu>
>   * Tested on hardware version 1.10.

This fixes the phone, but what's the situation with that Casio camera?

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

* Re: [linux-usb-devel] 2.6.20-rc6 SCSI error: I/O error - trouble with mass storage devices ?!
  2007-01-30 23:12   ` Robert Hancock
  2007-01-31  1:03     ` Greg KH
@ 2007-01-31 15:20     ` Alan Stern
  1 sibling, 0 replies; 7+ messages in thread
From: Alan Stern @ 2007-01-31 15:20 UTC (permalink / raw)
  To: Robert Hancock; +Cc: linux-kernel, Soeren Sonnenburg

On Tue, 30 Jan 2007, Robert Hancock wrote:

> Alan Stern wrote:
> 
> > The log revealed that the phone's firmware returns garbage values in the 
> > Residue field for some WRITEs.  This patch should take care of it.
> > 
> > Alan Stern
> 
> Is it just me, or should some of these device quirk entries that keep 
> being added be made unconditional? Adding entries for every single 
> device that shows up with these problems seems like not a very scalable 
> approach. These devices obviously work in Windows, can't we just emulate 
> its behavior here?

I have had the same thought...

Just because Windows (and a bunch of clueless firmware writers) does
something wrong shouldn't mean that we do it too.  The fact is, these
devices are in violation of the appropriate SCSI and USB specifications.

Ignoring the residue value can actually lead to undiscovered errors.  
According to the spec, it's perfectly legal for a device to return an
error indication there and nowhere else.

Alan Stern


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

* Re: [linux-usb-devel] 2.6.20-rc6 SCSI error: I/O error - trouble with mass storage devices ?!
  2007-01-31  1:03     ` Greg KH
@ 2007-01-31  1:06       ` Robert Hancock
  0 siblings, 0 replies; 7+ messages in thread
From: Robert Hancock @ 2007-01-31  1:06 UTC (permalink / raw)
  To: Greg KH; +Cc: Alan Stern, linux-kernel, Soeren Sonnenburg

Greg KH wrote:
> On Tue, Jan 30, 2007 at 05:12:54PM -0600, Robert Hancock wrote:
>> Alan Stern wrote:
>>
>>> The log revealed that the phone's firmware returns garbage values in the 
>>> Residue field for some WRITEs.  This patch should take care of it.
>>>
>>> Alan Stern
>> Is it just me, or should some of these device quirk entries that keep 
>> being added be made unconditional? Adding entries for every single 
>> device that shows up with these problems seems like not a very scalable 
>> approach. These devices obviously work in Windows, can't we just emulate 
>> its behavior here?
> 
> If you can figure out a way to dynamically detect broken devices like
> this, sure, that would be great.

For at least some of these quirks, would there be any harm in applying 
them to all devices?

-- 
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/


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

* Re: [linux-usb-devel] 2.6.20-rc6 SCSI error: I/O error - trouble with mass storage devices ?!
  2007-01-30 23:12   ` Robert Hancock
@ 2007-01-31  1:03     ` Greg KH
  2007-01-31  1:06       ` Robert Hancock
  2007-01-31 15:20     ` Alan Stern
  1 sibling, 1 reply; 7+ messages in thread
From: Greg KH @ 2007-01-31  1:03 UTC (permalink / raw)
  To: Robert Hancock; +Cc: Alan Stern, linux-kernel, Soeren Sonnenburg

On Tue, Jan 30, 2007 at 05:12:54PM -0600, Robert Hancock wrote:
> Alan Stern wrote:
> 
> >The log revealed that the phone's firmware returns garbage values in the 
> >Residue field for some WRITEs.  This patch should take care of it.
> >
> >Alan Stern
> 
> Is it just me, or should some of these device quirk entries that keep 
> being added be made unconditional? Adding entries for every single 
> device that shows up with these problems seems like not a very scalable 
> approach. These devices obviously work in Windows, can't we just emulate 
> its behavior here?

If you can figure out a way to dynamically detect broken devices like
this, sure, that would be great.

thanks,

greg k-h

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

* Re: [linux-usb-devel] 2.6.20-rc6 SCSI error: I/O error - trouble with mass storage devices ?!
       [not found] ` <fa.SlST1aKbNgZSghdvI9esD81kVnI@ifi.uio.no>
@ 2007-01-30 23:12   ` Robert Hancock
  2007-01-31  1:03     ` Greg KH
  2007-01-31 15:20     ` Alan Stern
  0 siblings, 2 replies; 7+ messages in thread
From: Robert Hancock @ 2007-01-30 23:12 UTC (permalink / raw)
  To: Alan Stern, linux-kernel; +Cc: Soeren Sonnenburg

Alan Stern wrote:

> The log revealed that the phone's firmware returns garbage values in the 
> Residue field for some WRITEs.  This patch should take care of it.
> 
> Alan Stern

Is it just me, or should some of these device quirk entries that keep 
being added be made unconditional? Adding entries for every single 
device that shows up with these problems seems like not a very scalable 
approach. These devices obviously work in Windows, can't we just emulate 
its behavior here?

-- 
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/


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

end of thread, other threads:[~2007-02-01 21:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1169909796.2462.56.camel@localhost>
2007-01-30 18:08 ` [linux-usb-devel] 2.6.20-rc6 SCSI error: I/O error - trouble with mass storage devices ?! Alan Stern
2007-01-31  9:12   ` Soeren Sonnenburg
2007-02-01 21:37   ` Andrew Morton
     [not found] <fa.PeThxrKzzfWoGYao97lEVEZgJlc@ifi.uio.no>
     [not found] ` <fa.SlST1aKbNgZSghdvI9esD81kVnI@ifi.uio.no>
2007-01-30 23:12   ` Robert Hancock
2007-01-31  1:03     ` Greg KH
2007-01-31  1:06       ` Robert Hancock
2007-01-31 15:20     ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).