[PATCH 12/14] scsi: sd: sd_read_cpr() requires VPD pages

Martin K. Petersen
2022-03-02T05:36:44Z

As such it should be called inside the scsi_device_supports_vpd()
conditional.

Cc: Damien Le Moal <damien.lemoal@wdc.com>
Fixes: e815d36548f0 ("scsi: sd: add concurrent positioning ranges support")
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
---
drivers/scsi/sd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 2c2e86738578..9d6b2205339d 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3396,6 +3396,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
sd_read_block_limits(sdkp);
sd_read_block_characteristics(sdkp);
sd_zbc_read_zones(sdkp, buffer);
+ sd_read_cpr(sdkp);
}

sd_print_capacity(sdkp, old_capacity);
@@ -3405,7 +3406,6 @@ static int sd_revalidate_disk(struct gendisk *disk)
sd_read_app_tag_own(sdkp, buffer);
sd_read_write_same(sdkp, buffer);
sd_read_security(sdkp, buffer);
- sd_read_cpr(sdkp);
sd_config_write_same(sdkp);
sd_config_discard(sdkp, SD_LBP_DEFAULT);
sd_config_write_zeroes(sdkp, SD_ZERO_DEFAULT);
--
2.32.0