From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Mark Brown" <broonie@kernel.org>
Cc: Simon Trimmer <simont@opensource.cirrus.com>,
Charles Keepax <ckeepax@opensource.cirrus.com>,
<patches@opensource.cirrus.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/2] firmware: cs_dsp: Remove usage of GFP_DMA
Date: Wed, 19 Feb 2025 16:26:55 +0000 [thread overview]
Message-ID: <8d15d138-658c-4083-885b-62495023bb9a@opensource.cirrus.com> (raw)
In-Reply-To: <20250213161059-a4c53711-fdf6-480c-af49-f9f36227ba42@linutronix.de>
On 13/02/2025 3:16 pm, Thomas Weißschuh wrote:
> On Thu, Feb 13, 2025 at 03:06:59PM +0000, Mark Brown wrote:
>> On Thu, Feb 13, 2025 at 02:28:06PM +0000, Richard Fitzgerald wrote:
>>> On 11/02/2025 5:21 pm, Richard Fitzgerald wrote:
>>
>>>>> Not tested on real hardware.
>>>>> This came up while porting kunit to mips64.
>>>>> Apparently GFP_DMA does not work there, but IMO the usage of GFP_DMA by
>>
>>> I would say that is a bug in mips64 that should be fixed in mips64.
>>> It is not reasonable to expect generic drivers to have special cases for
>>> platforms that don't handle GFP_DMA.
>
> Indeed, I did that, too.
>
>> What specifically is the issue? If it's a build time issue I'd
>> definitely agree that we should just be able to assume that platforms at
>> least build. IIRC there is a Kconfig you can depend on for DMA but it
>> seems more trouble than it's worth to fix all users.
>
> More details in [0], It's only a runtime issue.
>
> I'm still wondering how all the on-stack buffers used with regmap_raw_read()
> and regmap_raw_write() by cs_dsp are satisfying the DMA requirements.
>
There are 3 suspicious regmap_raw_read(). The others are all integers,
which are guaranteed not to cross a page boundary.
However, it looks like it might be safe to remove the GFP_DMA flags
now. regmap_raw_read() calls spi_write_then_read() which specifically
says that the buffers do not need to be DMA-safe and internally uses a
DMA-safe buffer. regmap_raw_write() uses either a temporary physically
contiguous buffer or GFP_DMA buffer (the implementation is terrifyingly
complex so it's difficult to determine exactly what it does).
(Some older systems could only use certain special memory areas for DMA
but we haven't seen any of those used with cs_dsp.)
> [0] https://lore.kernel.org/lkml/20250212-kunit-mips-v1-1-eb49c9d76615@linutronix.de/
next prev parent reply other threads:[~2025-02-19 16:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-11 17:03 Thomas Weißschuh
2025-02-11 17:03 ` [PATCH 1/2] " Thomas Weißschuh
2025-02-11 17:03 ` [PATCH 2/2] firmware: cs_dsp: Remove bounce buffer in cs_dsp_coeff_write_ctrl_raw() Thomas Weißschuh
2025-02-11 17:21 ` [PATCH 0/2] firmware: cs_dsp: Remove usage of GFP_DMA Richard Fitzgerald
2025-02-12 13:12 ` Thomas Weißschuh
2025-02-13 14:28 ` Richard Fitzgerald
2025-02-13 15:06 ` Mark Brown
2025-02-13 15:16 ` Thomas Weißschuh
2025-02-19 16:26 ` Richard Fitzgerald [this message]
2025-02-20 9:52 ` Charles Keepax
2025-02-20 10:29 ` Richard Fitzgerald
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=8d15d138-658c-4083-885b-62495023bb9a@opensource.cirrus.com \
--to=rf@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=simont@opensource.cirrus.com \
--cc=thomas.weissschuh@linutronix.de \
/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
all inboxes | Powered by JetHome®