* [PATCH] ASoC: xilinx: formatter_pcm: pass aud_drv_data to irq handlers
@ 2026-08-06 23:32 Rosen Penev
2026-08-11 14:26 ` Michal Simek
2026-08-11 14:41 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Rosen Penev @ 2026-08-06 23:32 UTC (permalink / raw)
To: linux-sound
Cc: Vincenzo Frascino, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Michal Simek, Maruthi Srinivas Bayyavarapu,
moderated list:ARM/ZYNQ ARCHITECTURE, open list
The irq handlers take a struct device pointer and call
dev_get_drvdata() to obtain the driver data. However, the driver
data is only set at the end of probe, after devm_request_irq(),
so an interrupt taken in between causes the handlers to pass a
NULL pointer to readl() and crash.
Pass the private data directly as the devm_request_irq() argument
instead of the device pointer, matching what the handlers expect.
Fixes: 6f6c3c36f091 ("ASoC: xlnx: add pcm formatter platform driver")
Assisted-by: opencode:deepseek-v4-flash-free
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
sound/soc/xilinx/xlnx_formatter_pcm.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/sound/soc/xilinx/xlnx_formatter_pcm.c b/sound/soc/xilinx/xlnx_formatter_pcm.c
index 7eba3a0205f1..b50306b0fc06 100644
--- a/sound/soc/xilinx/xlnx_formatter_pcm.c
+++ b/sound/soc/xilinx/xlnx_formatter_pcm.c
@@ -280,8 +280,7 @@ static irqreturn_t xlnx_mm2s_irq_handler(int irq, void *arg)
{
u32 val;
void __iomem *reg;
- struct device *dev = arg;
- struct xlnx_pcm_drv_data *adata = dev_get_drvdata(dev);
+ struct xlnx_pcm_drv_data *adata = arg;
reg = adata->mmio + XLNX_MM2S_OFFSET + XLNX_AUD_STS;
val = readl(reg);
@@ -299,8 +298,7 @@ static irqreturn_t xlnx_s2mm_irq_handler(int irq, void *arg)
{
u32 val;
void __iomem *reg;
- struct device *dev = arg;
- struct xlnx_pcm_drv_data *adata = dev_get_drvdata(dev);
+ struct xlnx_pcm_drv_data *adata = arg;
reg = adata->mmio + XLNX_S2MM_OFFSET + XLNX_AUD_STS;
val = readl(reg);
@@ -636,7 +634,7 @@ static int xlnx_formatter_pcm_probe(struct platform_device *pdev)
}
ret = devm_request_irq(dev, aud_drv_data->mm2s_irq,
xlnx_mm2s_irq_handler, 0,
- "xlnx_formatter_pcm_mm2s_irq", dev);
+ "xlnx_formatter_pcm_mm2s_irq", aud_drv_data);
if (ret) {
dev_err(dev, "xlnx audio mm2s irq request failed\n");
goto clk_err;
@@ -663,7 +661,7 @@ static int xlnx_formatter_pcm_probe(struct platform_device *pdev)
ret = devm_request_irq(dev, aud_drv_data->s2mm_irq,
xlnx_s2mm_irq_handler, 0,
"xlnx_formatter_pcm_s2mm_irq",
- dev);
+ aud_drv_data);
if (ret) {
dev_err(dev, "xlnx audio s2mm irq request failed\n");
goto clk_err;
--
2.55.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: xilinx: formatter_pcm: pass aud_drv_data to irq handlers
2026-08-06 23:32 [PATCH] ASoC: xilinx: formatter_pcm: pass aud_drv_data to irq handlers Rosen Penev
@ 2026-08-11 14:26 ` Michal Simek
2026-08-11 14:41 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Michal Simek @ 2026-08-11 14:26 UTC (permalink / raw)
To: Rosen Penev, linux-sound
Cc: Vincenzo Frascino, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, moderated list:ARM/ZYNQ ARCHITECTURE, open list,
Dhanunjanrao, Katta
On 8/7/26 01:32, Rosen Penev wrote:
> The irq handlers take a struct device pointer and call
> dev_get_drvdata() to obtain the driver data. However, the driver
> data is only set at the end of probe, after devm_request_irq(),
> so an interrupt taken in between causes the handlers to pass a
> NULL pointer to readl() and crash.
>
> Pass the private data directly as the devm_request_irq() argument
> instead of the device pointer, matching what the handlers expect.
>
> Fixes: 6f6c3c36f091 ("ASoC: xlnx: add pcm formatter platform driver")
> Assisted-by: opencode:deepseek-v4-flash-free
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
> sound/soc/xilinx/xlnx_formatter_pcm.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/sound/soc/xilinx/xlnx_formatter_pcm.c b/sound/soc/xilinx/xlnx_formatter_pcm.c
> index 7eba3a0205f1..b50306b0fc06 100644
> --- a/sound/soc/xilinx/xlnx_formatter_pcm.c
> +++ b/sound/soc/xilinx/xlnx_formatter_pcm.c
> @@ -280,8 +280,7 @@ static irqreturn_t xlnx_mm2s_irq_handler(int irq, void *arg)
> {
> u32 val;
> void __iomem *reg;
> - struct device *dev = arg;
> - struct xlnx_pcm_drv_data *adata = dev_get_drvdata(dev);
> + struct xlnx_pcm_drv_data *adata = arg;
>
> reg = adata->mmio + XLNX_MM2S_OFFSET + XLNX_AUD_STS;
> val = readl(reg);
> @@ -299,8 +298,7 @@ static irqreturn_t xlnx_s2mm_irq_handler(int irq, void *arg)
> {
> u32 val;
> void __iomem *reg;
> - struct device *dev = arg;
> - struct xlnx_pcm_drv_data *adata = dev_get_drvdata(dev);
> + struct xlnx_pcm_drv_data *adata = arg;
>
> reg = adata->mmio + XLNX_S2MM_OFFSET + XLNX_AUD_STS;
> val = readl(reg);
> @@ -636,7 +634,7 @@ static int xlnx_formatter_pcm_probe(struct platform_device *pdev)
> }
> ret = devm_request_irq(dev, aud_drv_data->mm2s_irq,
> xlnx_mm2s_irq_handler, 0,
> - "xlnx_formatter_pcm_mm2s_irq", dev);
> + "xlnx_formatter_pcm_mm2s_irq", aud_drv_data);
> if (ret) {
> dev_err(dev, "xlnx audio mm2s irq request failed\n");
> goto clk_err;
> @@ -663,7 +661,7 @@ static int xlnx_formatter_pcm_probe(struct platform_device *pdev)
> ret = devm_request_irq(dev, aud_drv_data->s2mm_irq,
> xlnx_s2mm_irq_handler, 0,
> "xlnx_formatter_pcm_s2mm_irq",
> - dev);
> + aud_drv_data);
> if (ret) {
> dev_err(dev, "xlnx audio s2mm irq request failed\n");
> goto clk_err;
Reviewed-by: Michal Simek <michal.simek@amd.com>
Thanks,
Michal
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: xilinx: formatter_pcm: pass aud_drv_data to irq handlers
2026-08-06 23:32 [PATCH] ASoC: xilinx: formatter_pcm: pass aud_drv_data to irq handlers Rosen Penev
2026-08-11 14:26 ` Michal Simek
@ 2026-08-11 14:41 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-08-11 14:41 UTC (permalink / raw)
To: linux-sound, Rosen Penev
Cc: Vincenzo Frascino, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
Michal Simek, Maruthi Srinivas Bayyavarapu, linux-arm-kernel,
linux-kernel
On Thu, 06 Aug 2026 16:32:31 -0700, Rosen Penev wrote:
> ASoC: xilinx: formatter_pcm: pass aud_drv_data to irq handlers
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.2
Thanks!
[1/1] ASoC: xilinx: formatter_pcm: pass aud_drv_data to irq handlers
https://git.kernel.org/broonie/sound/c/f12afefb7b01
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-11 16:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06 23:32 [PATCH] ASoC: xilinx: formatter_pcm: pass aud_drv_data to irq handlers Rosen Penev
2026-08-11 14:26 ` Michal Simek
2026-08-11 14:41 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox