Messages in this thread | | | Date | Wed, 7 Oct 2020 12:41:19 -0500 | From | Rob Herring <> | Subject | Re: [PATCH v5 2/2] PCI: dwc: Fix MSI page leakage in suspend/resume |
| |
On Wed, Sep 30, 2020 at 09:15:25AM +0800, Jisheng Zhang wrote: > Currently, dw_pcie_msi_init() allocates and maps page for msi, then > program the PCIE_MSI_ADDR_LO and PCIE_MSI_ADDR_HI. The Root Complex > may lose power during suspend-to-RAM, so when we resume, we want to > redo the latter but not the former. If designware based driver (for > example, pcie-tegra194.c) calls dw_pcie_msi_init() in resume path, the > msi page will be leaked. > > As pointed out by Rob and Ard, there's no need to allocate a page for > the MSI address, we could use an address in the driver data. > > To avoid map the MSI msg again during resume, we move the map MSI msg > from dw_pcie_msi_init() to dw_pcie_host_init(). > > Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com> > --- > drivers/pci/controller/dwc/pci-dra7xx.c | 18 ++++++++++- > .../pci/controller/dwc/pcie-designware-host.c | 32 +++++++++---------- > drivers/pci/controller/dwc/pcie-designware.h | 2 +- > 3 files changed, 34 insertions(+), 18 deletions(-)
I'm working on some larger MSI clean-ups which should eliminate the dra7xx addition, but this is good enough for now.
Reviewed-by: Rob Herring <robh@kernel.org>
| |