[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250211-cs_dsp-gfp_dma-v1-1-afc346363832@linutronix.de>
Date: Tue, 11 Feb 2025 18:03:28 +0100
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Simon Trimmer <simont@...nsource.cirrus.com>,
Charles Keepax <ckeepax@...nsource.cirrus.com>,
Richard Fitzgerald <rf@...nsource.cirrus.com>,
Mark Brown <broonie@...nel.org>
Cc: patches@...nsource.cirrus.com, linux-kernel@...r.kernel.org,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Subject: [PATCH 1/2] firmware: cs_dsp: Remove usage of GFP_DMA
Usage of GFP_DMA should be avoided in general.
The underlying regmap implementatinon should automatically use its own
bounce buffer if necessary.
On indication is that many other callers of regmap_raw_write() and
regmap_raw_read() in cs_dsp use stack allocated buffers which also do
not obey alignment or location restrictions.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
---
drivers/firmware/cirrus/cs_dsp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/firmware/cirrus/cs_dsp.c b/drivers/firmware/cirrus/cs_dsp.c
index 5365e9a4300070c42e1bc998b848e62a4e4c9d53..2a85c1009f10273bee3656e5f7aebe31862036b2 100644
--- a/drivers/firmware/cirrus/cs_dsp.c
+++ b/drivers/firmware/cirrus/cs_dsp.c
@@ -763,7 +763,7 @@ static int cs_dsp_coeff_write_ctrl_raw(struct cs_dsp_coeff_ctl *ctl,
if (ret)
return ret;
- scratch = kmemdup(buf, len, GFP_KERNEL | GFP_DMA);
+ scratch = kmemdup(buf, len, GFP_KERNEL);
if (!scratch)
return -ENOMEM;
@@ -868,7 +868,7 @@ static int cs_dsp_coeff_read_ctrl_raw(struct cs_dsp_coeff_ctl *ctl,
if (ret)
return ret;
- scratch = kmalloc(len, GFP_KERNEL | GFP_DMA);
+ scratch = kmalloc(len, GFP_KERNEL);
if (!scratch)
return -ENOMEM;
@@ -1731,7 +1731,7 @@ static void *cs_dsp_read_algs(struct cs_dsp *dsp, size_t n_algs,
/* Convert length from DSP words to bytes */
len *= sizeof(u32);
- alg = kzalloc(len, GFP_KERNEL | GFP_DMA);
+ alg = kzalloc(len, GFP_KERNEL);
if (!alg)
return ERR_PTR(-ENOMEM);
--
2.48.1
Powered by blists - more mailing lists