From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794321679; b=ObImqNnN7+k+oqO07pQig/p6WkND6uPzsN6rUgEwDXPu3l2Ebic+9W5QNN3nQXSSKW2I /QZ99+M7KFSppqFcmN4P7k7pfr3rvhY1kIzPDChVWYr7R+gtCsuxzqnun7UZYxhM4DX4G zIotfis/OuKuAhyJ85CPYVnXnQmDBCWUWYQPn1EDEACtWeabkLOKP4dzykXVuF4NsGvlt kz9q3P/NLxTSWmFxKUPgmNdzdBgtfazQlrwCVLX20OO9MDlNbQZ2uDf+xvTpJPwBU28z0 zfxg3qO7whHiQp4g12AJbH3ZA7zowIxNSmqgfiILAG+822uStsVgYWA6KmN87jG2xOQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794321679; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=mJB3GKwE6ZSRV+DDK93OBZrn7IZ2zXEYezrH8DN+TVU=; b=FyHaNoEVipz2EvphFrrlYkhvMOITIiqQ5A7BnuiEzsdXAg1SLpgDnICOA1Dazy2c9K38 4HJCx+xvq3TQjiCzUIW3oBoL3Z9Wx/NnSd2jdqHcJwXPLMm164+k7+BoT8PfiMtnd24qE a19yvH/aefCwLq57G20NcPVYDulgB2Xx9TlTBsEs7YYJyGbUDTn9hPjWmwxlmLRDicCln qToNnsFvrLwRxVCkazqvEbELMeayioB0MeqJcCt2GGF/hjEFY7bavnrwaLtvpmyyAQCjv ozycJii3IVEYzdU9qQ5/5D920LnS3w+1+Hm6wjVEp+dRs+CV8gpIRQXdDR5cloJN3wQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hYB965Yl; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4DE2606A31C for ; Tue, 10 Nov 2026 14:41:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hYB965Yl Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0740B1F008A1; Tue, 10 Nov 2026 14:41:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794321678; bh=mJB3GKwE6ZSRV+DDK93OBZrn7IZ2zXEYezrH8DN+TVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hYB965YlT+VrPwVF5lHEiMmlOsPJetqW3UpAsnRL4AyqBvNhQlhItlBss2nRJ7vzX x7IqSXdnlq0tUj6hHFXeVtWrehTmhpaL6xi4S4SMNh4CIPCRNwuUxSrVc5jzKPa1l+ zRKOYEU490S2gFQZyngUFrqIoaMTeuWxCW1PP1e4vpwb4xcFMsfNWbiAfQaPMqz0c2 6I1sx8cw198OTuWy2nmtmjmPOaZL8rBQGjA3hziAXS91ZK/hRrHvAyqKSHm6NnuixE 83Iozmy8onJ5asO2krkEN1x6MKCtz4LKBN3B0I8v9CuRoblV/pXJs45X4UAW8urn8i Av4ACnDUDsjDw== From: Sasha Levin To: stable@vger.kernel.org Cc: Niklas Cassel , Damien Le Moal , Sasha Levin Subject: [PATCH 5.10.y 1/2] ata: ahci: print the lpm policy on boot Date: Tue, 10 Nov 2026 09:41:14 -0500 Message-ID: <20261110144034.1942502-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261107061554-failed-5.10-34a4a34431ed@kernel.org> References: <20261107061554-failed-5.10-34a4a34431ed@kernel.org> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Niklas Cassel [ Upstream commit affccb16c117d188eb09495cbdea149cecbf00b9 ] The target LPM policy can be set using either a Kconfig or a kernel module parameter. However, if the board type is set to anything but board_ahci_low_power, then the LPM policy will overridden and set to ATA_LPM_UNKNOWN. Additionally, if the default suspend is suspend to idle, depending on the hardware capabilities of the HBA, ahci_update_initial_lpm_policy() might override the LPM policy to either ATA_LPM_MIN_POWER_WITH_PARTIAL or ATA_LPM_MIN_POWER. All this means that it is very hard to know which LPM policy a user will actually be using on a given system. In order to make it easier to debug LPM related issues, print the LPM policy on boot. One common LPM related issue is that the device fails to link up. Because of that, we cannot add this print to ata_dev_configure(), as that function is only called after a successful link up. Instead, add the info using ata_port_desc(), with the help of a new ata_port_desc_misc() helper. The port description is printed once per port during boot. Before changes: ata1: SATA max UDMA/133 abar m524288@0xa5780000 port 0xa5780100 irq 170 ata2: SATA max UDMA/133 abar m524288@0xa5780000 port 0xa5780180 irq 170 After changes: ata1: SATA max UDMA/133 abar m524288@0xa5780000 port 0xa5780100 irq 170 lpm-pol 4 ata2: SATA max UDMA/133 abar m524288@0xa5780000 port 0xa5780180 irq 170 lpm-pol 4 Signed-off-by: Niklas Cassel Signed-off-by: Damien Le Moal Stable-dep-of: 34a4a34431ed ("ata: libahci: Free the IRQs when activating a multi-IRQ host fails") Signed-off-by: Sasha Levin --- drivers/ata/libahci.c | 2 +- drivers/ata/libata-core.c | 2 +- drivers/ata/libata-sff.c | 10 +++++----- drivers/ata/pata_cs5520.c | 2 +- include/linux/libata.h | 5 +++++ 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 75ccd7872b7e8..32ebcfcb7914c 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -2578,7 +2578,7 @@ static int ahci_host_activate_multi_irqs(struct ata_host *host, if (rc) return rc; - ata_port_desc(host->ports[i], "irq %d", irq); + ata_port_desc_misc(host->ports[i], irq); } return ata_host_register(host, sht); diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 9be577e7c357c..2ff092c27d1f3 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -5886,7 +5886,7 @@ int ata_host_activate(struct ata_host *host, int irq, return rc; for (i = 0; i < host->n_ports; i++) - ata_port_desc(host->ports[i], "irq %d", irq); + ata_port_desc_misc(host->ports[i], irq); rc = ata_host_register(host, sht); /* if failed, just free the IRQ and leave ports alone */ diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 88bce10775afb..c6e91f06c751e 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c @@ -2405,7 +2405,7 @@ int ata_pci_sff_activate_host(struct ata_host *host, for (i = 0; i < 2; i++) { if (ata_port_is_dummy(host->ports[i])) continue; - ata_port_desc(host->ports[i], "irq %d", pdev->irq); + ata_port_desc_misc(host->ports[i], pdev->irq); } } else if (legacy_mode) { if (!ata_port_is_dummy(host->ports[0])) { @@ -2415,8 +2415,8 @@ int ata_pci_sff_activate_host(struct ata_host *host, if (rc) goto out; - ata_port_desc(host->ports[0], "irq %d", - ATA_PRIMARY_IRQ(pdev)); + ata_port_desc_misc(host->ports[0], + ATA_PRIMARY_IRQ(pdev)); } if (!ata_port_is_dummy(host->ports[1])) { @@ -2426,8 +2426,8 @@ int ata_pci_sff_activate_host(struct ata_host *host, if (rc) goto out; - ata_port_desc(host->ports[1], "irq %d", - ATA_SECONDARY_IRQ(pdev)); + ata_port_desc_misc(host->ports[1], + ATA_SECONDARY_IRQ(pdev)); } } diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c index 9052148b306d9..a78efb3f96f92 100644 --- a/drivers/ata/pata_cs5520.c +++ b/drivers/ata/pata_cs5520.c @@ -210,7 +210,7 @@ static int cs5520_init_one(struct pci_dev *pdev, const struct pci_device_id *id) if (rc) return rc; - ata_port_desc(ap, "irq %d", irq[i]); + ata_port_desc_misc(ap, irq[i]); } return ata_host_register(host, &cs5520_sht); diff --git a/include/linux/libata.h b/include/linux/libata.h index 1ceec830d5f74..12c43f39cd29b 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -1541,6 +1541,11 @@ void ata_port_desc(struct ata_port *ap, const char *fmt, ...); extern void ata_port_pbar_desc(struct ata_port *ap, int bar, ssize_t offset, const char *name); #endif +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); +} static inline bool ata_tag_internal(unsigned int tag) { -- 2.53.0