public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
To: USB Developers <linux-usb-devel@lists.sourceforge.net>,
	Greg KH <greg@kroah.com>,
	Linux SCSI list <linux-scsi@vger.kernel.org>,
	torvalds@transmeta.com
Subject: PATCH: unusual_devs fixups
Date: Sun, 15 Jun 2003 20:49:08 -0700	[thread overview]
Message-ID: <20030615204908.C10908@one-eyed-alien.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 3162 bytes --]

(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	mdharm@zen.san.one-eyed-alien.net	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);
 
diff -Nru a/drivers/scsi/sd.c b/drivers/scsi/sd.c
--- a/drivers/scsi/sd.c	Sun Jun 15 20:38:43 2003
+++ b/drivers/scsi/sd.c	Sun Jun 15 20:38:43 2003
@@ -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:
diff -Nru a/drivers/scsi/sr.c b/drivers/scsi/sr.c
--- a/drivers/scsi/sr.c	Sun Jun 15 20:38:43 2003
+++ b/drivers/scsi/sr.c	Sun Jun 15 20:38:43 2003
@@ -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 ?? */
-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
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

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

                 reply	other threads:[~2003-06-16  3:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030615204908.C10908@one-eyed-alien.net \
    --to=mdharm-usb@one-eyed-alien.net \
    --cc=greg@kroah.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox