Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH v2] PCI/VPD: Silence warning if optional VPD PROM is missing
Date: Thu, 1 Apr 2021 13:57:54 -0500	[thread overview]
Message-ID: <20210401185754.GA1530831@bjorn-Precision-5520> (raw)
In-Reply-To: <ccbc11f1-4dbb-e2c8-d0ea-559e06d4c340@gmail.com>

On Thu, Apr 01, 2021 at 02:03:49PM +0200, Heiner Kallweit wrote:
> Realtek RTL8169/8168/8125 NIC families indicate VPD capability and an
> optional VPD EEPROM can be connected via I2C/SPI. However I haven't
> seen any card or system with such a VPD EEPROM yet. The missing EEPROM
> causes the following warning whenever e.g. lscpi -vv is executed.
> 
> invalid short VPD tag 00 at offset 01
> 
> The warning confuses users, I think we should handle the situation more
> gentle. Therefore, if first VPD byte is read as 0x00, assume a missing
> optional VPD PROM and replace the warning with a more descriptive
> message at info level.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Looks perfect, applied to pci/vpd for v5.13, thanks!

> ---
> v2: - don't remove user info completely, replace the warning with a more
>       message at info level
> ---
>  drivers/pci/vpd.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c
> index d1cbc5e64..48f4a9ae8 100644
> --- a/drivers/pci/vpd.c
> +++ b/drivers/pci/vpd.c
> @@ -74,6 +74,11 @@ static size_t pci_vpd_size(struct pci_dev *dev, size_t old_size)
>  	       pci_read_vpd(dev, off, 1, header) == 1) {
>  		unsigned char tag;
>  
> +		if (!header[0] && !off) {
> +			pci_info(dev, "Invalid VPD tag 00, assume missing optional VPD EPROM\n");
> +			return 0;
> +		}
> +
>  		if (header[0] & PCI_VPD_LRDT) {
>  			/* Large Resource Data Type Tag */
>  			tag = pci_vpd_lrdt_tag(header);
> -- 
> 2.31.1
> 

      reply	other threads:[~2021-04-01 19:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01 12:03 [PATCH v2] PCI/VPD: Silence warning if optional VPD PROM is missing Heiner Kallweit
2021-04-01 18:57 ` Bjorn Helgaas [this message]

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=20210401185754.GA1530831@bjorn-Precision-5520 \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-pci@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox