]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ata: libata-acpi: Do not assume 40 wire cable if no devices are enabled
authorTasos Sahanidis <tasos@tasossah.com>
Mon, 19 May 2025 08:56:55 +0000 (11:56 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2025 13:59:49 +0000 (15:59 +0200)
commitda9a5486c604c59b35d0bb347056f4fd58de5081
tree3162c3e61d4f5d148ba540d2711c5413577d011a
parentac6fd02714513d1c0fa13dfd9041dfb197cfe3d7
ata: libata-acpi: Do not assume 40 wire cable if no devices are enabled

[ Upstream commit 33877220b8641b4cde474a4229ea92c0e3637883 ]

On at least an ASRock 990FX Extreme 4 with a VIA VT6330, the devices
have not yet been enabled by the first time ata_acpi_cbl_80wire() is
called. This means that the ata_for_each_dev loop is never entered,
and a 40 wire cable is assumed.

The VIA controller on this board does not report the cable in the PCI
config space, thus having to fall back to ACPI even though no SATA
bridge is present.

The _GTM values are correctly reported by the firmware through ACPI,
which has already set up faster transfer modes, but due to the above
the controller is forced down to a maximum of UDMA/33.

Resolve this by modifying ata_acpi_cbl_80wire() to directly return the
cable type. First, an unknown cable is assumed which preserves the mode
set by the firmware, and then on subsequent calls when the devices have
been enabled, an 80 wire cable is correctly detected.

Since the function now directly returns the cable type, it is renamed
to ata_acpi_cbl_pata_type().

Signed-off-by: Tasos Sahanidis <tasos@tasossah.com>
Link: https://lore.kernel.org/r/20250519085945.1399466-1-tasos@tasossah.com
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ata/libata-acpi.c
drivers/ata/pata_via.c
include/linux/libata.h