PCIe: dw: rockchip: Init and free msi whenever needed

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: Ic7bc74c1a05b06c45f83bdb7056a8c4b206dd4dd
This commit is contained in:
Shawn Lin
2022-09-03 11:49:50 +08:00
committed by Tao Huang
parent 47fb66b1b8
commit 451162c6bb

View File

@ -684,6 +684,9 @@ static int rk_pcie_host_init(struct pcie_port *pp)
ret = rk_pcie_establish_link(pci);
if (pp->msi_irq > 0)
dw_pcie_msi_init(pp);
return ret;
}
@ -1747,6 +1750,9 @@ static int __maybe_unused rockchip_dw_pcie_suspend(struct device *dev)
gpiod_set_value_cansleep(rk_pcie->rst_gpio, 0);
ret = rk_pcie_disable_power(rk_pcie);
if (rk_pcie->pci->pp.msi_irq > 0)
dw_pcie_free_msi(&rk_pcie->pci->pp);
return ret;
}
@ -1805,6 +1811,9 @@ static int __maybe_unused rockchip_dw_pcie_resume(struct device *dev)
goto err;
}
if (rk_pcie->pci->pp.msi_irq > 0)
dw_pcie_msi_init(&rk_pcie->pci->pp);
if (std_rc)
goto std_rc_done;