From: John Garry <john.g.garry@oracle.com>
To: Niklas Cassel <cassel@kernel.org>
Cc: 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>,
linux-ide@vger.kernel.org, hare@suse.de
Subject: Re: [PATCH 0/3] ata: fix deferred QC handling for port multipliers
Date: Mon, 4 May 2026 08:27:06 +0100 [thread overview]
Message-ID: <0f4458e2-cdb3-463b-a25c-5b2147e4e442@oracle.com> (raw)
In-Reply-To: <afT0INMUg7scssxk@fedora>
On 01/05/2026 19:42, Niklas Cassel wrote:
> On Fri, May 01, 2026 at 03:19:03PM +0100, John Garry wrote:
>> On 01/05/2026 13:54, Niklas Cassel wrote:
>>
>> 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.
>
> Are you certain that there are no libsas HBAs that support port
> multipliers?
No, I am just saying that libsas does not support port multipliers, see
earlier effort @
https://lore.kernel.org/linux-scsi/1398346023-10225-1-git-send-email-yxlraid@gmail.com/
See this today:
int sas_discover_sata(struct domain_device *dev)
{
if (dev->dev_type == SAS_SATA_PM)
return -ENODEV;
>
>
> Basically, before commit:
> 0ea84089dbf6 ("ata: libata-scsi: avoid Non-NCQ command starvation")
>
> We always aborted a new command, if that would have caused NCQ and non-NCQ
> commands to be mixed on the same device.
> Regardless if libsas driver or any other SATA driver, e.g. AHCI.
>
>
> After commit:
> 0ea84089dbf6 ("ata: libata-scsi: avoid Non-NCQ command starvation")
> If sending a non-NCQ command while NCQ commands are in flight,
> we instead save the non-NCQ command and issue it as soon all NCQ
> commands are finished, from a workqueue.
>
> This commit changed the behavior both for libsas based drivers and
> all other SATA drivers, including AHCI, which does support Port
> Multipliers.
>
> As you might now, Port Multipliers are not that common, and I think
> simply no one tested the change on Port Multipliers before the change
> was included.
>
>
> As you can see in patch 2/3, we basically stop using this deferred QC
> issuing via workqueue for Port Multipliers with CBS - when sending
> commands to different devices.
>
> For Port Multipliers with FBS support, or PMPs with CBS support where
> issuing commands within the same drive, we are still using it.
>
> For PMPs with FBS, I don't see any problem of keep using the workqueue
> to issue a deferred QC. It should basically be the same as if directly
> connected on the port. (There is no extra logic to handle ap->excl_link.)
>
>
> For PMPs with CBS, we could keep the same behavior as before, and just
> abort the command, if NCQ and non-NCQ are mixed.
>
> The advantage is that the workqueue issuing would not be able to somehow
> collide with the ap->excl_link handling for CBS PMPs. Looking at the code,
> it "should work", because we always will always have ATA_QCFLAG_CLEAR_EXCL
> set on the QC issued by the workqueue.
>
> This would require that we know that PMPs (with CBS) can't be used on
> libsas based HBAs.
Please see above.
> Hell, we could probably do that if we wanted to, since
> I don't think that people using an expense SAS HBA with a cheap CBS PMP
> (does not not even support FBS) is very common in practice.,,
Yes, SAS has expanders for this purpose.
Thanks,
John
next prev parent reply other threads:[~2026-05-04 7:27 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 ` [PATCH 0/3] ata: fix deferred QC handling for port multipliers John Garry
2026-05-01 18:42 ` Niklas Cassel
2026-05-04 7:27 ` John Garry [this message]
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=0f4458e2-cdb3-463b-a25c-5b2147e4e442@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