All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>,
	"Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: Douglas Gilbert <dgilbert@interlog.com>,
	Khalid Aziz <khalid@gonehiking.org>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Christoph Hellwig <hch@lst.de>, Nix <nix@esperi.org.uk>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] scsi: Set allocation length to 255 for ATA Information VPD page
Date: Thu, 6 Jan 2022 14:21:24 +0900	[thread overview]
Message-ID: <3cb24d6e-d52c-827f-7905-8e17411b23e1@opensource.wdc.com> (raw)
In-Reply-To: <yq1lezty169.fsf@ca-mkp.ca.oracle.com>

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

  reply	other threads:[~2022-01-06  5:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-02 23:23 [PATCH v3 0/3] Bring the BusLogic host bus adapter driver up to Y2021 Maciej W. Rozycki
2022-01-02 23:23 ` [PATCH v3 1/3] scsi: Provide for avoiding trailing allocation length with VPD inquiries Maciej W. Rozycki
2022-01-03  8:23   ` Christoph Hellwig
2022-01-04 16:39     ` Khalid Aziz and Shuah Khan
2022-01-04 17:20     ` Maciej W. Rozycki
2022-01-02 23:23 ` [PATCH v3 2/3] scsi: Avoid using reserved length byte " Maciej W. Rozycki
2022-01-02 23:23 ` [PATCH v3 3/3] scsi: Set allocation length to 255 for ATA Information VPD page Maciej W. Rozycki
2022-01-03  4:09   ` Douglas Gilbert
2022-01-03 21:06     ` Maciej W. Rozycki
2022-01-03 21:28       ` Martin K. Petersen
2022-01-04 13:52         ` Maciej W. Rozycki
2022-01-04 17:57           ` Martin K. Petersen
2022-01-06  4:13             ` Martin K. Petersen
2022-01-06  5:21               ` Damien Le Moal [this message]
2022-01-07 14:07                 ` Martin K. Petersen
2022-01-07 10:36               ` Maciej W. Rozycki
2022-01-07 14:03                 ` Martin K. Petersen
2022-01-10 12:00                   ` Maciej W. Rozycki
2022-01-10 15:48                     ` Martin K. Petersen
2022-01-03 21:37     ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3cb24d6e-d52c-827f-7905-8e17411b23e1@opensource.wdc.com \
    --to=damien.lemoal@opensource.wdc.com \
    --cc=dgilbert@interlog.com \
    --cc=hch@lst.de \
    --cc=jejb@linux.ibm.com \
    --cc=khalid@gonehiking.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=macro@orcam.me.uk \
    --cc=martin.petersen@oracle.com \
    --cc=nix@esperi.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.