From: Christoph Hellwig <hch@lst.de>
To: Tim Harvey <tharvey@gateworks.com>
Cc: Robin Murphy <robin.murphy@arm.com>,
Christoph Hellwig <hch@lst.de>,
Baochen Qiang <quic_bqiang@quicinc.com>,
ath11k@lists.infradead.org,
linux-wireless <linux-wireless@vger.kernel.org>,
Fabio Estevam <festevam@gmail.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
iommu@lists.linux.dev, P Praneesh <ppranees@codeaurora.org>
Subject: Re: ath11k swiotlb buffer is full (on IMX8M with 4GiB DRAM)
Date: Tue, 10 Dec 2024 05:11:33 +0100 [thread overview]
Message-ID: <20241210041133.GA17116@lst.de> (raw)
In-Reply-To: <CAJ+vNU2ypE_Mn_6iKCmf5LYk9Sth=ryWXyewc5MhOKK8VoAKCA@mail.gmail.com>
On Mon, Dec 09, 2024 at 11:15:02AM -0800, Tim Harvey wrote:
> After a lot of back and forth and investigation this is due to the
> IMX8M SoC's not having an IOMMU thus swiotlb is being used and ath11k
> is requesting some buffers that are too large for swiotlb to provide.
> There is a specific patch which added the HAL_WBM2SW_RELEASE buffers
> to cacheable memory that could be reverted to fix this but the concern
> was that it would impact performance moving those buffers to
> non-cacheable memory (there are three ~1MiB buffers being allocated):
> commit d0e2523bfa9cb ("ath11k: allocate HAL_WBM2SW_RELEASE ring from
> cacheable memory").
The combination of "buffers" and "swiotlb" sounds like Robin was right
below.
> The chain of events as best I can tell are:
>
> commit 6452f0a3d565 ("ath11k: allocate dst ring descriptors from
> cacheable memory")
> - Nov 12 2021 (made it into Linux 5.17)
> - changes allocation of reo_dst rings to cacheable memory to allow
> cached descriptor access to optimize CPU usage
> - this is flawed because it uses virt_to_phys() to allocate cacheable
> memory which does not work on systems with an IOMMU enabled or using
> software IOMMU (swiotlb); this causes a kernel crash on client
> association
And this is where it started to take a wrong turn, that everyhing
later basically made worse. If you have long living and potentially
large DMA allocations, you need to use dma_alloc_* interfaces.
5.17 already had dma_alloc_pages for quite a while which was and still is
the proper interface to use. For much older kernel you'd be stuck
with dma_alloc_noncoherent or dma_alloc_attrs with the right flag,
but even that would have been much better.
next prev parent reply other threads:[~2024-12-10 4:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAJ+vNU0EL3T+GyNAbVbGqYYQ5NM3h7cgAwqxxBMuZjh+-YQ3bA@mail.gmail.com>
[not found] ` <1b2ea8b2-6fbe-4118-b6c6-742c8f0be476@quicinc.com>
[not found] ` <CAJ+vNU1-OZ3y4p2L+zf64AiVtUv70yZNqkT20jTxyE0_gJb6Jg@mail.gmail.com>
[not found] ` <0282be95-9094-4d49-b79e-4f7c976dad00@quicinc.com>
2024-12-06 17:07 ` ath11k swiotlb buffer is full (on IMX8M with 4GiB DRAM) Tim Harvey
2024-12-09 6:39 ` Baochen Qiang
2024-12-09 8:17 ` Christoph Hellwig
2024-12-09 10:49 ` Robin Murphy
2024-12-09 19:15 ` Tim Harvey
2024-12-10 4:11 ` Christoph Hellwig [this message]
2024-12-10 23:06 ` Tim Harvey
2024-12-11 2:31 ` Baochen Qiang
2024-12-11 13:44 ` Robin Murphy
2024-12-12 5:24 ` Baochen Qiang
2024-12-12 7:18 ` Christoph Hellwig
2024-12-12 18:08 ` Jeff Johnson
2024-12-12 19:57 ` Tim Harvey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241210041133.GA17116@lst.de \
--to=hch@lst.de \
--cc=ath11k@lists.infradead.org \
--cc=festevam@gmail.com \
--cc=iommu@lists.linux.dev \
--cc=linux-wireless@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=ppranees@codeaurora.org \
--cc=quic_bqiang@quicinc.com \
--cc=robin.murphy@arm.com \
--cc=tharvey@gateworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox