OSDN Git Service

PCI: mvebu: Return zero for reserved or unimplemented config space
authorRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 23 Sep 2015 17:17:26 +0000 (18:17 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 8 Oct 2015 16:07:54 +0000 (11:07 -0500)
PCI requires reads to reserved or unimplemented configuration space to
return zero and complete normally (see PCI r3.0, sec 6.1).  However, the
root port software implementation was returning 0xfffffff and
PCIBIOS_BAD_REGISTER_NUMBER.

Return zero when reading reserved or unimplemented config space.

[bhelgaas: changelog]
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> (Armada XP GP)
Tested-by: Andrew Lunn <andrew@lunn.ch> (Kirkwood DIR665)
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
drivers/pci/host/pci-mvebu.c

index 67ec5e1..b6a096b 100644 (file)
@@ -515,8 +515,13 @@ static int mvebu_sw_pci_bridge_read(struct mvebu_pcie_port *port,
                break;
 
        default:
-               *value = 0xffffffff;
-               return PCIBIOS_BAD_REGISTER_NUMBER;
+               /*
+                * PCI defines configuration read accesses to reserved or
+                * unimplemented registers to read as zero and complete
+                * normally.
+                */
+               *value = 0;
+               return PCIBIOS_SUCCESSFUL;
        }
 
        if (size == 2)