From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC4193AD531 for ; Mon, 10 Aug 2026 13:54:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786370047; cv=none; b=ThDpi+FWTrlAPXBIoyX7zeUW6d9OZGZ6AsA2SO9G/nHrsGfFcTaxv3tic0j9SCGiCQd61gJmdw+FVAHEwYjwac5W3KZpyMv6HAvyb0v1NgfsZ+BhLnHt0ba9sM2CdaB3CvtGDv6qTc1EnvWg/tGV3T/GGWzToWash/uc7yhpHus= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786370047; c=relaxed/simple; bh=EwbKzoUhneeGcWDUA8JuUVel6Fgx/Oo5AvuYrUI/NsA=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cUiGuOPsCDO2a9fl1fsljJFctTqe0e58iouM1/tlmesvfQ+IlbqTLlG69GRtoiKLbqLeHkLLb5K/Ql/SR6j+SCtHDrubf8dCh7Cy+g7SsX0tdaMReRgWH4aI0LrNdIHnODQjgcrhFEQHXaOL7DLnkIo3JIinsJIe9bI25r3Pjd8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ntAyXT77; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ntAyXT77" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-47de0093c42so1372464f8f.3 for ; Mon, 10 Aug 2026 06:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786370044; x=1786974844; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:subject:cc:to:from:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=VgJBBQAfQwud2CBHM1vOxewj/JwZX0g9gZPthW2xd2U=; b=ntAyXT77FEm5O+Xt1xhfj2wmDOce/qTDhJ0YsEBue+5uQgYcGV8M0jnnDnVZaTKKBi 6pqxFKEnE3iY7RZjnvL1bN4utmHILqE0YpfVDKhGJ2Q67p8EE7B68T+VAZEa8M9KLjie GWZ4z05XuGiNmsYn8j+z7AE48t1wQWV0hLo0TLIUJ0UJSOddUIsmmbVU2FZLr+3jZQCm URJ1J16Lc5WvWehRCiCL7cunT8o9DhOLt2GNTfAToLY5mu8uSSR/fjN67ZO8a7I5o3OJ WTPR+nsq+ENqgAbbKsX3YFp3aRdWPmtrVxsS9kzJxOkhZflJOIerpF4EuVjLnDO2kvhK A/tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786370044; x=1786974844; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:subject:cc:to:from:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=VgJBBQAfQwud2CBHM1vOxewj/JwZX0g9gZPthW2xd2U=; b=miCdf5i9+SNWeMzXWf6T4li0ZYq3yyUV9509mbSbdpQWGaNBQOQGBhOfudV8ndBVNE r7HYA5C7auoAKmzdCFA5JOFUHIJiIkJr4g2Nl1qcdWjtu6PaEfwd43QFJUjegGmnsGhJ uSXZm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97d-48130eea9f4mr19631047f8f.21.1786370043636; Mon, 10 Aug 2026 06:54:03 -0700 (PDT) Received: from Ansuel-XPS. (host-87-20-3-207.retail.telecomitalia.it. [87.20.3.207]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-480021506desm33595891f8f.10.2026.08.10.06.54.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Aug 2026 06:54:02 -0700 (PDT) Message-ID: <6a79d7fa.ebbd881c.2cd61f.2e0d@mx.google.com> X-Google-Original-Message-ID: Date: Mon, 10 Aug 2026 15:53:58 +0200 From: Christian Marangi To: =?utf-8?B?TWljaGHFgiBLxJlwaWXFhA==?= Cc: Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: dsa: qca8k: Disable mgmt Ethernet for qca8327 References: <20260810061612.23745-1-kernel@kempniu.pl> 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260810061612.23745-1-kernel@kempniu.pl> On Mon, Aug 10, 2026 at 08:15:53AM +0200, Michał Kępień wrote: > While the qca8327 switch appears to support in-band mgmt Ethernet, > prolonged use of that protocol (e.g. for polling link state) makes the > device unstable: within minutes, ports randomly go down and no traffic > is forwarded anymore. The same issues do not occur when MDIO is used > exclusively, so ensure mgmt Ethernet is not used on the qca8327. > > Signed-off-by: Michał Kępień > --- > I came across this while migrating an AR9344-based router with a QCA8327 > rev. 4 switch to a DSA-aware driver. This glitch is a pain in the neck > to troubleshoot any further as it occurs randomly, anywhere between a > minute to an hour after the switch is set up; traffic load exerted on > the switch does not seem to matter as the problem can be triggered on a > virtually idle device. Previously working links are reported as going > down (one by one, not all at once), even though port LEDs still blink; > no traffic is forwarded; reloading qca8k does not alleviate the problem, > only power cycling seems to help. Nothing like this happens when only > MDIO is used. However, qca8k currently only uses MDIO as a fallback. I > figured that simpler is better and that mgmt Ethernet should simply be > disabled for the qca8327, but I would be happy to work on some > configurable solution if that would be preferable. > This is a long standing issue and it seems to me disabling mgmt is just a big workaround to a real problem. Long time ago it was reported that there seems to be a problem with the mdio master register for external and internall access and how mgmt was actually sending mdio command... just done by the switch. Could the 2 issue related? One idea might be to verify that stuff gets actually written... as Andrew said to verify if some packets doesn't get lost or just ignored. Also as Andrew said I would still save this for the MIB part as the 2 thing should be unrelated. > drivers/net/dsa/qca/qca8k-8xxx.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c > index 4c928983b8623..1d90a23aba6bb 100644 > --- a/drivers/net/dsa/qca/qca8k-8xxx.c > +++ b/drivers/net/dsa/qca/qca8k-8xxx.c > @@ -160,6 +160,11 @@ qca8k_set_page(struct qca8k_priv *priv, u16 page) > return 0; > } > > +static bool qca8k_mgmt_eth_disabled(const struct qca8k_priv *priv) > +{ > + return priv->switch_id == QCA8K_ID_QCA8327; > +} > + Instead of this and return ENXIO I would just not install the relevant OPs for the tagger and use the mdio path directly... Makes the code cleaner and less CPU cycle (the target is ath79 and powerpc stuff) But as said above disabling the feature is the last solution after all the verification are done. > static void qca8k_rw_reg_ack_handler(struct dsa_switch *ds, struct sk_buff *skb) > { > struct qca8k_mgmt_eth_data *mgmt_eth_data; > @@ -316,6 +321,9 @@ static int qca8k_read_eth(struct qca8k_priv *priv, u32 reg, u32 *val, int len) > bool ack; > int ret; > > + if (qca8k_mgmt_eth_disabled(priv)) > + return -ENXIO; > + > skb = qca8k_alloc_mdio_header(MDIO_READ, reg, NULL, > QCA8K_ETHERNET_MDIO_PRIORITY, len); > if (!skb) > @@ -368,6 +376,9 @@ static int qca8k_write_eth(struct qca8k_priv *priv, u32 reg, u32 *val, int len) > bool ack; > int ret; > > + if (qca8k_mgmt_eth_disabled(priv)) > + return -ENXIO; > + > skb = qca8k_alloc_mdio_header(MDIO_WRITE, reg, val, > QCA8K_ETHERNET_MDIO_PRIORITY, len); > if (!skb) > @@ -630,6 +641,9 @@ qca8k_phy_eth_command(struct qca8k_priv *priv, bool read, int phy, > int ret, ret1; > bool ack; > > + if (qca8k_mgmt_eth_disabled(priv)) > + return -ENXIO; > + > if (regnum >= QCA8K_MDIO_MASTER_MAX_REG) > return -EINVAL; > > -- > 2.55.0 > -- Ansuel