build/patch/kernel/archive/sunxi-5.15/patches.megous/PCI-dwc-rockchip-set-the-dma_mask-early.patch

32 lines
1.1 KiB
Diff
Raw Normal View History

From 94472e4b2efb4954ed58bf9df9f4595fb038b679 Mon Sep 17 00:00:00 2001
From: Peter Geis <pgwipeout@gmail.com>
Date: Wed, 4 Aug 2021 07:42:13 -0400
Subject: [PATCH 432/478] PCI: dwc: rockchip: set the dma_mask early
Set the dma_mask to 32 bit early in probe to prevent issues with devices
that only support 32 bit MSIs.
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
---
drivers/pci/controller/dwc/pcie-dw-rockchip.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
index c9b341e55cbb..916ef44db981 100644
--- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c
+++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
@@ -215,6 +215,10 @@ static int rockchip_pcie_probe(struct platform_device *pdev)
rockchip->pci.dev = dev;
rockchip->pci.ops = &dw_pcie_ops;
+ ret = dma_set_mask(rockchip->pci.dev, DMA_BIT_MASK(32));
+ if (ret)
+ dev_warn(rockchip->pci.dev, "Failed to set DMA mask to 32-bit. Devices with only 32-bit MSI support may not work properly\n");
+
pp = &rockchip->pci.pp;
pp->ops = &rockchip_pcie_host_ops;
--
2.35.3