Skip to content

Commit 316a2c9

Browse files
committed
Merge tag 'pci-v5.14-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull pci updates from Bjorn Helgaas: "Enumeration: - Fix dsm_label_utf16s_to_utf8s() buffer overrun (Krzysztof Wilczyński) - Rely on lengths from scnprintf(), dsm_label_utf16s_to_utf8s() (Krzysztof Wilczyński) - Use sysfs_emit() and sysfs_emit_at() in "show" functions (Krzysztof Wilczyński) - Fix 'resource_alignment' newline issues (Krzysztof Wilczyński) - Add 'devspec' newline (Krzysztof Wilczyński) - Dynamically map ECAM regions (Russell King) Resource management: - Coalesce host bridge contiguous apertures (Kai-Heng Feng) PCIe native device hotplug: - Ignore Link Down/Up caused by DPC (Lukas Wunner) Power management: - Leave Apple Thunderbolt controllers on for s2idle or standby (Konstantin Kharlamov) Virtualization: - Work around Huawei Intelligent NIC VF FLR erratum (Chiqijun) - Clarify error message for unbound IOV devices (Moritz Fischer) - Add pci_reset_bus_function() Secondary Bus Reset interface (Raphael Norwitz) Peer-to-peer DMA: - Simplify distance calculation (Christoph Hellwig) - Finish RCU conversion of pdev->p2pdma (Eric Dumazet) - Rename upstream_bridge_distance() and rework doc (Logan Gunthorpe) - Collect acs list in stack buffer to avoid sleeping (Logan Gunthorpe) - Use correct calc_map_type_and_dist() return type (Logan Gunthorpe) - Warn if host bridge not in whitelist (Logan Gunthorpe) - Refactor pci_p2pdma_map_type() (Logan Gunthorpe) - Avoid pci_get_slot(), which may sleep (Logan Gunthorpe) Altera PCIe controller driver: - Add Joyce Ooi as Altera PCIe maintainer (Joyce Ooi) Broadcom iProc PCIe controller driver: - Fix multi-MSI base vector number allocation (Sandor Bodo-Merle) - Support multi-MSI only on uniprocessor kernel (Sandor Bodo-Merle) Freescale i.MX6 PCIe controller driver: - Limit DBI register length for imx6qp PCIe (Richard Zhu) - Add "vph-supply" for PHY supply voltage (Richard Zhu) - Enable PHY internal regulator when supplied >3V (Richard Zhu) - Remove imx6_pcie_probe() redundant error message (Zhen Lei) Intel Gateway PCIe controller driver: - Fix INTx enable (Martin Blumenstingl) Marvell Aardvark PCIe controller driver: - Fix checking for PIO Non-posted Request (Pali Rohár) - Implement workaround for the readback value of VEND_ID (Pali Rohár) MediaTek PCIe controller driver: - Remove redundant error printing in mtk_pcie_subsys_powerup() (Zhen Lei) MediaTek PCIe Gen3 controller driver: - Add missing MODULE_DEVICE_TABLE (Zou Wei) Microchip PolarFlare PCIe controller driver: - Make struct event_descs static (Krzysztof Wilczyński) Microsoft Hyper-V host bridge driver: - Fix race condition when removing the device (Long Li) - Remove bus device removal unused refcount/functions (Long Li) Mobiveil PCIe controller driver: - Remove unused readl and writel functions (Krzysztof Wilczyński) NVIDIA Tegra PCIe controller driver: - Add missing MODULE_DEVICE_TABLE (Zou Wei) NVIDIA Tegra194 PCIe controller driver: - Fix tegra_pcie_ep_raise_msi_irq() ill-defined shift (Jon Hunter) - Fix host initialization during resume (Vidya Sagar) Rockchip PCIe controller driver: - Register IRQ handlers after device and data are ready (Javier Martinez Canillas)" * tag 'pci-v5.14-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (48 commits) PCI/P2PDMA: Finish RCU conversion of pdev->p2pdma PCI: xgene: Annotate __iomem pointer PCI: Fix kernel-doc formatting PCI: cpcihp: Declare cpci_debug in header file MAINTAINERS: Add Joyce Ooi as Altera PCIe maintainer PCI: rockchip: Register IRQ handlers after device and data are ready PCI: tegra194: Fix tegra_pcie_ep_raise_msi_irq() ill-defined shift PCI: aardvark: Implement workaround for the readback value of VEND_ID PCI: aardvark: Fix checking for PIO Non-posted Request PCI: tegra194: Fix host initialization during resume PCI: tegra: Add missing MODULE_DEVICE_TABLE PCI: imx6: Enable PHY internal regulator when supplied >3V dt-bindings: imx6q-pcie: Add "vph-supply" for PHY supply voltage PCI: imx6: Limit DBI register length for imx6qp PCIe PCI: imx6: Remove imx6_pcie_probe() redundant error message PCI: intel-gw: Fix INTx enable PCI: iproc: Support multi-MSI only on uniprocessor kernel PCI: iproc: Fix multi-MSI base vector number allocation PCI: mediatek-gen3: Add missing MODULE_DEVICE_TABLE PCI: Dynamically map ECAM regions ...
2 parents f3791f4 + d58b206 commit 316a2c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+722
-429
lines changed

Documentation/PCI/pci-error-recovery.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ and let the driver restart normal I/O processing.
295295
A driver can still return a critical failure for this function if
296296
it can't get the device operational after reset. If the platform
297297
previously tried a soft reset, it might now try a hard reset (power
298-
cycle) and then call slot_reset() again. It the device still can't
298+
cycle) and then call slot_reset() again. If the device still can't
299299
be recovered, there is nothing more that can be done; the platform
300300
will typically report a "permanent failure" in such a case. The
301301
device will be considered "dead" in this case.

Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ Optional properties:
3838
The regulator will be enabled when initializing the PCIe host and
3939
disabled either as part of the init process or when shutting down the
4040
host.
41+
- vph-supply: Should specify the regulator in charge of VPH one of the three
42+
PCIe PHY powers. This regulator can be supplied by both 1.8v and 3.3v voltage
43+
supplies.
4144

4245
Additional required properties for imx6sx-pcie:
4346
- clock names: Must include the following additional entries:

MAINTAINERS

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14106,8 +14106,7 @@ F: Documentation/devicetree/bindings/pci/aardvark-pci.txt
1410614106
F: drivers/pci/controller/pci-aardvark.c
1410714107

1410814108
PCI DRIVER FOR ALTERA PCIE IP
14109-
M: Ley Foon Tan <[email protected]>
14110-
L: [email protected] (moderated for non-subscribers)
14109+
M: Joyce Ooi <[email protected]>
1411114110
1411214111
S: Supported
1411314112
F: Documentation/devicetree/bindings/pci/altera-pcie.txt
@@ -14305,8 +14304,7 @@ S: Supported
1430514304
F: Documentation/PCI/pci-error-recovery.rst
1430614305

1430714306
PCI MSI DRIVER FOR ALTERA MSI IP
14308-
M: Ley Foon Tan <[email protected]>
14309-
L: [email protected] (moderated for non-subscribers)
14307+
M: Joyce Ooi <[email protected]>
1431014308
1431114309
S: Supported
1431214310
F: Documentation/devicetree/bindings/pci/altera-pcie-msi.txt

arch/x86/pci/mmconfig-shared.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ static bool __ref is_mmconf_reserved(check_reserved_t is_reserved,
461461
}
462462

463463
if (size < (16UL<<20) && size != old_size)
464-
return 0;
464+
return false;
465465

466466
if (dev)
467467
dev_info(dev, "MMCONFIG at %pR reserved in %s\n",
@@ -493,15 +493,15 @@ static bool __ref is_mmconf_reserved(check_reserved_t is_reserved,
493493
&cfg->res, (unsigned long) cfg->address);
494494
}
495495

496-
return 1;
496+
return true;
497497
}
498498

499499
static bool __ref
500500
pci_mmcfg_check_reserved(struct device *dev, struct pci_mmcfg_region *cfg, int early)
501501
{
502502
if (!early && !acpi_disabled) {
503503
if (is_mmconf_reserved(is_acpi_reserved, cfg, dev, 0))
504-
return 1;
504+
return true;
505505

506506
if (dev)
507507
dev_info(dev, FW_INFO
@@ -522,14 +522,14 @@ pci_mmcfg_check_reserved(struct device *dev, struct pci_mmcfg_region *cfg, int e
522522
* _CBA method, just assume it's reserved.
523523
*/
524524
if (pci_mmcfg_running_state)
525-
return 1;
525+
return true;
526526

527527
/* Don't try to do this check unless configuration
528528
type 1 is available. how about type 2 ?*/
529529
if (raw_pci_ops)
530530
return is_mmconf_reserved(e820__mapped_all, cfg, dev, 1);
531531

532-
return 0;
532+
return false;
533533
}
534534

535535
static void __init pci_mmcfg_reject_broken(int early)

drivers/pci/controller/cadence/pcie-cadence.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,12 @@ struct cdns_pcie_ops {
263263
* struct cdns_pcie - private data for Cadence PCIe controller drivers
264264
* @reg_base: IO mapped register base
265265
* @mem_res: start/end offsets in the physical system memory to map PCI accesses
266+
* @dev: PCIe controller
266267
* @is_rc: tell whether the PCIe controller mode is Root Complex or Endpoint.
267-
* @bus: In Root Complex mode, the bus number
268-
* @ops: Platform specific ops to control various inputs from Cadence PCIe
268+
* @phy_count: number of supported PHY devices
269+
* @phy: list of pointers to specific PHY control blocks
270+
* @link: list of pointers to corresponding device link representations
271+
* @ops: Platform-specific ops to control various inputs from Cadence PCIe
269272
* wrapper
270273
*/
271274
struct cdns_pcie {

drivers/pci/controller/dwc/pci-imx6.c

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#define IMX8MQ_GPR_PCIE_REF_USE_PAD BIT(9)
3838
#define IMX8MQ_GPR_PCIE_CLK_REQ_OVERRIDE_EN BIT(10)
3939
#define IMX8MQ_GPR_PCIE_CLK_REQ_OVERRIDE BIT(11)
40+
#define IMX8MQ_GPR_PCIE_VREG_BYPASS BIT(12)
4041
#define IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE GENMASK(11, 8)
4142
#define IMX8MQ_PCIE2_BASE_ADDR 0x33c00000
4243

@@ -80,6 +81,7 @@ struct imx6_pcie {
8081
u32 tx_swing_full;
8182
u32 tx_swing_low;
8283
struct regulator *vpcie;
84+
struct regulator *vph;
8385
void __iomem *phy_base;
8486

8587
/* power domain for pcie */
@@ -621,6 +623,17 @@ static void imx6_pcie_init_phy(struct imx6_pcie *imx6_pcie)
621623
imx6_pcie_grp_offset(imx6_pcie),
622624
IMX8MQ_GPR_PCIE_REF_USE_PAD,
623625
IMX8MQ_GPR_PCIE_REF_USE_PAD);
626+
/*
627+
* Regarding the datasheet, the PCIE_VPH is suggested
628+
* to be 1.8V. If the PCIE_VPH is supplied by 3.3V, the
629+
* VREG_BYPASS should be cleared to zero.
630+
*/
631+
if (imx6_pcie->vph &&
632+
regulator_get_voltage(imx6_pcie->vph) > 3000000)
633+
regmap_update_bits(imx6_pcie->iomuxc_gpr,
634+
imx6_pcie_grp_offset(imx6_pcie),
635+
IMX8MQ_GPR_PCIE_VREG_BYPASS,
636+
0);
624637
break;
625638
case IMX7D:
626639
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
@@ -1002,10 +1015,8 @@ static int imx6_pcie_probe(struct platform_device *pdev)
10021015
return ret;
10031016
}
10041017
imx6_pcie->phy_base = devm_ioremap_resource(dev, &res);
1005-
if (IS_ERR(imx6_pcie->phy_base)) {
1006-
dev_err(dev, "Unable to map PCIe PHY\n");
1018+
if (IS_ERR(imx6_pcie->phy_base))
10071019
return PTR_ERR(imx6_pcie->phy_base);
1008-
}
10091020
}
10101021

10111022
dbi_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1130,6 +1141,13 @@ static int imx6_pcie_probe(struct platform_device *pdev)
11301141
imx6_pcie->vpcie = NULL;
11311142
}
11321143

1144+
imx6_pcie->vph = devm_regulator_get_optional(&pdev->dev, "vph");
1145+
if (IS_ERR(imx6_pcie->vph)) {
1146+
if (PTR_ERR(imx6_pcie->vph) != -ENODEV)
1147+
return PTR_ERR(imx6_pcie->vph);
1148+
imx6_pcie->vph = NULL;
1149+
}
1150+
11331151
platform_set_drvdata(pdev, imx6_pcie);
11341152

11351153
ret = imx6_pcie_attach_pd(dev);
@@ -1175,6 +1193,7 @@ static const struct imx6_pcie_drvdata drvdata[] = {
11751193
.variant = IMX6QP,
11761194
.flags = IMX6_PCIE_FLAG_IMX6_PHY |
11771195
IMX6_PCIE_FLAG_IMX6_SPEED_CHANGE,
1196+
.dbi_length = 0x200,
11781197
},
11791198
[IMX7D] = {
11801199
.variant = IMX7D,

drivers/pci/controller/dwc/pcie-intel-gw.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
#define PCIE_APP_IRN_PM_TO_ACK BIT(9)
4040
#define PCIE_APP_IRN_LINK_AUTO_BW_STAT BIT(11)
4141
#define PCIE_APP_IRN_BW_MGT BIT(12)
42+
#define PCIE_APP_IRN_INTA BIT(13)
43+
#define PCIE_APP_IRN_INTB BIT(14)
44+
#define PCIE_APP_IRN_INTC BIT(15)
45+
#define PCIE_APP_IRN_INTD BIT(16)
4246
#define PCIE_APP_IRN_MSG_LTR BIT(18)
4347
#define PCIE_APP_IRN_SYS_ERR_RC BIT(29)
4448
#define PCIE_APP_INTX_OFST 12
@@ -48,10 +52,8 @@
4852
PCIE_APP_IRN_RX_VDM_MSG | PCIE_APP_IRN_SYS_ERR_RC | \
4953
PCIE_APP_IRN_PM_TO_ACK | PCIE_APP_IRN_MSG_LTR | \
5054
PCIE_APP_IRN_BW_MGT | PCIE_APP_IRN_LINK_AUTO_BW_STAT | \
51-
(PCIE_APP_INTX_OFST + PCI_INTERRUPT_INTA) | \
52-
(PCIE_APP_INTX_OFST + PCI_INTERRUPT_INTB) | \
53-
(PCIE_APP_INTX_OFST + PCI_INTERRUPT_INTC) | \
54-
(PCIE_APP_INTX_OFST + PCI_INTERRUPT_INTD))
55+
PCIE_APP_IRN_INTA | PCIE_APP_IRN_INTB | \
56+
PCIE_APP_IRN_INTC | PCIE_APP_IRN_INTD)
5557

5658
#define BUS_IATU_OFFSET SZ_256M
5759
#define RESET_INTERVAL_MS 100

drivers/pci/controller/dwc/pcie-tegra194.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1826,7 +1826,7 @@ static int tegra_pcie_ep_raise_msi_irq(struct tegra_pcie_dw *pcie, u16 irq)
18261826
if (unlikely(irq > 31))
18271827
return -EINVAL;
18281828

1829-
appl_writel(pcie, (1 << irq), APPL_MSI_CTRL_1);
1829+
appl_writel(pcie, BIT(irq), APPL_MSI_CTRL_1);
18301830

18311831
return 0;
18321832
}
@@ -2214,6 +2214,8 @@ static int tegra_pcie_dw_resume_noirq(struct device *dev)
22142214
goto fail_host_init;
22152215
}
22162216

2217+
dw_pcie_setup_rc(&pcie->pci.pp);
2218+
22172219
ret = tegra_pcie_dw_start_link(&pcie->pci);
22182220
if (ret < 0)
22192221
goto fail_host_init;

drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,6 @@ struct ls_pcie_g4 {
4242
int irq;
4343
};
4444

45-
static inline u32 ls_pcie_g4_lut_readl(struct ls_pcie_g4 *pcie, u32 off)
46-
{
47-
return ioread32(pcie->pci.csr_axi_slave_base + PCIE_LUT_OFF + off);
48-
}
49-
50-
static inline void ls_pcie_g4_lut_writel(struct ls_pcie_g4 *pcie,
51-
u32 off, u32 val)
52-
{
53-
iowrite32(val, pcie->pci.csr_axi_slave_base + PCIE_LUT_OFF + off);
54-
}
55-
5645
static inline u32 ls_pcie_g4_pf_readl(struct ls_pcie_g4 *pcie, u32 off)
5746
{
5847
return ioread32(pcie->pci.csr_axi_slave_base + PCIE_PF_OFF + off);

drivers/pci/controller/pci-aardvark.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
#define PIO_COMPLETION_STATUS_UR 1
5858
#define PIO_COMPLETION_STATUS_CRS 2
5959
#define PIO_COMPLETION_STATUS_CA 4
60-
#define PIO_NON_POSTED_REQ BIT(0)
60+
#define PIO_NON_POSTED_REQ BIT(10)
6161
#define PIO_ADDR_LS (PIO_BASE_ADDR + 0x8)
6262
#define PIO_ADDR_MS (PIO_BASE_ADDR + 0xc)
6363
#define PIO_WR_DATA (PIO_BASE_ADDR + 0x10)
@@ -125,6 +125,7 @@
125125
#define LTSSM_MASK 0x3f
126126
#define LTSSM_L0 0x10
127127
#define RC_BAR_CONFIG 0x300
128+
#define VENDOR_ID_REG (LMI_BASE_ADDR + 0x44)
128129

129130
/* PCIe core controller registers */
130131
#define CTRL_CORE_BASE_ADDR 0x18000
@@ -385,6 +386,16 @@ static void advk_pcie_setup_hw(struct advk_pcie *pcie)
385386
reg |= (IS_RC_MSK << IS_RC_SHIFT);
386387
advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG);
387388

389+
/*
390+
* Replace incorrect PCI vendor id value 0x1b4b by correct value 0x11ab.
391+
* VENDOR_ID_REG contains vendor id in low 16 bits and subsystem vendor
392+
* id in high 16 bits. Updating this register changes readback value of
393+
* read-only vendor id bits in PCIE_CORE_DEV_ID_REG register. Workaround
394+
* for erratum 4.1: "The value of device and vendor ID is incorrect".
395+
*/
396+
reg = (PCI_VENDOR_ID_MARVELL << 16) | PCI_VENDOR_ID_MARVELL;
397+
advk_writel(pcie, reg, VENDOR_ID_REG);
398+
388399
/* Set Advanced Error Capabilities and Control PF0 register */
389400
reg = PCIE_CORE_ERR_CAPCTL_ECRC_CHK_TX |
390401
PCIE_CORE_ERR_CAPCTL_ECRC_CHK_TX_EN |

0 commit comments

Comments
 (0)