Commit efc74733 authored by Will McVicker's avatar Will McVicker Committed by Carlos Llamas
Browse files

FROMGIT: PCI: dwc: Fix MSI msi_msg dma mapping

As of 07940c36 ("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, switch
back to allocating a 32-bit page for the msi_msg. To avoid the
suspend/resume leak, allocate the page in dw_pcie_host_init() since that
shouldn't be called during suspend/resume.

[1] https://lore.kernel.org/all/Yo0soniFborDl7+C@google.com/

Link: https://lore.kernel.org/all/20220525223316.388490-1-willmcvicker@google.com/
(cherry picked from commit 27235cd867cf7cd17e8d2384430dc54703419ffc https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git

 pci/ctrl/dwc)
Bug: 232293973
Signed-off-by: default avatarWill McVicker <willmcvicker@google.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Change-Id: I48f48d069ff27a391cf0043bc23cfe4ac8c32593
parent 99af01f2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment