diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2022-10-05 17:32:52 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2022-10-05 17:32:52 -0500 |
commit | f9538e27a2d9a386b1b488075e687867c599cd51 (patch) | |
tree | 625167f51e13687e738f356ea0eea4f4d9cd99f2 /drivers/pci/pcie | |
parent | c1c2d8921f10f8b81c57ed3838f150bb711c83c0 (diff) | |
parent | 5459c0b7046752e519a646e1c2404852bb628459 (diff) | |
download | linux-f9538e27a2d9a386b1b488075e687867c599cd51.tar.gz |
Merge branch 'pci/dpc'
- Work around a BIOS defect that makes some Intel Root Ports report an RP
PIO log size of zero (Mika Westerberg)
* pci/dpc:
PCI/DPC: Quirk PIO log size for certain Intel Root Ports
Diffstat (limited to 'drivers/pci/pcie')
-rw-r--r-- | drivers/pci/pcie/dpc.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c index 3e9afee02e8d..f5ffea17c7f8 100644 --- a/drivers/pci/pcie/dpc.c +++ b/drivers/pci/pcie/dpc.c @@ -335,11 +335,16 @@ void pci_dpc_init(struct pci_dev *pdev) return; pdev->dpc_rp_extensions = true; - pdev->dpc_rp_log_size = (cap & PCI_EXP_DPC_RP_PIO_LOG_SIZE) >> 8; - if (pdev->dpc_rp_log_size < 4 || pdev->dpc_rp_log_size > 9) { - pci_err(pdev, "RP PIO log size %u is invalid\n", - pdev->dpc_rp_log_size); - pdev->dpc_rp_log_size = 0; + + /* Quirks may set dpc_rp_log_size if device or firmware is buggy */ + if (!pdev->dpc_rp_log_size) { + pdev->dpc_rp_log_size = + (cap & PCI_EXP_DPC_RP_PIO_LOG_SIZE) >> 8; + if (pdev->dpc_rp_log_size < 4 || pdev->dpc_rp_log_size > 9) { + pci_err(pdev, "RP PIO log size %u is invalid\n", + pdev->dpc_rp_log_size); + pdev->dpc_rp_log_size = 0; + } } } |