Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Kui Sun <kui.sun@unisoc.com>
To: Alim Akhtar <alim.akhtar@samsung.com>,
	Avri Altman <avri.altman@sandisk.com>,
	Bart Van Assche <bvanassche@acm.org>,
	"James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: <linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<rain.zhang@unisoc.com>, <yuelin.tang@unisoc.com>,
	<wenchao.chen@unisoc.com>, <cixi.geng@linux.dev>
Subject: [PATCH] scsi: ufs: Allows the driver to choose the interrupt handler type
Date: Fri, 10 Jul 2026 14:59:48 +0800	[thread overview]
Message-ID: <20260710065948.467514-1-kui.sun@unisoc.com> (raw)

This capability allows the host controller driver to choose whether
To register interrupts in a threaded manner or in a
Standard (non-threaded) manner

Signed-off-by: Kui Sun <kui.sun@unisoc.com>
---
 drivers/ufs/core/ufshcd.c | 7 ++++++-
 include/ufs/ufshcd.h      | 7 +++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index d3044a3089b5..40fc6a60a4e7 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -11236,8 +11236,13 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
        ufshcd_readl(hba, REG_INTERRUPT_ENABLE);

        /* IRQ registration */
-       err = devm_request_threaded_irq(dev, irq, ufshcd_intr, ufshcd_threaded_intr,
+       if (hba->caps & UFSHCD_CAP_INTR_THREAD) {
+               err = devm_request_threaded_irq(dev, irq, ufshcd_intr, ufshcd_threaded_intr,
                                        IRQF_ONESHOT | IRQF_SHARED, UFSHCD, hba);
+       } else {
+               err = devm_request_irq(dev, irq, ufshcd_threaded_intr, IRQF_SHARED, UFSHCD, hba);
+       }
+
        if (err) {
                dev_err(hba->dev, "request irq failed\n");
                goto out_disable;
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index 248d0a5bef40..c1494a459b87 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -897,6 +897,13 @@ enum ufshcd_caps {
         * specific operations and TX Equaliztion Training procedure.
         */
        UFSHCD_CAP_TX_EQUALIZATION                      = 1 << 13,
+
+       /*
+        * This capability allows the host controller driver to choose whether
+        * to register interrupts in a threaded manner or in a standard
+        * (non-threaded) manner
+        */
+       UFSHCD_CAP_INTR_THREAD                          = 1 << 14,
 };

 struct ufs_hba_variant_params {
--
2.34.1

________________________________
 This email (including its attachments) is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Unauthorized use, dissemination, distribution or copying of this email or the information herein or taking any action in reliance on the contents of this email or the information herein, by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is strictly prohibited. If you are not the intended recipient, please do not read, copy, use or disclose any part of this e-mail to others. Please notify the sender immediately and permanently delete this e-mail and any attachments if you received it in error. Internet communications cannot be guaranteed to be timely, secure, error-free or virus-free. The sender does not accept liability for any errors or omissions.
本邮件及其附件具有保密性质,受法律保护不得泄露,仅发送给本邮件所指特定收件人。严禁非经授权使用、宣传、发布或复制本邮件或其内容。若非该特定收件人,请勿阅读、复制、 使用或披露本邮件的任何内容。若误收本邮件,请从系统中永久性删除本邮件及所有附件,并以回复邮件的方式即刻告知发件人。无法保证互联网通信及时、安全、无误或防毒。发件人对任何错漏均不承担责任。

             reply	other threads:[~2026-07-10  7:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10  6:59 Kui Sun [this message]
2026-07-10 11:29 ` [PATCH] scsi: ufs: Allows the driver to choose the interrupt handler type André Draszik
2026-07-10 12:45   ` André Draszik
2026-07-10 13:40 ` Bart Van Assche

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=20260710065948.467514-1-kui.sun@unisoc.com \
    --to=kui.sun@unisoc.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@sandisk.com \
    --cc=bvanassche@acm.org \
    --cc=cixi.geng@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=rain.zhang@unisoc.com \
    --cc=wenchao.chen@unisoc.com \
    --cc=yuelin.tang@unisoc.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