Skip to contentSkip to conversation

START-STOP under Linux 2.4

DISCUSSION Applied Alan Stern 2 participants 2 messages Apr 2, 2003 – Apr 9, 2003 1 message not in the archive SCSI

lore
Share & tools
lore

Alan Stern

author
#1 lore raw
In reply to a message not in the archive

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.c patch 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
Applied
#2 lore raw
Quoted 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.h with the US_FL_START_STOP flag; now that should no longer be necessary.

Applied, thanks.

greg k-h