[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <304053c7-9f88-8830-3287-2496a4cb48cd@arm.com>
Date: Wed, 8 Jul 2020 17:20:16 +0100
From: Robin Murphy <robin.murphy@....com>
To: Christoph Hellwig <hch@....de>,
Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
Cc: Jeremy Linton <jeremy.linton@....com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
David Rientjes <rientjes@...gle.com>,
linux-rpi-kernel@...ts.infradead.org,
iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dma-pool: use single atomic pool for both DMA zones
On 2020-07-08 16:36, Christoph Hellwig wrote:
> On Wed, Jul 08, 2020 at 12:35:34PM +0200, Nicolas Saenz Julienne wrote:
>>> Which allows me to switch between ACPI/DT on the machine. In DT mode it
>>> works fine now,
>>
>> Nice, would that count as a Tested-by from you?
>>
>>> but with ACPI I continue to have failures unless I
>>> disable CMA via cma=0 on the kernel command line.
>>
>> Yes, I see why, in atomic_pool_expand() memory is allocated from CMA without
>> checking its correctness. That calls for a separate fix. I'll try to think of
>> something.
>
> I think we need a dma_coherent_ok for the allocations from the
> pool and then fall back to the next better one to get started. And
> yes, CMA is a bit of a mess, that generally needs better checks.
Yeah, another thought that came to mind later is that iommu-dma can use
pages from any pool regardless of the device's DMA mask, so we could
stand to be a lot less restrictive in that case too.
Perhaps it is better to just bite the bullet, keep the straightforward
one-pool-per-zone setup, and implement the dma_coherent_ok() type
fallback logic. More complexity for dma_alloc_from_pool(), but
everything else stays nice and simple - lose the assumption that
dev_to_pool() can work for this and and just let callers pass an
allocation mask directly, and have dma_free_from_pool() simply check all
available pools.
Robin.
Powered by blists - more mailing lists