public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Tommy Kelly <linux@tkel.ly>
Cc: cassel@kernel.org, linux-ide@vger.kernel.org
Subject: Re: [PATCH v2 0/2] ATA port deferred qc fixes
Date: Sun, 5 Apr 2026 08:45:09 +0200	[thread overview]
Message-ID: <fb468ef1-8500-43db-a4b4-7dea882a7cee@kernel.org> (raw)
In-Reply-To: <ce09cc21-a8e9-4845-b205-35411e22fba9@tkel.ly>

On 2026/04/02 11:22, Tommy Kelly wrote:
> On 2/20/26 14:14, Damien Le Moal wrote:
>> The first patch addresses a use-after-free issue when a deferred qc
>> times out. The second patch avoids a call to a potentially sleeping
>> function while a port spinlock is held.
>>
>> Changes from v1:
>>  - Corrected typo in patch 1 message, improved comment in code and added
>>    a WARN_ON_ONCE() call to verify that a timed out qc is not active.
>>  - Fixed patch 2 to not call ata_scsi_requeue_deferred_qc() without the
>>    port lock held. This call is in fact removed: it is not needed as
>>    ata_scsi_requeue_deferred_qc() is called in EH, which is always run
>>    when removing a port.
>>
>> Damien Le Moal (2):
>>   ata: libata-eh: correctly handle deferred qc timeouts
>>   ata: libata-core: fix cancellation of a port deferred qc work
>>
>>  drivers/ata/libata-core.c |  8 +++-----
>>  drivers/ata/libata-eh.c   | 22 +++++++++++++++++++---
>>  2 files changed, 22 insertions(+), 8 deletions(-)
>>
> 
> 
> Hello, this is my first message on the LKML so please forgive me for
> likely not following etiquette.
> 
> I have what might be a regression from somewhere in the recent series of
> NCQ / QC patches.
> 
> I have a peculiar setup that might reveal the source of the bug. I'm
> using a SATA Port Multiplier (PMP), powered by JMB575, which expands 1
> SATA port to 5 drives.
> The device/driver/subsystem tree looks like rk3568-dwc-ahci -> scsi -> sda.
> The platform does not (yet) support FIS-Based Switching (FBS), so it is
> using Command-Based Switching (CBS). FBS support may land in Linux 7.1.
> 
>> kernel: ahci-dwc fc800000.sata: flags: ncq sntf pm led clo only pmp fbs pio slum part ccc apst
>> kernel: ahci-dwc fc800000.sata: port 0 is not capable of FBS
> 
> When switching from kernel 6.18.13 to 6.19.7, drive access became
> extremely slow, causing lock timeouts at the filesystem level. I solved
> the problem by changing /sys/block/sd*/device/queue_depth from 32 to 1.

We may have a bad interaction between PMP CBS and the deferred QC fix, though I
do not see how as long as NCQ commands are the main workload. Not sure what is
going on and we'll need to dig on this. Though this will be difficult as all the
PMP I have are FBS. I do not have any command based switching port multiplier.

Note that because of I do not have manual access to our lab for a while, this
may take some time. Please be patient.

> I also looked through the recent LPM patches, but the drives'
> performance didn't improve after changing LPM settings for the scsi host
> in sysfs.
> 
> Let me know if I need to provide more details or logs. I can see
> COMRESET a lot in each device's SMART logs but they aren't timestamped
> so I haven't proved that they are recent. Perhaps the slow drive
> switching is causing command starvation.

Please send the relevant parts of dmesg showing these resets and what leads to
them (e.g. any error).

> 
> 
> Thank you,
> Tommy


-- 
Damien Le Moal
Western Digital Research

  reply	other threads:[~2026-04-05  6:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-20 22:14 [PATCH v2 0/2] ATA port deferred qc fixes Damien Le Moal
2026-02-20 22:14 ` [PATCH v2 1/2] ata: libata-eh: correctly handle deferred qc timeouts Damien Le Moal
2026-02-23 12:09   ` Hannes Reinecke
2026-02-23 17:48   ` Igor Pylypiv
2026-03-05 17:59   ` Guenter Roeck
2026-03-05 23:27     ` Niklas Cassel
2026-03-06  0:11       ` Damien Le Moal
2026-03-06  0:59         ` Damien Le Moal
2026-03-06  8:23           ` Niklas Cassel
2026-03-06  0:14       ` Guenter Roeck
2026-03-06  0:21         ` Damien Le Moal
2026-03-06  0:41           ` Guenter Roeck
2026-03-05 23:59     ` Damien Le Moal
2026-03-06  0:32       ` Guenter Roeck
2026-03-06  0:50         ` Damien Le Moal
2026-03-06  1:31           ` Guenter Roeck
2026-03-06  8:24           ` Niklas Cassel
2026-02-20 22:14 ` [PATCH v2 2/2] ata: libata-core: fix cancellation of a port deferred qc work Damien Le Moal
2026-02-23 12:09   ` Hannes Reinecke
2026-02-23 17:49   ` Igor Pylypiv
2026-02-24  0:39 ` [PATCH v2 0/2] ATA port deferred qc fixes Damien Le Moal
2026-04-02  9:22 ` Tommy Kelly
2026-04-05  6:45   ` Damien Le Moal [this message]
2026-04-12 18:22   ` 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=fb468ef1-8500-43db-a4b4-7dea882a7cee@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=cassel@kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux@tkel.ly \
    /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