Linux ATA/IDE development
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ata: fix deferred QC handling for port multipliers
@ 2026-05-08 19:32 Niklas Cassel
  2026-05-08 19:32 ` [PATCH v2 1/2] ata: libata-scsi: do not use the deferred QC feature on PMPs with CBS Niklas Cassel
  2026-05-08 19:32 ` [PATCH v2 2/2] ata: libata-scsi: do not needlessly defer commands when using PMP with FBS Niklas Cassel
  0 siblings, 2 replies; 3+ messages in thread
From: Niklas Cassel @ 2026-05-08 19:32 UTC (permalink / raw)
  To: Tommy Kelly, Damien Le Moal, Niklas Cassel, Martin K. Petersen,
	John Garry
  Cc: linux-ide

Hello all,

Tommy Kelly reported a regression with PMP that use CBS:
https://lore.kernel.org/linux-ide/ce09cc21-a8e9-4845-b205-35411e22fba9@tkel.ly/

It turns out that the ap->excl_link logic used for PMP that use CBS is
incompatible with the deferred qc issuing via a workqueue.
This is fixed in patch 1/2.

While looking at the code, it turns out that the deferred qc issuing via
workqueue is misdesigned. It assumed that we can't mix NCQ and non-NCQ
commands on the same port. The limitation is that you can not mix NCQ and
non-NCQ commands on the same drive. However, with a PMP with FBS, you can
issue (mixed NCQ and non-NCQ commands) to the different drives. Thus, move
the saved deferred QC from struct ata_port to struct ata_link. This is
fixed in patch 2/2.


Changes since v1:
-As pointed out by Sashiko:
 https://sashiko.dev/#/patchset/20260501125410.1204490-5-cassel%40kernel.org?part=2
 My patch in v1 unintentionally changed the fairness of
 sata_pmp_qc_defer_cmd_switch().
-Add a code comment which explains how the ap->excl_link handling works.


Niklas Cassel (2):
  ata: libata-scsi: do not use the deferred QC feature on PMPs with CBS
  ata: libata-scsi: do not needlessly defer commands when using PMP with
    FBS

 drivers/ata/libata-core.c | 16 ++++---
 drivers/ata/libata-eh.c   |  8 ++--
 drivers/ata/libata-pmp.c  | 29 ++++++++++--
 drivers/ata/libata-scsi.c | 95 ++++++++++++++++++++++++---------------
 include/linux/libata.h    |  8 ++--
 5 files changed, 104 insertions(+), 52 deletions(-)

-- 
2.54.0


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

end of thread, other threads:[~2026-05-08 19:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-08 19:32 [PATCH v2 0/2] ata: fix deferred QC handling for port multipliers Niklas Cassel
2026-05-08 19:32 ` [PATCH v2 1/2] ata: libata-scsi: do not use the deferred QC feature on PMPs with CBS Niklas Cassel
2026-05-08 19:32 ` [PATCH v2 2/2] ata: libata-scsi: do not needlessly defer commands when using PMP with FBS Niklas Cassel

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