Linux ATA/IDE development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Carlos Junior" <cjuniorfox@gmail.com>
Cc: dlemoal@kernel.org, linux-ide@vger.kernel.org, cassel@kernel.org
Subject: Re: [PATCH] ata: sata_mv: enable SoC SATA LED presence indication
Date: Fri, 25 Sep 2026 19:40:34 +0000	[thread overview]
Message-ID: <20260925194034.A05C31F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260925193134.114566-1-cjuniorfox@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] ata: sata_mv: LED blink mode state desynchronization and register clobbering
- [Medium] ata: sata_mv: hardcoded LED multiplexing risks board-specific pin conflicts
--

commit 30e313ac1545b898b81aab6027f1bf3c7b86b831
Author: Carlos Junior <cjuniorfox@gmail.com>

ata: sata_mv: enable SoC SATA LED presence indication

This commit enables the SoC SATA LED controller in mv_soc_enable_leds().
It sets the enable, device presence multiplexing, and activity blink bits
in the host-controller register.

> diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
> index 365454390d7e0..90a4ca5b5c407 100644
> --- a/drivers/ata/sata_mv.c
> +++ b/drivers/ata/sata_mv.c
[ ... ]
> @@ -3382,12 +3383,21 @@ static void mv6_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio,
>  	writel(m2, port_mmio + PHY_MODE2);
>  }
>  
> -/* TODO: use the generic LED interface to configure the SATA Presence */
> -/* & Acitivy LEDs on the board */
> +/*
> + * Enable the SoC SATA LED controller and device presence
> + * indication on the board's SATA LEDs.
> + */
>  static void mv_soc_enable_leds(struct mv_host_priv *hpriv,
>  				      void __iomem *mmio)
>  {
> -	return;
> +	void __iomem *hc_mmio;
> +
> +	hc_mmio = mv_hc_base(mmio, 0);
> +
> +	writel(SOC_LED_CTRL_ENABLE |
> +		SOC_LED_CTRL_ACT_PRESENCE |
> +		SOC_LED_CTRL_BLINK,
> +		hc_mmio + SOC_LED_CTRL);

[Severity: High]
Does this blind writel clobber existing register configurations? Without a
read-modify-write pattern, any settings previously configured by the
bootloader will be overwritten.

Additionally, this enables blink mode in hardware without updating the
software state tracker. When mv_edma_cfg() later attempts to disable
blinking for non-NCQ devices, it relies on mv_soc_led_blink_disable():

    if (!(hpriv->hp_flags & MV_HP_QUIRK_LED_BLINK_EN))
        return;

Because hpriv->hp_flags was never updated to include
MV_HP_QUIRK_LED_BLINK_EN during initialization, this check will falsely
indicate that blinking is already disabled and return early. Will this
leave non-NCQ devices permanently stuck in blink mode?

[Severity: Medium]
Does forcing SOC_LED_CTRL_ACT_PRESENCE globally for all SoC devices risk
board-specific pin conflicts?

Unconditionally enabling LED multiplexing here overrides platform-specific
pinmux routing. On boards where these physical pins are utilized for other
GPIO functions like UART or I2C, forcing the controller to drive them
could result in hardware conflicts or erratic behavior. The previous
comment indicated this should be handled through the generic LED interface
to respect dynamic Device Tree routing.

>  }
>  
>  static void mv_soc_read_preamp(struct mv_host_priv *hpriv, int idx,

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260925193134.114566-1-cjuniorfox@gmail.com?part=1

  reply	other threads:[~2026-09-25 19:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 19:31 [PATCH] ata: sata_mv: enable SoC SATA LED presence indication Carlos Junior
2026-09-25 19:40 ` sashiko-bot [this message]
2026-09-25 21:28 ` [PATCH v2] " Carlos Junior
2026-09-28  6:51   ` Damien Le Moal
2026-09-28 13:28 ` [PATCH v3] " Carlos Junior
2026-10-09 11:37   ` 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=20260925194034.A05C31F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=cassel@kernel.org \
    --cc=cjuniorfox@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox