linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PATCH: usb-storage-set-last-sector-bug-flag.patch
@ 2008-01-20 10:27 Hans de Goede
  2008-01-20 20:56 ` Greg KH
       [not found] ` <47932211.90105-fbo2DhPpy/Q@public.gmane.org>
  0 siblings, 2 replies; 15+ messages in thread
From: Hans de Goede @ 2008-01-20 10:27 UTC (permalink / raw)
  To: Matthew Dharm
  Cc: James Bottomley, Boaz Harrosh, USB Storage list,
	USB development list, David Brown,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 491 bytes --]

Hi all,

This patch sets the last_sector_bug flag to 1 for all USB disks. This is
needed to makes the cardreader on various HP multifunction printers work.

Since the performance impact is negible we set this flag for all USB disks to
avoid an unusual_devs.h nightmare.

Note that this patch depends on:
PATCH: scsi-sd-last-sector-bug-flag.patch

Which actually adds this flag to the scsi subsystem.

Signed-off-by: Hans de Goede <j.w.r.degoede-fbo2DhPpy/Q@public.gmane.org>

Regards,

Hans

[-- Attachment #2: usb-storage-set-last-sector-bug-flag.patch --]
[-- Type: text/x-patch, Size: 1106 bytes --]

This patch sets the last_sector_bug flag to 1 for all USB disks. This is
needed to makes the cardreader on various HP multifunction printers work.

Since the performance impact is negible we set this flag for all USB disks to
avoid an unusual_devs.h nightmare.

Note that this patch depends on:
PATCH: scsi-sd-last-sector-bug-flag.patch

Which actually adds this flag to the scsi subsystem.

Signed-off-by: Hans de Goede <j.w.r.degoede-fbo2DhPpy/Q@public.gmane.org>
--- vanilla-2.6.24-rc7/drivers/usb/storage/scsiglue.c.psc1350	2008-01-11 19:40:31.000000000 +0100
+++ vanilla-2.6.24-rc7/drivers/usb/storage/scsiglue.c	2008-01-20 11:18:38.000000000 +0100
@@ -187,6 +187,10 @@ static int slave_configure(struct scsi_d
 		 * automatically, requiring a START-STOP UNIT command. */
 		sdev->allow_restart = 1;
 
+		/* Some USB cardreaders have trouble reading an sdcard's last
+		 * sector in a larger then 1 sector read, since the performance
+		 * impact is negible we set this flag for all USB disks */
+		sdev->last_sector_bug = 1;
 	} else {
 
 		/* Non-disk-type devices don't need to blacklist any pages

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

* Re: PATCH: usb-storage-set-last-sector-bug-flag.patch
  2008-01-20 10:27 PATCH: usb-storage-set-last-sector-bug-flag.patch Hans de Goede
@ 2008-01-20 20:56 ` Greg KH
       [not found]   ` <20080120205625.GB28842-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
       [not found] ` <47932211.90105-fbo2DhPpy/Q@public.gmane.org>
  1 sibling, 1 reply; 15+ messages in thread
From: Greg KH @ 2008-01-20 20:56 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Matthew Dharm, James Bottomley, Boaz Harrosh, USB Storage list,
	USB development list, David Brown, linux-scsi, linux-usb

On Sun, Jan 20, 2008 at 11:27:29AM +0100, Hans de Goede wrote:
> Hi all,
>
> This patch sets the last_sector_bug flag to 1 for all USB disks. This is
> needed to makes the cardreader on various HP multifunction printers work.
>
> Since the performance impact is negible we set this flag for all USB disks 
> to avoid an unusual_devs.h nightmare.

Oh great, now my "working just fine" USB devices, which happen to have
data in the last sector, suddenly stop working.

That's not acceptable :(

greg k-h

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

* Re: PATCH: usb-storage-set-last-sector-bug-flag.patch
       [not found]   ` <20080120205625.GB28842-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
@ 2008-01-20 21:03     ` James Bottomley
       [not found]       ` <1200863008.3105.30.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2008-01-20 21:45     ` Alan Stern
  1 sibling, 1 reply; 15+ messages in thread
From: James Bottomley @ 2008-01-20 21:03 UTC (permalink / raw)
  To: Greg KH
  Cc: Hans de Goede, Matthew Dharm, Boaz Harrosh, USB Storage list,
	USB development list, David Brown,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA


On Sun, 2008-01-20 at 12:56 -0800, Greg KH wrote:
> On Sun, Jan 20, 2008 at 11:27:29AM +0100, Hans de Goede wrote:
> > Hi all,
> >
> > This patch sets the last_sector_bug flag to 1 for all USB disks. This is
> > needed to makes the cardreader on various HP multifunction printers work.
> >
> > Since the performance impact is negible we set this flag for all USB disks 
> > to avoid an unusual_devs.h nightmare.
> 
> Oh great, now my "working just fine" USB devices, which happen to have
> data in the last sector, suddenly stop working.
> 
> That's not acceptable :(

I don't see how this will happen, might you not be confusing this change
(which allows access to the last sector, just insists that it be
accessed by a single sector read) with US_FL_FIX_CAPACITY which is for
devices that report having one more sectors than they actually have and
therefore adjusts the access limits down by one?

James

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

* Re: PATCH: usb-storage-set-last-sector-bug-flag.patch
       [not found]       ` <1200863008.3105.30.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2008-01-20 21:25         ` Hans de Goede
  2008-01-20 21:39         ` [usb-storage] " Guillaume Bedot
  1 sibling, 0 replies; 15+ messages in thread
From: Hans de Goede @ 2008-01-20 21:25 UTC (permalink / raw)
  To: James Bottomley
  Cc: Greg KH, Matthew Dharm, Boaz Harrosh, USB Storage list,
	USB development list, David Brown,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

James Bottomley wrote:
> On Sun, 2008-01-20 at 12:56 -0800, Greg KH wrote:
>> On Sun, Jan 20, 2008 at 11:27:29AM +0100, Hans de Goede wrote:
>>> Hi all,
>>>
>>> This patch sets the last_sector_bug flag to 1 for all USB disks. This is
>>> needed to makes the cardreader on various HP multifunction printers work.
>>>
>>> Since the performance impact is negible we set this flag for all USB disks 
>>> to avoid an unusual_devs.h nightmare.
>> Oh great, now my "working just fine" USB devices, which happen to have
>> data in the last sector, suddenly stop working.
>>
>> That's not acceptable :(
> 
> I don't see how this will happen, might you not be confusing this change
> (which allows access to the last sector, just insists that it be
> accessed by a single sector read) with US_FL_FIX_CAPACITY which is for
> devices that report having one more sectors than they actually have and
> therefore adjusts the access limits down by one?
> 

Let me try to explain some more, the scsi-sd patch, which goes hand in hand 
with this adds a last_sector_bug flag, which is indeed a different flag form 
the fix_capacity flag. Both deal with with what are (in case of the 
last_sector_bug flag probably) off by one bugs.

The fix_capacity flag is for devices which report their last sector is N (with 
sectors numbered from 0 - N) but in reality  / they mean they have N sectors, 
so their last sector really is N - 1.

The last_sector_bug flag is for a bug (sofar only seen in HP multifunction 
printers with cardreader when using an sdcard) where the reader will cease to 
function (returns error codes in response to each and every command) after one 
has attempted to read the last sector in a read larger then 1 sector. To be 
clear an example lets say an example disk has 256 sectors, numbered 0 - 255.

Then the following reads will all cause the reader to go into borked mode:
16 sectors starting at 240
8 sectors starting at 248
2 sectors starting at 254

Yet the last sector can still be read without problems the following read:
1 sector starting at 255

So what the scsi-sd part of these 2 patches does it adds a last_sector_bug 
flag, which when set will cause the layer to split a read like this:
16 sectors starting at 240

Into:
15 sectors starting at 240
1 sector starting at 255


Since reading the last sector is a rare occurence (but one which does happen 
every time when determining the partition table, triggering the bug on every 
card insert). and since there are a lot of different HP printer models ( and 
cheap usb card readers are notoriously buggy so other cardreaders might be 
affected too), Matthew Dharm (the usb-storage maintainer) thought it best to 
enable this for all devices.

Regards,

Hans

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

* Re: [usb-storage] PATCH: usb-storage-set-last-sector-bug-flag.patch
       [not found]       ` <1200863008.3105.30.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  2008-01-20 21:25         ` Hans de Goede
@ 2008-01-20 21:39         ` Guillaume Bedot
  1 sibling, 0 replies; 15+ messages in thread
From: Guillaume Bedot @ 2008-01-20 21:39 UTC (permalink / raw)
  To: James Bottomley
  Cc: Greg KH, USB development list, linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	USB Storage list, linux-usb-u79uwXL29TY76Z2rM5mHXA, Boaz Harrosh,
	Matthew Dharm


Le dimanche 20 janvier 2008 à 15:03 -0600, James Bottomley a écrit :
> On Sun, 2008-01-20 at 12:56 -0800, Greg KH wrote:
> > On Sun, Jan 20, 2008 at 11:27:29AM +0100, Hans de Goede wrote:
> > > Hi all,
> > >
> > > This patch sets the last_sector_bug flag to 1 for all USB disks. This is
> > > needed to makes the cardreader on various HP multifunction printers work.
> > >
> > > Since the performance impact is negible we set this flag for all USB disks 
> > > to avoid an unusual_devs.h nightmare.
> > 
> > Oh great, now my "working just fine" USB devices, which happen to have
> > data in the last sector, suddenly stop working.
> > 
> > That's not acceptable :(
> 
> I don't see how this will happen, might you not be confusing this change
> (which allows access to the last sector, just insists that it be
> accessed by a single sector read) with US_FL_FIX_CAPACITY which is for
> devices that report having one more sectors than they actually have and
> therefore adjusts the access limits down by one?

Well, i was the one suggesting more than 2 devices might be impacted
(i'm absolutely not sure about this, but it could be).
It seems caused by a common error when using 0 as a base index.

I don't like loosing performance for broken devices, but i'm not against
keeping that patch for all devices.

1) As the last sectors are read when the card is inserted, it results in
not working at all devices :
Users may think they are just not supported, and won't report any bug.
See how Hans worked hard to find 3 other cases in fedora, ubuntu, etc
forums !

2) It should not break in the other cases, IIUC, it just splits the read
in two.

3) It's just about the last sector, so any issue should only be greater
timing when using realtime perhaps ?

Whatever, this patch, or an other form of it, is needed (because of
1) ).
If it is a default, an option or dedicated to a limited set of devices
must be chosen.

I hope you will soon find this solution.

Best regards,

Guillaume B.

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

* Re: PATCH: usb-storage-set-last-sector-bug-flag.patch
       [not found]   ` <20080120205625.GB28842-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
  2008-01-20 21:03     ` James Bottomley
@ 2008-01-20 21:45     ` Alan Stern
  2008-01-23 18:12       ` Greg KH
  1 sibling, 1 reply; 15+ messages in thread
From: Alan Stern @ 2008-01-20 21:45 UTC (permalink / raw)
  To: Greg KH
  Cc: Hans de Goede, Matthew Dharm, James Bottomley, Boaz Harrosh,
	USB Storage list, USB development list, David Brown,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

On Sun, 20 Jan 2008, Greg KH wrote:

> On Sun, Jan 20, 2008 at 11:27:29AM +0100, Hans de Goede wrote:
> > Hi all,
> >
> > This patch sets the last_sector_bug flag to 1 for all USB disks. This is
> > needed to makes the cardreader on various HP multifunction printers work.
> >
> > Since the performance impact is negible we set this flag for all USB disks 
> > to avoid an unusual_devs.h nightmare.
> 
> Oh great, now my "working just fine" USB devices, which happen to have
> data in the last sector, suddenly stop working.
> 
> That's not acceptable :(

These patches really should not impact existing devices.  If they do
then something is definitely wrong.

Can you provide detailed logging information showing your problem?  For 
example, a usbmon trace would be good.  Better yet, a usbmon trace 
without the patches and a usbmon trace with the patches, for 
comparison.

Alan Stern

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

* Re: [usb-storage] PATCH: usb-storage-set-last-sector-bug-flag.patch
       [not found] ` <47932211.90105-fbo2DhPpy/Q@public.gmane.org>
@ 2008-01-22  8:26   ` Guillaume Bedot
  0 siblings, 0 replies; 15+ messages in thread
From: Guillaume Bedot @ 2008-01-22  8:26 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Matthew Dharm, USB development list,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA, USB Storage list,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, James Bottomley, Boaz Harrosh

Hello,

Le dimanche 20 janvier 2008 à 11:27 +0100, Hans de Goede a écrit :
> Hi all,
> 
> This patch sets the last_sector_bug flag to 1 for all USB disks. This is
> needed to makes the cardreader on various HP multifunction printers work.
> 
> Since the performance impact is negible we set this flag for all USB disks to
> avoid an unusual_devs.h nightmare.
> 
> Note that this patch depends on:
> PATCH: scsi-sd-last-sector-bug-flag.patch
> 
> Which actually adds this flag to the scsi subsystem.
> 
> Signed-off-by: Hans de Goede <j.w.r.degoede-fbo2DhPpy/Q@public.gmane.org>
> 
> Regards,
> 
> Hans

Just a line to say these new patches work for me.

Best regards,

Guillaume B.

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

* Re: PATCH: usb-storage-set-last-sector-bug-flag.patch
  2008-01-20 21:45     ` Alan Stern
@ 2008-01-23 18:12       ` Greg KH
       [not found]         ` <20080123181239.GA21836-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
  2008-01-24 17:07         ` Stefan Richter
  0 siblings, 2 replies; 15+ messages in thread
From: Greg KH @ 2008-01-23 18:12 UTC (permalink / raw)
  To: Alan Stern
  Cc: USB development list, linux-scsi, USB Storage list, linux-usb,
	David Brown, James Bottomley, Hans de Goede, Boaz Harrosh,
	Matthew Dharm

On Sun, Jan 20, 2008 at 04:45:36PM -0500, Alan Stern wrote:
> On Sun, 20 Jan 2008, Greg KH wrote:
> 
> > On Sun, Jan 20, 2008 at 11:27:29AM +0100, Hans de Goede wrote:
> > > Hi all,
> > >
> > > This patch sets the last_sector_bug flag to 1 for all USB disks. This is
> > > needed to makes the cardreader on various HP multifunction printers work.
> > >
> > > Since the performance impact is negible we set this flag for all USB disks 
> > > to avoid an unusual_devs.h nightmare.
> > 
> > Oh great, now my "working just fine" USB devices, which happen to have
> > data in the last sector, suddenly stop working.
> > 
> > That's not acceptable :(
> 
> These patches really should not impact existing devices.  If they do
> then something is definitely wrong.
> 
> Can you provide detailed logging information showing your problem?  For 
> example, a usbmon trace would be good.  Better yet, a usbmon trace 
> without the patches and a usbmon trace with the patches, for 
> comparison.

I don't have a device with such a problem, I just am worried that we are
now suddenly keeping access from the last sector for devices that
currently did work just fine.

If you all guarantee that this will not happen, hey, I'm happy, and I'll
gladly point all bug reports on to you all :)

thanks,

greg k-h

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

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

* Re: PATCH: usb-storage-set-last-sector-bug-flag.patch
       [not found]         ` <20080123181239.GA21836-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
@ 2008-01-23 18:39           ` James Bottomley
  2008-01-23 18:50             ` Greg KH
  0 siblings, 1 reply; 15+ messages in thread
From: James Bottomley @ 2008-01-23 18:39 UTC (permalink / raw)
  To: Greg KH
  Cc: Alan Stern, Hans de Goede, Matthew Dharm, Boaz Harrosh,
	USB Storage list, USB development list, David Brown,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA


On Wed, 2008-01-23 at 10:12 -0800, Greg KH wrote:
> On Sun, Jan 20, 2008 at 04:45:36PM -0500, Alan Stern wrote:
> > On Sun, 20 Jan 2008, Greg KH wrote:
> > 
> > > On Sun, Jan 20, 2008 at 11:27:29AM +0100, Hans de Goede wrote:
> > > > Hi all,
> > > >
> > > > This patch sets the last_sector_bug flag to 1 for all USB disks. This is
> > > > needed to makes the cardreader on various HP multifunction printers work.
> > > >
> > > > Since the performance impact is negible we set this flag for all USB disks 
> > > > to avoid an unusual_devs.h nightmare.
> > > 
> > > Oh great, now my "working just fine" USB devices, which happen to have
> > > data in the last sector, suddenly stop working.
> > > 
> > > That's not acceptable :(
> > 
> > These patches really should not impact existing devices.  If they do
> > then something is definitely wrong.
> > 
> > Can you provide detailed logging information showing your problem?  For 
> > example, a usbmon trace would be good.  Better yet, a usbmon trace 
> > without the patches and a usbmon trace with the patches, for 
> > comparison.
> 
> I don't have a device with such a problem, I just am worried that we are
> now suddenly keeping access from the last sector for devices that
> currently did work just fine.
> 
> If you all guarantee that this will not happen, hey, I'm happy, and I'll
> gladly point all bug reports on to you all :)


Hey, you can trust me ... I'm a doctor ...

Would you like me to add your 'Responsibility-disclamed-by:' to the
patch ...?

James

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

* Re: PATCH: usb-storage-set-last-sector-bug-flag.patch
  2008-01-23 18:39           ` James Bottomley
@ 2008-01-23 18:50             ` Greg KH
  0 siblings, 0 replies; 15+ messages in thread
From: Greg KH @ 2008-01-23 18:50 UTC (permalink / raw)
  To: James Bottomley
  Cc: Alan Stern, Hans de Goede, Matthew Dharm, Boaz Harrosh,
	USB Storage list, USB development list, David Brown, linux-scsi,
	linux-usb

On Wed, Jan 23, 2008 at 12:39:39PM -0600, James Bottomley wrote:
> 
> On Wed, 2008-01-23 at 10:12 -0800, Greg KH wrote:
> > On Sun, Jan 20, 2008 at 04:45:36PM -0500, Alan Stern wrote:
> > > On Sun, 20 Jan 2008, Greg KH wrote:
> > > 
> > > > On Sun, Jan 20, 2008 at 11:27:29AM +0100, Hans de Goede wrote:
> > > > > Hi all,
> > > > >
> > > > > This patch sets the last_sector_bug flag to 1 for all USB disks. This is
> > > > > needed to makes the cardreader on various HP multifunction printers work.
> > > > >
> > > > > Since the performance impact is negible we set this flag for all USB disks 
> > > > > to avoid an unusual_devs.h nightmare.
> > > > 
> > > > Oh great, now my "working just fine" USB devices, which happen to have
> > > > data in the last sector, suddenly stop working.
> > > > 
> > > > That's not acceptable :(
> > > 
> > > These patches really should not impact existing devices.  If they do
> > > then something is definitely wrong.
> > > 
> > > Can you provide detailed logging information showing your problem?  For 
> > > example, a usbmon trace would be good.  Better yet, a usbmon trace 
> > > without the patches and a usbmon trace with the patches, for 
> > > comparison.
> > 
> > I don't have a device with such a problem, I just am worried that we are
> > now suddenly keeping access from the last sector for devices that
> > currently did work just fine.
> > 
> > If you all guarantee that this will not happen, hey, I'm happy, and I'll
> > gladly point all bug reports on to you all :)
> 
> 
> Hey, you can trust me ... I'm a doctor ...
> 
> Would you like me to add your 'Responsibility-disclamed-by:' to the
> patch ...?

Heh.

As long as you take it through your trees, I inherently disclaim any
responsibility :)

greg k-h

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

* Re: PATCH: usb-storage-set-last-sector-bug-flag.patch
  2008-01-23 18:12       ` Greg KH
       [not found]         ` <20080123181239.GA21836-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
@ 2008-01-24 17:07         ` Stefan Richter
  2008-01-24 17:21           ` Greg KH
       [not found]           ` <4798C5B4.1000208-MtYdepGKPcBMYopoZt5u/LNAH6kLmebB@public.gmane.org>
  1 sibling, 2 replies; 15+ messages in thread
From: Stefan Richter @ 2008-01-24 17:07 UTC (permalink / raw)
  To: Greg KH
  Cc: USB development list, linux-scsi, USB Storage list, linux-usb,
	David Brown, James Bottomley, Alan Stern, Hans de Goede,
	Boaz Harrosh, Matthew Dharm

Greg KH wrote:
> I just am worried that we are
> now suddenly keeping access from the last sector for devices that
> currently did work just fine.

This new workaround doesn't prevent access to the last sector.  It only
breaks up a multi-sector access which would also reach the last sector
into several (two? I'm too lazy to look back in the mail thread)
accesses, in order to access the last sector in a dedicated
single-sector access.

So that's very differently to the fix-capacity workaround.  The
fix-capacity workaround manipulates the READ CAPACITY parameter data.
Therefore the fix-capacity workaround is unsafe for non-buggy devices.

The last-sector-(access-)bug workaround _only_ modifies the command
stream which is sent to the device.  A dangerous command is replaced by
equivalent safe commands.  These commands are luckily safe for _all_
devices, buggy and non-buggy ones.  The only cost of this workaround is
(1.) the code, (2.) the runtime/ bandwidth/ latency overhead for
accesses which reach the last sector.

Somebody correct me if I got something wrong.
-- 
Stefan Richter
-=====-==--- ---= ==---
http://arcgraph.de/sr/

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

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

* Re: PATCH: usb-storage-set-last-sector-bug-flag.patch
  2008-01-24 17:07         ` Stefan Richter
@ 2008-01-24 17:21           ` Greg KH
  2008-01-25 17:12             ` James Bottomley
       [not found]           ` <4798C5B4.1000208-MtYdepGKPcBMYopoZt5u/LNAH6kLmebB@public.gmane.org>
  1 sibling, 1 reply; 15+ messages in thread
From: Greg KH @ 2008-01-24 17:21 UTC (permalink / raw)
  To: Stefan Richter
  Cc: USB development list, linux-scsi, USB Storage list, linux-usb,
	David Brown, James Bottomley, Alan Stern, Hans de Goede,
	Boaz Harrosh, Matthew Dharm

On Thu, Jan 24, 2008 at 06:07:00PM +0100, Stefan Richter wrote:
> Greg KH wrote:
> > I just am worried that we are
> > now suddenly keeping access from the last sector for devices that
> > currently did work just fine.
> 
> This new workaround doesn't prevent access to the last sector.  It only
> breaks up a multi-sector access which would also reach the last sector
> into several (two? I'm too lazy to look back in the mail thread)
> accesses, in order to access the last sector in a dedicated
> single-sector access.
> 
> So that's very differently to the fix-capacity workaround.  The
> fix-capacity workaround manipulates the READ CAPACITY parameter data.
> Therefore the fix-capacity workaround is unsafe for non-buggy devices.
> 
> The last-sector-(access-)bug workaround _only_ modifies the command
> stream which is sent to the device.  A dangerous command is replaced by
> equivalent safe commands.  These commands are luckily safe for _all_
> devices, buggy and non-buggy ones.  The only cost of this workaround is
> (1.) the code, (2.) the runtime/ bandwidth/ latency overhead for
> accesses which reach the last sector.

Ok, thanks for explaining it better.  I have no objection to this change
anymore.

thanks,

greg k-h

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

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

* Re: PATCH: usb-storage-set-last-sector-bug-flag.patch
       [not found]           ` <4798C5B4.1000208-MtYdepGKPcBMYopoZt5u/LNAH6kLmebB@public.gmane.org>
@ 2008-01-24 17:22             ` Stefan Richter
  0 siblings, 0 replies; 15+ messages in thread
From: Stefan Richter @ 2008-01-24 17:22 UTC (permalink / raw)
  To: Greg KH
  Cc: Alan Stern, Hans de Goede, Matthew Dharm, James Bottomley,
	Boaz Harrosh, USB Storage list, USB development list, David Brown,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

> The last-sector-(access-)bug workaround _only_ modifies the command
> stream which is sent to the device.  A dangerous command is replaced by
> equivalent safe commands.

BTW, one thing about this patch set needs to be criticized:

"last_sector_bug" is a really bad name choice for the new flag.  No
wonder that it is confused with the (well named) "fix_capacity" flag.

How about "read_last_sector_separately" or something in the way?
-- 
Stefan Richter
-=====-==--- ---= ==---
http://arcgraph.de/sr/

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

* Re: PATCH: usb-storage-set-last-sector-bug-flag.patch
  2008-01-24 17:21           ` Greg KH
@ 2008-01-25 17:12             ` James Bottomley
  2008-01-25 19:23               ` Matthew Dharm
  0 siblings, 1 reply; 15+ messages in thread
From: James Bottomley @ 2008-01-25 17:12 UTC (permalink / raw)
  To: Greg KH
  Cc: USB development list, linux-scsi, USB Storage list, linux-usb,
	David Brown, Stefan Richter, Alan Stern, Hans de Goede,
	Boaz Harrosh, Matthew Dharm

On Thu, 2008-01-24 at 09:21 -0800, Greg KH wrote:
> On Thu, Jan 24, 2008 at 06:07:00PM +0100, Stefan Richter wrote:
> > Greg KH wrote:
> > > I just am worried that we are
> > > now suddenly keeping access from the last sector for devices that
> > > currently did work just fine.
> > 
> > This new workaround doesn't prevent access to the last sector.  It only
> > breaks up a multi-sector access which would also reach the last sector
> > into several (two? I'm too lazy to look back in the mail thread)
> > accesses, in order to access the last sector in a dedicated
> > single-sector access.
> > 
> > So that's very differently to the fix-capacity workaround.  The
> > fix-capacity workaround manipulates the READ CAPACITY parameter data.
> > Therefore the fix-capacity workaround is unsafe for non-buggy devices.
> > 
> > The last-sector-(access-)bug workaround _only_ modifies the command
> > stream which is sent to the device.  A dangerous command is replaced by
> > equivalent safe commands.  These commands are luckily safe for _all_
> > devices, buggy and non-buggy ones.  The only cost of this workaround is
> > (1.) the code, (2.) the runtime/ bandwidth/ latency overhead for
> > accesses which reach the last sector.
> 
> Ok, thanks for explaining it better.  I have no objection to this change
> anymore.

So, for forms sake to take this through the SCSI tree I need at least
one USB person to ack it ...

James



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

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

* Re: PATCH: usb-storage-set-last-sector-bug-flag.patch
  2008-01-25 17:12             ` James Bottomley
@ 2008-01-25 19:23               ` Matthew Dharm
  0 siblings, 0 replies; 15+ messages in thread
From: Matthew Dharm @ 2008-01-25 19:23 UTC (permalink / raw)
  To: James Bottomley
  Cc: USB development list, linux-scsi, USB Storage list, Greg KH,
	linux-usb, David Brown, Stefan Richter, Alan Stern, Hans de Goede,
	Boaz Harrosh


[-- Attachment #1.1: Type: text/plain, Size: 1855 bytes --]

ACKed-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>

Matt

On Fri, Jan 25, 2008 at 11:12:21AM -0600, James Bottomley wrote:
> On Thu, 2008-01-24 at 09:21 -0800, Greg KH wrote:
> > On Thu, Jan 24, 2008 at 06:07:00PM +0100, Stefan Richter wrote:
> > > Greg KH wrote:
> > > > I just am worried that we are
> > > > now suddenly keeping access from the last sector for devices that
> > > > currently did work just fine.
> > > 
> > > This new workaround doesn't prevent access to the last sector.  It only
> > > breaks up a multi-sector access which would also reach the last sector
> > > into several (two? I'm too lazy to look back in the mail thread)
> > > accesses, in order to access the last sector in a dedicated
> > > single-sector access.
> > > 
> > > So that's very differently to the fix-capacity workaround.  The
> > > fix-capacity workaround manipulates the READ CAPACITY parameter data.
> > > Therefore the fix-capacity workaround is unsafe for non-buggy devices.
> > > 
> > > The last-sector-(access-)bug workaround _only_ modifies the command
> > > stream which is sent to the device.  A dangerous command is replaced by
> > > equivalent safe commands.  These commands are luckily safe for _all_
> > > devices, buggy and non-buggy ones.  The only cost of this workaround is
> > > (1.) the code, (2.) the runtime/ bandwidth/ latency overhead for
> > > accesses which reach the last sector.
> > 
> > Ok, thanks for explaining it better.  I have no objection to this change
> > anymore.
> 
> So, for forms sake to take this through the SCSI tree I need at least
> one USB person to ack it ...
> 
> James
> 

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

It was a new hope.
					-- Dust Puppy
User Friendly, 12/25/1998

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #3: Type: text/plain, Size: 191 bytes --]

_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

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

end of thread, other threads:[~2008-01-25 19:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-20 10:27 PATCH: usb-storage-set-last-sector-bug-flag.patch Hans de Goede
2008-01-20 20:56 ` Greg KH
     [not found]   ` <20080120205625.GB28842-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2008-01-20 21:03     ` James Bottomley
     [not found]       ` <1200863008.3105.30.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-01-20 21:25         ` Hans de Goede
2008-01-20 21:39         ` [usb-storage] " Guillaume Bedot
2008-01-20 21:45     ` Alan Stern
2008-01-23 18:12       ` Greg KH
     [not found]         ` <20080123181239.GA21836-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2008-01-23 18:39           ` James Bottomley
2008-01-23 18:50             ` Greg KH
2008-01-24 17:07         ` Stefan Richter
2008-01-24 17:21           ` Greg KH
2008-01-25 17:12             ` James Bottomley
2008-01-25 19:23               ` Matthew Dharm
     [not found]           ` <4798C5B4.1000208-MtYdepGKPcBMYopoZt5u/LNAH6kLmebB@public.gmane.org>
2008-01-24 17:22             ` Stefan Richter
     [not found] ` <47932211.90105-fbo2DhPpy/Q@public.gmane.org>
2008-01-22  8:26   ` [usb-storage] " Guillaume Bedot

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).