PCI: Support PCIe devices with short cfg_size
Jason S. McMullan authored
commit c20aecf6

 upstream.

If a device quirk modifies the pci_dev->cfg_size to be less than
PCI_CFG_SPACE_EXP_SIZE (4096), but greater than PCI_CFG_SPACE_SIZE (256),
the PCI sysfs interface truncates the readable size to PCI_CFG_SPACE_SIZE.

Allow sysfs access to config space up to cfg_size, even if the device
doesn't support the entire 4096-byte PCIe config space.

Note that pci_read_config() and pci_write_config() limit access to
dev->cfg_size even though pcie_config_attr contains 4096 (the maximum
size).
Signed-off-by: default avatarJason S. McMullan <jason.mcmullan@netronome.com>
[simon: edited changelog]
Signed-off-by: default avatarSimon Horman <simon.horman@netronome.com>
[bhelgaas: more changelog edits]
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
c7308f63
Name Last commit Last update