diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c index 8e20a36cc575e..1cb3d6b10fb46 100644 --- a/drivers/pci/controller/pcie-apple.c +++ b/drivers/pci/controller/pcie-apple.c @@ -6733,6 +6733,8 @@ static bool apple_pcie_below_kernel_trained_port(struct pci_dev *pdev) * * Check hardware PMCSR rather than current_state: the PCI core may mark a * driverless root port PCI_UNKNOWN even though its hardware remains in D0. + * An endpoint the core itself put in D3hot (the SD reader on port 1: its + * config space and link stay up) is accepted when the hardware agrees. */ static int apple_pcie_check_d0(struct pci_dev *pdev, void *data) { @@ -6754,7 +6756,10 @@ static int apple_pcie_check_d0(struct pci_dev *pdev, void *data) *error = -ENODEV; } else if (pdev->pm_cap && (pci_read_config_word(pdev, pdev->pm_cap + PCI_PM_CTRL, &value) || - (value & PCI_PM_CTRL_STATE_MASK) != PCI_D0)) { + ((value & PCI_PM_CTRL_STATE_MASK) != PCI_D0 && + !(!pci_is_bridge(pdev) && + (value & PCI_PM_CTRL_STATE_MASK) == PCI_D3hot && + pdev->current_state == PCI_D3hot)))) { *error = -EBUSY; } if (*error)