lkml.org 
[lkml]   [2020]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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>

\
 
 \ /
  Last update: 2020-10-07 19:42    [W:0.999 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site