public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [GIT PATCH] USB autosuspend fixes for 2.6.23-rc6
@ 2007-09-17 12:56 Hans de Goede
  0 siblings, 0 replies; 25+ messages in thread
From: Hans de Goede @ 2007-09-17 12:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: Hans de Goede

Hi all,

Please keep me CC-ed I'm not on the list. I just found out about this thread 
while ivnestegating some autosuspend problems, which I will describe in another 
list.

stern at rowland  wrote:
 > Linus Torvalds wrote:
 > > - US_FL_FIX_CAPACITY:
 > > This is a generic SCSI issue, not a USB one, and maybe there are
 > > better solutions to it. Are we perhaps doing something wrong? Is
 > > there some patterns we haven't seen? Why do we need this, when
 > > presumably Windows does not?
 >
 > Why doesn't Windows need this? For all we know, it does. Has anybody
 > ever tried forcing Windows to read the sector beyond the end of one of
 > these buggy devices?

I haven't but I'm pretty sure it will crash my hp usb printer (with builtin 
cardreader)

 > For one reason or another, Linux supports filesystems/partitioning
 > schemes which do need to access the last sector (EFI GUID, md, maybe
 > others). Some devices are so buggy that trying to read the nonexistent
 > "last" sector causes them to lock up, requiring a power cycle.
 > Obviously we can't probe for this sort of behavior. (There was one
 > report of a device which _could_ read its last sector correctly, but
 > only if the transfer was exactly 1 sector long! Attempts to read two
 > sectors starting from the second-to-last sector would cause it to
 > crash.)

Yes and the reporter of that one device (a HP PSC1350) would be me, I even 
wrote a patch introducing a new quirk for this (shoot me, I don't like quirks 
either, but if we can choose between making some device work and not 
introducing a quirk, I say make the device work!)

Talking about this patch (posted to the usb-storage list) I haven't received 
any feedback, any chance this patch could get integrated soon? I have found 
another Linux user with the same printer and the same problem who has 
independently verified my patch fixes it. Currently a third Linux using owner 
of such a device has contacted me, I'm waiting for his feedback if the patch 
helps him too, but I assume it will. That makes 3 users who have jumped through 
many hoops to get it to work, so there are probably many other users who have 
just given up, or even returned to that other OS!

I'm pretty sure the only reason why that other OS doesn't crash the printer is 
because it normally doesn't try to read the last sector, I haven't tried as I 
no longer have that other OS on any computer in my home.

Also I think it might be an idea to have an option to easily disable the 
partition reading code which tries to read the end of the disk, this seems to 
cause problems in various places.

Regards,

Hans


^ permalink raw reply	[flat|nested] 25+ messages in thread
* Re: [GIT PATCH] USB autosuspend fixes for 2.6.23-rc6
@ 2007-09-18 10:39 Joerg Schilling
  0 siblings, 0 replies; 25+ messages in thread
From: Joerg Schilling @ 2007-09-18 10:39 UTC (permalink / raw)
  To: linux-kernel, stern


> That's true now, but it wasn't always.  Until the last year or so, 
> cdrecord wouldn't work properly with USB CD drives having a 64-sector 
> limit unless the user added a particular command-line argument. 

This is a bug that is known since ~ 3 years and that has been fixed 
_very_ recently. It was still present in 2.6.21.7 a few weeks ago.

And BTW: the limit was not 64 sectors but ~13 sectors. 64 sectors would be at 
least 128 kB but the limit was ~ 32k.





Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 25+ messages in thread
* [GIT PATCH] USB autosuspend fixes for 2.6.23-rc6
@ 2007-09-13 13:33 Greg KH
  2007-09-13 14:52 ` Adrian Bunk
  0 siblings, 1 reply; 25+ messages in thread
From: Greg KH @ 2007-09-13 13:33 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: linux-kernel, linux-usb-devel, Alan Stern, Oliver Neukum

It turns out that USB devices suck when it comes to powermanagement
issues :(

A number of patches have been submitted near the end of this kernel
release cycle that add new device ids to the quirk table in the kernel
to disable autosuspend for specific devices.  However, a number of
developers are very worried that even with the testing that has been
done, once 2.6.23 is released, we are going to get a whole raft of angry
users when their devices break in nasty ways.

As an example, it seems that almost 2/3 of all USB printers just can not
handle autosuspend.  And there's a _lot_ of USB printers out there...

When researching how other operating systems handle this, it was found
out that they use a whitelist of devices that are able to properly
suspend.  So, in the future, that is how we are going to handle this.

These two patches address the need today to have users machines still
work, even if they might draw more power than they possibly could (which
is not any more than they did in 2.6.22.)

These patches do two things:
  - disable USB autosuspend on all devices except for USB hubs.  This
    can be easily overridden by userspace to turn on autosuspend for
    devices that a user wants to.  HAL will use a whitelist in the
    future for these types of devices.
  - revert the usb-storage autosuspend patch.  This breaks a number of
    devices out there that can not handle suspend properly, _AND_ the
    current patch is broken even for devices that do work properly under
    some situations.  Data loss is not a good thing to have happen, so
    this patch is reverted for now.  Oliver has more specifics about the
    issues involved here if anyone is curious.

The "disable autosuspend" patch has been in the -mm tree for a while,
and is being shipped by Ubuntu and Red Hat in their bleeding-edge
kernels in order to handle the huge number of broken devices.  openSUSE
will also get this patch for its next kernel release once the suse
developers return from wondering around the woods of the Czech Republic
next week.

Please pull from:
	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6.git/

The full patches will be sent to the linux-usb-devel mailing list, if
anyone wants to see them.

thanks,

greg k-h


 drivers/usb/core/quirks.c      |    6 ++++++
 drivers/usb/storage/scsiglue.c |   13 ++++---------
 drivers/usb/storage/usb.c      |   27 +++++++--------------------
 3 files changed, 17 insertions(+), 29 deletions(-)

---------------

Alan Stern (1):
      USB: disable autosuspend by default for non-hubs

Greg Kroah-Hartman (1):
      Revert "usb-storage: implement autosuspend"



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

end of thread, other threads:[~2007-09-18 10:50 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-17 12:56 [GIT PATCH] USB autosuspend fixes for 2.6.23-rc6 Hans de Goede
  -- strict thread matches above, loose matches on Subject: below --
2007-09-18 10:39 Joerg Schilling
2007-09-13 13:33 Greg KH
2007-09-13 14:52 ` Adrian Bunk
2007-09-13 15:20   ` Alan Stern
2007-09-13 15:40     ` Adrian Bunk
2007-09-13 16:07       ` Alan Stern
2007-09-13 16:34         ` Greg KH
2007-09-13 16:43         ` Linus Torvalds
2007-09-13 19:13           ` Alan Stern
2007-09-14  0:24             ` Matthew Dharm
2007-09-14 14:34               ` Alan Stern
2007-09-14  8:55             ` Jiri Kosina
2007-09-14  9:59               ` Greg KH
2007-09-13 19:26           ` Pete Zaitcev
2007-09-13 20:19         ` Adrian Bunk
2007-09-13 20:31           ` Alan Stern
2007-09-13 20:44           ` Linus Torvalds
2007-09-13 21:28             ` Adrian Bunk
2007-09-13 22:05               ` Adrian Bunk
2007-09-14  0:11                 ` Linus Torvalds
2007-09-14 13:21                   ` Mark Lord
2007-09-14 14:15                     ` Adrian Bunk
2007-09-14 14:29                 ` Alan Stern
2007-09-14 14:26               ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox