Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <gustavo.pimentel@synopsys.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>

authored by

Gustavo Pimentel and committed by
Lorenzo Pieralisi
4e965ede 53dd0c51

+9 -8
+6 -8
drivers/pci/controller/dwc/pcie-designware-ep.c
··· 386 386 return -ENOMEM; 387 387 ep->outbound_addr = addr; 388 388 389 - if (ep->ops->ep_init) 390 - ep->ops->ep_init(ep); 391 - 392 389 epc = devm_pci_epc_create(dev, &epc_ops); 393 390 if (IS_ERR(epc)) { 394 391 dev_err(dev, "Failed to create epc device\n"); 395 392 return PTR_ERR(epc); 396 393 } 394 + 395 + ep->epc = epc; 396 + epc_set_drvdata(epc, ep); 397 + 398 + if (ep->ops->ep_init) 399 + ep->ops->ep_init(ep); 397 400 398 401 ret = of_property_read_u8(np, "max-functions", &epc->max_functions); 399 402 if (ret < 0) ··· 416 413 return -ENOMEM; 417 414 } 418 415 419 - epc->features = EPC_FEATURE_NO_LINKUP_NOTIFIER; 420 - EPC_FEATURE_SET_BAR(epc->features, BAR_0); 421 - 422 - ep->epc = epc; 423 - epc_set_drvdata(epc, ep); 424 416 dw_pcie_setup(pci); 425 417 426 418 return 0;
+3
drivers/pci/controller/dwc/pcie-designware-plat.c
··· 70 70 static void dw_plat_pcie_ep_init(struct dw_pcie_ep *ep) 71 71 { 72 72 struct dw_pcie *pci = to_dw_pcie_from_ep(ep); 73 + struct pci_epc *epc = ep->epc; 73 74 enum pci_barno bar; 74 75 75 76 for (bar = BAR_0; bar <= BAR_5; bar++) 76 77 dw_pcie_ep_reset_bar(pci, bar); 78 + 79 + epc->features |= EPC_FEATURE_NO_LINKUP_NOTIFIER; 77 80 } 78 81 79 82 static int dw_plat_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,