Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp450797lqa; Sat, 27 Apr 2024 08:43:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU9lkfk5RwNCoK8Lg8UkYsVS8vZ9f87mJ6VnZtg4bxJ4FcnsimRQNRjVOYwLFjufcH5Mw0h0RKu+gkDRgnbStqi9cmseP/BdN+XdPMbHA== X-Google-Smtp-Source: AGHT+IHkn+QVFLnwDr4cgTiYA2w8WIiWeQV/6gmXLkRPQke5BZ5t7RHqjn24wLy2eQeBu0OFGlIg X-Received: by 2002:a17:906:f10c:b0:a58:8394:85b3 with SMTP id gv12-20020a170906f10c00b00a58839485b3mr3438585ejb.35.1714232631103; Sat, 27 Apr 2024 08:43:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714232631; cv=pass; d=google.com; s=arc-20160816; b=zmSlXePAPfr7xIbDLaFW2WE9f/0BJIZvRagSr2nHSVg7gxr5KrVLfBUMwJzBaOBo0i Bkf8vM50Rr5xFCDmnwL8EHyMSkcSQnrFC60wuSX4mFVr2oFHeSSwNqBzPsARqEcsDljc fCmCuSjweSZv6LA5WVhzVG9TX6yp/R+yyeokDjZBSszVhshTT/oyFqdUL5HIKQBC569k zxQ74SmdYWsbHfSvFbmU8PchPokO1cuuhfQZIW5QQq4wK7FhestsGYytrcE+BGhpwOTj CP3Fn2+kbCwDnX0mqoaEuM/priii9f8NU3f/xeZl+J9A59WXXxMIWKuhpllbVaNC3jEm OjCg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=lHffaf6MDxa8ECiqE5Vi9zLtI98CHdrDDXTGIYN72xw=; fh=c6HDV5PQ56z0Z/lbgYxuNoy+hsx7TmRsHz/XaL3FgVI=; b=Appg1zUuxJ8jpJEe2Z/H7bhxfuOdehcCLPA6v0WPLuf/GiX/eHw+74UNw7eQLgnhmU /s0PCYWJU4M/aewcWTo+Ddg6mb4UOqkjq70jfPi106E1UEFnMdYnfl/GYcT+tFV0xF+M 5D2TZf4OaT8dgDCim2Iro6aiUMWCrv/kQqOMxUcWDYmlAehbJEOD7bcm/1cXLl1knAaq Ju4Zy5aRCRRGxmaFYPnRfsWuipr/J6CW6NoCLFU+Ix8yFg+sGeTSr/mg00todeJfxMNO ZSlNcBSgC/pfoBkXtOqLyHe6LQ8A4ja9iJBjktHw0E+D+KK8tUjK1cZbfe6MQ2pC40Mp BW4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=Eq6oBAyk; arc=pass (i=1 spf=pass spfdomain=arinc9.com dkim=pass dkdomain=arinc9.com dmarc=pass fromdomain=arinc9.com); spf=pass (google.com: domain of linux-kernel+bounces-161089-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161089-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id lu7-20020a170906fac700b00a519441a20csi12102320ejb.512.2024.04.27.08.43.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Apr 2024 08:43:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161089-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=Eq6oBAyk; arc=pass (i=1 spf=pass spfdomain=arinc9.com dkim=pass dkdomain=arinc9.com dmarc=pass fromdomain=arinc9.com); spf=pass (google.com: domain of linux-kernel+bounces-161089-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161089-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D20581F238CB for ; Sat, 27 Apr 2024 15:43:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C4A41772F; Sat, 27 Apr 2024 15:43:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arinc9.com header.i=@arinc9.com header.b="Eq6oBAyk" Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.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 BFAD11A5A2; Sat, 27 Apr 2024 15:43:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714232621; cv=none; b=sw19pNBrrZRtzU0sSn9jYqpTVKJ+qhZEnJja7c5rKXM+SnM73PK1Eex9MmqsVx4uIoy5CwUUDc/PDQp4wjMVA9sqWCXPb6jYFOSaizj2vizloG6LW+gwDBEf8057hlsPZKY2dVJ4PneCDcGyKiC8HTYmjDYdrhr2ixxsODG5AdQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714232621; c=relaxed/simple; bh=MUPyksaMnqMHR3rhg2pHvS7eabTrvdA8JEqSZc1k2yY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=izcWu3Durd85pcXcnwqtNPz7cirOgK0GkrsyaHypF6qUTqzI5JqgkzwEjJ7HbJheqIQUhoUH2YZSJr/CAvh/GkpD8p1KypW1saFFD2W7yW7Oyo8yPJkznDaYQ0dDVlRB96ETkV+35VKT3req7DyWE/yiluol4AC16ZLvEXZwuQI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arinc9.com; spf=pass smtp.mailfrom=arinc9.com; dkim=pass (2048-bit key) header.d=arinc9.com header.i=@arinc9.com header.b=Eq6oBAyk; arc=none smtp.client-ip=217.70.183.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arinc9.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arinc9.com Received: by mail.gandi.net (Postfix) with ESMTPSA id D524C1BF203; Sat, 27 Apr 2024 15:43:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1714232611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lHffaf6MDxa8ECiqE5Vi9zLtI98CHdrDDXTGIYN72xw=; b=Eq6oBAykWZPY6GDMA4LSkKisBPZVfPxAjf89dyIQEVNNaoC3265TX/4x0kp76tqoJDpAQi UhLULDiNaPF5Inm3ZThvJF7k+dLf1lT9c/myv9sLB0M6bqLSNmD1LQRXDMFJpMwwcIKgmb 76rRoWWDV4ZdQ55EfrdG5VBsatVhmXRaZ5+VazQMJ6VEe8dBFn6Uy5dsFpPV92cZih82so c10GSPuSPiQf/wuyuCv9ptx4oymOHXIovRGmGCYhhIsCi1nJT/bZbS0/+pgRutMAyht7nx 6FGycRbeSgifOvXaSUKW+vxamba5EBqILD5VvFO7gWyhnuVeBHYE9239zsWByw== Message-ID: <5acf02b1-8af4-4259-9ce1-c7c7ae00ae9d@arinc9.com> Date: Sat, 27 Apr 2024 18:43:03 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next] net: dsa: mt7530: do not set MT7530_P5_DIS when PHY muxing is being used To: Andrew Lunn Cc: Daniel Golle , DENG Qingfang , Sean Wang , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20240427-for-netnext-mt7530-do-not-disable-port5-when-phy-muxing-v1-1-793cdf9d7707@arinc9.com> <7c476e63-5747-4128-af97-13edc252a263@lunn.ch> Content-Language: en-US From: =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= In-Reply-To: <7c476e63-5747-4128-af97-13edc252a263@lunn.ch> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-GND-Sasl: arinc.unal@arinc9.com On 27.04.2024 16:31, Andrew Lunn wrote: > On Sat, Apr 27, 2024 at 02:24:42PM +0300, Arınç ÜNAL via B4 Relay wrote: >> From: Arınç ÜNAL >> >> When the PHY muxing feature is in use, port 5 won't be defined in the >> device tree. Because of this, the type member of the dsa_port structure for >> this port will be assigned DSA_PORT_TYPE_UNUSED. The dsa_port_setup() >> function calls ds->ops->port_disable() when the port type is >> DSA_PORT_TYPE_UNUSED. >> >> The MT7530_P5_DIS bit is unset when PHY muxing is being used. >> mt7530_port_disable() which is assigned to ds->ops->port_disable() is >> called afterwards. Currently, mt7530_port_disable() sets MT7530_P5_DIS >> which breaks network connectivity when PHY muxing is being used. >> >> Therefore, do not set MT7530_P5_DIS when PHY muxing is being used. >> >> Fixes: 377174c5760c ("net: dsa: mt7530: move MT753X_MTRAP operations for MT7530") >> Reported-by: Daniel Golle >> Signed-off-by: Arınç ÜNAL >> --- >> Hello. >> >> I've sent this to net-next as the patch it fixes is on the current >> development cycle. >> --- >> drivers/net/dsa/mt7530.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c >> index 2b9f904a98f0..07b6da3ae97c 100644 >> --- a/drivers/net/dsa/mt7530.c >> +++ b/drivers/net/dsa/mt7530.c >> @@ -1220,7 +1220,7 @@ mt7530_port_disable(struct dsa_switch *ds, int port) >> if (priv->id != ID_MT7530 && priv->id != ID_MT7621) >> return; >> >> - if (port == 5) >> + if (port == 5 && priv->p5_mode == GMAC5) >> mt7530_set(priv, MT753X_MTRAP, MT7530_P5_DIS); > > > It might be worth a comment. It is not obvious that > priv->p5_mode == GMAC5 means the PHY MUX is being used. > mt7530_setup_port5() thinks it is sufficiently obscure that > it comments each case. priv->p5_mode == GMAC5 means PHY muxing is not being used. That is why MT7530_P5_DIS is set when priv->p5_mode is GMAC5. Anyway, I believe this proves your point. Arınç