public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ata: libata-core: Add BRIDGE_OK quirk for QEMU drives
@ 2026-03-05 14:53 Pedro Falcato
  2026-03-05 15:06 ` Pedro Falcato
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Pedro Falcato @ 2026-03-05 14:53 UTC (permalink / raw)
  To: Damien Le Moal, Niklas Cassel
  Cc: linux-ide, linux-kernel, Pedro Falcato, stable

Currently, whenever you boot with a QEMU drive over an AHCI interface,
you get:
[    1.632121] ata1.00: applying bridge limits

This happens due to the kernel not believing the given drive is SATA,
since word 93 of IDENTIFY (ATA_ID_HW_CONFIG) is non-zero. The result is
a pretty severe limit in max_hw_sectors_kb, which limits our IO sizes.

QEMU has set word 93 erroneously for SATA drives but does not, in any
way, emulate any of these real hardware details. There is no PATA
drive and no SATA cable.

As such, add a BRIDGE_OK quirk for QEMU HARDDISK. Special care is taken
to limit this quirk to "2.5+", to allow for fixed future versions.

This results in the max_hw_sectors being limited solely by the
controller interface's limits. Which, for AHCI controllers, takes it
from 128KB to 32767KB.

Cc: stable@vger.kernel.org
Signed-off-by: Pedro Falcato <pfalcato@suse.de>
---
 drivers/ata/libata-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index d61846f03edc..c57e35ccc092 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4231,6 +4231,7 @@ static const struct ata_dev_quirks_entry __ata_dev_quirks[] = {
 	/* Devices that do not need bridging limits applied */
 	{ "MTRON MSP-SATA*",		NULL,	ATA_QUIRK_BRIDGE_OK },
 	{ "BUFFALO HD-QSU2/R5",		NULL,	ATA_QUIRK_BRIDGE_OK },
+	{ "QEMU HARDDISK",		"2.5+",	ATA_QUIRK_BRIDGE_OK },
 
 	/* Devices which aren't very happy with higher link speeds */
 	{ "WD My Book",			NULL,	ATA_QUIRK_1_5_GBPS },
-- 
2.53.0


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

* Re: [PATCH v2] ata: libata-core: Add BRIDGE_OK quirk for QEMU drives
  2026-03-05 14:53 [PATCH v2] ata: libata-core: Add BRIDGE_OK quirk for QEMU drives Pedro Falcato
@ 2026-03-05 15:06 ` Pedro Falcato
  2026-03-05 15:35 ` Hannes Reinecke
  2026-03-05 15:54 ` Niklas Cassel
  2 siblings, 0 replies; 4+ messages in thread
From: Pedro Falcato @ 2026-03-05 15:06 UTC (permalink / raw)
  To: Damien Le Moal, Niklas Cassel; +Cc: linux-ide, linux-kernel, stable

On Thu, Mar 05, 2026 at 02:53:12PM +0000, Pedro Falcato wrote:
> Currently, whenever you boot with a QEMU drive over an AHCI interface,
> you get:
> [    1.632121] ata1.00: applying bridge limits
> 
> This happens due to the kernel not believing the given drive is SATA,
> since word 93 of IDENTIFY (ATA_ID_HW_CONFIG) is non-zero. The result is
> a pretty severe limit in max_hw_sectors_kb, which limits our IO sizes.
> 
> QEMU has set word 93 erroneously for SATA drives but does not, in any
> way, emulate any of these real hardware details. There is no PATA
> drive and no SATA cable.
> 
> As such, add a BRIDGE_OK quirk for QEMU HARDDISK. Special care is taken
> to limit this quirk to "2.5+", to allow for fixed future versions.
> 
> This results in the max_hw_sectors being limited solely by the
> controller interface's limits. Which, for AHCI controllers, takes it
> from 128KB to 32767KB.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Pedro Falcato <pfalcato@suse.de>

Ugh, just noticed I forgot to pick up Damien's Rb, please add it when
applying, thanks!

-- 
Pedro

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

* Re: [PATCH v2] ata: libata-core: Add BRIDGE_OK quirk for QEMU drives
  2026-03-05 14:53 [PATCH v2] ata: libata-core: Add BRIDGE_OK quirk for QEMU drives Pedro Falcato
  2026-03-05 15:06 ` Pedro Falcato
@ 2026-03-05 15:35 ` Hannes Reinecke
  2026-03-05 15:54 ` Niklas Cassel
  2 siblings, 0 replies; 4+ messages in thread
From: Hannes Reinecke @ 2026-03-05 15:35 UTC (permalink / raw)
  To: Pedro Falcato, Damien Le Moal, Niklas Cassel
  Cc: linux-ide, linux-kernel, stable

On 3/5/26 15:53, Pedro Falcato wrote:
> Currently, whenever you boot with a QEMU drive over an AHCI interface,
> you get:
> [    1.632121] ata1.00: applying bridge limits
> 
> This happens due to the kernel not believing the given drive is SATA,
> since word 93 of IDENTIFY (ATA_ID_HW_CONFIG) is non-zero. The result is
> a pretty severe limit in max_hw_sectors_kb, which limits our IO sizes.
> 
> QEMU has set word 93 erroneously for SATA drives but does not, in any
> way, emulate any of these real hardware details. There is no PATA
> drive and no SATA cable.
> 
> As such, add a BRIDGE_OK quirk for QEMU HARDDISK. Special care is taken
> to limit this quirk to "2.5+", to allow for fixed future versions.
> 
> This results in the max_hw_sectors being limited solely by the
> controller interface's limits. Which, for AHCI controllers, takes it
> from 128KB to 32767KB.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Pedro Falcato <pfalcato@suse.de>
> ---
>   drivers/ata/libata-core.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index d61846f03edc..c57e35ccc092 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -4231,6 +4231,7 @@ static const struct ata_dev_quirks_entry __ata_dev_quirks[] = {
>   	/* Devices that do not need bridging limits applied */
>   	{ "MTRON MSP-SATA*",		NULL,	ATA_QUIRK_BRIDGE_OK },
>   	{ "BUFFALO HD-QSU2/R5",		NULL,	ATA_QUIRK_BRIDGE_OK },
> +	{ "QEMU HARDDISK",		"2.5+",	ATA_QUIRK_BRIDGE_OK },
>   
>   	/* Devices which aren't very happy with higher link speeds */
>   	{ "WD My Book",			NULL,	ATA_QUIRK_1_5_GBPS },

Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich

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

* Re: [PATCH v2] ata: libata-core: Add BRIDGE_OK quirk for QEMU drives
  2026-03-05 14:53 [PATCH v2] ata: libata-core: Add BRIDGE_OK quirk for QEMU drives Pedro Falcato
  2026-03-05 15:06 ` Pedro Falcato
  2026-03-05 15:35 ` Hannes Reinecke
@ 2026-03-05 15:54 ` Niklas Cassel
  2 siblings, 0 replies; 4+ messages in thread
From: Niklas Cassel @ 2026-03-05 15:54 UTC (permalink / raw)
  To: Pedro Falcato; +Cc: Damien Le Moal, linux-ide, linux-kernel, stable

On Thu, Mar 05, 2026 at 02:53:12PM +0000, Pedro Falcato wrote:
> Currently, whenever you boot with a QEMU drive over an AHCI interface,
> you get:
> [    1.632121] ata1.00: applying bridge limits
> 
> This happens due to the kernel not believing the given drive is SATA,
> since word 93 of IDENTIFY (ATA_ID_HW_CONFIG) is non-zero. The result is
> a pretty severe limit in max_hw_sectors_kb, which limits our IO sizes.
> 
> [...]


Added Damien's R-b tag, since the patch is essentially the same as V1.


Applied to libata/linux.git (libata-for-7.0-fixes), thanks!

[1/1] ata: libata-core: Add BRIDGE_OK quirk for QEMU drives
      https://git.kernel.org/libata/linux/c/b92b0075

Kind regards,
Niklas

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

end of thread, other threads:[~2026-03-05 15:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-05 14:53 [PATCH v2] ata: libata-core: Add BRIDGE_OK quirk for QEMU drives Pedro Falcato
2026-03-05 15:06 ` Pedro Falcato
2026-03-05 15:35 ` Hannes Reinecke
2026-03-05 15:54 ` Niklas Cassel

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