Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: Xingui Yang <yangxingui@huawei.com>,
	yanaijie@huawei.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linuxarm@huawei.com, liuyonglong@huawei.com,
	kangfenglong@huawei.com
Subject: Re: [PATCH v3 0/2] scsi: libsas: Support spinup notification for SAS devices
Date: Tue, 4 Aug 2026 08:35:21 +0100	[thread overview]
Message-ID: <e34a40de-474c-4a3c-8013-726d473bc79c@oracle.com> (raw)
In-Reply-To: <20260803020536.546544-1-yangxingui@huawei.com>

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.

> This patch series addresses the issue entirely within the SAS transport
> layer (libsas), reusing the existing phy event framework, without modifying
> the generic SCSI mid-layer. This addresses the review feedback from
> John Garry on v2.
> 
> Changes in v3 (addressing John Garry's review on v2):
> - Move spinup notification from scsi_host_template to libsas. Reuse
>    the existing phy event framework: add PHYE_NOTIFY_ENABLE_SPINUP
>    and lldd_notify_enable_spinup callback.
> - Sense detection in sas_ssp_task_response() covers all SAS LLDDs.
> 
> 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: libsas: Add PHYE_NOTIFY_ENABLE_SPINUP phy event for
>      ASC/ASCQ=0x04/0x11
>    scsi: hisi_sas: Add lldd_notify_enable_spinup callback for SAS devices
> 
>   drivers/scsi/hisi_sas/hisi_sas_main.c | 11 +++++++
>   drivers/scsi/libsas/sas_internal.h    |  2 ++
>   drivers/scsi/libsas/sas_phy.c         | 12 +++++++
>   drivers/scsi/libsas/sas_scsi_host.c   | 45 +++++++++++++++++++++++++++
>   drivers/scsi/libsas/sas_task.c        |  2 ++
>   include/scsi/libsas.h                 |  9 ++++++
>   6 files changed, 81 insertions(+)
> 


  parent reply	other threads:[~2026-08-04  7:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03  2:05 [PATCH v3 0/2] scsi: libsas: Support spinup notification for SAS devices Xingui Yang
2026-08-03  2:05 ` [PATCH v3 1/2] scsi: libsas: Add PHYE_NOTIFY_ENABLE_SPINUP phy event for ASC/ASCQ=0x04/0x11 Xingui Yang
2026-08-03  4:17   ` sashiko-bot
2026-08-03  2:05 ` [PATCH v3 2/2] scsi: hisi_sas: Add lldd_notify_enable_spinup callback for SAS devices Xingui Yang
2026-08-03  2:36   ` sashiko-bot
2026-08-04  7:35 ` John Garry [this message]
2026-08-04  9:30   ` [PATCH v3 0/2] scsi: libsas: Support spinup notification " yangxingui
2026-08-05 11:43     ` John Garry
2026-08-06  1:45       ` yangxingui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e34a40de-474c-4a3c-8013-726d473bc79c@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=jejb@linux.ibm.com \
    --cc=kangfenglong@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liuyonglong@huawei.com \
    --cc=martin.petersen@oracle.com \
    --cc=yanaijie@huawei.com \
    --cc=yangxingui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox