Re: [PATCH] scsi: Do no try to probe for CDL on old drives

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


On 9/14/23 19:20, Damien Le Moal wrote:
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 92ae4b4f30ac..7aa70af1fc07 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1828,6 +1828,9 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf)
  		hdr[2] = 0x7; /* claim SPC-5 version compatibility */
+ if (args->dev->flags & ATA_DFLAG_CDL)
+		hdr[2] = 0xd; /* claim SPC-6 version compatibility */

How about using the symbolic name SCSI_SPC_6 - 1 instead of the literal constant 0xd?

-	sdev->scsi_level = inq_result[2] & 0x07;
+	sdev->scsi_level = inq_result[2] & 0x0f;
  	if (sdev->scsi_level >= 2 ||
  	    (sdev->scsi_level == 1 && (inq_result[3] & 0x0f) == 1))

Can support for inq_result[3] & 0x0f == 1 be dropped? From an SPC-2
draft from 2001: "A RESPONSE DATA FORMAT field value of two indicates that the data shall be in the format specified in this standard. Response data format values less than two are obsolete. Response data format values greater than two are reserved."

@@ -157,6 +157,9 @@ enum scsi_disposition {
  #define SCSI_3          4        /* SPC */
  #define SCSI_SPC_2      5
  #define SCSI_SPC_3      6
+#define SCSI_SPC_4	7
+#define SCSI_SPC_5	8
+#define SCSI_SPC_6	14

Please consider changing the SCSI_SPC_* constants such that these match the SPC standard. Having numerical values that do not match the standard is confusing.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux