Re: USB harddisk drive fails on 2.6.23-rc3 (regression)
Bernhard Kaindl <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 20 Aug 2007, Alan Stern wrote: > On Sun, 19 Aug 2007, Jean Delvare wrote: > >>> There are lots of possible ways to address this. Worth trying is >>> to enable the "allow_restart" attribute for the drive. The attribute >>> file appears in the sysfs directory for the disk; you may have to >>> search around a little to find exactly where it is. Also you may have >>> to use the blockdev command to force the system to read the partition >>> table after turning on allow_restart. ... >> Am I supposed to add these commands to my init scripts, or is there >> another way to make the effect permanent? > > If allow_restart were set to to 1 by default then you wouldn't have to > do anything. That's why I wrote: > >>> (Perhaps allow_restart should be on by default for all SCSI devices. >>> That's a question which should be raised on the linux-scsi mailing >>> list.) > > I can't see any reason for not setting it to 1 by default, but there > may be reasons I am not aware of. As far as I found in my research, Matthew Dharm was against it back in early 2004: http://marc.info/?l=linux-scsi&m=107702811830956 Matthew Dharm wrote: > Umm... I hope that the issuing of START_UNIT will only occur in very > narrowly defined cases. > > If you just issue START_UNIT semi-arbitrarily, you'll break most USB > devices. The answer which he was given didn't mention that START_UNIT is by no means issued in a "semi-arbitrarily" way. It's only issued when SCSI commands fail due to to not ready and initializing command required: drivers/scsi/scsi_error.c /** * scsi_eh_stu - send START_UNIT if needed * @shost: scsi host being recovered. * @eh_done_q: list_head for processed commands. * * Notes: * If commands are failing due to not ready, initializing command required, * try revalidating the device, which will end up sending a start unit. **/ There is also scsi_eh_try_stu() in the same file which just does the START_UNIT and it's called also from scsi_eh_host_reset() when scsi_device_online() didn't report success. The other function where the "_stu" (START_UNIT) functions are called is scsi_eh_ready_devs() which is used by scsi_unjam_host() (this function can be overridden by SCSI drivers). But all of this code gets only to run if the SCSI error handler thread is kicked off to fix an error, so at least unless an error occurs, START_UNIT should never be issed, but I must confess that I didn't add an prink to the scsi error handler yet to be able to attest this, but it's easy for everyone to add one at the top of scsi_unjam_host(), which is the entry function to the error handler to verify it. On this ancient mail from 2001, Matthew was also critical to START_UNIT, but as he (back then) claimed that the SCSI layer's way of probing for media change is START_UNIT (which I could not see anymore with 2.6.22), I think this is obsolete: http://www.mail-archive.com/[email protected]/msg03598.html Here, James Bottomley was sceptical whether it works for USB as well: http://www.nabble.com/Re%3A-Spinup-of-SCSI-Disks%3A-allow_restart-won%27t-work-on-2.6.18-p7465626.html That also seems to be obsolete or a wrong guess because simply setting the bit just works fine as we know now. Finally, I want to mention that the SCSI layer of FireWire (SBP2) already enables allow_restart for all block-based FireWire storage devices since 2.6.19-rcX (I confirmed that): http://www.nabble.com/Re%3A-Spinup-of-SCSI-Disks%3A-allow_restart-won%27t-work-on-2.6.18-p7413003.html sbp2.c does exactly what Brian King in the first mail linked above: > And the patch allows for this. With the patch, devices will only get > this new behavior if a flag gets set in their scsi_device struct by > the LLD in its slave_configure routine. There is a family of USB disks from Seagate (FreeAgent Desktop, Pro and Go models) which actually need allow_restart by default, even without autosuspend: These disks suspend themselfes after 15 minutes of inactivity but need START_UNIT for restart. I have two Pro models and tested this and have a patch ready which fixes those selectively. Sending it as followup mail. Bernhard ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel