On 2022-03-02 00:35, Martin K. Petersen wrote:
This series addresses several issues in the SCSI device discovery code: - Fetch the VPD header before getting the full VPD page. This removes the guesswork from sizing the VPD buffer and fixes problems with RAID controllers that wedge when we try to fetch the IDENTIFY DEVICE information trailing the ATA Information VPD page. - Cache the VPD pages we need instead of fetching them every revalidate iteration. - Avoid truncating the INQUIRY length for modern devices. This allows us to query the version descriptors reported by most contemporary drives. These version descriptors are used as an extra heuristic for querying protocol features.
Version descriptors used to be updated by Ralph Weber (WDC, T10) but he stopped doing that about 2 years ago. When that was pointed out he made a proposal to T10 [20-022r0] for dropping version descriptors henceforth. The proposal was voted down but no-one has stepped up at T10 to keep the version descriptors up to date. Version descriptors used to have an entry on this page: https://www.t10.org/lists/1spc-lst.htm That is no longer the case. They are still in spc6r06.pdf (latest draft) but haven't been updated for the same period. I believe Seagate never supported version descriptors. Hitachi/WD used to support them. But I have a WD SAS disk manufactured last month and it has no version descriptors. I have no Toshiba, Samsung nor Kioxia disks. Could someone report if their recent SAS disks support version descriptors?
- Additional sanity checking for the reported minimum and optimal I/O sizes. - Fix reported discard failures by making the configuration a two-stage process. Completing full VPD/RSOC discovery before we configure discard prevents a small window of error where the wrong command and/or wrong limit would briefly be applied. - Make the zeroing configuration a two-stage process as well. - Implement support for the NDOB flag for both discards and zeroing. The "No Data Out Buffer" flag removes the need for a zeroed payload to be included with a WRITE SAME(16) command. - Remove the superfluous revalidate operation historically required by the integrity profile registration. This further reduces the commands we send during device discovery. - Add additional heuristics for enabling discards on modern devices. Specifically, if a device reports that it supports logical block provisioning, attempt to query the LBP VPD page. - Also query the device VPD pages if a device reports conformance to a recent version of the SCSI Block Commands specification.
Everything else here looks great. Ah, one thing. If you cache VPD pages (and the standard INQUIRY response), then if an INQUIRY DATA CHANGED Unit Attention occurs, all the cached data should be invalidated and the cached VPD pages re-fetched. The Last n Inquiry Data Changed log page [0xb,0x1] could help with that, but I haven't seen it implemented yet. Doug Gilbert
Thanks to several bug reporters and volunteers this series has been extensively tested with a much wider variety of USB/UAS devices than I have access to.