From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Gregory CLEMENT <gregory.clement@bootlin.com>
Cc: "Bart Van Assche" <bvanassche@acm.org>,
"Alim Akhtar" <alim.akhtar@samsung.com>,
"Avri Altman" <avri.altman@sandisk.com>,
"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
"Clark Williams" <clrkwllms@kernel.org>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
"Benoît Monin" <benoit.monin@bootlin.com>,
"Théo Lebrun" <theo.lebrun@bootlin.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-rt-devel@lists.linux.dev
Subject: Re: [PATCH] scsi: ufs: core: Avoid sleeping in hard interrupt context when PREEMP_RT is enabled.
Date: Wed, 15 Jul 2026 17:25:00 +0200 [thread overview]
Message-ID: <20260715152500.iY9-Bp-R@linutronix.de> (raw)
In-Reply-To: <87v7ag5loj.fsf@BLaptop.bootlin.com>
On 2026-07-15 17:15:08 [+0200], Gregory CLEMENT wrote:
> Hello Sebastian,
Hi,
> > If MCQ is enabled then request_threaded_irq(, mask_interrupt_only,
> > ufshcd_threaded_intr, IRQF_NO_THREAD)
> >
>
> I'm implementing your solution to see if it fixes the issue without
> introducing a regression., but I'm puzzled by this previous line:
> `mask_interrupt_only ??`.
mask_interrupt_only means the function would mask the interrupt in the
device (UFS) hardware so the IRQ does not raise again once interrupts
are enabled again. The ufshcd_threaded_intr() routine would then have to
unmask the interrupt at the end of its doing so the IRQ can raise again.
> Also, I don't understand why `IRQF_NO_THREAD` is used for the threaded
> IRQ; it seems to indicate opposite behavior. Could you please explain
> what you have in mind ?
The previous without IRQF_NO_THREAD provide a primary handler just
masking the IRQ line and a threaded handler. One thread visible in the
system.
With `threadirqs' or PREEMPT_RT enabled the IRQ core will thread the
primary handler (masking just the IRQ line) and the threaded handler
which does the work. So you will see two threads. Also the interrupt
line will be masked (in the IRQ-chip) as long the two handler are
running. ps will show two threads.
To limit this, IRQF_NO_THREAD will ensure that the primary handler
(which masks the IRQ line in the device's HW) will not be threaded. It
is brief, takes no locks so why not. The secondary handler is the only
thread. The IRQ will also not be masked in the IRQ-chip.
> Grégory
>
Sebastian
prev parent reply other threads:[~2026-07-15 15:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 9:55 [PATCH] scsi: ufs: core: Avoid sleeping in hard interrupt context when PREEMP_RT is enabled Gregory CLEMENT
2026-06-30 10:23 ` sashiko-bot
2026-06-30 10:28 ` Gregory CLEMENT
2026-06-30 14:15 ` Sebastian Andrzej Siewior
2026-07-06 14:30 ` Bart Van Assche
2026-07-06 15:20 ` Sebastian Andrzej Siewior
2026-07-15 15:15 ` Gregory CLEMENT
2026-07-15 15:25 ` Sebastian Andrzej Siewior [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=20260715152500.iY9-Bp-R@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=James.Bottomley@hansenpartnership.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@sandisk.com \
--cc=benoit.monin@bootlin.com \
--cc=bvanassche@acm.org \
--cc=clrkwllms@kernel.org \
--cc=gregory.clement@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=rostedt@goodmis.org \
--cc=theo.lebrun@bootlin.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=vladimir.kondratiev@mobileye.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.