On Thu, 2026-02-12 at 15:07 +0100, Marek Vasut wrote:
> 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On 2/12/26 9:21 AM, Macpaul Lin (林智斌) wrote:
> > On Wed, 2026-02-11 at 12:06 +0100, Marek Vasut wrote:
> > > 
> > > External email : Please do not click links or open attachments
> > > until
> > > you have verified the sender or the content.
> > > 
> > > 
> > > On 2/11/26 11:40 AM, Macpaul Lin wrote:
> > > > Adjust the data length of the SCSI inquiry command to
> > > > accommodate
> > > > various
> > > > UFS device vendors. This prevents SCSI detection failures on
> > > > Longsys UFS
> > > > devices. Verified with Hynix, SD, and Longsys UFS devices.
> > > Can this be quirked using some vendor/device ID match , so only
> > > the
> > > problematic devices suffer the consequences ? Thank you
> > 
> > During the patch reviewing last time, Eric (HT Lin) commented
> > the length of 512 bytes is not follow the specification of UFS
> > storage;
> > it should be 36 bytes. So these are not problematic devices
> > actually.
> > However, I'm wondering how the parameter should apply to the
> > traditional SCSI devices like harddrive  or USB disk.
> > 
> > I'll double check it with Eric then update new patch around the end
> > of
> > February.
> Thank you, and yes, I was about to point out that this is a scsi core
> code, this applies to SCSI, USB and such devices.

After re-visit the specification of SCSI SPC-4, we have confirmed the 
standard inquiry (and the 1st) should not "less than" 36 bytes.

https://www.t10.org/members/w_spc4.htm
(A summary of SCSI-1 could be found here in html format
https://www.staff.uni-mainz.de/tacke/scsi/SCSI2-08.html#8.2.5 )

Compare the logic with the Linux's implementation in these sections:
https://elixir.bootlin.com/linux/v6.19.3/source/drivers/scsi/scsi_scan.c#L690

https://elixir.bootlin.com/linux/v6.19.3/source/drivers/scsi/scsi_scan.c#L801
https://elixir.bootlin.com/linux/v6.19.3/source/drivers/scsi/scsi_scan.c#L757

Unless the inquiry length has been assigned by the device, Linux use 36
bytes as the default standard inquiry length.

Is it possible to update the implementation in u-boot to use 36 bytes
as default standard inquiry lenght aligned with Linux, other devices
should apply vendor specific inquiry length with quirk settings. Would
it be okay? Looking forward for the further suggestions. 

Thanks
Macpaul Lin

Reply via email to