mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@amd.com>
To: Rosen Penev <rosenp@gmail.com>, linux-sound@vger.kernel.org
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	"moderated list:ARM/ZYNQ ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	"Dhanunjanrao, Katta" <katta.dhanunjanrao@amd.com>
Subject: Re: [PATCH] ASoC: xilinx: formatter_pcm: pass aud_drv_data to irq handlers
Date: Tue, 11 Aug 2026 16:26:22 +0200	[thread overview]
Message-ID: <98ddc5e1-0341-4c5e-9a80-e03c79a9660a@amd.com> (raw)
In-Reply-To: <20260806233231.30631-1-rosenp@gmail.com>



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

  reply	other threads:[~2026-08-11 14:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06 23:32 Rosen Penev
2026-08-11 14:26 ` Michal Simek [this message]
2026-08-11 14:41 ` Mark Brown

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=98ddc5e1-0341-4c5e-9a80-e03c79a9660a@amd.com \
    --to=michal.simek@amd.com \
    --cc=broonie@kernel.org \
    --cc=katta.dhanunjanrao@amd.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=rosenp@gmail.com \
    --cc=tiwai@suse.com \
    --cc=vincenzo.frascino@arm.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

all inboxes | Powered by JetHome®