Re: [PATCH v2 0/2] scsi: support spinup notification for SAS SSP devices in Active_Wait/Idle_Wait state

From: yangxingui

Date: Sun Jul 19 2026 - 22:37:38 EST


Kindly ping for review...

On 2026/7/3 10:28, Xingui Yang wrote:
When a SAS HDD connected via SSP (Serial Attached SCSI Protocol) is powered
up with the RNOT (Ready Not Optimized) bit set, the device enters the
Active_Wait or Idle_Wait power state per the SAS protocol specification. In
this state, the device does not respond to standard SCSI START_STOP spinup
commands and instead returns NOT_READY with ASC/ASCQ = 0x04/0x11 ("Logical
unit not ready, notify (enable spinup) required").

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.

This patch series addresses the issue:

Adds a new optional spinup_notify callback to struct scsi_host_template
in the SCSI mid-layer. When ASC/ASCQ = 0x04/0x11 is detected in
scsi_io_completion_action(), the callback is invoked before the mid-layer
falls through to ACTION_DELAYED_RETRY, giving the LLDD an opportunity to
perform controller-specific spinup notification.

Changes in v2 (addressing Sashiko AI review on v1):
- Add softirq context documentation to spinup_notify in scsi_host.h
- Defer sl_notify_ssp() to ordered workqueue, fixing msleep-in-
atomic bug, preventing RMW races on SL_CONTROL, and deduplicating
concurrent callbacks via queue_work()

Xingui Yang (2):
scsi: scsi_lib: add spinup_notify callback for ASC/ASCQ=0x04/0x11
scsi: hisi_sas: add spinup_notify callback to handle
Active_Wait/Idle_Wait SSP devices

drivers/scsi/hisi_sas/hisi_sas.h | 2 ++
drivers/scsi/hisi_sas/hisi_sas_main.c | 34 ++++++++++++++++++++++++++
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 1 +
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 1 +
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 +
drivers/scsi/scsi_lib.c | 4 +++
include/scsi/scsi_host.h | 12 +++++++++
7 files changed, 55 insertions(+)



Thanks,
Xingui