@@ -956,12 +956,18 @@ int dw_pcie_suspend_noirq(struct dw_pcie *pci)
if (dw_pcie_readw_dbi(pci, offset + PCI_EXP_LNKCTL) & PCI_EXP_LNKCTL_ASPM_L1)
return 0;
- if (pci->pp.ops->pme_turn_off) {
- pci->pp.ops->pme_turn_off(&pci->pp);
+ if (dw_pcie_get_ltssm(pci) <= DW_PCIE_LTSSM_DETECT_WAIT &&
+ dwc_check_quirk(pci, QUIRK_NOLINK_NOPME)) {
+ /* Don't send the PME_TURN_OFF when link is down. */
+ ;
} else {
- ret = dw_pcie_pme_turn_off(pci);
- if (ret)
- return ret;
+ if (pci->pp.ops->pme_turn_off) {
+ pci->pp.ops->pme_turn_off(&pci->pp);
+ } else {
+ ret = dw_pcie_pme_turn_off(pci);
+ if (ret)
+ return ret;
+ }
}
if (!dwc_check_quirk(pci, QUIRK_NOL2POLL_IN_PM)) {
@@ -283,6 +283,7 @@
#define DMA_LLP_MEM_SIZE PAGE_SIZE
#define QUIRK_NOL2POLL_IN_PM BIT(0)
+#define QUIRK_NOLINK_NOPME BIT(1)
#define dwc_check_quirk(pci, val) (pci->quirk_flag & val)
struct dw_pcie;
When no endpoint is connected on i.MX7D PCIe, chip would be freeze when do the dummy write in dw_pcie_pme_turn_off() to issue a PME_Turn_Off Msg TLP. Add one quirk to issue the PME_Turn_Off only when link is up to avoid this problem on the PME_Turn_Off handshake broken platform, for example the i.MX7D. Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com> --- .../pci/controller/dwc/pcie-designware-host.c | 16 +++++++++++----- drivers/pci/controller/dwc/pcie-designware.h | 1 + 2 files changed, 12 insertions(+), 5 deletions(-)