From: Heiner Kallweit <hkallweit1@gmail.com>
To: "Krzysztof Wilczyński" <kw@linux.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH] PCI/VPD: Add simple sanity check to pci_vpd_size()
Date: Fri, 17 Sep 2021 21:07:00 +0200 [thread overview]
Message-ID: <371af84d-a709-074e-5424-1870eb1c460c@gmail.com> (raw)
In-Reply-To: <20210917135342.GB1518947@rocinante>
On 17.09.2021 15:53, Krzysztof Wilczyński wrote:
> Hi Heiner,
>
> [...]
>> Instead let's add a simple sanity check on the number of found tags.
>> A VPD image conforming to the PCI spec can have max. 4 tags:
>> id string, ro section, rw section, end tag.
>
> It's always nice to check if something is compliant with the specification.
>
> Would you be able to either cite this part of the official specification or
> mention where to find it? Like we do in other such changes related to some
> official standards, mainly for posterity to benefit others that might look
> at this commit in the future.
>
Right, I should have mentioned that:
PCI 3.0 I.3.1. VPD Large and Small Resource Data Tags
> [...]
>> + /* We can have max 4 tags: STRING_ID, RO, RW, END */
>> + if (++num_tags > 4)
>> + goto error;
>
> Do we want to let someone know that their device (or a device they might
> have in the system) has non-compliant and/or malformed VPD which is why we
> decided to return an error? I wonder if this would help with
> troubleshooting or just simply had some informative value. So perhaps
> a warning or debug level message? What do you think?
>
A message is printed, see code after error label. We differentiate
between "hard" and "soft" error. Soft error here means that the VPD EEPROM
is optional, in such a case it's not an actual error that the VPD reads
return non-VPD data.
> Reviewed-by: Krzysztof Wilczyński <kw@linux.com>
>
> Krzysztof
>
next prev parent reply other threads:[~2021-09-17 19:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-17 12:07 [PATCH] PCI/VPD: Add simple sanity check to pci_vpd_size() Heiner Kallweit
2021-09-17 13:53 ` Krzysztof Wilczyński
2021-09-17 19:07 ` Heiner Kallweit [this message]
2021-09-27 22:29 ` Krzysztof Wilczyński
2021-10-13 18:30 ` Heiner Kallweit
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=371af84d-a709-074e-5424-1870eb1c460c@gmail.com \
--to=hkallweit1@gmail.com \
--cc=bhelgaas@google.com \
--cc=kw@linux.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;
as well as URLs for NNTP newsgroup(s).