mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: core: Add a vop to handle vendor specific ops
@ 2026-03-19  9:38 Hongjie Fang
  2026-03-19 21:12 ` Bart Van Assche
  0 siblings, 1 reply; 4+ messages in thread
From: Hongjie Fang @ 2026-03-19  9:38 UTC (permalink / raw)
  To: avri.altman, bvanassche, peter.wang, beanhuo; +Cc: linux-kernel

add a vop to allow some vendors to do some additional ops
for some interrupts if necessary.

Signed-off-by: Hongjie Fang <hongjiefang@asrmicro.com>
---
 drivers/ufs/core/ufshcd-priv.h | 6 ++++++
 drivers/ufs/core/ufshcd.c      | 2 ++
 include/ufs/ufshcd.h           | 2 ++
 3 files changed, 10 insertions(+)

diff --git a/drivers/ufs/core/ufshcd-priv.h b/drivers/ufs/core/ufshcd-priv.h
index 37c32071e754..1d3dcbc2fda3 100644
--- a/drivers/ufs/core/ufshcd-priv.h
+++ b/drivers/ufs/core/ufshcd-priv.h
@@ -287,6 +287,12 @@ static inline u32 ufshcd_vops_freq_to_gear_speed(struct ufs_hba *hba, unsigned l
 	return 0;
 }
 
+static inline void ufshcd_vops_vendor_intr(struct ufs_hba *hba)
+{
+	if (hba->vops && hba->vops->vendor_intr)
+		hba->vops->vendor_intr(hba);
+}
+
 extern const struct ufs_pm_lvl_states ufs_pm_lvl_states[];
 
 /**
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 9ceb6d6d479d..be51418e09c2 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -7141,6 +7141,8 @@ static irqreturn_t ufshcd_sl_intr(struct ufs_hba *hba, u32 intr_status)
 {
 	irqreturn_t retval = IRQ_NONE;
 
+	ufshcd_vops_vendor_intr(hba);
+
 	if (intr_status & UFSHCD_UIC_MASK)
 		retval |= ufshcd_uic_cmd_compl(hba, intr_status);
 
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index 8563b6648976..a8eca8c22e7f 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -331,6 +331,7 @@ struct ufs_pwr_mode_info {
  * @config_esi: called to config Event Specific Interrupt
  * @config_scsi_dev: called to configure SCSI device parameters
  * @freq_to_gear_speed: called to map clock frequency to the max supported gear speed
+ * @vendor_intr: called before the interrupts handle
  */
 struct ufs_hba_variant_ops {
 	const char *name;
@@ -380,6 +381,7 @@ struct ufs_hba_variant_ops {
 	int	(*config_esi)(struct ufs_hba *hba);
 	void	(*config_scsi_dev)(struct scsi_device *sdev);
 	u32	(*freq_to_gear_speed)(struct ufs_hba *hba, unsigned long freq);
+	void    (*vendor_intr)(struct ufs_hba *hba);
 };
 
 /* clock gating state  */
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-23 17:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-19  9:38 [PATCH] scsi: ufs: core: Add a vop to handle vendor specific ops Hongjie Fang
2026-03-19 21:12 ` Bart Van Assche
2026-03-21  3:34   ` Fang Hongjie(方洪杰)
2026-03-23 17:29     ` Bart Van Assche

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®