]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
PCI: Support PCIe devices with short cfg_size
authorJason S. McMullan <jason.mcmullan@netronome.com>
Wed, 30 Sep 2015 06:35:05 +0000 (15:35 +0900)
committerKamal Mostafa <kamal@canonical.com>
Thu, 15 Sep 2016 16:33:46 +0000 (09:33 -0700)
commitb1758cbb501d13290f7f361d8b9d86b609d5c544
treebc00a4f29dd8f80bc533c16d52a7217d9961fbc9
parent30d6592fce71beabe18460252c3823747c4742f6
PCI: Support PCIe devices with short cfg_size

BugLink: http://bugs.launchpad.net/bugs/1621113
commit c20aecf6963d1273d8f6d61c042b4845441ca592 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: Jason S. McMullan <jason.mcmullan@netronome.com>
[simon: edited changelog]
Signed-off-by: Simon Horman <simon.horman@netronome.com>
[bhelgaas: more changelog edits]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
drivers/pci/pci-sysfs.c