From: Damien Le Moal <dlemoal@kernel.org>
To: linux-ide@vger.kernel.org, Niklas Cassel <cassel@kernel.org>
Subject: [PATCH v2 09/10] ata: libata-core: Reduce the number of messages signaling broken LPM
Date: Tue, 1 Jul 2025 09:14:07 +0900 [thread overview]
Message-ID: <20250701001408.330364-10-dlemoal@kernel.org> (raw)
In-Reply-To: <20250701001408.330364-1-dlemoal@kernel.org>
ata_dev_config_lpm() prints the message "LPM support broken, forcing
max_power" for devices that have the ATA_QUIRK_NOLPM quirk flag set.
This messages is repeated for every device revalidation, which is not
necessary, but also erroneously printed for devices without a broken LPM
support when connected to a port that does not support LPM (e.g. because
the port is an external one with hotplug capability).
Since in all cases the device port target_lpm_policy is set to
ATA_LPM_MAX_POWER, avoid the "LPM broken" message repetition and
erroneous output by generating it only if the port target_lpm_policy is
not already set to ATA_LPM_MAX_POWER.
This change will suppress the "LPM broken" message for genuine cases of
a device having broken LPM if the initial LPM policy is set to
ATA_LPM_MAX_POWER through CONFIG_SATA_MOBILE_LPM_POLICY. This is not a
problem as the ATA_LPM_MAX_POWER policy implies that LPM is disabled and
unused, which is safe for devices with broken LPM.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
---
drivers/ata/libata-core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index d1dff9018a3a..3e6cf26af4e4 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2819,7 +2819,8 @@ static void ata_dev_config_lpm(struct ata_device *dev)
dev->quirks |= ATA_QUIRK_NOLPM;
}
- if (dev->quirks & ATA_QUIRK_NOLPM) {
+ if (dev->quirks & ATA_QUIRK_NOLPM &&
+ ap->target_lpm_policy != ATA_LPM_MAX_POWER) {
ata_dev_warn(dev, "LPM support broken, forcing max_power\n");
ap->target_lpm_policy = ATA_LPM_MAX_POWER;
}
--
2.50.0
next prev parent reply other threads:[~2025-07-01 0:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-01 0:13 [PATCH v2 00/10] Improve link power management Damien Le Moal
2025-07-01 0:13 ` [PATCH v2 01/10] ata: libata-core: Introduce ata_dev_config_lpm() Damien Le Moal
2025-07-01 10:41 ` Niklas Cassel
2025-07-01 0:14 ` [PATCH v2 02/10] ata: libata-core: Move device LPM quirk settings to ata_dev_config_lpm() Damien Le Moal
2025-07-01 0:14 ` [PATCH v2 03/10] ata: libata-core: Advertize device support for DIPM and HIPM features Damien Le Moal
2025-07-01 0:14 ` [PATCH v2 04/10] ata: libata-eh: Avoid unnecessary resets when revalidating devices Damien Le Moal
2025-07-01 0:14 ` [PATCH v2 05/10] ata: libata-sata: Disallow changing LPM state if not supported Damien Le Moal
2025-07-01 0:14 ` [PATCH v2 06/10] ata: ahci: Disable DIPM if host lacks support Damien Le Moal
2025-07-01 0:14 ` [PATCH v2 07/10] ata: ahci: Disallow LPM policy control for external ports Damien Le Moal
2025-07-01 9:43 ` Niklas Cassel
2025-07-01 0:14 ` [PATCH v2 08/10] ata: ahci: Disallow LPM policy control if not supported Damien Le Moal
2025-07-01 9:44 ` Niklas Cassel
2025-07-01 0:14 ` Damien Le Moal [this message]
2025-07-01 0:14 ` [PATCH v2 10/10] ata: libata_eh: Add debug messages to ata_eh_link_set_lpm() Damien Le Moal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250701001408.330364-10-dlemoal@kernel.org \
--to=dlemoal@kernel.org \
--cc=cassel@kernel.org \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).