Re: [PATCH 1/2] scsi: Add scsi_device max_cmd_len (resend)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Brian King <brking@xxxxxxxxxx>
---

 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;
_

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux