Re: [PATCH] ata: libata-sata: allow re-enabling NCQ with the same queue_depth
From: Niklas Cassel
Date: Mon Nov 02 2026 - 05:37:17 EST
On Thu, 29 Oct 2026 11:44:45 -0700, Igor Pylypiv wrote:
> When ata_eh_speed_down() disables NCQ due to excessive errors, it sets
> ATA_DFLAG_NCQ_OFF without changing sdev->queue_depth. Userspace can
> re-enable NCQ by writing a queue depth > 1 to the sysfs queue_depth
> attribute, which invokes ata_change_queue_depth() to clear
> ATA_DFLAG_NCQ_OFF.
>
> However, ata_change_queue_depth() returns early if the requested
> queue_depth is equal to sdev->queue_depth before clearing
> ATA_DFLAG_NCQ_OFF. As a result, writing a different queue depth > 1
> re-enables NCQ, whereas writing the current sdev->queue_depth value
> leaves ATA_DFLAG_NCQ_OFF set.
>
> [...]
Applied to libata/linux.git (for-7.4-fixes), thanks!
[1/1] ata: libata-sata: allow re-enabling NCQ with the same queue_depth
https://git.kernel.org/libata/linux/c/d7c5cc8c
Kind regards,
Niklas