[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3cb24d6e-d52c-827f-7905-8e17411b23e1@opensource.wdc.com>
Date: Thu, 6 Jan 2022 14:21:24 +0900
From: Damien Le Moal <damien.lemoal@...nsource.wdc.com>
To: "Martin K. Petersen" <martin.petersen@...cle.com>,
"Maciej W. Rozycki" <macro@...am.me.uk>
Cc: Douglas Gilbert <dgilbert@...erlog.com>,
Khalid Aziz <khalid@...ehiking.org>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
Christoph Hellwig <hch@....de>, Nix <nix@...eri.org.uk>,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 3/3] scsi: Set allocation length to 255 for ATA
Information VPD page
On 1/6/22 13:13, Martin K. Petersen wrote:
>
> Maciej,
>
>> Oh, you'll also need a follow-on patch that uses the cached ATA
>> Information VPD page. I'll try to get my full series out today.
>
> I would really appreciate it if you would be willing give this a whirl:
>
> https://git.kernel.org/mkp/h/5.18/discovery
Martin,
Indeed, my bad.
That said, it is weird that scsi_get_vpd_page() does not call
scsi_device_supports_vpd(). We could simplify everything like this:
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index f6af1562cba4..c27eabedf9e3 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -341,7 +341,7 @@ int scsi_get_vpd_page(struct scsi_device *sdev, u8
page, unsigned char *buf,
{
int i, result;
- if (sdev->skip_vpd_pages)
+ if (!scsi_device_supports_vpd(sdev))
goto fail;
/* Ask for all the pages supported by this device */
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 65875a598d62..2ef7953512ed 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3316,12 +3316,10 @@ static int sd_revalidate_disk(struct gendisk *disk)
blk_queue_flag_clear(QUEUE_FLAG_NONROT, q);
blk_queue_flag_set(QUEUE_FLAG_ADD_RANDOM, q);
- if (scsi_device_supports_vpd(sdp)) {
- sd_read_block_provisioning(sdkp);
- sd_read_block_limits(sdkp);
- sd_read_block_characteristics(sdkp);
- sd_zbc_read_zones(sdkp, buffer);
- }
+ sd_read_block_provisioning(sdkp);
+ sd_read_block_limits(sdkp);
+ sd_read_block_characteristics(sdkp);
+ sd_zbc_read_zones(sdkp, buffer);
sd_print_capacity(sdkp, old_capacity);
Since all the sd_read_xxx() functions do nothing if the vpd page needed
is not supported.
--
Damien Le Moal
Western Digital Research
Powered by blists - more mailing lists