Skip to content

Commit 44e56f3

Browse files
committed
Merge tag 'pci-v5.0-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fixes from Bjorn Helgaas: - Revert armada8k GPIO reset change that broke Macchiatobin booting (Baruch Siach) - Use actual size config reads on ARM cns3xxx (Koen Vandeputte) - Fix ARM cns3xxx config write alignment issue (Koen Vandeputte) - Fix imx6 PHY device link error checking (Leonard Crestez) - Fix imx6 probe failure on chips without separate PCI power domain (Leonard Crestez) * tag 'pci-v5.0-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: Revert "PCI: armada8k: Add support for gpio controlled reset signal" ARM: cns3xxx: Use actual size reads for PCIe ARM: cns3xxx: Fix writing to wrong PCI config registers after alignment PCI: imx: Fix checking pd_pcie_phy device link addition PCI: imx: Fix probe failure without power domain
2 parents e74c98c + f14bcc0 commit 44e56f3

File tree

3 files changed

+9
-22
lines changed

3 files changed

+9
-22
lines changed

arch/arm/mach-cns3xxx/pcie.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static void __iomem *cns3xxx_pci_map_bus(struct pci_bus *bus,
8383
} else /* remote PCI bus */
8484
base = cnspci->cfg1_regs + ((busno & 0xf) << 20);
8585

86-
return base + (where & 0xffc) + (devfn << 12);
86+
return base + where + (devfn << 12);
8787
}
8888

8989
static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
@@ -93,7 +93,7 @@ static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
9393
u32 mask = (0x1ull << (size * 8)) - 1;
9494
int shift = (where % 4) * 8;
9595

96-
ret = pci_generic_config_read32(bus, devfn, where, size, val);
96+
ret = pci_generic_config_read(bus, devfn, where, size, val);
9797

9898
if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn &&
9999
(where & 0xffc) == PCI_CLASS_REVISION)

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ static int imx6_pcie_attach_pd(struct device *dev)
310310
imx6_pcie->pd_pcie = dev_pm_domain_attach_by_name(dev, "pcie");
311311
if (IS_ERR(imx6_pcie->pd_pcie))
312312
return PTR_ERR(imx6_pcie->pd_pcie);
313+
/* Do nothing when power domain missing */
314+
if (!imx6_pcie->pd_pcie)
315+
return 0;
313316
link = device_link_add(dev, imx6_pcie->pd_pcie,
314317
DL_FLAG_STATELESS |
315318
DL_FLAG_PM_RUNTIME |
@@ -323,13 +326,13 @@ static int imx6_pcie_attach_pd(struct device *dev)
323326
if (IS_ERR(imx6_pcie->pd_pcie_phy))
324327
return PTR_ERR(imx6_pcie->pd_pcie_phy);
325328

326-
device_link_add(dev, imx6_pcie->pd_pcie_phy,
329+
link = device_link_add(dev, imx6_pcie->pd_pcie_phy,
327330
DL_FLAG_STATELESS |
328331
DL_FLAG_PM_RUNTIME |
329332
DL_FLAG_RPM_ACTIVE);
330-
if (IS_ERR(link)) {
331-
dev_err(dev, "Failed to add device_link to pcie_phy pd: %ld\n", PTR_ERR(link));
332-
return PTR_ERR(link);
333+
if (!link) {
334+
dev_err(dev, "Failed to add device_link to pcie_phy pd.\n");
335+
return -EINVAL;
333336
}
334337

335338
return 0;

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@
2222
#include <linux/resource.h>
2323
#include <linux/of_pci.h>
2424
#include <linux/of_irq.h>
25-
#include <linux/gpio/consumer.h>
2625

2726
#include "pcie-designware.h"
2827

2928
struct armada8k_pcie {
3029
struct dw_pcie *pci;
3130
struct clk *clk;
3231
struct clk *clk_reg;
33-
struct gpio_desc *reset_gpio;
3432
};
3533

3634
#define PCIE_VENDOR_REGS_OFFSET 0x8000
@@ -139,12 +137,6 @@ static int armada8k_pcie_host_init(struct pcie_port *pp)
139137
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
140138
struct armada8k_pcie *pcie = to_armada8k_pcie(pci);
141139

142-
if (pcie->reset_gpio) {
143-
/* assert and then deassert the reset signal */
144-
gpiod_set_value_cansleep(pcie->reset_gpio, 1);
145-
msleep(100);
146-
gpiod_set_value_cansleep(pcie->reset_gpio, 0);
147-
}
148140
dw_pcie_setup_rc(pp);
149141
armada8k_pcie_establish_link(pcie);
150142

@@ -257,14 +249,6 @@ static int armada8k_pcie_probe(struct platform_device *pdev)
257249
goto fail_clkreg;
258250
}
259251

260-
/* Get reset gpio signal and hold asserted (logically high) */
261-
pcie->reset_gpio = devm_gpiod_get_optional(dev, "reset",
262-
GPIOD_OUT_HIGH);
263-
if (IS_ERR(pcie->reset_gpio)) {
264-
ret = PTR_ERR(pcie->reset_gpio);
265-
goto fail_clkreg;
266-
}
267-
268252
platform_set_drvdata(pdev, pcie);
269253

270254
ret = armada8k_add_pcie_port(pcie, pdev);

0 commit comments

Comments
 (0)