From nobody Thu Jul 16 20:33:49 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED05E30C16E; Mon, 8 Jun 2026 07:22:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780903340; cv=none; b=ifH4nKjouFSDQVdHPHzV4a2STRU4dNtvz4IsJZIFRh2yYEtmNfNmBvev2dh3WtaAwj0CrVKCNECWOkGkas9Ks7yt0hgZJIZobHnIXuccL5iAg2GQpXHadw3rkUiHXrmhjWTzNR8APGSMYpDZVxvAvWcfbuIoF9Wsq+uwAwo1qiw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780903340; c=relaxed/simple; bh=POlbjguZIxiI8p8YrsvrR/hDEeJoeEbuygWZ0xZGOF8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=e9VfX9ixFUyz06gUNsA5OuPN5lZX9UkT0lsD6Etmw584sgp2ecqO313SqoDo9FEUrJYBqdoVyLzPHhADJY1OZ5Z82kOQr6s+jQpnR7jyIbENHhZm2AMKK5osQciLZGMpZTxqCM8riT2caiWKfDWJ955nrSMFKGdurCrZQQ2C0rg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hQkyNClU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hQkyNClU" Received: by smtp.kernel.org (Postfix) with ESMTPS id 8A288C2BCB0; Mon, 8 Jun 2026 07:22:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1780903339; bh=POlbjguZIxiI8p8YrsvrR/hDEeJoeEbuygWZ0xZGOF8=; h=From:Date:Subject:To:Cc:Reply-To:From; b=hQkyNClUiv/Nab1MDxqtuor/NGlka9IrRlVK8a/L4Mq+rLSSx9GNpOlEi7k7wmeQn KAFHRpuQa1prQFQI/uu+mzyUv+6FDeYxpi2M/06N6wJHrRzkPQhagheD63gXfYOpXA U8UD9Z/RrckMpCHtH8JNs/thR0WCenYwH+EvbPm4HIf0BVWBL4Xvdcl6XlQ+Q5yr6G GB7KUYSslOoysKRRHHElZFbFRc3QaQaHHcJH0qG76SyqkQtfvVFVKNf8qxFljqrjnV 8eQxtleFTkT/T83CqdxbhdP6I35GoepIOyIgjnuW9FDovk4Tqec2hcWqYbFDTICZfB ACn38SPsVFdDg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E64DCD8C92; Mon, 8 Jun 2026 07:22:19 +0000 (UTC) From: George Moussalem via B4 Relay Date: Mon, 08 Jun 2026 11:22:08 +0400 Subject: [PATCH v3] net: dsa: qca8k: fix led devicename when using external mdio bus Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260608-qca8k-leds-fix-v3-1-a915bb2f37ae@outlook.com> X-B4-Tracking: v=1; b=H4sIAAAAAAAC/03MywrCMBCF4Vcps3YkpmkdXPke4iKXiQ29pCa1C KXvbhAEl/+B822QOQXOcKk2SLyGHOJUoj5UYDs9PRiDKw1SyFa0gvBpNfU4sMvowxuZjHLk2ai zgXKaE5f5C97upX2KIy5dYv1jGqFk88+sEk9o2pq8q4kaq6/xtQwx9kcbR9j3Dy1x+lqkAAAA X-Change-ID: 20260608-qca8k-leds-fix-e8b4d8feb47b To: Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Christian Marangi , Florian Fainelli Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, George Moussalem X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1780903338; l=2408; i=george.moussalem@outlook.com; s=20250321; h=from:subject:message-id; bh=HiUw3Q504F5hs2do7v6tmrj/sdstwjc54LpITglorVY=; b=6akJitugOoduxzekxXr8wUyxaunTXPSPvklTHqMbAzdPnSbxEeFFnt0i8kmIwCy8NxlIWVsL1 UFb4R/AmSnvDsmCKI1yyVbZUYEV0weZfCN2/aOR1uGK2stn129rnQ5T X-Developer-Key: i=george.moussalem@outlook.com; a=ed25519; pk=/PuRTSI9iYiHwcc6Nrde8qF4ZDhJBlUgpHdhsIjnqIk= X-Endpoint-Received: by B4 Relay for george.moussalem@outlook.com/20250321 with auth_id=364 X-Original-From: George Moussalem Reply-To: george.moussalem@outlook.com From: George Moussalem 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 Reviewed-by: Andrew Lunn --- 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.3= 0493-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-b638fd3885= ca@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-6316ad36ad= 22@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-l= eds.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 f= wnode_handle *port, int p init_data.fwnode =3D led; init_data.devname_mandatory =3D true; init_data.devicename =3D 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); --- base-commit: 6e845bcb78c95af935094040bd4edc3c2b6dd784 change-id: 20260608-qca8k-leds-fix-e8b4d8feb47b Best regards, --=20 George Moussalem