]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
scsi: Adjust SCSI inquiry command data length
authorMacpaul Lin <macpaul.lin@mediatek.com>
Thu, 5 Mar 2026 10:23:24 +0000 (18:23 +0800)
committerTom Rini <trini@konsulko.com>
Mon, 16 Mar 2026 16:39:26 +0000 (10:39 -0600)
Per the SCSI SPC-4 specification, the standard inquiry data length
should not be less than 36 bytes. The current implementation uses 512
bytes, which causes detection failures on some UFS devices (e.g.,
Longsys) that do not expect a transfer length exceeding the standard
inquiry size.

Align the default standard inquiry length with the Linux kernel's
implementation (see drivers/scsi/scsi_scan.c), which uses 36 bytes as
the default. Devices requiring vendor-specific inquiry lengths should
be handled through quirk settings in the future.

Signed-off-by: ht.lin <ht.lin@mediatek.com>
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Reviewed-by: Marek Vasut <marek.vasut@mailbox.org>
drivers/scsi/scsi.c

index 8fe6b38a8c748e9224dcbf075bcfac1dcec83219..116b696b08dd120ba083a5d8714a76384f813eba 100644 (file)
@@ -513,7 +513,7 @@ static int scsi_detect_dev(struct udevice *dev, int target, int lun,
        pccb->target = target;
        pccb->lun = lun;
        pccb->pdata = tempbuff;
-       pccb->datalen = 512;
+       pccb->datalen = 36;
        pccb->dma_dir = DMA_FROM_DEVICE;
        scsi_setup_inquiry(pccb);
        if (scsi_exec(dev, pccb)) {