Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion drivers/pci/controller/pcie-apple.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
Expand Down
Loading