[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200901132905.GA11506@alpha.franken.de>
Date: Tue, 1 Sep 2020 15:29:05 +0200
From: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
To: Christoph Hellwig <hch@....de>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
Joonyoung Shim <jy0922.shim@...sung.com>,
Seung-Woo Kim <sw0312.kim@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>,
Ben Skeggs <bskeggs@...hat.com>,
Pawel Osciak <pawel@...iak.com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Matt Porter <mporter@...nel.crashing.org>,
iommu@...ts.linux-foundation.org,
Tom Lendacky <thomas.lendacky@....com>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-ia64@...r.kernel.org, linux-mips@...r.kernel.org,
linux-parisc@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
nouveau@...ts.freedesktop.org, netdev@...r.kernel.org,
linux-nvme@...ts.infradead.org, linux-scsi@...r.kernel.org,
linux-mm@...ck.org, alsa-devel@...a-project.org
Subject: Re: [PATCH 06/28] lib82596: move DMA allocation into the callers of
i82596_probe
On Wed, Aug 19, 2020 at 08:55:33AM +0200, Christoph Hellwig wrote:
> This allows us to get rid of the LIB82596_DMA_ATTR defined and prepare
> for untangling the coherent vs non-coherent DMA allocation API.
>
> Signed-off-by: Christoph Hellwig <hch@....de>
> ---
> drivers/net/ethernet/i825xx/lasi_82596.c | 24 ++++++++++------
> drivers/net/ethernet/i825xx/lib82596.c | 36 ++++++++----------------
> drivers/net/ethernet/i825xx/sni_82596.c | 19 +++++++++----
> 3 files changed, 40 insertions(+), 39 deletions(-)
>
> [...]
> diff --git a/drivers/net/ethernet/i825xx/sni_82596.c b/drivers/net/ethernet/i825xx/sni_82596.c
> index 22f5887578b2bd..e80e790ffbd4d4 100644
> --- a/drivers/net/ethernet/i825xx/sni_82596.c
> +++ b/drivers/net/ethernet/i825xx/sni_82596.c
> @@ -24,8 +24,6 @@
>
> static const char sni_82596_string[] = "snirm_82596";
>
> -#define LIB82596_DMA_ATTR 0
> -
> #define DMA_WBACK(priv, addr, len) do { } while (0)
> #define DMA_INV(priv, addr, len) do { } while (0)
> #define DMA_WBACK_INV(priv, addr, len) do { } while (0)
> @@ -134,10 +132,19 @@ static int sni_82596_probe(struct platform_device *dev)
> lp->ca = ca_addr;
> lp->mpu_port = mpu_addr;
>
> + lp->dma = dma_alloc_coherent(dev->dev.parent, sizeof(struct i596_dma),
> + &lp->dma_addr, GFP_KERNEL);
this needs to use &dev->dev as device argument otherwise I get a
WARNING: CPU: 0 PID: 1 at linux/kernel/dma/mapping.c:416 dma_alloc_attrs+0x64/0x98
(coherent_dma_mask is set correctly).
dev->dev.parent was correct when going from netdevice to underlying device,
but now allocation is done via platform_device probe. I wonder why this works
for parisc.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
Powered by blists - more mailing lists