From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
To: Guenter Roeck <linux@roeck-us.net>, Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, Linux PM <linux-pm@vger.kernel.org>,
linux-acpi <linux-acpi@intel.com>,
rafael@kernel.org
Subject: Re: [PATCH] genirq/PM: Always unlock IRQ descriptor in rearm_wake_irq
Date: Tue, 11 Aug 2020 21:21:49 +0200 [thread overview]
Message-ID: <a009f2e5-8bf9-fc7d-ece6-0ee2e4381cc1@intel.com> (raw)
In-Reply-To: <20200811180001.80203-1-linux@roeck-us.net>
On 8/11/2020 8:00 PM, Guenter Roeck wrote:
> rearm_wake_irq() does not unlock the irq descriptor if the interrupt
> is not suspended or if wakeup is not enabled on it. Fix it.
>
> Fixes: 3a79bc63d9075 ("PCI: irq: Introduce rearm_wake_irq()")
> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
And it needs to go to -stable (even though the bug is latent now,
because this function is called for suspended IRQs only AFAICS).
Or I can apply this as the mistake was in my commit. Please let me know
what you prefer.
> ---
> kernel/irq/pm.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/irq/pm.c b/kernel/irq/pm.c
> index 8f557fa1f4fe..c6c7e187ae74 100644
> --- a/kernel/irq/pm.c
> +++ b/kernel/irq/pm.c
> @@ -185,14 +185,18 @@ void rearm_wake_irq(unsigned int irq)
> unsigned long flags;
> struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
>
> - if (!desc || !(desc->istate & IRQS_SUSPENDED) ||
> - !irqd_is_wakeup_set(&desc->irq_data))
> + if (!desc)
> return;
>
> + if (!(desc->istate & IRQS_SUSPENDED) ||
> + !irqd_is_wakeup_set(&desc->irq_data))
> + goto unlock;
> +
> desc->istate &= ~IRQS_SUSPENDED;
> irqd_set(&desc->irq_data, IRQD_WAKEUP_ARMED);
> __enable_irq(desc);
>
> +unlock:
> irq_put_desc_busunlock(desc, flags);
> }
>
next prev parent reply other threads:[~2020-08-11 19:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-11 18:00 Guenter Roeck
2020-08-11 19:21 ` Rafael J. Wysocki [this message]
2020-08-12 9:13 ` [tip: irq/urgent] genirq/PM: Always unlock IRQ descriptor in rearm_wake_irq() tip-bot2 for Guenter Roeck
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=a009f2e5-8bf9-fc7d-ece6-0ee2e4381cc1@intel.com \
--to=rafael.j.wysocki@intel.com \
--cc=linux-acpi@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=rafael@kernel.org \
--cc=tglx@linutronix.de \
/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®