Re: [PATCH v3 0/2] scsi: libsas: Support spinup notification for SAS devices
From: yangxingui
Date: Tue Aug 04 2026 - 05:37:22 EST
Hi John
On 2026/8/4 15:35, John Garry wrote:
On 03/08/2026 03:05, Xingui Yang wrote:
When a SAS device is in the Active_Wait or Idle_Wait power state, it
returns NOT_READY with ASC/ASCQ = 0x04/0x11 (notify (enable spinup)
required), indicating that a NOTIFY(ENABLE SPINUP) primitive is needed to
trigger media spinup.
Without handling this condition, the SCSI mid-layer will indefinitely retry
the command with ACTION_DELAYED_RETRY, resulting in the disk never spinning
up and becoming unusable. A typical manifestation is:
sd 4:0:9:0: [sde] Spinning up disk...
...not responding...
sd 4:0:9:0: [sde] Sense Key : Not Ready
sd 4:0:9:0: [sde] Add. Sense: Logical unit not ready, notify (enable spinup) required
To resolve this, the SAS controller needs to send a NOTIFY(ENABLE SPINUP)
primitive to the target phy, which transitions the device out of the
waiting state and allows normal spinup to proceed.
How would other SAS HBAs which use libsas handle this scenario? Since they have FW, would the FW automatically issue this NOTIFY(ENABLE SPINUP)?
I just wonder why hisi_sas seems to be only driver which would need this.
Thanks for the question. This affects only SAS HDDs. I checked pm8001, isci, and aic94xx — all handle NOTIFY(ENABLE SPINUP) at the driver level:
- pm8001: sends once at phy-up, then mdelay(200) — comment: "delay a moment to wait disk to spinup" — before notifying libsas.
- isci: enables hardware periodic insertion during link idle (ENABLE bit in notify_enable_spinup_control), cleared at phy stop.
- aic94xx: enables microcode periodic insertion during link idle (NOTIFY_TIMER_TIMEOUT = 500ms interval), stops at phy down.
hisi_sas also calls sl_notify_ssp() at phy-up, but the NOTIFY_EN bit is held for only 1ms — msleep(1) between setting and clearing — before immediately notifying libsas.
The root cause appears to be that 1ms is insufficient compared to pm8001's 200ms. An alternative to hisi_sas would be to simply increase the hold time in sl_notify_ssp() to match pm8001's approach, keeping the fix within hisi_sas.
Would you prefer this simpler approach, or do you still see value in the libsas-level sense detection and callback from hisi_sas? ^-^
Thanks,
Xingui Yang