linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian King <brking@us.ibm.com>
To: Brian King <brking@us.ibm.com>
Cc: James.Bottomley@steeleye.com, linux-scsi@vger.kernel.org,
	jgarzik@pobox.com, linux-ide@vger.kernel.org
Subject: [PATCH 2/2] libata: Use scsi_device max_cmd_len (resend)
Date: Mon, 17 Apr 2006 17:48:33 -0500	[thread overview]
Message-ID: <44441B41.40206@us.ibm.com> (raw)
In-Reply-To: <200604172240.k3HMes2V010154@d01av01.pok.ibm.com>

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



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: libata_sd_cdb_len.patch --]
[-- Type: text/x-patch; name="libata_sd_cdb_len.patch", Size: 2305 bytes --]


Use the newly added max_cmd_len in the scsi_device
struct instead of the field by the same name in
the scsi_host struct. This allows for better
granularity of control of the max allowed command
length and allows for SAS/SATA hosts to impose their
own host restrictions on max command length, if needed.
It also simplifies using libata for SATA devices under
SAS HBAs.

Signed-off-by: Brian King <brking@us.ibm.com>
---

 libata-dev-bjking1/drivers/scsi/libata-core.c |   10 ++--------
 libata-dev-bjking1/drivers/scsi/libata-scsi.c |    1 +
 2 files changed, 3 insertions(+), 8 deletions(-)

diff -puN drivers/scsi/libata-core.c~libata_sd_cdb_len drivers/scsi/libata-core.c
--- libata-dev/drivers/scsi/libata-core.c~libata_sd_cdb_len	2006-04-17 17:30:20.000000000 -0500
+++ libata-dev-bjking1/drivers/scsi/libata-core.c	2006-04-17 17:30:20.000000000 -0500
@@ -1225,7 +1225,7 @@ static int ata_dev_configure(struct ata_
 {
 	const u16 *id = dev->id;
 	unsigned int xfer_mask;
-	int i, rc;
+	int rc;
 
 	if (!ata_dev_enabled(dev)) {
 		DPRINTK("ENTER/EXIT (host %u, dev %u) -- nodev\n",
@@ -1328,12 +1328,6 @@ static int ata_dev_configure(struct ata_
 			       ap->id, dev->devno, ata_mode_string(xfer_mask));
 	}
 
-	ap->host->max_cmd_len = 0;
-	for (i = 0; i < ATA_MAX_DEVICES; i++)
-		ap->host->max_cmd_len = max_t(unsigned int,
-					      ap->host->max_cmd_len,
-					      ap->device[i].cdb_len);
-
 	/* limit bridge transfers to udma5, 200 sectors */
 	if (ata_dev_knobble(ap, dev)) {
 		if (print_info)
@@ -4573,7 +4567,7 @@ static void ata_host_init(struct ata_por
 	host->max_lun = 1;
 	host->max_channel = 1;
 	host->unique_id = ata_unique_id++;
-	host->max_cmd_len = 12;
+	host->max_cmd_len = ATAPI_CDB_LEN;
 
 	ap->flags = ATA_FLAG_DISABLED;
 	ap->id = host->unique_id;
diff -puN drivers/scsi/libata-scsi.c~libata_sd_cdb_len drivers/scsi/libata-scsi.c
--- libata-dev/drivers/scsi/libata-scsi.c~libata_sd_cdb_len	2006-04-17 17:30:20.000000000 -0500
+++ libata-dev-bjking1/drivers/scsi/libata-scsi.c	2006-04-17 17:30:20.000000000 -0500
@@ -670,6 +670,7 @@ static void ata_scsi_dev_config(struct s
 		max_sectors = dev->max_sectors;
 
 	blk_queue_max_sectors(sdev->request_queue, max_sectors);
+	sdev->max_cmd_len = dev->cdb_len;
 
 	/*
 	 * SATA DMA transfers must be multiples of 4 byte, so
_

  reply	other threads:[~2006-04-17 22:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-17 22:40 [PATCH 1/2] scsi: Add scsi_device max_cmd_len (resend) Brian King
2006-04-17 22:48 ` Brian King [this message]
2006-04-17 22:52   ` [PATCH 2/2] libata: Use " Jeff Garzik
2006-04-18 14:01     ` Brian King
2006-04-28 14:28 ` [PATCH 1/2] scsi: Add " Brian King
2006-04-28 15:17   ` James Bottomley
2006-04-28 17:47     ` Luben Tuikov
2006-04-28 18:19     ` Brian King
2006-04-28 18:30       ` James Bottomley
2006-04-28 19:03         ` Brian King
2006-04-28 20:56           ` James Bottomley
2006-04-28 21:11             ` Brian King
2006-04-28 21:21               ` James Bottomley
2006-04-28 21:32               ` Jeff Garzik
2006-04-28 21:43                 ` Brian King
2006-04-28 21:54                 ` James Bottomley
2006-04-28 17:28   ` Luben Tuikov
2006-04-28 18:16     ` Brian King

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=44441B41.40206@us.ibm.com \
    --to=brking@us.ibm.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).