Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 00/15] Add runtime PM support for libsas
@ 2021-12-20 11:21 chenxiang
  2021-12-20 11:21 ` [PATCH v2 01/15] libsas: Don't always drain event workqueue for HA resume chenxiang
                   ` (15 more replies)
  0 siblings, 16 replies; 21+ messages in thread
From: chenxiang @ 2021-12-20 11:21 UTC (permalink / raw)
  To: jejb, martin.petersen; +Cc: linux-scsi, linuxarm, john.garry, Xiang Chen

From: Xiang Chen <chenxiang66@hisilicon.com>

Currently the Hisilicon SAS controller v3 hw driver supports runtime PM.
However a number of corner-case bugs have been reported for this feature.
These includes:
a. If a directly-attached disk is removed when the host is suspended, a
system hang may occur during resuming. Libsas drains events after resuming
the host. Draining the events causes a deadlock as we need to ensure that
the host is resumed for some libsas events processing, however the resume
process will not complete until all events are processed;
b. If a disk is attached to an expander when the host is suspended then 
this new disk will not be detected when active again;
c. The host controller may not be resumed from suspension when sending 
SMP IOs;
d. If a phy comes up when resuming the host controller then we may get a
deadlock from processing of events DISCE_DISCOVER_DOMAIN and 
PORTE_BYTES_DMAED;
e. Similar to d., the work of PORTE_BROADCAST_RCVD and PORTE_BYTES_DMAED
may deadlock.

This series addresses those issues, briefly described as follows:
a. As far as we can see, this drain is unneeded, so conditionally remove it
in patch 1~2;
b. Just insert broadcast events to revalidate the topology in patch 4~7;
c. and e. When processing any events from the LLD, make libsas keep the
host active until finished processing all works related to the original
events in patch 9 and 14;
d. Defer phyup event processing in case described in patch 10~12;


Change Log:
v1 -> v2:
- Rewrite those commit messages according to John Garry's suggestions;
- Add my SOB for patch 2 and change SOB of John Garry's to Acked-by 
in patch 8 and 15; 

Alan Stern (1):
  scsi/block PM: Always set request queue runtime active in
    blk_post_runtime_resume()

John Garry (2):
  libsas: Don't always drain event workqueue for HA resume
  Revert "scsi: hisi_sas: Filter out new PHY up events during suspend"

Xiang Chen (12):
  scsi: libsas: Add spin_lock/unlock() to protect asd_sas_port->phy_list
  scsi: hisi_sas: Fix some issues related to asd_sas_port->phy_list
  scsi: mvsas: Add spin_lock/unlock() to protect asd_sas_port->phy_list
  scsi: libsas: Insert PORTE_BROADCAST_RCVD events for resuming host
  scsi: hisi_sas: Add more logs for runtime suspend/resume
  scsi: libsas: Resume host while sending SMP IOs
  scsi: libsas: Add flag SAS_HA_RESUMING
  scsi: libsas: Refactor sas_queue_deferred_work()
  scsi: libsas: Defer works of new phys during suspend
  scsi: hisi_sas: Keep controller active between ISR of phyup and the
    event being processed
  scsi: libsas: Keep host active while processing events
  scsi: hisi_sas: Use autosuspend for the host controller

 block/blk-pm.c                         | 22 +++-----
 drivers/scsi/hisi_sas/hisi_sas.h       |  1 +
 drivers/scsi/hisi_sas/hisi_sas_main.c  | 39 +++++++++----
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 24 ++++++--
 drivers/scsi/libsas/sas_event.c        | 77 +++++++++++++++++++++-----
 drivers/scsi/libsas/sas_expander.c     |  3 +
 drivers/scsi/libsas/sas_init.c         | 49 +++++++++++++++-
 drivers/scsi/libsas/sas_internal.h     |  2 +
 drivers/scsi/mvsas/mv_sas.c            |  5 ++
 drivers/scsi/scsi_pm.c                 |  2 +-
 include/linux/blk-pm.h                 |  2 +-
 include/scsi/libsas.h                  |  2 +
 12 files changed, 180 insertions(+), 48 deletions(-)

-- 
2.33.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2022-01-04 11:38 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-20 11:21 [PATCH v2 00/15] Add runtime PM support for libsas chenxiang
2021-12-20 11:21 ` [PATCH v2 01/15] libsas: Don't always drain event workqueue for HA resume chenxiang
2021-12-20 11:21 ` [PATCH v2 02/15] Revert "scsi: hisi_sas: Filter out new PHY up events during suspend" chenxiang
2021-12-20 11:21 ` [PATCH v2 03/15] scsi/block PM: Always set request queue runtime active in blk_post_runtime_resume() chenxiang
2021-12-20 11:21 ` [PATCH v2 04/15] scsi: libsas: Add spin_lock/unlock() to protect asd_sas_port->phy_list chenxiang
2021-12-20 11:21 ` [PATCH v2 05/15] scsi: hisi_sas: Fix some issues related to asd_sas_port->phy_list chenxiang
2021-12-27 17:25   ` Nathan Chancellor
2021-12-28  2:03     ` chenxiang (M)
2022-01-04 10:02       ` John Garry
2022-01-04 11:38         ` chenxiang (M)
2021-12-20 11:21 ` [PATCH v2 06/15] scsi: mvsas: Add spin_lock/unlock() to protect asd_sas_port->phy_list chenxiang
2021-12-20 11:21 ` [PATCH v2 07/15] scsi: libsas: Insert PORTE_BROADCAST_RCVD event for resuming host chenxiang
2021-12-20 11:21 ` [PATCH v2 08/15] scsi: hisi_sas: Add more logs for runtime suspend/resume chenxiang
2021-12-20 11:21 ` [PATCH v2 09/15] scsi: libsas: Resume host while sending SMP IOs chenxiang
2021-12-20 11:21 ` [PATCH v2 10/15] scsi: libsas: Add flag SAS_HA_RESUMING chenxiang
2021-12-20 11:21 ` [PATCH v2 11/15] scsi: libsas: Refactor sas_queue_deferred_work() chenxiang
2021-12-20 11:21 ` [PATCH v2 12/15] scsi: libsas: Defer works of new phys during suspend chenxiang
2021-12-20 11:21 ` [PATCH v2 13/15] scsi: hisi_sas: Keep controller active between ISR of phyup and the event being processed chenxiang
2021-12-20 11:21 ` [PATCH v2 14/15] scsi: libsas: Keep host active while processing events chenxiang
2021-12-20 11:21 ` [PATCH v2 15/15] scsi: hisi_sas: Use autosuspend for the host controller chenxiang
2021-12-23  4:39 ` [PATCH v2 00/15] Add runtime PM support for libsas Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox