From: Adrian Hunter <adrian.hunter@intel.com>
To: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>,
Ulf Hansson <ulfh@kernel.org>
Cc: <linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mmc: sdhci-acpi: Fix free_irq() of a never requested IRQ
Date: Tue, 24 Nov 2026 08:16:19 +0200 [thread overview]
Message-ID: <1f6cefa9-497c-4803-a027-81e84f6a6e9f@intel.com> (raw)
In-Reply-To: <20261110070032.1387-1-laixiangwu@cmss.chinamobile.com>
On 10/11/2026 09:00, Xiangwu Lai wrote:
> qcom_probe_slot() stores the IRQ number from platform_get_irq() in
> *irq and requests it afterwards. When request_threaded_irq() fails,
> sdhci_acpi_probe() already jumps to the error path that calls
> qcom_free_slot(), but *irq still holds the positive IRQ number, so
> the (*irq < 0) guard in qcom_free_slot() does not catch it and
> free_irq() is called for an IRQ that was never requested, resulting
> in a "Trying to free already-free IRQ" warning.
>
> Reset *irq to the -EINVAL sentinel when the request fails, so
> qcom_free_slot() skips the free_irq() as intended.
>
> Fixes: 96ccb858093d ("sdhci: acpi: add qcom sdhci host reset quirk fix")
> Signed-off-by: laixiangwu <laixiangwu@cmss.chinamobile.com>
WARNING: From:/Signed-off-by: email name mismatch: 'From: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>' != 'Signed-off-by: laixiangwu <laixiangwu@cmss.chinamobile.com>'
Otherwise:
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> drivers/mmc/host/sdhci-acpi.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
> index 84c705460..85705d2eb 100644
> --- a/drivers/mmc/host/sdhci-acpi.c
> +++ b/drivers/mmc/host/sdhci-acpi.c
> @@ -412,6 +412,7 @@ static int qcom_probe_slot(struct platform_device *pdev, struct acpi_device *ade
> struct sdhci_acpi_host *c = platform_get_drvdata(pdev);
> struct sdhci_host *host = c->host;
> int *irq = sdhci_acpi_priv(c);
> + int ret;
>
> *irq = -EINVAL;
>
> @@ -422,9 +423,13 @@ static int qcom_probe_slot(struct platform_device *pdev, struct acpi_device *ade
> if (*irq < 0)
> return 0;
>
> - return request_threaded_irq(*irq, NULL, sdhci_acpi_qcom_handler,
> + ret = request_threaded_irq(*irq, NULL, sdhci_acpi_qcom_handler,
> IRQF_ONESHOT | IRQF_TRIGGER_HIGH,
> "sdhci_qcom", host);
> + if (ret)
> + *irq = -EINVAL;
> +
> + return ret;
> }
>
> static int qcom_free_slot(struct platform_device *pdev)
>
>
next prev parent reply other threads:[~2026-11-24 6:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 7:00 Xiangwu Lai
2026-11-24 4:42 ` Xiangwu Lai
2026-11-24 6:16 ` Adrian Hunter [this message]
2026-11-24 7:32 ` Xiangwu Lai
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=1f6cefa9-497c-4803-a027-81e84f6a6e9f@intel.com \
--to=adrian.hunter@intel.com \
--cc=laixiangwu@cmss.chinamobile.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ulfh@kernel.org \
/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®