[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221216093423.4bettdxisserdzsh@mobilestation>
Date: Fri, 16 Dec 2022 12:34:23 +0300
From: Serge Semin <fancer.lancer@...il.com>
To: Christoph Hellwig <hch@...radead.org>
Cc: Robin Murphy <robin.murphy@....com>,
Serge Semin <Sergey.Semin@...kalelectronics.ru>,
Gustavo Pimentel <gustavo.pimentel@...opsys.com>,
Vinod Koul <vkoul@...nel.org>, Rob Herring <robh@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Cai Huoqing <cai.huoqing@...ux.dev>,
Jingoo Han <jingoohan1@...il.com>, Frank Li <Frank.Li@....com>,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
Pavel Parkhomenko <Pavel.Parkhomenko@...kalelectronics.ru>,
caihuoqing <caihuoqing@...du.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
linux-pci@...r.kernel.org, dmaengine@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 23/25] PCI: dwc: Restore DMA-mask after MSI-data
allocation
On Thu, Dec 15, 2022 at 11:39:41PM -0800, Christoph Hellwig wrote:
> On Fri, Dec 16, 2022 at 02:52:18AM +0300, Serge Semin wrote:
> > Got it. Thanks for clarification. I'll resubmit the series with only
> > the streaming DMA mask restoration.
>
> Note that even for that we need to make sure there are no outstanding
> mappings when you change the mask.
>
What about instead of save/restore pattern I'll just change the
dma_set_mask_and_coherent() method with the dma_set_coherent_mask()
function call? It seems cleaner. Like this:
< --- a/drivers/pci/controller/dwc/pcie-designware-host.c
< +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
< @@ -366,10 +366,10 @@ static int dw_pcie_msi_host_init(struct dw_pcie_rp *pp)
< dw_chained_msi_isr, pp);
< }
<
< - ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
< + ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
< if (ret)
< dev_warn(dev, "Failed to set DMA mask to 32-bit. Devices with only 32-bit MSI support may not work properly\n");
<
< msi_vaddr = dmam_alloc_coherent(dev, sizeof(u64), &pp->msi_data,
< GFP_KERNEL);
Thus the platform-specific streaming DMA mask would be preserved.
Since it's PCIe then having the streaming DMA-mask less than 32-bits
wide is very much improbable. Moreover DW PCIe AXI-interface can be
synthesize only with one out of two address bus widths: 32 and 64.
-Serge(y)
Powered by blists - more mailing lists