All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI/VPD: Treat tag 0xff as indicator for missing VPD EPROM
@ 2021-07-15  8:41 Heiner Kallweit
  2021-08-02 22:31 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Heiner Kallweit @ 2021-07-15  8:41 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci

First tag being read as 0xff indicates a missing VPD EPROM, same as 0x00.
The latter case we handle properly already, so let's handle 0x00 here too.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/pci/vpd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c
index 26bf7c877..6a32d938d 100644
--- a/drivers/pci/vpd.c
+++ b/drivers/pci/vpd.c
@@ -78,8 +78,8 @@ static size_t pci_vpd_size(struct pci_dev *dev, size_t old_size)
 	while (off < 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");
+		if ((!header[0] || header[0] == 0xff) && !off) {
+			pci_info(dev, "Invalid VPD tag 00/FF, assume missing optional VPD EPROM\n");
 			return 0;
 		}
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] PCI/VPD: Treat tag 0xff as indicator for missing VPD EPROM
  2021-07-15  8:41 [PATCH] PCI/VPD: Treat tag 0xff as indicator for missing VPD EPROM Heiner Kallweit
@ 2021-08-02 22:31 ` Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2021-08-02 22:31 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: Bjorn Helgaas, linux-pci

On Thu, Jul 15, 2021 at 10:41:08AM +0200, Heiner Kallweit wrote:
> First tag being read as 0xff indicates a missing VPD EPROM, same as 0x00.
> The latter case we handle properly already, so let's handle 0x00 here too.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Applied to pci/vpd for v5.15 with small tweak so the error message can
be shared with other errors, thanks!

> ---
>  drivers/pci/vpd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c
> index 26bf7c877..6a32d938d 100644
> --- a/drivers/pci/vpd.c
> +++ b/drivers/pci/vpd.c
> @@ -78,8 +78,8 @@ static size_t pci_vpd_size(struct pci_dev *dev, size_t old_size)
>  	while (off < 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");
> +		if ((!header[0] || header[0] == 0xff) && !off) {
> +			pci_info(dev, "Invalid VPD tag 00/FF, assume missing optional VPD EPROM\n");
>  			return 0;
>  		}
>  
> -- 
> 2.32.0
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-02 22:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15  8:41 [PATCH] PCI/VPD: Treat tag 0xff as indicator for missing VPD EPROM Heiner Kallweit
2021-08-02 22:31 ` Bjorn Helgaas

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.