Netdev List
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: george.moussalem@outlook.com, Andrew Lunn <andrew@lunn.ch>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Christian Marangi <ansuelsmth@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] net: dsa: qca8k: fix led devicename when using external mdio bus
Date: Thu, 11 Jun 2026 11:33:15 +0200	[thread overview]
Message-ID: <c515433a-a43c-48fa-a313-e83715646b01@redhat.com> (raw)
In-Reply-To: <20260608-qca8k-leds-fix-v3-1-a915bb2f37ae@outlook.com>

On 6/8/26 9:22 AM, George Moussalem via B4 Relay wrote:
> From: George Moussalem <george.moussalem@outlook.com>
> 
> The qca8k dsa switch can use either an external or internal mdio bus.
> This depends on whether the mdio node is defined under the switch node
> itself. Upon registering the internal mdio bus, the internal_mdio_bus
> of the dsa switch is assigned to this bus. When an external mdio bus is
> used, the driver still uses the internal_mdio_bus id which is used to
> create the device names of the leds.
> This leads to the leds being prefixed with '(efault)' as the
> internal_mii_bus is null. So let's fix this by adding a null check and
> use the devicename of the external bus instead when an external bus is
> configured.
> 
> Fixes: 1e264f9d2918 ("net: dsa: qca8k: add LEDs basic support")
> Signed-off-by: George Moussalem <george.moussalem@outlook.com>
> ---
> Resending this patch as v3 with an updated commit message. There was a
> discussion on removing the notion of having an external and internal
> bus which was never followed up on, yet the issue is still there.
> Link: https://patchwork.kernel.org/project/netdevbpf/patch/20250425151309.30493-1-kabel@kernel.org/
> 
> Changed in v3:
> - Rebased on top of tree
> - Updated commit message to reflect renaming of slave_mii_bus to
>   internal_mdio_bus
> - Link to v2: https://lore.kernel.org/r/20250425-qca8k-leds-v2-1-b638fd3885ca@outlook.com
> Changes in v2:
> - Fixed c/p error from older kernel version: slave_mii_bus was renamed
>   to internal_mdio_bus
> - Link to v1: https://lore.kernel.org/r/20250425-qca8k-leds-v1-1-6316ad36ad22@outlook.com
> ---
>  drivers/net/dsa/qca/qca8k-leds.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/dsa/qca/qca8k-leds.c b/drivers/net/dsa/qca/qca8k-leds.c
> index 43ac68052baf..ef496e345a4e 100644
> --- a/drivers/net/dsa/qca/qca8k-leds.c
> +++ b/drivers/net/dsa/qca/qca8k-leds.c
> @@ -429,7 +429,8 @@ qca8k_parse_port_leds(struct qca8k_priv *priv, struct fwnode_handle *port, int p
>  		init_data.fwnode = led;
>  		init_data.devname_mandatory = true;
>  		init_data.devicename = kasprintf(GFP_KERNEL, "%s:0%d",
> -						 priv->internal_mdio_bus->id,
> +						 priv->internal_mdio_bus ?
> +						 priv->internal_mdio_bus->id : priv->bus->id,
>  						 port_num);
>  		if (!init_data.devicename) {
>  			fwnode_handle_put(led);
> 

@Andrew: are you ok with this? I *think* you may still have the same
concern WRT the previous iteration.

/P


  reply	other threads:[~2026-06-11  9:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08  7:22 [PATCH v3] net: dsa: qca8k: fix led devicename when using external mdio bus George Moussalem via B4 Relay
2026-06-11  9:33 ` Paolo Abeni [this message]
2026-06-11 12:53 ` Andrew Lunn

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=c515433a-a43c-48fa-a313-e83715646b01@redhat.com \
    --to=pabeni@redhat.com \
    --cc=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=george.moussalem@outlook.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    /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