From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>,
"tj@kernel.org" <tj@kernel.org>,
"dn3108@gmail.com" <dn3108@gmail.com>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>
Subject: Re: [PATCH] scsi/libata: Support variable-length cdb of ata pass-thru(32).
Date: Fri, 23 Jun 2017 17:15:37 +0000 [thread overview]
Message-ID: <1498238136.2735.8.camel@wdc.com> (raw)
In-Reply-To: <CAKv8XUU-k0dFjHAu9G2rM+is4AZw9BKfsFDh1zG0zwq=GzSVkg@mail.gmail.com>
On Sat, 2017-06-24 at 01:50 +0900, Minwoo Im wrote:
> - * Handles either 12 or 16-byte versions of the CDB.
> + * Handles either 12 16, or 32-byte versions of the CDB.
Please insert a comma between "12" and "16" to avoid that this comment
gets confusing.
> + if ((tf->protocol = ata_scsi_map_proto(cdb[1 + cdb_offset]))
> + == ATA_PROT_UNKNOWN) {
Have you verified this patch with checkpatch? The recommended style is
*not* to use assignments in the expression that controls an if-statement
and also if a comparison expression has to be split to keep the comparison
operator at the end of the first line.
> - shost->max_cmd_len = 16;
> + /*
> + * SPC says that CDB may have a fixed length of up to 16 bytes
> + * or variable length of between 12 and 260 bytes.
> + */
> + shost->max_cmd_len = 260;
As mentioned before, I think a maximum CDB length of 260 is overkill.
> /* Values for T10/04-262r7 */
> +#define ATA_32 0x1ff0 /* 32-byte pass-thru,
> service action */
> #define ATA_16 0x85 /* 16-byte pass-thru */
> #define ATA_12 0xa1 /* 12-byte pass-thru */
Defining ATA_32 just above ATA_12 and ATA_16 is misleading because
the latter two are CDB opcodes while the former is a service action
code. Please move the definition of the ATA_32 service action code
one line up such that it appears at the end of the list of already
defined service codes, namely this list:
/* values for variable length command */
#define XDREAD_32 0x03
#define XDWRITE_32 0x04
#define XPWRITE_32 0x06
#define XDWRITEREAD_32 0x07
#define READ_32 0x09
#define VERIFY_32 0x0a
#define WRITE_32 0x0b
#define WRITE_SAME_32 0x0d
Thanks,
Bart.
next prev parent reply other threads:[~2017-06-23 17:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-17 11:00 [PATCH] scsi/libata: Support variable-length cdb of ata pass-thru(32) Minwoo Im
2017-06-19 13:22 ` [PATCH] scsi/libata: Support variable-length cdb of ata pass-thru(32)-bug fixed Minwoo Im
2017-06-21 18:52 ` [PATCH] scsi/libata: Support variable-length cdb of ata pass-thru(32) Bart Van Assche
2017-06-23 16:50 ` Minwoo Im
2017-06-23 17:02 ` Bart Van Assche
2017-06-23 17:15 ` Bart Van Assche [this message]
2017-06-23 17:59 ` Minwoo Im
2017-06-23 18:13 ` Bart Van Assche
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=1498238136.2735.8.camel@wdc.com \
--to=bart.vanassche@wdc.com \
--cc=dn3108@gmail.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=tj@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).