]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ata: libata: Print if port is external on boot
authorNiklas Cassel <cassel@kernel.org>
Mon, 12 May 2025 08:44:00 +0000 (10:44 +0200)
committerDamien Le Moal <dlemoal@kernel.org>
Wed, 14 May 2025 07:12:39 +0000 (16:12 +0900)
Commit affccb16c117 ("ata: ahci: print the lpm policy on boot") added a
lpm-pol print during boot, which shows the LPM policy used by each port.

While the LPM policy is usually determined by the Kconfig
CONFIG_SATA_MOBILE_LPM_POLICY, the Kconfig value is overridden e.g. if
firmware has marked the port as hotplug capable / external.

Commit f97106b10d9a ("ata: ahci: Add debug print for external port") did
add a debug print to show if LPM was disabled because firmware has marked
the port as external, however, because devices having broken LPM (even
though they claim to support it) is more common than one would have hoped,
print "ext" during boot if firmware has marked the port is external.

This will make it easier to debug certain LPM issues, e.g. if firmware has
enabled/marked only some of the ports as hotplug capable / external.

Before (port marked as external by firmware):
ata1: SATA max UDMA/133 abar m4096@0xfebd3000 port 0xfebd3100 irq 57 lpm-pol 0

After (port marked as external by firmware):
ata1: SATA max UDMA/133 abar m4096@0xfebd3000 port 0xfebd3100 irq 57 lpm-pol 0 ext

Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
include/linux/libata.h

index 98affa1d9136d276d404bf2dd4e1b0fad0cf8f8a..31be45fd47a616f0cce7195d2b6e7f4214962e15 100644 (file)
@@ -1618,6 +1618,8 @@ static inline void ata_port_desc_misc(struct ata_port *ap, int irq)
 {
        ata_port_desc(ap, "irq %d", irq);
        ata_port_desc(ap, "lpm-pol %d", ap->target_lpm_policy);
+       if (ap->pflags & ATA_PFLAG_EXTERNAL)
+               ata_port_desc(ap, "ext");
 }
 
 static inline bool ata_tag_internal(unsigned int tag)