Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 0/4] scsi: hisi_sas: Some misc fixes
@ 2026-10-08  3:26 Xingui Yang
  2026-10-08  3:26 ` [PATCH v2 1/4] scsi: libsas: Fix out-of-bounds memcpy in sas_ssp_task_response() Xingui Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Xingui Yang @ 2026-10-08  3:26 UTC (permalink / raw)
  To: mkp, jejb, john.garry, yanaijie
  Cc: linux-scsi, linux-kernel, linuxarm, liuyonglong, kangfenglong

This series contains three independent fixes for the hisi_sas driver,
plus a libsas fix found during review.

Patch 1 fixes an out-of-bounds memcpy in sas_ssp_task_response(): a
device-provided sense_data_len >= 0x80000000 turns negative in the
min_t(int, ...) clamp and becomes a huge memcpy length.

Patch 2 fixes incorrect delay values introduced by a previous
magic-number cleanup commit. Three delay sites were changed to use
a single macro (value 100) which did not match their original values,
causing increased boot and shutdown time.

Patch 3 clears stale PHY error counts on phyup so that error detection
is not misled by intermediate errors generated during link
establishment.

Patch 4 fixes spinup failures of directly-attached SAS HDDs that power
up in the Active_Wait state and wait for a NOTIFY(ENABLE SPINUP)
primitive before becoming ready: parse the sense data in the slot
completion path and send the primitive from deferred work.

Changes from v1:

- Patch 1 is new, found in review of the sense parsing of patch 4.
- Patch 2 (v1 patch 1) is unchanged.
- Patch 3 (v1 patch 2) now clears the counters under phy->lock with
  the error interrupts masked around the CHL_INT2 status write, drops
  the broken print gate on the cumulative counters, and replaces the
  open-coded RX error bit mask with the CHL_INT2_RX_ERR_MSK macro.
- Patch 4 (v1 patch 3) now takes a runtime PM reference for the
  deferred work, pairing with pm_runtime_put_sync() in the work, and
  uses the 16-bit LU_NOT_READY_NOTIFY_REQUIRED definition from
  scsi_sense.h instead of local ASC/ASCQ macros.

The remaining review findings are pre-existing issues, left for
separate fixes:

  - lockless SL_CONTROL read-modify-write between
    sl_notify_ssp_v3_hw() and phy_down_v3_hw() (hardirq)
  - _suspend_v3_hw() flush/interrupt-disable ordering versus late
    work queued by the threaded CQ handlers

The 50 ms wait in disable_phy_v3_hw() for the PHY to leave the up
state is a hardware requirement and is left as is.

Xingui Yang (4):
  scsi: libsas: Fix out-of-bounds memcpy in sas_ssp_task_response()
  scsi: hisi_sas: Fix incorrect delay values from magic-number cleanup
  scsi: hisi_sas: Clear PHY error counts on phyup
  scsi: hisi_sas: Fix spinup failure for SAS SSP devices in Active_Wait
    state

 drivers/scsi/hisi_sas/hisi_sas.h       |  3 ++
 drivers/scsi/hisi_sas/hisi_sas_main.c  | 42 ++++++++++++++++++++++
 drivers/scsi/hisi_sas/hisi_sas_v1_hw.c |  3 ++
 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c |  3 ++
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 48 +++++++++++++++++---------
 drivers/scsi/libsas/sas_task.c         |  2 +-
 6 files changed, 84 insertions(+), 17 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-10-09  1:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-08  3:26 [PATCH v2 0/4] scsi: hisi_sas: Some misc fixes Xingui Yang
2026-10-08  3:26 ` [PATCH v2 1/4] scsi: libsas: Fix out-of-bounds memcpy in sas_ssp_task_response() Xingui Yang
2026-10-08  3:26 ` [PATCH v2 2/4] scsi: hisi_sas: Fix incorrect delay values from magic-number cleanup Xingui Yang
2026-10-08  3:35   ` sashiko-bot
2026-10-08  3:26 ` [PATCH v2 3/4] scsi: hisi_sas: Clear PHY error counts on phyup Xingui Yang
2026-10-08  3:41   ` sashiko-bot
2026-10-09  1:01     ` yangxingui
2026-10-08  3:26 ` [PATCH v2 4/4] scsi: hisi_sas: Fix spinup failure for SAS SSP devices in Active_Wait state Xingui Yang
2026-10-08  3:46   ` sashiko-bot

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