pci-v6.5-fixes-1

-----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCgAyFiEEgMe7l+5h9hnxdsnuWYigwDrT+vwFAmTWUuYUHGJoZWxnYWFz
 QGdvb2dsZS5jb20ACgkQWYigwDrT+vyWug/9FL7lSZdp5dHwjJKHF3N+vgSj56oS
 FrMqtoAM62unI2/ei9JFNjhvdDJFcBsnM3YNNSUmFOdsVOWGXADeMHIeJbsIJev0
 u7vCzphkpgJC/qFGozu5XLwZoP4AJnGxh9NpBz/uJwMApqQR7aLWWnvpy7LnvFR4
 ru8CNIKuDSk/ZNGI1LxrOShSrHTHiXky1/GC0RPd1EaJ8KNrOSUywJ4Kd3OcSjwM
 OtvNXZCWhusiIn4FRyacgA6Btm5POJVPTaefDlUtMCQekGgJCh9YPJ3RscD4Cv1g
 dHVlPfsuB591WiO67PO4i0Q0NtM0pT9f/AeyxzrflyvR/e54VLaOE1iEDDQeO+D9
 4Edu+OpWukp1YfbIfXa+2KOmXmgI6lwodK87PzMBRmepn4V8DW+/HaKg8wtr6JpX
 uYKSeZRlLH0rIegzOgARCUZRjmBy/cxHDDKrekrW8VReYRa3S5O3dVZ6oS7fmxAF
 QQFF0YLUv34cjQ8289mWKj0vcmB6fnh8VCc/dbzfHbGjjQ/HXEBRUao/jn9SOA+C
 tMsYkdOf15jU+5SQXxfOCj6aYr5BLTxE4/3Qc5WkMOW5IT3VghV4gf4W2F8Fs6Qz
 YVUUaN0vKhRgjEmz7/k3KyvtMy+jmpRQMIin8ftj0tDoTy+X9MmsjQB//zINOusV
 wYlYhClZIiAf0OE=
 =/0Ra
 -----END PGP SIGNATURE-----

Merge tag 'pci-v6.5-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci

Pull pci fixes from Bjorn Helgaas:

 - Add Manivannan Sadhasivam as DesignWare PCIe driver co-maintainer
   (Krzysztof Wilczyński)

 - Revert "PCI: dwc: Wait for link up only if link is started" to fix a
   regression on Qualcomm platforms that don't reach interconnect sync
   state if the slot is empty (Johan Hovold)

 - Revert "PCI: mvebu: Mark driver as BROKEN" so people can use
   pci-mvebu even though some others report problems (Bjorn Helgaas)

 - Avoid a NULL pointer dereference when using acpiphp for root bus
   hotplug to fix a regression added in v6.5-rc1 (Igor Mammedov)

* tag 'pci-v6.5-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci:
  PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus
  Revert "PCI: mvebu: Mark driver as BROKEN"
  Revert "PCI: dwc: Wait for link up only if link is started"
  MAINTAINERS: Add Manivannan Sadhasivam as DesignWare PCIe driver maintainer
This commit is contained in:
Linus Torvalds 2023-08-11 09:39:17 -07:00
commit 9106536c1a
6 changed files with 19 additions and 25 deletions

View file

@ -16293,6 +16293,7 @@ F: drivers/pci/controller/dwc/pci-exynos.c
PCI DRIVER FOR SYNOPSYS DESIGNWARE
M: Jingoo Han <jingoohan1@gmail.com>
M: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
L: linux-pci@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml

View file

@ -179,7 +179,6 @@ config PCI_MVEBU
depends on MVEBU_MBUS
depends on ARM
depends on OF
depends on BROKEN
select PCI_BRIDGE_EMUL
help
Add support for Marvell EBU PCIe controller. This PCIe controller

View file

@ -485,19 +485,14 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp)
if (ret)
goto err_remove_edma;
if (dw_pcie_link_up(pci)) {
dw_pcie_print_link_status(pci);
} else {
if (!dw_pcie_link_up(pci)) {
ret = dw_pcie_start_link(pci);
if (ret)
goto err_remove_edma;
}
if (pci->ops && pci->ops->start_link) {
ret = dw_pcie_wait_for_link(pci);
if (ret)
goto err_stop_link;
}
}
/* Ignore errors, the link may come up later */
dw_pcie_wait_for_link(pci);
bridge->sysdata = pp;

View file

@ -644,20 +644,9 @@ void dw_pcie_disable_atu(struct dw_pcie *pci, u32 dir, int index)
dw_pcie_writel_atu(pci, dir, index, PCIE_ATU_REGION_CTRL2, 0);
}
void dw_pcie_print_link_status(struct dw_pcie *pci)
{
u32 offset, val;
offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
val = dw_pcie_readw_dbi(pci, offset + PCI_EXP_LNKSTA);
dev_info(pci->dev, "PCIe Gen.%u x%u link up\n",
FIELD_GET(PCI_EXP_LNKSTA_CLS, val),
FIELD_GET(PCI_EXP_LNKSTA_NLW, val));
}
int dw_pcie_wait_for_link(struct dw_pcie *pci)
{
u32 offset, val;
int retries;
/* Check if the link is up or not */
@ -673,7 +662,12 @@ int dw_pcie_wait_for_link(struct dw_pcie *pci)
return -ETIMEDOUT;
}
dw_pcie_print_link_status(pci);
offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
val = dw_pcie_readw_dbi(pci, offset + PCI_EXP_LNKSTA);
dev_info(pci->dev, "PCIe Gen.%u x%u link up\n",
FIELD_GET(PCI_EXP_LNKSTA_CLS, val),
FIELD_GET(PCI_EXP_LNKSTA_NLW, val));
return 0;
}

View file

@ -429,7 +429,6 @@ void dw_pcie_setup(struct dw_pcie *pci);
void dw_pcie_iatu_detect(struct dw_pcie *pci);
int dw_pcie_edma_detect(struct dw_pcie *pci);
void dw_pcie_edma_remove(struct dw_pcie *pci);
void dw_pcie_print_link_status(struct dw_pcie *pci);
static inline void dw_pcie_writel_dbi(struct dw_pcie *pci, u32 reg, u32 val)
{

View file

@ -498,6 +498,7 @@ static void enable_slot(struct acpiphp_slot *slot, bool bridge)
acpiphp_native_scan_bridge(dev);
}
} else {
LIST_HEAD(add_list);
int max, pass;
acpiphp_rescan_slot(slot);
@ -511,9 +512,14 @@ static void enable_slot(struct acpiphp_slot *slot, bool bridge)
if (pass && dev->subordinate) {
check_hotplug_bridge(slot, dev);
pcibios_resource_survey_bus(dev->subordinate);
if (pci_is_root_bus(bus))
__pci_bus_size_bridges(dev->subordinate, &add_list);
}
}
}
if (pci_is_root_bus(bus))
__pci_bus_assign_resources(bus, &add_list, NULL);
else
pci_assign_unassigned_bridge_resources(bus->self);
}