[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5271f3041cf16ec06a8266b0072f294384280f54.camel@suse.de>
Date: Wed, 28 Aug 2019 11:44:12 +0200
From: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
To: Christoph Hellwig <hch@....de>
Cc: catalin.marinas@....com, linux-mm@...ck.org,
linux-riscv@...ts.infradead.org, will@...nel.org,
m.szyprowski@...sung.com, linux-arch@...r.kernel.org,
f.fainelli@...il.com, frowand.list@...il.com,
devicetree@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
marc.zyngier@....com, robh+dt@...nel.org,
linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, phill@...pberryi.org,
mbrugger@...e.com, eric@...olt.net, linux-kernel@...r.kernel.org,
iommu@...ts.linux-foundation.org, wahrenst@....net,
akpm@...ux-foundation.org, Robin Murphy <robin.murphy@....com>
Subject: Re: [PATCH v2 01/11] asm-generic: add dma_zone_size
On Mon, 2019-08-26 at 15:46 +0200, Nicolas Saenz Julienne wrote:
> On Mon, 2019-08-26 at 09:09 +0200, Christoph Hellwig wrote:
> > On Tue, Aug 20, 2019 at 04:58:09PM +0200, Nicolas Saenz Julienne wrote:
> > > Some architectures have platform specific DMA addressing limitations.
> > > This will allow for hardware description code to provide the constraints
> > > in a generic manner, so as for arch code to properly setup it's memory
> > > zones and DMA mask.
> >
> > I know this just spreads the arm code, but I still kinda hate it.
>
> Rob's main concern was finding a way to pass the constraint from HW definition
> to arch without widening fdt's architecture specific function surface. I'd say
> it's fair to argue that having a generic mechanism makes sense as it'll now
> traverse multiple archs and subsystems.
>
> I get adding globals like this is not very appealing, yet I went with it as it
> was the easier to integrate with arm's code. Any alternative suggestions?
>
> > MAX_DMA_ADDRESS is such an oddly defined concepts. We have the mm
> > code that uses it to start allocating after the dma zones, but
> > I think that would better be done using a function returning
> > 1 << max(zone_dma_bits, 32) or so. Then we have about a handful
> > of drivers using it that all seem rather bogus, and one of which
> > I think are usable on arm64.
>
> Is it safe to assume DMA limitations will always be a power of 2? I ask as
> RPi4
> kinda isn't: ZONE_DMA is 0x3c000000 bytes big, I'm approximating the zone mask
> to 30 as [0x3c000000 0x3fffffff] isn't defined as memory so it's unlikely that
> we´ll encounter buffers there. But I don't know how it could affect mm
> initialization code.
>
> This also rules out 'zone_dma_bits' as a mechanism to pass ZONE_DMA's size
> from
> HW definition code to arch's.
Hi Christoph,
I gave it a thought and think this whole MAX_DMA_ADDRESS topic falls out of the
scope of the series. I agree it's something that we should get rid of, but
fixing it isn't going to affect the overall enhancement intended here. I'd
rather focus on how are we going to pass the DMA zone data into the arch code
and fix MAX_DMA_ADDRESS on another series.
Regards,
Nicolas
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists