Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp237411lqt; Thu, 6 Jun 2024 01:57:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWENs47csRpN6N/n3k52oz8+2qo09el9LZ2OzdIJg/9aodCpRl7JNayEenHUlpTDJwyvYBRQjAs/lc1YqgVdxfrosGfzCVI7UaIcvR9dw== X-Google-Smtp-Source: AGHT+IGHBwUXERspKcJ2rDUsNriqUUdCw+YWFHd7XyzWMCyx7UrCFzzE/Liqiiu8zimr6iBKNobV X-Received: by 2002:a17:906:46ca:b0:a6c:7337:b178 with SMTP id a640c23a62f3a-a6c7337b5c1mr152570466b.2.1717664278737; Thu, 06 Jun 2024 01:57:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717664278; cv=pass; d=google.com; s=arc-20160816; b=pN/g6plf7JlAJYl58w+JumCEE3pZO7Po2CH/Yw5tYVDAvIcROXoNFPOS6EFYIs6bMy Bst+hNDglpGLfWJ/VGmvYoZkWt7pJh7KwphzhZkuKia0bpVGiz0aeKQIZj98rkxdt3pF 5ofn6nBcorckW+h4oTAWyZ7JgtoDUVbdiZvgWDS+KZjJccPqxpeM5cYv2RnQkzSmshI6 3eIXJm8f/hnmMr8/K/6QiQ5lrxJbue44ChLP9LHUESlo5m7V/5kb3f/nJRewss4oNEpQ UWs4Na+zSwSXNJSWioQut0CPsqklC6sUCceViIUcpVaf+3r03DoZ9hi/iZI2R6mJnC/F aelA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Nh327zlZxhPDoo3zTNmSQBg+RS8zxq4Q2/C0NwCWfbM=; fh=xpoQVmrQSZpN3CPEFDk03EkFlnnuNVrhFp3Ynb61HGk=; b=O7cW8c2789am/nLMsQzClEMubG3faB901LhecZGwH7r8BSSESSOBooEiCJG4VLG+HM DiS1+HlAbvX9gKMjOJ7mtG8QU7dLnbG8ONNs7MS/yZov8EiG/w9xKIgbHuRIsdPMxH+E 7I2/4ztz3uXmtTNVqzhuNdpc1eIiGKOiLkNWtqTUFtu8JcdAgQVShq5hzISglANUXfxT /i1bk4wmebCKnQs6EYqO8ZwlfgNhwHID0I3O4JPtUqbB/BBMr/8z5Bzr9CKYEVHejQqo NQJM2RqGwNF7LtsGlCqvrrSUmIfunJE4VYUUTOl4fsJ0CWCKJIwbGmgvN6ABShT1wtu2 N36A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=dev.tdt.de); spf=pass (google.com: domain of linux-kernel+bounces-203898-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203898-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c80749865si47220266b.980.2024.06.06.01.57.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 01:57:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203898-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=dev.tdt.de); spf=pass (google.com: domain of linux-kernel+bounces-203898-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203898-linux.lists.archive=gmail.com@vger.kernel.org" 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 A9F341F22C12 for ; Thu, 6 Jun 2024 08:57:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1614914EC71; Thu, 6 Jun 2024 08:54:38 +0000 (UTC) Received: from mxout70.expurgate.net (mxout70.expurgate.net [91.198.224.70]) (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 DA89D13F443; Thu, 6 Jun 2024 08:54:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.198.224.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664077; cv=none; b=WBydNQBd1d4RJmMFttjinVPf9Vef1rLnOHQXNyQQZqBSPHYNTH+ef2WGWZZQ1rYL81u8fW0K4j7q+pxgCUoJqYMdOo1VxMr2ZCPVrOctDp+89N13SlBESzBsn4mgqQGq0TudV50UBhkGH7Hk2RzqntNux0R86D10KDZz3njvimQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664077; c=relaxed/simple; bh=ff7Ngupcny7KC9lpg/v95cDqYfKYHIZG/yZwynHYxpM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fRyxvKcy+JqsVZcvyPYiT6oOJqEx9sR9CKXxY+rEN+16Eup93j1aoraoXbZ26q1d3OpMYPLwSpnsP/dKzcas5RWy2W11OphBZGvs4SnZ47lic8OyFp9EUsfE0fHMfzPb/uPYjXckQUTrp+PE3zxJ0Jzf+aBiGFiYnGbiAfiwNM4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dev.tdt.de; spf=pass smtp.mailfrom=dev.tdt.de; arc=none smtp.client-ip=91.198.224.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dev.tdt.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dev.tdt.de Received: from [127.0.0.1] (helo=localhost) by relay.expurgate.net with smtp (Exim 4.92) (envelope-from ) id 1sF8tE-00CzgL-DN; Thu, 06 Jun 2024 10:54:32 +0200 Received: from [195.243.126.94] (helo=securemail.tdt.de) by relay.expurgate.net with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sF8tD-00EJzr-Rc; Thu, 06 Jun 2024 10:54:31 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 8757F240053; Thu, 6 Jun 2024 10:54:31 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 18243240050; Thu, 6 Jun 2024 10:54:31 +0200 (CEST) Received: from mschiller1.dev.tdt.de (unknown [10.2.3.20]) by mail.dev.tdt.de (Postfix) with ESMTPSA id BA071379F6; Thu, 6 Jun 2024 10:54:30 +0200 (CEST) From: Martin Schiller To: martin.blumenstingl@googlemail.com, hauke@hauke-m.de, andrew@lunn.ch, f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Schiller Subject: [PATCH net-next 05/13] net: dsa: lantiq_gswip: do also enable or disable cpu port Date: Thu, 6 Jun 2024 10:52:26 +0200 Message-ID: <20240606085234.565551-6-ms@dev.tdt.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240606085234.565551-1-ms@dev.tdt.de> References: <20240606085234.565551-1-ms@dev.tdt.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-type: clean X-purgate-ID: 151534::1717664072-214CD43F-B6CA1C71/0/0 X-purgate: clean Before commit 74be4babe72f ("net: dsa: do not enable or disable non user ports"), gswip_port_enable/disable() were also executed for the cpu port in gswip_setup() which disabled the cpu port during initialization. Let's restore this by removing the dsa_is_user_port checks. Also, let's clean up the gswip_port_enable() function so that we only have to check for the cpu port once. Fixes: 74be4babe72f ("net: dsa: do not enable or disable non user ports") Signed-off-by: Martin Schiller --- drivers/net/dsa/lantiq_gswip.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswi= p.c index 3fd5599fca52..38b5f743e5ee 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -695,13 +695,18 @@ static int gswip_port_enable(struct dsa_switch *ds,= int port, struct gswip_priv *priv =3D ds->priv; int err; =20 - if (!dsa_is_user_port(ds, port)) - return 0; - if (!dsa_is_cpu_port(ds, port)) { + u32 mdio_phy =3D 0; + err =3D gswip_add_single_port_br(priv, port, true); if (err) return err; + + if (phydev) + mdio_phy =3D phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK; + + gswip_mdio_mask(priv, GSWIP_MDIO_PHY_ADDR_MASK, mdio_phy, + GSWIP_MDIO_PHYp(port)); } =20 /* RMON Counter Enable for port */ @@ -714,16 +719,6 @@ static int gswip_port_enable(struct dsa_switch *ds, = int port, gswip_switch_mask(priv, 0, GSWIP_SDMA_PCTRL_EN, GSWIP_SDMA_PCTRLp(port)); =20 - if (!dsa_is_cpu_port(ds, port)) { - u32 mdio_phy =3D 0; - - if (phydev) - mdio_phy =3D phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK; - - gswip_mdio_mask(priv, GSWIP_MDIO_PHY_ADDR_MASK, mdio_phy, - GSWIP_MDIO_PHYp(port)); - } - return 0; } =20 @@ -731,9 +726,6 @@ static void gswip_port_disable(struct dsa_switch *ds,= int port) { struct gswip_priv *priv =3D ds->priv; =20 - if (!dsa_is_user_port(ds, port)) - return; - gswip_switch_mask(priv, GSWIP_FDMA_PCTRL_EN, 0, GSWIP_FDMA_PCTRLp(port)); gswip_switch_mask(priv, GSWIP_SDMA_PCTRL_EN, 0, --=20 2.39.2