Linux ATA/IDE development
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: Niklas Cassel <cassel@kernel.org>, Tommy Kelly <linux@tkel.ly>,
	Damien Le Moal <dlemoal@kernel.org>, Tejun Heo <htejun@gmail.com>,
	Jeff Garzik <jeff@garzik.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-ide@vger.kernel.org, hare@suse.de
Subject: Re: [PATCH 0/3] ata: fix deferred QC handling for port multipliers
Date: Fri, 1 May 2026 15:19:03 +0100	[thread overview]
Message-ID: <4be77745-2b7d-416c-b01a-88669d9bbeb8@oracle.com> (raw)
In-Reply-To: <20260501125410.1204490-5-cassel@kernel.org>

On 01/05/2026 13:54, Niklas Cassel wrote:
> 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/
> 
> To me, this appears to be a problem in ata_pmp_qc_defer_cmd_switch() that
> has been there since this function was introduced. ap->excl_link did not
> always get set. This is fixed in patch 1/3.
> 
> While looking at the code, when using a PMP with CBS, it turns out that we
> are incorrectly using the deferred_qc feature that issues a QC via a
> workqueue, even for non-NCQ commands that are issued to another link
> (a link that is not the active link). This workqueue feature was meant to
> avoid dealing with non-NCQ vs NCQ commands for a single drive, not to
> duplicate the existing ap->excl_link logic. This is fixed in patch 2/3.
> 
> 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 3/3.
> 
> Tommy, it would be nice if you could apply this series and see if it solves
> your problem. Right now the series is compile tested only.
> 
> 

Hi Niklas,

As I understand, this deferred QC scheme was intended to solve 
starvation problems for multiqueue SAS HBAs (using libsas-based 
drivers). libsas has no port multiplier support, so I wonder why we make 
deferred QC scheme work for port multiplier, i.e. non-libsas scenario.

Thanks,
John

> Niklas Cassel (3):
>    ata: libata-pmp: fix ata_pmp_qc_defer_cmd_switch()
>    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  | 13 +++++---
>   drivers/ata/libata-scsi.c | 66 ++++++++++++++++++++++-----------------
>   include/linux/libata.h    |  6 ++--
>   5 files changed, 64 insertions(+), 45 deletions(-)
> 


  parent reply	other threads:[~2026-05-01 14:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01 12:54 [PATCH 0/3] ata: fix deferred QC handling for port multipliers Niklas Cassel
2026-05-01 12:54 ` [PATCH 1/3] ata: libata-pmp: fix ata_pmp_qc_defer_cmd_switch() Niklas Cassel
2026-05-01 12:54 ` [PATCH 2/3] ata: libata-scsi: do not use the deferred QC feature on PMPs with CBS Niklas Cassel
2026-05-01 12:54 ` [PATCH 3/3] ata: libata-scsi: do not needlessly defer commands when using PMP with FBS Niklas Cassel
2026-05-01 14:19 ` John Garry [this message]
2026-05-01 18:42   ` [PATCH 0/3] ata: fix deferred QC handling for port multipliers Niklas Cassel
2026-05-04  7:27     ` John Garry
2026-05-08 19:23       ` Niklas Cassel
2026-05-03  0:59 ` Tommy Kelly
2026-05-06  0:13   ` Tommy Kelly
2026-05-06  8:45     ` Heiko Stuebner
2026-05-06 15:00     ` Niklas Cassel
2026-05-06 14:52   ` Niklas Cassel

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=4be77745-2b7d-416c-b01a-88669d9bbeb8@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=hare@suse.de \
    --cc=htejun@gmail.com \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux@tkel.ly \
    --cc=martin.petersen@oracle.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