From: Sasha Levin <sashal@kernel.org>
To: Johan Hovold <johan@kernel.org>
Cc: patches@lists.linux.dev, stable@vger.kernel.org,
Brian Norris <briannorris@chromium.org>,
Thomas Gleixner <tglx@linutronix.de>,
matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
Aleksandrs Vinarskis <alex.vinarskis@gmail.com>
Subject: Re: [PATCH AUTOSEL 6.15 092/110] genirq: Retain disable depth for managed interrupts across CPU hotplug
Date: Wed, 18 Jun 2025 11:11:51 -0400 [thread overview]
Message-ID: <aFLXN5Rbx_egQBeB@lappy> (raw)
In-Reply-To: <aELf3QmuEJOlR7Dv@hovoldconsulting.com>
On Fri, Jun 06, 2025 at 02:32:29PM +0200, Johan Hovold wrote:
>On Sun, Jun 01, 2025 at 07:24:14PM -0400, Sasha Levin wrote:
>> From: Brian Norris <briannorris@chromium.org>
>>
>> [ Upstream commit 788019eb559fd0b365f501467ceafce540e377cc ]
>>
>> Affinity-managed interrupts can be shut down and restarted during CPU
>> hotunplug/plug. Thereby the interrupt may be left in an unexpected state.
>> Specifically:
>>
>> 1. Interrupt is affine to CPU N
>> 2. disable_irq() -> depth is 1
>> 3. CPU N goes offline
>> 4. irq_shutdown() -> depth is set to 1 (again)
>> 5. CPU N goes online
>> 6. irq_startup() -> depth is set to 0 (BUG! driver expects that the interrupt
>> still disabled)
>> 7. enable_irq() -> depth underflow / unbalanced enable_irq() warning
>>
>> This is only a problem for managed interrupts and CPU hotplug, all other
>> cases like request()/free()/request() truly needs to reset a possibly stale
>> disable depth value.
>>
>> Provide a startup function, which takes the disable depth into account, and
>> invoked it for the managed interrupts in the CPU hotplug path.
>>
>> This requires to change irq_shutdown() to do a depth increment instead of
>> setting it to 1, which allows to retain the disable depth, but is harmless
>> for the other code paths using irq_startup(), which will still reset the
>> disable depth unconditionally to keep the original correct behaviour.
>>
>> A kunit tests will be added separately to cover some of these aspects.
>>
>> [ tglx: Massaged changelog ]
>>
>> Suggested-by: Thomas Gleixner <tglx@linutronix.de>
>> Signed-off-by: Brian Norris <briannorris@chromium.org>
>> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
>> Link: https://lore.kernel.org/all/20250514201353.3481400-2-briannorris@chromium.org
>> Signed-off-by: Sasha Levin <sashal@kernel.org>
>
>This one breaks suspend of laptops like the Lenovo ThinkPad T14s. Issue
>was just reported here by Alex:
>
> https://lore.kernel.org/lkml/24ec4adc-7c80-49e9-93ee-19908a97ab84@gmail.com/
>
>Please drop from all stable queues for now.
Will do, thanks!
--
Thanks,
Sasha
prev parent reply other threads:[~2025-06-18 17:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250601232435.3507697-1-sashal@kernel.org>
2025-06-01 23:23 ` [PATCH AUTOSEL 6.15 032/110] drm/amdgpu: Add basic validation for RAS header Sasha Levin
2025-06-01 23:23 ` [PATCH AUTOSEL 6.15 052/110] media: rkvdec: h264: Use bytesperline and buffer height as virstride Sasha Levin
2025-06-02 5:31 ` Greg KH
2025-06-01 23:23 ` [PATCH AUTOSEL 6.15 053/110] media: cec: extron-da-hd-4k-plus: Fix Wformat-truncation Sasha Levin
2025-06-01 23:24 ` [PATCH AUTOSEL 6.15 092/110] genirq: Retain disable depth for managed interrupts across CPU hotplug Sasha Levin
2025-06-06 12:32 ` Johan Hovold
2025-06-18 15:11 ` Sasha Levin [this message]
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=aFLXN5Rbx_egQBeB@lappy \
--to=sashal@kernel.org \
--cc=alex.vinarskis@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=briannorris@chromium.org \
--cc=johan@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=patches@lists.linux.dev \
--cc=stable@vger.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;
as well as URLs for NNTP newsgroup(s).