Skip to content

Commit 4db5e63

Browse files
committed
Merge tag 'pci-v4.9-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fixes from Bjorn Helgaas: "PCI fixes: - Fix Read Completion Boundary setting, which fixes a boot failure on IBM x3850 with Mellanox MT27500 ConnectX-3 - Update some MAINTAINERS entries and email addresses" * tag 'pci-v4.9-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: Set Read Completion Boundary to 128 iff Root Port supports it (_HPX) PCI: Export pcie_find_root_port PCI: designware-plat: Update author email PCI: designware: Change maintainer to Joao Pinto MAINTAINERS: Add devicetree binding to PCI i.MX6 entry MAINTAINERS: Update Richard Zhu's email address
2 parents 2caceb3 + e42010d commit 4db5e63

File tree

5 files changed

+46
-25
lines changed

5 files changed

+46
-25
lines changed

MAINTAINERS

+4-9
Original file line numberDiff line numberDiff line change
@@ -9257,11 +9257,12 @@ S: Maintained
92579257
F: drivers/pci/host/*layerscape*
92589258

92599259
PCI DRIVER FOR IMX6
9260-
M: Richard Zhu <Richard.Zhu@freescale.com>
9260+
M: Richard Zhu <hongxing.zhu@nxp.com>
92619261
M: Lucas Stach <[email protected]>
92629262
92639263
L: [email protected] (moderated for non-subscribers)
92649264
S: Maintained
9265+
F: Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt
92659266
F: drivers/pci/host/*imx6*
92669267

92679268
PCI DRIVER FOR TI KEYSTONE
@@ -9320,17 +9321,11 @@ F: drivers/pci/host/pci-exynos.c
93209321

93219322
PCI DRIVER FOR SYNOPSIS DESIGNWARE
93229323
M: Jingoo Han <[email protected]>
9323-
M: Pratyush Anand <[email protected]>
9324-
9325-
S: Maintained
9326-
F: drivers/pci/host/*designware*
9327-
9328-
PCI DRIVER FOR SYNOPSYS PROTOTYPING DEVICE
9329-
M: Jose Abreu <[email protected]>
9324+
M: Joao Pinto <[email protected]>
93309325
93319326
S: Maintained
93329327
F: Documentation/devicetree/bindings/pci/designware-pcie.txt
9333-
F: drivers/pci/host/pcie-designware-plat.c
9328+
F: drivers/pci/host/*designware*
93349329

93359330
PCI DRIVER FOR GENERIC OF HOSTS
93369331
M: Will Deacon <[email protected]>

drivers/pci/host/pcie-designware-plat.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (C) 2015-2016 Synopsys, Inc. (www.synopsys.com)
55
*
6-
* Authors: Joao Pinto <jpmpinto@gmail.com>
6+
* Authors: Joao Pinto <Joao.Pinto@synopsys.com>
77
*
88
* This program is free software; you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License version 2 as

drivers/pci/pcie/aer/aer_inject.c

-14
Original file line numberDiff line numberDiff line change
@@ -307,20 +307,6 @@ static int pci_bus_set_aer_ops(struct pci_bus *bus)
307307
return 0;
308308
}
309309

310-
static struct pci_dev *pcie_find_root_port(struct pci_dev *dev)
311-
{
312-
while (1) {
313-
if (!pci_is_pcie(dev))
314-
break;
315-
if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)
316-
return dev;
317-
if (!dev->bus->self)
318-
break;
319-
dev = dev->bus->self;
320-
}
321-
return NULL;
322-
}
323-
324310
static int find_aer_device_iter(struct device *device, void *data)
325311
{
326312
struct pcie_device **result = data;

drivers/pci/probe.c

+27-1
Original file line numberDiff line numberDiff line change
@@ -1439,6 +1439,21 @@ static void program_hpp_type1(struct pci_dev *dev, struct hpp_type1 *hpp)
14391439
dev_warn(&dev->dev, "PCI-X settings not supported\n");
14401440
}
14411441

1442+
static bool pcie_root_rcb_set(struct pci_dev *dev)
1443+
{
1444+
struct pci_dev *rp = pcie_find_root_port(dev);
1445+
u16 lnkctl;
1446+
1447+
if (!rp)
1448+
return false;
1449+
1450+
pcie_capability_read_word(rp, PCI_EXP_LNKCTL, &lnkctl);
1451+
if (lnkctl & PCI_EXP_LNKCTL_RCB)
1452+
return true;
1453+
1454+
return false;
1455+
}
1456+
14421457
static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
14431458
{
14441459
int pos;
@@ -1468,9 +1483,20 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
14681483
~hpp->pci_exp_devctl_and, hpp->pci_exp_devctl_or);
14691484

14701485
/* Initialize Link Control Register */
1471-
if (pcie_cap_has_lnkctl(dev))
1486+
if (pcie_cap_has_lnkctl(dev)) {
1487+
1488+
/*
1489+
* If the Root Port supports Read Completion Boundary of
1490+
* 128, set RCB to 128. Otherwise, clear it.
1491+
*/
1492+
hpp->pci_exp_lnkctl_and |= PCI_EXP_LNKCTL_RCB;
1493+
hpp->pci_exp_lnkctl_or &= ~PCI_EXP_LNKCTL_RCB;
1494+
if (pcie_root_rcb_set(dev))
1495+
hpp->pci_exp_lnkctl_or |= PCI_EXP_LNKCTL_RCB;
1496+
14721497
pcie_capability_clear_and_set_word(dev, PCI_EXP_LNKCTL,
14731498
~hpp->pci_exp_lnkctl_and, hpp->pci_exp_lnkctl_or);
1499+
}
14741500

14751501
/* Find Advanced Error Reporting Enhanced Capability */
14761502
pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);

include/linux/pci.h

+14
Original file line numberDiff line numberDiff line change
@@ -1928,6 +1928,20 @@ static inline int pci_pcie_type(const struct pci_dev *dev)
19281928
return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4;
19291929
}
19301930

1931+
static inline struct pci_dev *pcie_find_root_port(struct pci_dev *dev)
1932+
{
1933+
while (1) {
1934+
if (!pci_is_pcie(dev))
1935+
break;
1936+
if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)
1937+
return dev;
1938+
if (!dev->bus->self)
1939+
break;
1940+
dev = dev->bus->self;
1941+
}
1942+
return NULL;
1943+
}
1944+
19311945
void pci_request_acs(void);
19321946
bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags);
19331947
bool pci_acs_path_enabled(struct pci_dev *start,

0 commit comments

Comments
 (0)