Skip to content

Commit 4e965ed

Browse files
gustavoSNPSLorenzo Pieralisi
authored andcommitted
PCI: dwc: Fix EP link notification implementation
Move specific features settings from EP shared code (pcie-designware-ep.c) to the driver (pcie-designware-plat.c). Previous implementation disables the EP link notification by default for all SoCs that uses EP DesignWare IP, which affects directly the dra7xx and artpec6 SoCs. Signed-off-by: Gustavo Pimentel <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Acked-by: Kishon Vijay Abraham I <[email protected]>
1 parent 53dd0c5 commit 4e965ed

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

drivers/pci/controller/dwc/pcie-designware-ep.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -386,15 +386,18 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep)
386386
return -ENOMEM;
387387
ep->outbound_addr = addr;
388388

389-
if (ep->ops->ep_init)
390-
ep->ops->ep_init(ep);
391-
392389
epc = devm_pci_epc_create(dev, &epc_ops);
393390
if (IS_ERR(epc)) {
394391
dev_err(dev, "Failed to create epc device\n");
395392
return PTR_ERR(epc);
396393
}
397394

395+
ep->epc = epc;
396+
epc_set_drvdata(epc, ep);
397+
398+
if (ep->ops->ep_init)
399+
ep->ops->ep_init(ep);
400+
398401
ret = of_property_read_u8(np, "max-functions", &epc->max_functions);
399402
if (ret < 0)
400403
epc->max_functions = 1;
@@ -413,11 +416,6 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep)
413416
return -ENOMEM;
414417
}
415418

416-
epc->features = EPC_FEATURE_NO_LINKUP_NOTIFIER;
417-
EPC_FEATURE_SET_BAR(epc->features, BAR_0);
418-
419-
ep->epc = epc;
420-
epc_set_drvdata(epc, ep);
421419
dw_pcie_setup(pci);
422420

423421
return 0;

drivers/pci/controller/dwc/pcie-designware-plat.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,13 @@ static const struct dw_pcie_ops dw_pcie_ops = {
7070
static void dw_plat_pcie_ep_init(struct dw_pcie_ep *ep)
7171
{
7272
struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
73+
struct pci_epc *epc = ep->epc;
7374
enum pci_barno bar;
7475

7576
for (bar = BAR_0; bar <= BAR_5; bar++)
7677
dw_pcie_ep_reset_bar(pci, bar);
78+
79+
epc->features |= EPC_FEATURE_NO_LINKUP_NOTIFIER;
7780
}
7881

7982
static int dw_plat_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,

0 commit comments

Comments
 (0)