Skip to content

Commit 9106536

Browse files
committed
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
2 parents 2a3c17e + cc22522 commit 9106536

File tree

6 files changed

+19
-25
lines changed

6 files changed

+19
-25
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16293,6 +16293,7 @@ F: drivers/pci/controller/dwc/pci-exynos.c
1629316293
PCI DRIVER FOR SYNOPSYS DESIGNWARE
1629416294
M: Jingoo Han <jingoohan1@gmail.com>
1629516295
M: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
16296+
M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
1629616297
L: linux-pci@vger.kernel.org
1629716298
S: Maintained
1629816299
F: Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml

drivers/pci/controller/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ config PCI_MVEBU
179179
depends on MVEBU_MBUS
180180
depends on ARM
181181
depends on OF
182-
depends on BROKEN
183182
select PCI_BRIDGE_EMUL
184183
help
185184
Add support for Marvell EBU PCIe controller. This PCIe controller

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -485,20 +485,15 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp)
485485
if (ret)
486486
goto err_remove_edma;
487487

488-
if (dw_pcie_link_up(pci)) {
489-
dw_pcie_print_link_status(pci);
490-
} else {
488+
if (!dw_pcie_link_up(pci)) {
491489
ret = dw_pcie_start_link(pci);
492490
if (ret)
493491
goto err_remove_edma;
494-
495-
if (pci->ops && pci->ops->start_link) {
496-
ret = dw_pcie_wait_for_link(pci);
497-
if (ret)
498-
goto err_stop_link;
499-
}
500492
}
501493

494+
/* Ignore errors, the link may come up later */
495+
dw_pcie_wait_for_link(pci);
496+
502497
bridge->sysdata = pp;
503498

504499
ret = pci_host_probe(bridge);

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

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -644,20 +644,9 @@ void dw_pcie_disable_atu(struct dw_pcie *pci, u32 dir, int index)
644644
dw_pcie_writel_atu(pci, dir, index, PCIE_ATU_REGION_CTRL2, 0);
645645
}
646646

647-
void dw_pcie_print_link_status(struct dw_pcie *pci)
648-
{
649-
u32 offset, val;
650-
651-
offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
652-
val = dw_pcie_readw_dbi(pci, offset + PCI_EXP_LNKSTA);
653-
654-
dev_info(pci->dev, "PCIe Gen.%u x%u link up\n",
655-
FIELD_GET(PCI_EXP_LNKSTA_CLS, val),
656-
FIELD_GET(PCI_EXP_LNKSTA_NLW, val));
657-
}
658-
659647
int dw_pcie_wait_for_link(struct dw_pcie *pci)
660648
{
649+
u32 offset, val;
661650
int retries;
662651

663652
/* Check if the link is up or not */
@@ -673,7 +662,12 @@ int dw_pcie_wait_for_link(struct dw_pcie *pci)
673662
return -ETIMEDOUT;
674663
}
675664

676-
dw_pcie_print_link_status(pci);
665+
offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
666+
val = dw_pcie_readw_dbi(pci, offset + PCI_EXP_LNKSTA);
667+
668+
dev_info(pci->dev, "PCIe Gen.%u x%u link up\n",
669+
FIELD_GET(PCI_EXP_LNKSTA_CLS, val),
670+
FIELD_GET(PCI_EXP_LNKSTA_NLW, val));
677671

678672
return 0;
679673
}

drivers/pci/controller/dwc/pcie-designware.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ void dw_pcie_setup(struct dw_pcie *pci);
429429
void dw_pcie_iatu_detect(struct dw_pcie *pci);
430430
int dw_pcie_edma_detect(struct dw_pcie *pci);
431431
void dw_pcie_edma_remove(struct dw_pcie *pci);
432-
void dw_pcie_print_link_status(struct dw_pcie *pci);
433432

434433
static inline void dw_pcie_writel_dbi(struct dw_pcie *pci, u32 reg, u32 val)
435434
{

drivers/pci/hotplug/acpiphp_glue.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ static void enable_slot(struct acpiphp_slot *slot, bool bridge)
498498
acpiphp_native_scan_bridge(dev);
499499
}
500500
} else {
501+
LIST_HEAD(add_list);
501502
int max, pass;
502503

503504
acpiphp_rescan_slot(slot);
@@ -511,10 +512,15 @@ static void enable_slot(struct acpiphp_slot *slot, bool bridge)
511512
if (pass && dev->subordinate) {
512513
check_hotplug_bridge(slot, dev);
513514
pcibios_resource_survey_bus(dev->subordinate);
515+
if (pci_is_root_bus(bus))
516+
__pci_bus_size_bridges(dev->subordinate, &add_list);
514517
}
515518
}
516519
}
517-
pci_assign_unassigned_bridge_resources(bus->self);
520+
if (pci_is_root_bus(bus))
521+
__pci_bus_assign_resources(bus, &add_list, NULL);
522+
else
523+
pci_assign_unassigned_bridge_resources(bus->self);
518524
}
519525

520526
acpiphp_sanitize_bus(bus);

0 commit comments

Comments
 (0)