Skip to contentSkip to conversation

PATCH: unusual_devs fixups

PATCH Matthew Dharm 1 participant 1 message Jun 16, 2003 SCSI

lore
Share & tools
lore
#0 lore raw

(Resend due to error in address for linux-scsi.)

This patch moves the initialization of the struct scsi_device fields use_10_for_ms and use_10_for_rw into a central place. This allows the host's slave_configure() function to change them (with effect). This also collapses two identical sections of code into a single one.

This patch is needed by usb-storage, so we can resolve some Babble problems, some device-crashing problems, and remove a great deal of troublesome mode-sense-translation code.

This patch is made against one of Greg K-H's USB trees, but it should apply with little-or-no fuzz against a Linus tree or a linux-scsi tree.

Linus, please apply.

Matt

# This is a BitKeeper generated patch for the following project:
# Project Name: greg k-h's linux 2.5 USB kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:

#	           ChangeSet	1.1963  -> 1.1964 
#	   drivers/scsi/sr.c	1.46    -> 1.47   
#	   drivers/scsi/sd.c	1.49    -> 1.50   

# drivers/scsi/scsi_scan.c 1.39 -> 1.40
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/06/15 [email protected] 1.1964
# Move the setting of the use_10_for_ms and use_10_for_rw members of struct

# scsi_device to between where the structure is created and where
# slave_configure() is called.
# 
# This allows slave_configure() to manipulate the variables while
# simultaneously moves two pieces of identical code into one common place.
# --------------------------------------------
#
diff -Nru a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
--- a/drivers/scsi/scsi_scan.c	Sun Jun 15 20:38:43 2003
+++ b/drivers/scsi/scsi_scan.c	Sun Jun 15 20:38:43 2003
@@ -686,6 +686,9 @@
 	 * function */
 	sdev->max_device_blocked = SCSI_DEFAULT_DEVICE_BLOCKED;

+ sdev->use_10_for_rw = 1;
+ sdev->use_10_for_ms = 0;
+
if(sdev->host->hostt->slave_configure)
sdev->host->hostt->slave_configure(sdev);

drivers/scsi/sd.c +0 -2
diff -Nru a/drivers/scsi/sd.c b/drivers/scsi/sd.c
@@ -1265,8 +1265,6 @@
 	if (sdkp->media_present)
 		sd_read_cache_type(sdkp, disk->disk_name, SRpnt, buffer);
 		
-	SRpnt->sr_device->use_10_for_rw = 1;
-	SRpnt->sr_device->use_10_for_ms = 0;
 	SRpnt->sr_device->remap = 1;
 
  leave:
drivers/scsi/sr.c +0 -2
diff -Nru a/drivers/scsi/sr.c b/drivers/scsi/sr.c
@@ -524,8 +524,6 @@
 	sprintf(cd->cdi.name, "sr%d", minor);
 
 	sdev->sector_size = 2048;	/* A guess, just in case */
-	sdev->use_10_for_rw = 1;
-	sdev->use_10_for_ms = 0;
 	sdev->remap = 1;
 
 	/* FIXME: need to handle a get_capabilities failure properly ?? */
Signature · 7 lines
Matthew Dharm                              Home: [email protected] 
Maintainer, Linux USB Mass Storage Driver

Sir, for the hundreth time, we do NOT carry 600-round boxes of belt-fed 
suction darts!
					-- Salesperson to Greg
User Friendly, 12/30/1997