[PATCH 1/2] firmware: cs_dsp: Remove usage of GFP_DMA
From: Thomas Weißschuh
Date: Tue Feb 11 2025 - 12:03:54 EST
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@xxxxxxxxxxxxx>
---
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