Re: [PATCH] scsi: core: Add BLIST_NO_ASK_VPD_SIZE for some VDASD

From: Lee Duncan
Date: Sun Oct 02 2022 - 18:22:14 EST


On 10/2/22 14:16, Bart Van Assche wrote:
On 9/28/22 11:13, Lee Duncan wrote:
From: Lee Duncan <lduncan@xxxxxxxx>

Some storage, such as AIX VDASD (virtual storage) and IBM 2076
(front end) do not like the recent commit:

commit c92a6b5d6335 ("scsi: core: Query VPD size before getting full page")

That commit changed getting SCSI VPD pages so that we now read
just enough of the page to get the actual page size, then read
the whole page in a second read. The problem is that the above
mentioned hardware returns zero for the page size, because of
a firmware error. In such cases, until the firmware is fixed,
this new black flag says to revert to the original method of
reading the VPD pages, i.e. try to read as a whole buffer's
worth on the first try.

Fixes: c92a6b5d6335 ("scsi: core: Query VPD size before getting full page")

Hi Lee,

If we introduce a blacklist flag to skip querying the VPD page size then we will have to find all SCSI devices that do not handle querying the VPD page size correctly. Has it been considered instead of introducing a blacklist flag to not use the reported VPD page size if the device reports that the VPD page size is zero? I am not aware of any VPD pages for which zero is a valid size.

Thanks,

Bart.

Hi Bart:

The problem with the broken firmware in my case is that it reports a size of zero, but it actually has the data! So the "size" returned for this one VPD page is just wrong. And I haven't researched it yet, but I assume that this hardware returned the failing page in question as a page it supported. In other words, you can't count on this hardware to report correctly. [I will check and update this email thread if this is wrong.]

This broken firmware was never an issue before commit c92a6b5d6335, since we used to just try to read 255 bytes, expecting that we would get back 255 or less. This worked almost all the time -- except for buggy hardware!

I suspect there isn't many pieces of hardware that return zero length incorrectly, and that if such hardware shoes up then they'll be able to use this flag to work around it.

So, for my hardware use case, if I add my commit, the VPD page shows up in sysfs, and before my commit no VPD page showed up. [Also, reverting commit c92a6b5d6335 made the VPD page show up, as a side note.]

Lastly, as for pages that might validly return size zero, Hannes seems to think some of the older hardware (under the older standards) returned zero as a valid page size for some VPD pages. For this reason I decided to not use a simpler approach of just trying to read the VPD page with a size of 255 if the "read length" returned zero (as in this case), i.e. since Hannes thinks some hardware might legitimately do this.

--
Lee