All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Niklas Cassel" <cassel@kernel.org>
Cc: linux-ide@vger.kernel.org, dlemoal@kernel.org, cassel@kernel.org
Subject: Re: [PATCH 1/2] ata: libata-core: Disable LPM on some WD drives
Date: Tue, 28 Jul 2026 11:22:00 +0000	[thread overview]
Message-ID: <20260728112200.B99F21F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260728111310.722450-5-cassel@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Incorrect loop iteration in `ata_scsi_lpm_supported` completely ignores `ATA_QUIRK_NOLPM` for devices attached via a Port Multiplier.
--

--- Patch [1]: [PATCH 1/2] ata: libata-core: Disable LPM on some WD drives ---
commit ddcafc7d1d056ed46964475cc9dcb5abcb0d3b87
Author: Niklas Cassel <cassel@kernel.org>

ata: libata-core: Disable LPM on some WD drives

This commit adds the ATA_QUIRK_NOLPM quirk for specific WD drives that
have problems with Link Power Management (LPM).

Link: https://bugzilla.kernel.org/show_bug.cgi?id=220693

> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index c43bd28b20b1a..15781b4f04897 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -4413,6 +4413,14 @@ static const struct ata_dev_quirks_entry __ata_dev_quirks[] = {
>  	{ "WDC WD3000JD-*",		NULL,	ATA_QUIRK_WD_BROKEN_LPM },
>  	{ "WDC WD3200JD-*",		NULL,	ATA_QUIRK_WD_BROKEN_LPM },
>  
> +	/*
> +	 * WD drives with LPM issues (irrespective of supported SATA speeds).
> +	 * (Unlike ATA_QUIRK_WD_BROKEN_LPM, which is only applied if the drive
> +	 * exposes SATA Gen1 speed support, and SATA Gen1 speed support only.)
> +	 */
> +	{ "WDC WD100EFGX-68CPLN0",	NULL,	ATA_QUIRK_NOLPM },
> +	{ "WDC WD102KFBX-68M95N0",	NULL,	ATA_QUIRK_NOLPM },

[Severity: High]
This is a pre-existing issue, but will these devices still experience LPM
issues if they are attached via a Port Multiplier?

Looking at ata_scsi_lpm_supported() in drivers/ata/libata-sata.c:

static bool ata_scsi_lpm_supported(struct ata_port *ap)
{
	struct ata_link *link;
	struct ata_device *dev;

	if ((ap->flags & ATA_FLAG_NO_LPM) || !ap->ops->set_lpm)
		return false;

	ata_for_each_link(link, ap, EDGE) {
		ata_for_each_dev(dev, &ap->link, ENABLED) {
			if (dev->quirks & ATA_QUIRK_NOLPM)
				return false;
		}
	}

	return true;
}

The outer loop correctly iterates over all links, including PMP links, but
the inner loop iterates over &ap->link instead of the current link being
evaluated.

Could this cause the code to repeatedly check the host link's devices while
entirely ignoring devices on PMP links? If so, the ATA_QUIRK_NOLPM quirk
might be bypassed for these buggy drives when they are attached via a Port
Multiplier and power management is configured.

> +
>  	/*
>  	 * This sata dom device goes on a walkabout when the ATA_LOG_DIRECTORY
>  	 * log page is accessed. Ensure we never ask for this log page with

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260728111310.722450-4-cassel@kernel.org?part=1

  reply	other threads:[~2026-07-28 11:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28 11:13 [PATCH 0/2] ata: disable LPM on some WDC drives Niklas Cassel
2026-07-28 11:13 ` [PATCH 1/2] ata: libata-core: Disable LPM on some WD drives Niklas Cassel
2026-07-28 11:22   ` sashiko-bot [this message]
2026-07-28 11:13 ` [PATCH 2/2] ata: libata-core: Disable LPM on WD Green 2.5 480GB Niklas Cassel

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=20260728112200.B99F21F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.