All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian King <brking@us.ibm.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
	linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org
Subject: Re: [PATCH 1/2] scsi: Add scsi_device max_cmd_len (resend)
Date: Fri, 28 Apr 2006 16:43:18 -0500	[thread overview]
Message-ID: <44528C76.2010006@us.ibm.com> (raw)
In-Reply-To: <445289F5.6070608@pobox.com>

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

Jeff Garzik wrote:
> Brian King wrote:
>> Going along with that argument, there's really no good reason for
>> libata to be playing games with scsi_host->max_cmd_len based on
>> the attached devices.
> 
> If both host controller and device support 16-byte CDB, it should not be 
> limited to 12 bytes.

Agreed.

> libata is not "playing games", just exporting what the hardware supports 
> as best the API allows.  It needs to support 16-byte CDBs for the same 
> reason any SCSI LLDD supports 16-byte CDBs.
> 
> Remember ATAPI<->SCSI bridges exist, thus any SCSI disk can appear 
> attached to ATAPI.

The libata code in question is the code that changes
scsi_host->max_cmd_len based on what the attached devices support.
I propose the following patch. This patch is untested.


-- 
Brian King
eServer Storage I/O
IBM Linux Technology Center

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



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

 libata-dev-bjking1/drivers/scsi/libata-core.c |    8 +-------
 1 files changed, 1 insertion(+), 7 deletions(-)

diff -puN drivers/scsi/libata-core.c~libata_max_cmd_len drivers/scsi/libata-core.c
--- libata-dev/drivers/scsi/libata-core.c~libata_max_cmd_len	2006-04-28 16:34:16.000000000 -0500
+++ libata-dev-bjking1/drivers/scsi/libata-core.c	2006-04-28 16:34:40.000000000 -0500
@@ -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;
_

  reply	other threads:[~2006-04-28 21:43 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 ` [PATCH 2/2] libata: Use " Brian King
2006-04-17 22:52   ` 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 [this message]
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=44528C76.2010006@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.