From: Brian King <brking@us.ibm.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: James.Bottomley@steeleye.com, linux-scsi@vger.kernel.org,
linux-ide@vger.kernel.org
Subject: Re: [PATCH 2/2] libata: Use scsi_device max_cmd_len (resend)
Date: Tue, 18 Apr 2006 09:01:59 -0500 [thread overview]
Message-ID: <4444F157.2010504@us.ibm.com> (raw)
In-Reply-To: <44441C3D.80906@pobox.com>
Jeff Garzik wrote:
> Brian King wrote:
>> @@ -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;
>>
>
>
> Have you audited the code paths to ensure that a CDB of length 15 is
> _NEVER_ sent, before ata_scsi_dev_config() is called?
Yes. I don't see any problems. slave_configure is called before any
upper layer drivers are attached and before anything shows up in sysfs,
so that limits us to libata initiated commands issued as part of the
port probe process and scsi core initiated commands issued as part of
device scanning. All the commands libata issues as part of the port
probe process are issued through ata_exec_internal, which does not go
through scsi core, so there is no protection there today. scsi core
only issues inquiry and report luns commands as part of scanning, both
of which are not an issue.
> The current code intentionally uses the minimum -- 12 -- and then raises
> it if both device and host are capable of more.
Actually, the current code does not allow for an ata host to limit the
max CDB length. ata_host_init initializes host->max_cmd_len to 12, then
ata_dev_configure zeroes out ap->host->max_cmd_len, then sets it to the
maximum CDB length supported by any of the devices on that host. The obvious
followup patch to this one would be to change all the users of libata
to have them initialize scsi_host_template->max_cmd_len and remove that code
from ata_host_init.
--
Brian King
eServer Storage I/O
IBM Linux Technology Center
next prev parent reply other threads:[~2006-04-18 14:02 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 [this message]
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=4444F157.2010504@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).