[PATCH v3 2/2] scsi: hisi_sas: Add lldd_notify_enable_spinup callback for SAS devices

Xingui Yang <[email protected]> Mon, 3 Aug 2026 10:05:36 +0800
Newsgroups org.kernel.vger.linux-scsi,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Register the lldd_notify_enable_spinup callback. The callback sends a
NOTIFY(ENABLE SPINUP) primitive via sl_notify_ssp() to trigger media spinup
on SAS devices in Active_Wait or Idle_Wait state.

Signed-off-by: Xingui Yang <[email protected]>
---
 drivers/scsi/hisi_sas/hisi_sas_main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 944ce19ae2fc..a726d6680386 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -2081,6 +2081,16 @@ static int hisi_sas_write_gpio(struct sas_ha_struct *sha, u8 reg_type,
 				reg_index, reg_count, write_data);
 }
 
+static void hisi_sas_notify_enable_spinup(struct asd_sas_phy *phy)
+{
+	struct hisi_sas_phy *hisi_phy =
+		container_of(phy, struct hisi_sas_phy, sas_phy);
+	struct hisi_hba *hisi_hba = hisi_phy->hisi_hba;
+
+	hisi_hba->hw->sl_notify_ssp(hisi_hba, phy->id);
+	dev_info(hisi_hba->dev, "phy%d notify enable spinup\n", phy->id);
+}
+
 static void hisi_sas_phy_disconnected(struct hisi_sas_phy *phy)
 {
 	struct asd_sas_phy *sas_phy = &phy->sas_phy;
@@ -2180,6 +2190,7 @@ static struct sas_domain_function_template hisi_sas_transport_ops = {
 	.lldd_write_gpio	= hisi_sas_write_gpio,
 	.lldd_tmf_aborted	= hisi_sas_tmf_aborted,
 	.lldd_abort_timeout	= hisi_sas_internal_abort_timeout,
+	.lldd_notify_enable_spinup = hisi_sas_notify_enable_spinup,
 };
 
 void hisi_sas_init_mem(struct hisi_hba *hisi_hba)
-- 
2.43.0