From: Frank Li <Frank.li@oss.nxp.com>
To: Rosen Penev <rosenp@gmail.com>
Cc: linux-edac@vger.kernel.org, Frank Li <Frank.Li@nxp.com>,
Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
York Sun <york.sun@nxp.com>,
"open list:EDAC-FSL_DDR" <imx@lists.linux.dev>,
open list <linux-kernel@vger.kernel.org>,
"open list:CLANG/LLVM BUILD SUPPORT:Keyword:b(?i:clang|llvm)b"
<llvm@lists.linux.dev>
Subject: Re: [PATCHv2 2/3] EDAC/fsl_ddr: use non devm for request_irq()
Date: Fri, 31 Jul 2026 09:48:25 -0500 [thread overview]
Message-ID: <amy1ubRWGB7_rViV@SMW015318> (raw)
In-Reply-To: <20260731012130.1212640-3-rosenp@gmail.com>
On Thu, Jul 30, 2026 at 06:21:29PM -0700, Rosen Penev wrote:
> We need to tear down the irq before edac_mc_free() to avoid a use after
> free on teardown as request_irq uses mci as dev_id.
>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
> drivers/edac/fsl_ddr_edac.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/edac/fsl_ddr_edac.c b/drivers/edac/fsl_ddr_edac.c
> index 3745eec67335..c505fb268474 100644
> --- a/drivers/edac/fsl_ddr_edac.c
> +++ b/drivers/edac/fsl_ddr_edac.c
> @@ -599,7 +599,7 @@ int fsl_mc_err_probe(struct platform_device *op)
>
> /* register interrupts */
> pdata->irq = platform_get_irq(op, 0);
> - res = devm_request_irq(&op->dev, pdata->irq,
> + res = request_irq(pdata->irq,
> fsl_mc_isr,
> IRQF_SHARED,
> "[EDAC] MC err", mci);
> @@ -635,6 +635,7 @@ void fsl_mc_err_remove(struct platform_device *op)
>
> if (edac_op_state == EDAC_OPSTATE_INT) {
> ddr_out32(pdata, FSL_MC_ERR_INT_EN, 0);
> + free_irq(pdata->irq, mci);
I asked at v1.
it already disable hardware irq request,
synchronize_irq() should be enought to make sure finish current irq handle.
Frank
> }
>
> ddr_out32(pdata, FSL_MC_ERR_DISABLE,
> --
> 2.55.0
>
>
next prev parent reply other threads:[~2026-07-31 14:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 1:21 [PATCHv2 0/3] EDAC/fsl_ddr: some cleanups Rosen Penev
2026-07-31 1:21 ` [PATCHv2 1/3] EDAC/fsl_ddr: use devm_platform_ioremap_resource() Rosen Penev
2026-07-31 15:04 ` Frank Li
2026-07-31 17:14 ` Rosen Penev
2026-07-31 1:21 ` [PATCHv2 2/3] EDAC/fsl_ddr: use non devm for request_irq() Rosen Penev
2026-07-31 14:48 ` Frank Li [this message]
2026-07-31 1:21 ` [PATCHv2 3/3] EDAC/fsl_ddr: restore MC error registers on probe failure Rosen Penev
2026-07-31 14:57 ` Frank Li
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=amy1ubRWGB7_rViV@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@nxp.com \
--cc=bp@alien8.de \
--cc=imx@lists.linux.dev \
--cc=justinstitt@google.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=rosenp@gmail.com \
--cc=tony.luck@intel.com \
--cc=york.sun@nxp.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