[PATCH] scsi: ufs: core: Add a vop to handle vendor specific ops
From: Hongjie Fang
Date: Thu Mar 19 2026 - 05:39:36 EST
add a vop to allow some vendors to do some additional ops
for some interrupts if necessary.
Signed-off-by: Hongjie Fang <hongjiefang@xxxxxxxxxxxx>
---
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