Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp284467lqp; Tue, 11 Jun 2024 04:45:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWdqwaEhDCdz+wo0IZg/lTZRdc7ieONC1BMhxEat7bDOoqQntUGngyXyuseNQY+TIfx2sx5gviCxyj6Nw72xsq81lCgDOVHNp23uLbKhQ== X-Google-Smtp-Source: AGHT+IEBrdg8DnIIWLI7AcJLVmldkzW1Jjtcykc2OkI3DnBdGSuVMMuDl0GGLzCltZUbwpmLLQ3j X-Received: by 2002:a05:6a21:6d86:b0:1b8:622a:cf8f with SMTP id adf61e73a8af0-1b8622ad8a5mr2998171637.57.1718106303270; Tue, 11 Jun 2024 04:45:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718106303; cv=pass; d=google.com; s=arc-20160816; b=tFPcTNSTgl8qXJlb3huiqQm52qzNS+LPS/sgNfPRjKxo95hNaajMhwr+HU8GqIzXP1 tdpKzoWKm5njY8VbPN4uiH6lYjcnaH8khBlxIkGaixQEfjx9qfO17eSj9hZK9Kkws0QS 1qizFykK9NJ9GWB6pivawDZYfH9a95synJnedSe7LXFd80khdvyQFhcFPLxHDmDMKQTc rSQoFOvr/vRSiA1v2PwM8IwRAvlx5jMx5dA5Ohs+ccNsmeymfzrDsUPLZa/3UO78YhDl 4IUwVpWtPYi9en6StUdFjActogQf+Y6bjPQ9R6JplGr/KuE4Ul/iJW3AJjyIBlt5Nn/w gG2w== 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=/s/qF7FnnCFgjRP5iPJ5LGokfXj6Ijvw0A1GU5RZHPc=; fh=Lh+JMPZo65h8qJAnE5jHWvKtvWM25xS7kSTjy8t+qRE=; b=X40Jl72BaqA+Ve5dTJQqx0sEzNKq1LPtljDGrJoqiZEaX5ERAOpkmKrro8ArAV6rLs 3JyRMVAD1cHTXn1cwmxUfENegp43rk3TUE8/S4tbRIV04LMOcrB6G/mNlExXARc0E7Tm Mjde64QzbFWXLCgb+TGctrA00tYJtEPLUjHndF3eQ5D2mweHWvG2tipiYpJRWoMf8SN7 2OHleXcclRoiRkH6rg/H8kHhIvzbR0uz9i7gZ4+K6wFQ1+fIScOxmJVa3jCBJSwOIr3G pi1+vb+rpY100z1dduF5iCIBjP7xfzJ5UpWr5v5bVRjcufyrumCor6Nl8euRKXciUTUy Yk9w==; 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-209786-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209786-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e7d89af7fbsi5748032a12.410.2024.06.11.04.45.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 04:45:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209786-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=dev.tdt.de); spf=pass (google.com: domain of linux-kernel+bounces-209786-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209786-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 64D62286FF0 for ; Tue, 11 Jun 2024 11:43:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4ACA17D8BE; Tue, 11 Jun 2024 11:41:30 +0000 (UTC) Received: from mxout70.expurgate.net (mxout70.expurgate.net [194.37.255.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 E67FD178CC1; Tue, 11 Jun 2024 11:41:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.37.255.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718106090; cv=none; b=UqNVvfLvuUsokJiVgj4jtC5GSGWZsA2hqk/CEpvLQ//ew12Y+A+bff/WDOueb7nDFwPZ+28qO/TcCyP54W29/AJj9Ce/4+aPUkdBZcjnFO4U0pOvzSHr2rJQfKCU2SpXQD4lYa2q3I3SvO9NgWZ3YdXLkQzrU/JCZY0lEjJhKI4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718106090; c=relaxed/simple; bh=kxwZ0cw+FzmbsarNoyILQQVuOInUJpunM/01+HV2TG4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kZ45M9LG4XZDfo6an8EiNoFMCOxPJq142qXywd/7Tq/DKQ6lbfH0lCHYTulJXW4SEK2uhYGFs/rAiqBDdpRpxyyNmvj2NmN7iS1/lGBnU9Vm+8GQKZXjL7CWVe41g/EM98q/bll/70QwsrCdKi+zYE9qp+YBfNYqQ2NqQSaALxU= 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=194.37.255.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 1sGzsU-00037F-U1; Tue, 11 Jun 2024 13:41:26 +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 1sGzsU-001XVM-D1; Tue, 11 Jun 2024 13:41:26 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 1F205240053; Tue, 11 Jun 2024 13:41:26 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id AA4D5240050; Tue, 11 Jun 2024 13:41:25 +0200 (CEST) Received: from mschiller1.dev.tdt.de (unknown [10.2.3.20]) by mail.dev.tdt.de (Postfix) with ESMTPSA id 69DFC29768; Tue, 11 Jun 2024 13:41:25 +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, ms@dev.tdt.de Subject: [PATCH net-next v4 07/13] net: dsa: lantiq_gswip: do also enable or disable cpu port Date: Tue, 11 Jun 2024 13:40:21 +0200 Message-ID: <20240611114027.3136405-8-ms@dev.tdt.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240611114027.3136405-1-ms@dev.tdt.de> References: <20240611114027.3136405-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: clean X-purgate-type: clean X-purgate-ID: 151534::1718106086-36936522-3C646042/0/0 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. The operation reordering done here is safe. Signed-off-by: Martin Schiller Acked-by: Hauke Mehrtens --- 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 c1f9419af35f..8ec329d0c136 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