[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220613210929.GA87830-robh@kernel.org>
Date: Mon, 13 Jun 2022 15:09:29 -0600
From: Rob Herring <robh@...nel.org>
To: Will McVicker <willmcvicker@...gle.com>
Cc: Jingoo Han <jingoohan1@...il.com>,
Gustavo Pimentel <gustavo.pimentel@...opsys.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Krzysztof WilczyĆski <kw@...ux.com>,
Bjorn Helgaas <bhelgaas@...gle.com>, kernel-team@...roid.com,
Vidya Sagar <vidyas@...dia.com>, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 1/1] PCI: dwc: Fix MSI msi_msg dma mapping
On Wed, May 25, 2022 at 10:33:16PM +0000, Will McVicker wrote:
> As of commit 07940c369a6b ("PCI: dwc: Fix MSI page leakage in
> suspend/resume"), the PCIe designware host driver has been using the
> driver data allocation for the msi_msg dma mapping which can result in
> a DMA_MAPPING_ERROR due to the DMA overflow check in
> dma_direct_map_page() when the address is greater than 32-bits (reported
> in [1]). The commit was trying to address a memory leak on
> suspend/resume by moving the MSI mapping to dw_pcie_host_init(), but
> subsequently dropped the page allocation thinking it wasn't needed.
>
> To fix the DMA mapping issue as well as make msi_msg DMA'able, let's
> switch back to allocating a 32-bit page for the msi_msg. To avoid the
> suspend/resume leak, we can allocate the page in dw_pcie_host_init()
> since that function shouldn't be called during suspend/resume.
>
> [1] https://lore.kernel.org/all/Yo0soniFborDl7+C@google.com/
>
> Signed-off-by: Will McVicker <willmcvicker@...gle.com>
> ---
> drivers/pci/controller/dwc/pcie-designware-host.c | 14 ++++++++------
> drivers/pci/controller/dwc/pcie-designware.h | 2 +-
> 2 files changed, 9 insertions(+), 7 deletions(-)
Reviewed-by: Rob Herring <robh@...nel.org>
Powered by blists - more mailing lists