diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-01 14:32:49 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-01 14:32:49 -0500 |
| commit | c734b42583bc391d86ed64e3be25fd5f2c464124 (patch) | |
| tree | dddf7be75faee072e545b216028b92f3581c87ff | |
| parent | d8f190ee836a4581ba906731835d735cb97948f5 (diff) | |
| parent | c74eadf881ad634c68880e2c1b504989d95993ee (diff) | |
Merge tag 'pci-v4.20-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fixes from Bjorn Helgaas:
- Fix a link speed checking interface that broke PCIe gen3 cards in
gen1 slots (Mikulas Patocka)
- Fix an imx6 link training error (Trent Piepho)
- Fix a layerscape outbound window accessor calling error (Hou
Zhiqiang)
- Fix a DesignWare endpoint MSI-X address calculation error (Gustavo
Pimentel)
* tag 'pci-v4.20-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
PCI: Fix incorrect value returned from pcie_get_speed_cap()
PCI: dwc: Fix MSI-X EP framework address calculation bug
PCI: layerscape: Fix wrong invocation of outbound window disable accessor
PCI: imx6: Fix link training status detection in link up check
| -rw-r--r-- | drivers/pci/controller/dwc/pci-imx6.c | 10 | ||||
| -rw-r--r-- | drivers/pci/controller/dwc/pci-layerscape.c | 2 | ||||
| -rw-r--r-- | drivers/pci/controller/dwc/pcie-designware-ep.c | 1 | ||||
| -rw-r--r-- | drivers/pci/pci.c | 24 |
4 files changed, 13 insertions, 24 deletions
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 2cbef2d7c207..88af6bff945f 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c | |||
| @@ -81,8 +81,6 @@ struct imx6_pcie { | |||
| 81 | #define PCIE_PL_PFLR_FORCE_LINK (1 << 15) | 81 | #define PCIE_PL_PFLR_FORCE_LINK (1 << 15) |
| 82 | #define PCIE_PHY_DEBUG_R0 (PL_OFFSET + 0x28) | 82 | #define PCIE_PHY_DEBUG_R0 (PL_OFFSET + 0x28) |
| 83 | #define PCIE_PHY_DEBUG_R1 (PL_OFFSET + 0x2c) | 83 | #define PCIE_PHY_DEBUG_R1 (PL_OFFSET + 0x2c) |
| 84 | #define PCIE_PHY_DEBUG_R1_XMLH_LINK_IN_TRAINING (1 << 29) | ||
| 85 | #define PCIE_PHY_DEBUG_R1_XMLH_LINK_UP (1 << 4) | ||
| 86 | 84 | ||
| 87 | #define PCIE_PHY_CTRL (PL_OFFSET + 0x114) | 85 | #define PCIE_PHY_CTRL (PL_OFFSET + 0x114) |
| 88 | #define PCIE_PHY_CTRL_DATA_LOC 0 | 86 | #define PCIE_PHY_CTRL_DATA_LOC 0 |
| @@ -711,12 +709,6 @@ static int imx6_pcie_host_init(struct pcie_port *pp) | |||
| 711 | return 0; | 709 | return 0; |
| 712 | } | 710 | } |
| 713 | 711 | ||
| 714 | static int imx6_pcie_link_up(struct dw_pcie *pci) | ||
| 715 | { | ||
| 716 | return dw_pcie_readl_dbi(pci, PCIE_PHY_DEBUG_R1) & | ||
| 717 | PCIE_PHY_DEBUG_R1_XMLH_LINK_UP; | ||
| 718 | } | ||
| 719 | |||
| 720 | static const struct dw_pcie_host_ops imx6_pcie_host_ops = { | 712 | static const struct dw_pcie_host_ops imx6_pcie_host_ops = { |
| 721 | .host_init = imx6_pcie_host_init, | 713 | .host_init = imx6_pcie_host_init, |
| 722 | }; | 714 | }; |
| @@ -749,7 +741,7 @@ static int imx6_add_pcie_port(struct imx6_pcie *imx6_pcie, | |||
| 749 | } | 741 | } |
| 750 | 742 | ||
| 751 | static const struct dw_pcie_ops dw_pcie_ops = { | 743 | static const struct dw_pcie_ops dw_pcie_ops = { |
| 752 | .link_up = imx6_pcie_link_up, | 744 | /* No special ops needed, but pcie-designware still expects this struct */ |
| 753 | }; | 745 | }; |
| 754 | 746 | ||
| 755 | #ifdef CONFIG_PM_SLEEP | 747 | #ifdef CONFIG_PM_SLEEP |
diff --git a/drivers/pci/controller/dwc/pci-layerscape.c b/drivers/pci/controller/dwc/pci-layerscape.c index 3724d3ef7008..7aa9a82b7ebd 100644 --- a/drivers/pci/controller/dwc/pci-layerscape.c +++ b/drivers/pci/controller/dwc/pci-layerscape.c | |||
| @@ -88,7 +88,7 @@ static void ls_pcie_disable_outbound_atus(struct ls_pcie *pcie) | |||
| 88 | int i; | 88 | int i; |
| 89 | 89 | ||
| 90 | for (i = 0; i < PCIE_IATU_NUM; i++) | 90 | for (i = 0; i < PCIE_IATU_NUM; i++) |
| 91 | dw_pcie_disable_atu(pcie->pci, DW_PCIE_REGION_OUTBOUND, i); | 91 | dw_pcie_disable_atu(pcie->pci, i, DW_PCIE_REGION_OUTBOUND); |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | static int ls1021_pcie_link_up(struct dw_pcie *pci) | 94 | static int ls1021_pcie_link_up(struct dw_pcie *pci) |
diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index 1e7b02221eac..de8635af4cde 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c | |||
| @@ -440,7 +440,6 @@ int dw_pcie_ep_raise_msix_irq(struct dw_pcie_ep *ep, u8 func_no, | |||
| 440 | tbl_offset = dw_pcie_readl_dbi(pci, reg); | 440 | tbl_offset = dw_pcie_readl_dbi(pci, reg); |
| 441 | bir = (tbl_offset & PCI_MSIX_TABLE_BIR); | 441 | bir = (tbl_offset & PCI_MSIX_TABLE_BIR); |
| 442 | tbl_offset &= PCI_MSIX_TABLE_OFFSET; | 442 | tbl_offset &= PCI_MSIX_TABLE_OFFSET; |
| 443 | tbl_offset >>= 3; | ||
| 444 | 443 | ||
| 445 | reg = PCI_BASE_ADDRESS_0 + (4 * bir); | 444 | reg = PCI_BASE_ADDRESS_0 + (4 * bir); |
| 446 | bar_addr_upper = 0; | 445 | bar_addr_upper = 0; |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index d068f11d08a7..c9d8e3c837de 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
| @@ -5556,9 +5556,13 @@ enum pci_bus_speed pcie_get_speed_cap(struct pci_dev *dev) | |||
| 5556 | u32 lnkcap2, lnkcap; | 5556 | u32 lnkcap2, lnkcap; |
| 5557 | 5557 | ||
| 5558 | /* | 5558 | /* |
| 5559 | * PCIe r4.0 sec 7.5.3.18 recommends using the Supported Link | 5559 | * Link Capabilities 2 was added in PCIe r3.0, sec 7.8.18. The |
| 5560 | * Speeds Vector in Link Capabilities 2 when supported, falling | 5560 | * implementation note there recommends using the Supported Link |
| 5561 | * back to Max Link Speed in Link Capabilities otherwise. | 5561 | * Speeds Vector in Link Capabilities 2 when supported. |
| 5562 | * | ||
| 5563 | * Without Link Capabilities 2, i.e., prior to PCIe r3.0, software | ||
| 5564 | * should use the Supported Link Speeds field in Link Capabilities, | ||
| 5565 | * where only 2.5 GT/s and 5.0 GT/s speeds were defined. | ||
| 5562 | */ | 5566 | */ |
| 5563 | pcie_capability_read_dword(dev, PCI_EXP_LNKCAP2, &lnkcap2); | 5567 | pcie_capability_read_dword(dev, PCI_EXP_LNKCAP2, &lnkcap2); |
| 5564 | if (lnkcap2) { /* PCIe r3.0-compliant */ | 5568 | if (lnkcap2) { /* PCIe r3.0-compliant */ |
| @@ -5574,16 +5578,10 @@ enum pci_bus_speed pcie_get_speed_cap(struct pci_dev *dev) | |||
| 5574 | } | 5578 | } |
| 5575 | 5579 | ||
| 5576 | pcie_capability_read_dword(dev, PCI_EXP_LNKCAP, &lnkcap); | 5580 | pcie_capability_read_dword(dev, PCI_EXP_LNKCAP, &lnkcap); |
| 5577 | if (lnkcap) { | 5581 | if ((lnkcap & PCI_EXP_LNKCAP_SLS) == PCI_EXP_LNKCAP_SLS_5_0GB) |
| 5578 | if (lnkcap & PCI_EXP_LNKCAP_SLS_16_0GB) | 5582 | return PCIE_SPEED_5_0GT; |
| 5579 | return PCIE_SPEED_16_0GT; | 5583 | else if ((lnkcap & PCI_EXP_LNKCAP_SLS) == PCI_EXP_LNKCAP_SLS_2_5GB) |
| 5580 | else if (lnkcap & PCI_EXP_LNKCAP_SLS_8_0GB) | 5584 | return PCIE_SPEED_2_5GT; |
| 5581 | return PCIE_SPEED_8_0GT; | ||
| 5582 | else if (lnkcap & PCI_EXP_LNKCAP_SLS_5_0GB) | ||
| 5583 | return PCIE_SPEED_5_0GT; | ||
| 5584 | else if (lnkcap & PCI_EXP_LNKCAP_SLS_2_5GB) | ||
| 5585 | return PCIE_SPEED_2_5GT; | ||
| 5586 | } | ||
| 5587 | 5585 | ||
| 5588 | return PCI_SPEED_UNKNOWN; | 5586 | return PCI_SPEED_UNKNOWN; |
| 5589 | } | 5587 | } |
