START-STOP under Linux 2.4
Greg:
This patch for 2.4.21-pre6 (a backport from 2.5) removes a source of problems for many usb-storage devices by replacing a START-STOP command, used to determine if the drive media is loaded, with a TEST-UNIT-READY. In the past people have handled this by creating entries in unusual_devs.h with the US_FL_START_STOP flag; now that should no longer be necessary.
Alan Stern
Quoted 32 lines · Matthew Dharm
Send it to Greg K-H -- he'll send it to Marcello.
Matt
Quoted 27 lines · Alan Stern
Great! I'll try to get this into the official kernel source.
Matt: Do you know the appropriate person to send this patch to for inclusion in 2.4.21?
Alan Stern
Quoted 8 lines · John Goerzen
Quoted 4 lines · Alan Stern
Based on the kernel log you posted earlier, it looks like your problem may stem from the use of a START-STOP command. The patch below removes that command; it's a backport from 2.5. Try installing this and let us know if it helps.
Indeed it does! Things seem to work fine with your patch.
Quoted 6 lines · Chris Worley
Bingo.
This worked great. There was a little tweak on the
sd.cpatch for the 2.4.19 kernel, but it was apparent.Thanks!
drivers/scsi/sd.c renamed from drivers/scsi/sd.c.orig +6 -4
@@ -731,15 +731,17 @@* check_disk_change */ } -/* Using Start/Stop enables differentiation between drive with +/* +* Using TEST_UNIT_READY enables differentiation between drive with * no cartridge loaded - NOT READY, drive with changed cartridge - * UNIT ATTENTION, or with same cartridge - GOOD STATUS. -* This also handles drives that auto spin down. eg iomega jaz 1GB -* as this will spin up the drive. +* +* Drives that auto spin down. eg iomega jaz 1G, will be started +* by sd_init_onedisk(), whenever revalidate_scsidisk() is called. */ retval = -ENODEV ;if (scsi_block_when_processing_errors (SDev)) - retval =scsi_ioctl (SDev,SCSI_IOCTL_START_UNIT ,NULL ); + retval =scsi_ioctl (SDev,SCSI_IOCTL_TEST_UNIT_READY ,NULL );if (retval) {/* Unable to test, unit probably not ready. * This usually means there is no disc in the
Greg KH
AppliedQuoted 7 lines · Alan Stern
Greg:
This patch for 2.4.21-pre6 (a backport from 2.5) removes a source of problems for many usb-storage devices by replacing a START-STOP command, used to determine if the drive media is loaded, with a TEST-UNIT-READY. In the past people have handled this by creating entries in
unusual_devs.hwith theUS_FL_START_STOPflag; now that should no longer be necessary.
Applied, thanks.
greg k-h