From patchwork Thu Jun 6 08:52:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Schiller X-Patchwork-Id: 13688075 X-Patchwork-Delegate: kuba@kernel.org 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 9520D13E02E; Thu, 6 Jun 2024 08:55:45 +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=1717664148; cv=none; b=afI0RBLvxQrWjxF7kUtbVidfyjXbPCDu3Qm6MSp3XJYjExaB/DaR4BfsP6A2DjWTFnSdgyKdp+U49wsWG9p68QkYtyAEretlVdvflfDz4GXKGAIYYjZfSaPyma6v784Z/NgmOIYFbI1CkOVNioZsaEeVYLCZc667qz8FO9gR2Hs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664148; c=relaxed/simple; bh=5SkCojbOupms9kdTbT85vRcF6Ax30rBWXXz0025LSO8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zth3jaADglqVW0iAhurBfuIz2nvcgzcSP+LVcRZHOWtMRd4NOjfHxJEd0dEvnfQlHiYdI5YqoGRd3wRYeR2wtoog3LT7hx0uvyp3OpmXUFogL6ITzn/jqIRaL9I6uOzYmCnsR2+U7EPt1a1YWTsyf4nOU9PEA9pREXFOtuy4VX4= 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 1sF8si-008wh2-Uz; Thu, 06 Jun 2024 10:54:01 +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 1sF8si-002ket-B6; Thu, 06 Jun 2024 10:54:00 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 114DF240053; Thu, 6 Jun 2024 10:54:00 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 95F92240050; Thu, 6 Jun 2024 10:53:59 +0200 (CEST) Received: from mschiller1.dev.tdt.de (unknown [10.2.3.20]) by mail.dev.tdt.de (Postfix) with ESMTPSA id 47359379F6; Thu, 6 Jun 2024 10:53:59 +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 Subject: [PATCH net-next 01/13] dt-bindings: net: dsa: lantiq_gswip: Add missing phy-mode and fixed-link Date: Thu, 6 Jun 2024 10:52:22 +0200 Message-ID: <20240606085234.565551-2-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-purgate-type: clean X-purgate: clean X-purgate-ID: 151534::1717664040-AF4A7257-89460A7D/0/0 X-Patchwork-Delegate: kuba@kernel.org From: Martin Blumenstingl The CPU port has to specify a phy-mode and either a phy or a fixed-link. Since GSWIP is connected using a SoC internal protocol there's no PHY involved. Add phy-mode = "internal" and a fixed-link to describe the communication between the PMAC (Ethernet controller) and GSWIP switch. Signed-off-by: Martin Blumenstingl Reviewed-by: Vladimir Oltean --- Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt b/Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt index 8bb1eff21cb1..e81ba0e0da0f 100644 --- a/Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt +++ b/Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt @@ -96,7 +96,13 @@ switch@e108000 { port@6 { reg = <0x6>; + phy-mode = "internal"; ethernet = <ð0>; + + fixed-link { + speed = <1000>; + full-duplex; + }; }; }; From patchwork Thu Jun 6 08:52:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Schiller X-Patchwork-Id: 13688062 X-Patchwork-Delegate: kuba@kernel.org 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 BA07913F443; Thu, 6 Jun 2024 08:54:18 +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=1717664060; cv=none; b=htZlcgUTwhpxW1XkBaBsFWf2jK5gs/yT7w1W0k6aGNS0pSMKuYQ7kxa9+f31C9rtOa+cjPtoZI7IZtK8c4/28NS0VLMaRhdMKFbI5DSF45DhkyxnTjWLeYc1R0MB3fPVGEAT97RQGzmYkxKPcwIINAcLR9tDLTUfkbgeVf0wo5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664060; c=relaxed/simple; bh=Dxzgu1E2bxWwq/MieO5oAXOSUD/JtmEc28wK0XbexZQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bOq4VTxh/n+/He7upx/UgrKEJBvDxHZ75GfMSjOBB6szIp49MuH12KjfB8K0436SQ8vnXfix9rNBdjPBtWO1HsNCc8vlOom4ppftyZQkCGqH7/twbgerbcRoC3wEiq7ijuYzkYJYYa4FbghW4oytXvhDnyHz+rN4aT+4UruxxUA= 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 1sF8sy-00EJuv-8f; Thu, 06 Jun 2024 10:54:16 +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 1sF8sx-00EJun-O2; Thu, 06 Jun 2024 10:54:15 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 773EA240053; Thu, 6 Jun 2024 10:54:15 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 0E9AA240050; Thu, 6 Jun 2024 10:54:15 +0200 (CEST) Received: from mschiller1.dev.tdt.de (unknown [10.2.3.20]) by mail.dev.tdt.de (Postfix) with ESMTPSA id B9CD2379F6; Thu, 6 Jun 2024 10:54:14 +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 Subject: [PATCH net-next 02/13] net: dsa: lantiq_gswip: Only allow phy-mode = "internal" on the CPU port Date: Thu, 6 Jun 2024 10:52:23 +0200 Message-ID: <20240606085234.565551-3-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-purgate-ID: 151534::1717664056-FD9A0776-C50BB7C2/0/0 X-purgate: clean X-purgate-type: clean X-Patchwork-Delegate: kuba@kernel.org From: Martin Blumenstingl Add the CPU port to gswip_xrx200_phylink_get_caps() and gswip_xrx300_phylink_get_caps(). It connects through a SoC-internal bus, so the only allowed phy-mode is PHY_INTERFACE_MODE_INTERNAL. Signed-off-by: Martin Blumenstingl Reviewed-by: Vladimir Oltean --- drivers/net/dsa/lantiq_gswip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index a557049e34f5..b9c7076ce32f 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -1516,6 +1516,7 @@ static void gswip_xrx200_phylink_get_caps(struct dsa_switch *ds, int port, case 2: case 3: case 4: + case 6: __set_bit(PHY_INTERFACE_MODE_INTERNAL, config->supported_interfaces); break; @@ -1547,6 +1548,7 @@ static void gswip_xrx300_phylink_get_caps(struct dsa_switch *ds, int port, case 2: case 3: case 4: + case 6: __set_bit(PHY_INTERFACE_MODE_INTERNAL, config->supported_interfaces); break; From patchwork Thu Jun 6 08:52:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Schiller X-Patchwork-Id: 13688063 X-Patchwork-Delegate: kuba@kernel.org 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 C303A14036B; Thu, 6 Jun 2024 08:54:20 +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=1717664062; cv=none; b=ahXQhrchCJ5O1I3CWAae3TqTo4ko8XQPmWPrxqdVxBcy3tsqnsRK3RLpShZVmjEph5rv7qARnGlhS9IQQK4geUFcTvhB7a3jAgiFHmYtkK/++3ybPAkpg+DfFIool+o+dgkxveQPZS9VmQlywph4zJFI6NPmYMkq3LoQO7Z2mJc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664062; c=relaxed/simple; bh=66urcvoEApM1CzR497m8zafhOLZ1hN5H/7AOLh3HeQw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=raYrrnxAfjf3y9RZqEN7rOVIOudFzg4KmMM8cy3KF4zPLrTVy5MAFFfmjiTV1/oEskLqzjk4a2D82uwqGAXGIJdeMPBm+yrVghzn5rrvtdMA9Kiwqo81poWcJtsLs0n4q1XzoE+xT/h2VSS/sSTo/VUMwb2d/dqv25ZvxwKd4HM= 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 1sF8t0-00C3w0-Aw; Thu, 06 Jun 2024 10:54:18 +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 1sF8sz-008wpl-PX; Thu, 06 Jun 2024 10:54:17 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 7E49B240053; Thu, 6 Jun 2024 10:54:17 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 1299B240050; Thu, 6 Jun 2024 10:54:17 +0200 (CEST) Received: from mschiller1.dev.tdt.de (unknown [10.2.3.20]) by mail.dev.tdt.de (Postfix) with ESMTPSA id A6DD6379F6; Thu, 6 Jun 2024 10:54:16 +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 Subject: [PATCH net-next 03/13] net: dsa: lantiq_gswip: Use dev_err_probe where appropriate Date: Thu, 6 Jun 2024 10:52:24 +0200 Message-ID: <20240606085234.565551-4-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-purgate: clean X-purgate-type: clean X-purgate-ID: 151534::1717664058-F1FD4148-1CAA412A/0/0 X-Patchwork-Delegate: kuba@kernel.org From: Martin Blumenstingl dev_err_probe() can be used to simplify the existing code. Also it means we get rid of the following warning which is seen whenever the PMAC (Ethernet controller which connects to GSWIP's CPU port) has not been probed yet: gswip 1e108000.switch: dsa switch register failed: -517 Signed-off-by: Martin Blumenstingl --- drivers/net/dsa/lantiq_gswip.c | 53 ++++++++++++++++------------------ 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index b9c7076ce32f..fcb5929c9c88 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -1931,11 +1931,9 @@ static int gswip_gphy_fw_load(struct gswip_priv *priv, struct gswip_gphy_fw *gph msleep(200); ret = request_firmware(&fw, gphy_fw->fw_name, dev); - if (ret) { - dev_err(dev, "failed to load firmware: %s, error: %i\n", - gphy_fw->fw_name, ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "failed to load firmware: %s\n", + gphy_fw->fw_name); /* GPHY cores need the firmware code in a persistent and contiguous * memory area with a 16 kB boundary aligned start address. @@ -1948,9 +1946,9 @@ static int gswip_gphy_fw_load(struct gswip_priv *priv, struct gswip_gphy_fw *gph dev_addr = ALIGN(dma_addr, XRX200_GPHY_FW_ALIGN); memcpy(fw_addr, fw->data, fw->size); } else { - dev_err(dev, "failed to alloc firmware memory\n"); release_firmware(fw); - return -ENOMEM; + return dev_err_probe(dev, -ENOMEM, + "failed to alloc firmware memory\n"); } release_firmware(fw); @@ -1977,8 +1975,8 @@ static int gswip_gphy_fw_probe(struct gswip_priv *priv, gphy_fw->clk_gate = devm_clk_get(dev, gphyname); if (IS_ERR(gphy_fw->clk_gate)) { - dev_err(dev, "Failed to lookup gate clock\n"); - return PTR_ERR(gphy_fw->clk_gate); + return dev_err_probe(dev, PTR_ERR(gphy_fw->clk_gate), + "Failed to lookup gate clock\n"); } ret = of_property_read_u32(gphy_fw_np, "reg", &gphy_fw->fw_addr_offset); @@ -1998,8 +1996,8 @@ static int gswip_gphy_fw_probe(struct gswip_priv *priv, gphy_fw->fw_name = priv->gphy_fw_name_cfg->ge_firmware_name; break; default: - dev_err(dev, "Unknown GPHY mode %d\n", gphy_mode); - return -EINVAL; + return dev_err_probe(dev, -EINVAL, "Unknown GPHY mode %d\n", + gphy_mode); } gphy_fw->reset = of_reset_control_array_get_exclusive(gphy_fw_np); @@ -2050,8 +2048,9 @@ static int gswip_gphy_fw_list(struct gswip_priv *priv, priv->gphy_fw_name_cfg = &xrx200a2x_gphy_data; break; default: - dev_err(dev, "unknown GSWIP version: 0x%x", version); - return -ENOENT; + return dev_err_probe(dev, -ENOENT, + "unknown GSWIP version: 0x%x", + version); } } @@ -2059,10 +2058,9 @@ static int gswip_gphy_fw_list(struct gswip_priv *priv, if (match && match->data) priv->gphy_fw_name_cfg = match->data; - if (!priv->gphy_fw_name_cfg) { - dev_err(dev, "GPHY compatible type not supported"); - return -ENOENT; - } + if (!priv->gphy_fw_name_cfg) + return dev_err_probe(dev, -ENOENT, + "GPHY compatible type not supported"); priv->num_gphy_fw = of_get_available_child_count(gphy_fw_list_np); if (!priv->num_gphy_fw) @@ -2163,8 +2161,8 @@ static int gswip_probe(struct platform_device *pdev) return -EINVAL; break; default: - dev_err(dev, "unknown GSWIP version: 0x%x", version); - return -ENOENT; + return dev_err_probe(dev, -ENOENT, + "unknown GSWIP version: 0x%x", version); } /* bring up the mdio bus */ @@ -2172,28 +2170,27 @@ static int gswip_probe(struct platform_device *pdev) if (gphy_fw_np) { err = gswip_gphy_fw_list(priv, gphy_fw_np, version); of_node_put(gphy_fw_np); - if (err) { - dev_err(dev, "gphy fw probe failed\n"); - return err; - } + if (err) + return dev_err_probe(dev, err, + "gphy fw probe failed\n"); } /* bring up the mdio bus */ err = gswip_mdio(priv); if (err) { - dev_err(dev, "mdio probe failed\n"); + dev_err_probe(dev, err, "mdio probe failed\n"); goto gphy_fw_remove; } err = dsa_register_switch(priv->ds); if (err) { - dev_err(dev, "dsa switch register failed: %i\n", err); + dev_err_probe(dev, err, "dsa switch registration failed\n"); goto gphy_fw_remove; } if (!dsa_is_cpu_port(priv->ds, priv->hw_info->cpu_port)) { - dev_err(dev, "wrong CPU port defined, HW only supports port: %i", - priv->hw_info->cpu_port); - err = -EINVAL; + err = dev_err_probe(dev, -EINVAL, + "wrong CPU port defined, HW only supports port: %i", + priv->hw_info->cpu_port); goto disable_switch; } From patchwork Thu Jun 6 08:52:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Schiller X-Patchwork-Id: 13688064 X-Patchwork-Delegate: kuba@kernel.org 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 5287E13F443; Thu, 6 Jun 2024 08:54:28 +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=1717664070; cv=none; b=scou0LJ4tHgXcU97pyC4cu/WWIHFSMkeNzHKOm6KIwoolYpokZXvwsW5fYN6A2Jmjtz9FANv6Mlxoa7nFaLLGF6FIR1aXy1r88DOwUj3lvboUsPK0G0LOsiu1EIwCc4oMPPreUPbcWiIpja/QXAug+pII8KNyvTW2UzDUC7iGlo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664070; c=relaxed/simple; bh=r3iuti7lDwZ0oPfpVeo+fnC7tvxPcC58p6W6V9840pg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DjLotNIv5kzWSDpJcUSkRD6Xgf9vMnqa8k+vcfyIk6fhv5KhjScLpKFVQv1Tawi5kYkVi3V7neTtoWDI9Ap/zptH9aA2xqK3BjOC4P5V11HX4o6QiKxWLrUtOv3wExgx/u3H3RipazSwAWq/1Me1Slq7lbrrADflwQjPfmYeQNQ= 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 1sF8t6-002kyj-NB; Thu, 06 Jun 2024 10:54:24 +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 1sF8t6-00C3xA-5b; Thu, 06 Jun 2024 10:54:24 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id D9E0B240053; Thu, 6 Jun 2024 10:54:23 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 6F4E2240050; Thu, 6 Jun 2024 10:54:23 +0200 (CEST) Received: from mschiller1.dev.tdt.de (unknown [10.2.3.20]) by mail.dev.tdt.de (Postfix) with ESMTPSA id 362A7379F6; Thu, 6 Jun 2024 10:54:23 +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 Subject: [PATCH net-next 04/13] net: dsa: lantiq_gswip: Don't manually call gswip_port_enable() Date: Thu, 6 Jun 2024 10:52:25 +0200 Message-ID: <20240606085234.565551-5-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-purgate-ID: 151534::1717664064-7CEF3356-FB453595/0/0 X-purgate-type: clean X-purgate: clean X-Patchwork-Delegate: kuba@kernel.org From: Martin Blumenstingl We don't need to manually call gswip_port_enable() from within gswip_setup() for the CPU port. DSA does this automatically for us. Signed-off-by: Martin Blumenstingl --- drivers/net/dsa/lantiq_gswip.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index fcb5929c9c88..3fd5599fca52 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -898,8 +898,6 @@ static int gswip_setup(struct dsa_switch *ds) ds->mtu_enforcement_ingress = true; - gswip_port_enable(ds, cpu_port, NULL); - ds->configure_vlan_while_not_filtering = false; return 0; From patchwork Thu Jun 6 08:52:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Schiller X-Patchwork-Id: 13688065 X-Patchwork-Delegate: kuba@kernel.org 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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-purgate-type: clean X-purgate-ID: 151534::1717664072-214CD43F-B6CA1C71/0/0 X-purgate: clean X-Patchwork-Delegate: kuba@kernel.org 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_gswip.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 = ds->priv; int err; - if (!dsa_is_user_port(ds, port)) - return 0; - if (!dsa_is_cpu_port(ds, port)) { + u32 mdio_phy = 0; + err = gswip_add_single_port_br(priv, port, true); if (err) return err; + + if (phydev) + mdio_phy = phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK; + + gswip_mdio_mask(priv, GSWIP_MDIO_PHY_ADDR_MASK, mdio_phy, + GSWIP_MDIO_PHYp(port)); } /* 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)); - if (!dsa_is_cpu_port(ds, port)) { - u32 mdio_phy = 0; - - if (phydev) - mdio_phy = 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; } @@ -731,9 +726,6 @@ static void gswip_port_disable(struct dsa_switch *ds, int port) { struct gswip_priv *priv = ds->priv; - 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, From patchwork Thu Jun 6 08:52:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Schiller X-Patchwork-Id: 13688066 X-Patchwork-Delegate: kuba@kernel.org 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 5411C14BFA8; Thu, 6 Jun 2024 08:54:39 +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=1717664080; cv=none; b=gTojHCkOVs+dreYWfQXET3Rh2oDPJ1vVJk+HESHkh73HwC/9QRph8y125Dg+OJM94nfsfYZWd2ImlEb/dXeZ4xv/0tXrml5f9e4dJKffTmMWqiig6RZGcPrFQJLw1kUdqtIxCs51rKV5b/G3LgrbmVJlRML3hzmD8bugKNIG8f8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664080; c=relaxed/simple; bh=U5XAGK39m7qKAwqpT4r8gKe5EEI5JdrNkymm/Ox3yoE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ooYqH83SWC0PTBn5/H5tsNJdWXki8VrxliEiQ/S0AyYQY+VZyBnJsezbfrVR9mZ4vzcLTYFlVlkpA5fQdt+c4CO6X+00I5pMi4da3Nx5eLX4WiLgKXMyniLa1i3cqZ3CniHz6dv0gOivrEgedJiwd06JkHCHHnvkK1uWG5k7vfU= 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 1sF8tJ-002l13-9J; Thu, 06 Jun 2024 10:54:37 +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 1sF8tI-00EFAW-OG; Thu, 06 Jun 2024 10:54:36 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 78D62240053; Thu, 6 Jun 2024 10:54:36 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 0D843240050; Thu, 6 Jun 2024 10:54:36 +0200 (CEST) Received: from mschiller1.dev.tdt.de (unknown [10.2.3.20]) by mail.dev.tdt.de (Postfix) with ESMTPSA id ACA6C379F6; Thu, 6 Jun 2024 10:54:35 +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 Subject: [PATCH net-next 06/13] net: dsa: lantiq_gswip: Use dsa_is_cpu_port() in gswip_port_change_mtu() Date: Thu, 6 Jun 2024 10:52:27 +0200 Message-ID: <20240606085234.565551-7-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-purgate-ID: 151534::1717664077-A5EFD356-F033A507/0/0 X-purgate-type: clean X-purgate: clean X-Patchwork-Delegate: kuba@kernel.org From: Martin Blumenstingl Make the check for the CPU port in gswip_port_change_mtu() consistent with other areas of the driver by using dsa_is_cpu_port(). Signed-off-by: Martin Blumenstingl Reviewed-by: Vladimir Oltean --- drivers/net/dsa/lantiq_gswip.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index 38b5f743e5ee..789b8a1076f1 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -1464,12 +1464,11 @@ static int gswip_port_max_mtu(struct dsa_switch *ds, int port) static int gswip_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu) { struct gswip_priv *priv = ds->priv; - int cpu_port = priv->hw_info->cpu_port; /* CPU port always has maximum mtu of user ports, so use it to set * switch frame size, including 8 byte special header. */ - if (port == cpu_port) { + if (dsa_is_cpu_port(ds, port)) { new_mtu += 8; gswip_switch_w(priv, VLAN_ETH_HLEN + new_mtu + ETH_FCS_LEN, GSWIP_MAC_FLEN); From patchwork Thu Jun 6 08:52:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Schiller X-Patchwork-Id: 13688067 X-Patchwork-Delegate: kuba@kernel.org 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 A48892EAE6; Thu, 6 Jun 2024 08:54:43 +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=1717664085; cv=none; b=GXSWNcE85O0bmt9XWnsGMjQUl8IdKJxNIDrqbAVb9bqfWyJOfg8CxeBoCeHGj2zfGuwVRZT50gJ+Au0fg/wP+pOrzkLSPqSW1mQkKpB2V5Z3CY2EclOHKuDy5Qa6jL92r6vW34wpIrpjEaasKMZU6k9inuKTSM4zl6q2l7NbFQw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664085; c=relaxed/simple; bh=hAqr40aLxM9Ss999aTo1EmdgF4JWFBEkKDHKpKlM5Tw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cNIRipB1YICXeSvQA+x5UrMwokdcu9+/lL8szKsH5DTkKF2eT872FheFC7UgUdieiA5YVzViN5e1qmA2SnTGUX0PqLG/qjn0095bySi4Q47Puxu7UY+2mm5hE/SP1zk88gDzZiX7KB4rRpxWUbGdDn0CLFje3zbYw4MzrsEl6Vo= 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 1sF8tN-003vyy-DC; Thu, 06 Jun 2024 10:54:41 +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 1sF8tM-002l3J-SQ; Thu, 06 Jun 2024 10:54:40 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 96F8D240054; Thu, 6 Jun 2024 10:54:40 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 28D6C240053; Thu, 6 Jun 2024 10:54:40 +0200 (CEST) Received: from mschiller1.dev.tdt.de (unknown [10.2.3.20]) by mail.dev.tdt.de (Postfix) with ESMTPSA id E553B379F6; Thu, 6 Jun 2024 10:54:39 +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 Subject: [PATCH net-next 07/13] net: dsa: lantiq_gswip: Change literal 6 to ETH_ALEN Date: Thu, 6 Jun 2024 10:52:28 +0200 Message-ID: <20240606085234.565551-8-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-purgate: clean X-purgate-ID: 151534::1717664081-824B2642-649193BA/0/0 X-purgate-type: clean X-Patchwork-Delegate: kuba@kernel.org From: Martin Blumenstingl The addr variable in gswip_port_fdb_dump() stores a mac address. Use ETH_ALEN to make this consistent across other drivers. Signed-off-by: Martin Blumenstingl Reviewed-by: Vladimir Oltean --- drivers/net/dsa/lantiq_gswip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index 789b8a1076f1..c049f505fcc7 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -1413,7 +1413,7 @@ static int gswip_port_fdb_dump(struct dsa_switch *ds, int port, { struct gswip_priv *priv = ds->priv; struct gswip_pce_table_entry mac_bridge = {0,}; - unsigned char addr[6]; + unsigned char addr[ETH_ALEN]; int i; int err; From patchwork Thu Jun 6 08:52:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Schiller X-Patchwork-Id: 13688068 X-Patchwork-Delegate: kuba@kernel.org 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 F320E1514F4; Thu, 6 Jun 2024 08:54:45 +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=1717664087; cv=none; b=ZKEDnaL6AYb0fC3dNGJEw8ey1bVEYQoNfxAwlvil5jThjmIi4wsfy8K8HtTUsuA6EqTUeNfKbQqbZFwp0W5tR7FiC7He+RiwygIR3aYbVLJvB97b81RZSmb7Pov4Fyb1Vs8OQlPct2jfaKDwq2aCuk8vw1mqMrR4qxtarG4FezU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664087; c=relaxed/simple; bh=Tku3qhWCDMuJ21BgSTr1MYubHb54Q4c0MxJpGN/1K7Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DKFVvCkkKO51fehZx5L21odbFE3+PSjcpFSNcD1z+6ZGYdgcJBKQlFusfjwfYkHsgKEQBMdfZ09CXP4mUit4rsOvKtwrtfuDSBlW4z/LthZLw3sMgoxZ/63h5+faSodCUHYhe+0bhNzie1RbnF4dhM3CnQ0vicCIUgr09KUCkBg= 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 1sF8tQ-00EUxP-21; Thu, 06 Jun 2024 10:54:44 +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 1sF8tP-00EK3l-Fz; Thu, 06 Jun 2024 10:54:43 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 36EC4240054; Thu, 6 Jun 2024 10:54:43 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id BD3C0240053; Thu, 6 Jun 2024 10:54:42 +0200 (CEST) Received: from mschiller1.dev.tdt.de (unknown [10.2.3.20]) by mail.dev.tdt.de (Postfix) with ESMTPSA id 7C9E5379F6; Thu, 6 Jun 2024 10:54:42 +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 Subject: [PATCH net-next 08/13] net: dsa: lantiq_gswip: Consistently use macros for the mac bridge table Date: Thu, 6 Jun 2024 10:52:29 +0200 Message-ID: <20240606085234.565551-9-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-purgate-type: clean X-purgate: clean X-purgate-ID: 151534::1717664084-E147EADA-BC968BDD/0/0 X-Patchwork-Delegate: kuba@kernel.org From: Martin Blumenstingl Introduce a new GSWIP_TABLE_MAC_BRIDGE_PORT macro and use it throughout the driver. Also update GSWIP_TABLE_MAC_BRIDGE_STATIC to use the BIT() macro. This makes the driver code easier to understand. Signed-off-by: Martin Blumenstingl Reviewed-by: Vladimir Oltean --- drivers/net/dsa/lantiq_gswip.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index c049f505fcc7..ee8296d5b901 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -236,7 +236,8 @@ #define GSWIP_TABLE_ACTIVE_VLAN 0x01 #define GSWIP_TABLE_VLAN_MAPPING 0x02 #define GSWIP_TABLE_MAC_BRIDGE 0x0b -#define GSWIP_TABLE_MAC_BRIDGE_STATIC 0x01 /* Static not, aging entry */ +#define GSWIP_TABLE_MAC_BRIDGE_STATIC BIT(0) /* Static not, aging entry */ +#define GSWIP_TABLE_MAC_BRIDGE_PORT GENMASK(7, 4) /* Port on learned entries */ #define XRX200_GPHY_FW_ALIGN (16 * 1024) @@ -1307,7 +1308,8 @@ static void gswip_port_fast_age(struct dsa_switch *ds, int port) if (mac_bridge.val[1] & GSWIP_TABLE_MAC_BRIDGE_STATIC) continue; - if (((mac_bridge.val[0] & GENMASK(7, 4)) >> 4) != port) + if (port != FIELD_GET(GSWIP_TABLE_MAC_BRIDGE_PORT, + mac_bridge.val[0])) continue; mac_bridge.valid = false; @@ -1445,7 +1447,8 @@ static int gswip_port_fdb_dump(struct dsa_switch *ds, int port, return err; } } else { - if (((mac_bridge.val[0] & GENMASK(7, 4)) >> 4) == port) { + if (port == FIELD_GET(GSWIP_TABLE_MAC_BRIDGE_PORT, + mac_bridge.val[0])) { err = cb(addr, 0, false, data); if (err) return err; From patchwork Thu Jun 6 08:52:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Schiller X-Patchwork-Id: 13688069 X-Patchwork-Delegate: kuba@kernel.org 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 6DFB413CFBC; Thu, 6 Jun 2024 08:54:51 +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=1717664092; cv=none; b=EnKYKmaj5ibVfLb7c3Wps91stMRB2iYz+p4PavAQAexxK18GAkv/QXveh36sJp04R6Wlm0a9NidgXLMo+0NRfRrwICQK1ybqAs8HiOvjUOKLKT/n8E7PBDtoKrQ8S/ppW7C7//j3dOE4Xkqi/pzkZdtblE0OtoVKuQdrWYbrM/s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664092; c=relaxed/simple; bh=CwVmWu56KuGwPm5oczbn1YtNSkQIFslQ4iVcM+3rwS8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kusQKjZfRnFDK+Rg2CpJj28LRh87n6MIldQ22auV96rkoqf3ELAs1SwePwNyf0p8pcBLJZAYcEf0MDgTgEL8NleGvk2qSiMc+XiPSu9qTjp3Q3l+R1RMF/PpejvJZ4yl+AQa7/Fr4NmwkBKGK6KAIWuHfuhndI0OrEcK7teW9H4= 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 1sF8tV-008wwQ-CV; Thu, 06 Jun 2024 10:54:49 +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 1sF8tU-008ww4-R0; Thu, 06 Jun 2024 10:54:48 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 8C7A7240054; Thu, 6 Jun 2024 10:54:48 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 22AAC240053; Thu, 6 Jun 2024 10:54:48 +0200 (CEST) Received: from mschiller1.dev.tdt.de (unknown [10.2.3.20]) by mail.dev.tdt.de (Postfix) with ESMTPSA id E563D379F6; Thu, 6 Jun 2024 10:54:47 +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 Subject: [PATCH net-next 09/13] net: dsa: lantiq_gswip: Forbid gswip_add_single_port_br on the CPU port Date: Thu, 6 Jun 2024 10:52:30 +0200 Message-ID: <20240606085234.565551-10-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-purgate-ID: 151534::1717664089-AFCA6257-36AAEA49/0/0 X-purgate: clean X-purgate-type: clean X-Patchwork-Delegate: kuba@kernel.org From: Martin Blumenstingl Calling gswip_add_single_port_br() with the CPU port would be a bug because then only the CPU port could talk to itself. Add the CPU port to the validation at the beginning of gswip_add_single_port_br(). Signed-off-by: Martin Blumenstingl --- drivers/net/dsa/lantiq_gswip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index ee8296d5b901..d2195271ffe9 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -657,7 +657,7 @@ static int gswip_add_single_port_br(struct gswip_priv *priv, int port, bool add) unsigned int max_ports = priv->hw_info->max_ports; int err; - if (port >= max_ports) { + if (port >= max_ports || dsa_is_cpu_port(priv->ds, port)) { dev_err(priv->dev, "single port for %i supported\n", port); return -EIO; } From patchwork Thu Jun 6 08:52:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Schiller X-Patchwork-Id: 13688070 X-Patchwork-Delegate: kuba@kernel.org 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 F19A71474BD; Thu, 6 Jun 2024 08:54:55 +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=1717664097; cv=none; b=Ml3vmjJz8WHvh3Um0IWN3uoFzzhVzcgNcX5I8z+ufV8rtqqwIj11AUMVJ+ZjTaemDzp/tcNbSIay8e1VbTCdgULld4HnNxUk7dPQmwv/83+HVEhyplxeicVW6GhuxqMwlhtmH2oURaf/wmfKNacwybNp5CC9uPKZyVUWM87s+IA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664097; c=relaxed/simple; bh=fSzXFHz8So6LOSgm/n9bpHmuN4nc6jc2gCVZIUfzEaE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m7bw5ITSq4wedRR6SSSyvD5In3caetRJnl1yezC2tyw9Cn/90mCnN4c/n5dU/e/DlONLUJlEvr4lFXfh4aUX6iP++SoilRarKP7B2UxYwvI8dP3xiajt+WW3lSnf8zxggKGN3ChtUQ77naXCsBz94IlnueVQAr5ThBwaTNNSMZg= 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 1sF8tZ-008wxL-VN; Thu, 06 Jun 2024 10:54:54 +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 1sF8tZ-002l5c-E4; Thu, 06 Jun 2024 10:54:53 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 2A630240053; Thu, 6 Jun 2024 10:54:53 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id B4E99240050; Thu, 6 Jun 2024 10:54:52 +0200 (CEST) Received: from mschiller1.dev.tdt.de (unknown [10.2.3.20]) by mail.dev.tdt.de (Postfix) with ESMTPSA id 87EBE379F6; Thu, 6 Jun 2024 10:54:52 +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 Subject: [PATCH net-next 10/13] net: dsa: lantiq_gswip: Fix error message in gswip_add_single_port_br() Date: Thu, 6 Jun 2024 10:52:31 +0200 Message-ID: <20240606085234.565551-11-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-purgate: clean X-purgate-ID: 151534::1717664093-AECA0257-5965B5D2/0/0 X-purgate-type: clean X-Patchwork-Delegate: kuba@kernel.org From: Martin Blumenstingl The error message is printed when the port cannot be used. Update the error message to reflect that. Signed-off-by: Martin Blumenstingl --- drivers/net/dsa/lantiq_gswip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index d2195271ffe9..3c96a62b8e0a 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -658,7 +658,8 @@ static int gswip_add_single_port_br(struct gswip_priv *priv, int port, bool add) int err; if (port >= max_ports || dsa_is_cpu_port(priv->ds, port)) { - dev_err(priv->dev, "single port for %i supported\n", port); + dev_err(priv->dev, "single port for %i is not supported\n", + port); return -EIO; } From patchwork Thu Jun 6 08:52:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Schiller X-Patchwork-Id: 13688071 X-Patchwork-Delegate: kuba@kernel.org 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 4629513D8AE; Thu, 6 Jun 2024 08:55:00 +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=1717664101; cv=none; b=HuKmF2IbXiAVg8woW+7MoBCpeYX7Bk1uJfuNYNc+YGbNKb/849WpZ/DDRM/UNHMp7VwEmsA3kOkV2kW9kzUtkLDHvEW5Z4hqnVfOUAwSNzjcK/67rU75AP6oeg60NAkQTWVMbkPn/odCAMNM4f7eNIGZHb4nnvij0lyvgwXYMkM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664101; c=relaxed/simple; bh=KYnzf2IvAqkR+TMZf28aEgu6bpbKnDGL8pVsCkiQRq8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e+zIFN0hmFol8Ai66kWCGap/u8pJGTA3uzxpi9Ybv0t74ALJpra/NrJFaGeyjF5RQWWV5sKiJgVOIrGvwlV8T3HUt5V2FRyExY5+7mAYZfSyqURN0rmpa7fxM3UOLA+5vBJjMGxlfEBSNLQoK+M5m288JKGdZDEq7x8dPBgsInI= 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-00EUz7-7r; Thu, 06 Jun 2024 10:54:58 +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-00EK6Z-MQ; Thu, 06 Jun 2024 10:54:57 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 6C6B9240053; Thu, 6 Jun 2024 10:54:57 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 03993240050; Thu, 6 Jun 2024 10:54:57 +0200 (CEST) Received: from mschiller1.dev.tdt.de (unknown [10.2.3.20]) by mail.dev.tdt.de (Postfix) with ESMTPSA id ACCFC379F6; Thu, 6 Jun 2024 10:54:56 +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 11/13] net: dsa: lantiq_gswip: Fix comments in gswip_port_vlan_filtering() Date: Thu, 6 Jun 2024 10:52:32 +0200 Message-ID: <20240606085234.565551-12-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-purgate-type: clean X-purgate: clean X-purgate-ID: 151534::1717664098-EEC7DADA-81332706/0/0 X-Patchwork-Delegate: kuba@kernel.org From: Martin Blumenstingl Update the comments in gswip_port_vlan_filtering() so it's clear that there are two separate cases, one for "tag based VLAN" and another one for "port based VLAN". Suggested-by: Martin Schiller Signed-off-by: Martin Blumenstingl --- drivers/net/dsa/lantiq_gswip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index 3c96a62b8e0a..f2faee112e33 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -786,7 +786,7 @@ static int gswip_port_vlan_filtering(struct dsa_switch *ds, int port, } if (vlan_filtering) { - /* Use port based VLAN tag */ + /* Use tag based VLAN */ gswip_switch_mask(priv, GSWIP_PCE_VCTRL_VSR, GSWIP_PCE_VCTRL_UVR | GSWIP_PCE_VCTRL_VIMR | @@ -795,7 +795,7 @@ static int gswip_port_vlan_filtering(struct dsa_switch *ds, int port, gswip_switch_mask(priv, GSWIP_PCE_PCTRL_0_TVM, 0, GSWIP_PCE_PCTRL_0p(port)); } else { - /* Use port based VLAN tag */ + /* Use port based VLAN */ gswip_switch_mask(priv, GSWIP_PCE_VCTRL_UVR | GSWIP_PCE_VCTRL_VIMR | GSWIP_PCE_VCTRL_VEMR, From patchwork Thu Jun 6 08:52:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Schiller X-Patchwork-Id: 13688072 X-Patchwork-Delegate: kuba@kernel.org 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 9123A155307; Thu, 6 Jun 2024 08:55:04 +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=1717664105; cv=none; b=B6FACCMtn+WldNoxkTvhv68n7xNXnaF+jmOL/BVyCvedB092VGALfqDHuWVw9aFojtHMOCLiQx3xYcmYlMf2/G0bZlHZMD9pKDnGxGzRLG2VqgH9M7oKEvRrxV+ArhdPnJa0+ukdSCZm1w9FkM0R0G9AOkMh2dv8wlgdgzV+XTM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664105; c=relaxed/simple; bh=whHbmZoVgRqfuvp8JQDubSalkz34FeHDYtrAB7NSNX0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OlptdBhp1S+SIUXbU1QIWIdp+Zi9sckjaGcU7RdCfU9SdSxCDhvO5MibuUKpQBlGKe2k7mwDy7jKLjYbiROz+eQ7sqxWiDbLN4RqwDXXMRfk+y6LekfRWxLsL9augkOK+duZNkG/AGAuWC98ixomPxjbiISM7qf7+iqwLTbUTs8= 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 1sF8ti-00ESSM-H9; Thu, 06 Jun 2024 10:55:02 +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 1sF8th-002l7A-W2; Thu, 06 Jun 2024 10:55:02 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id ADD66240053; Thu, 6 Jun 2024 10:55:01 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 41261240050; Thu, 6 Jun 2024 10:55:01 +0200 (CEST) Received: from mschiller1.dev.tdt.de (unknown [10.2.3.20]) by mail.dev.tdt.de (Postfix) with ESMTPSA id E8977379F6; Thu, 6 Jun 2024 10:55:00 +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 Subject: [PATCH net-next 12/13] net: dsa: lantiq_gswip: Add and use a GSWIP_TABLE_MAC_BRIDGE_FID macro Date: Thu, 6 Jun 2024 10:52:33 +0200 Message-ID: <20240606085234.565551-13-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-purgate: clean X-purgate-type: clean X-purgate-ID: 151534::1717664102-06392B7C-B77CF30C/0/0 X-Patchwork-Delegate: kuba@kernel.org From: Martin Blumenstingl Only bits [5:0] in mac_bridge.key[3] are reserved for the FID. Add a macro so this becomes obvious when reading the driver code. Signed-off-by: Martin Blumenstingl --- drivers/net/dsa/lantiq_gswip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index f2faee112e33..4bb894e75b81 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -238,6 +238,7 @@ #define GSWIP_TABLE_MAC_BRIDGE 0x0b #define GSWIP_TABLE_MAC_BRIDGE_STATIC BIT(0) /* Static not, aging entry */ #define GSWIP_TABLE_MAC_BRIDGE_PORT GENMASK(7, 4) /* Port on learned entries */ +#define GSWIP_TABLE_MAC_BRIDGE_FID GENMASK(5, 0) /* Filtering identifier */ #define XRX200_GPHY_FW_ALIGN (16 * 1024) @@ -1385,7 +1386,7 @@ static int gswip_port_fdb(struct dsa_switch *ds, int port, mac_bridge.key[0] = addr[5] | (addr[4] << 8); mac_bridge.key[1] = addr[3] | (addr[2] << 8); mac_bridge.key[2] = addr[1] | (addr[0] << 8); - mac_bridge.key[3] = fid; + mac_bridge.key[3] = FIELD_PREP(GSWIP_TABLE_MAC_BRIDGE_FID, fid); mac_bridge.val[0] = add ? BIT(port) : 0; /* port map */ mac_bridge.val[1] = GSWIP_TABLE_MAC_BRIDGE_STATIC; mac_bridge.valid = add; From patchwork Thu Jun 6 08:52:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Schiller X-Patchwork-Id: 13688073 X-Patchwork-Delegate: kuba@kernel.org 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 DA016155A46; Thu, 6 Jun 2024 08:55:09 +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=1717664111; cv=none; b=rcIvhXjm4YmCSpeNpcIjJO1JaD+Utv6vaKRcjM5ayGtmXXZHh54UvVX56dqV9c1bkRVjxLcmfNBhnxYAByR9vxGfVDaUGNAsnwAWWCXtAOsoR53a4LbcWbCO+vHb/RJXuaoNshfcMApVxnoTlexTgINfwWWZ8MwSa06u2XdJTsg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664111; c=relaxed/simple; bh=Bn8X3b011v9yLue7/qfY2gNcWkxvqcOkHg5uIA94qxA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GEZwRN/E0U74yySJX+8pOhY1gImNRmI5r65qsb/9L/KphWf2DM1tczuItJyqFhhS4ASC4O2UJMEB6D936i+pkbQ6RV1ahwuPztQJVD/uI8WVMaSr5LFQIDqlwZEtHG6HHdJU/hj8SKeZpzB1GE6ghdZiViJBL4DiemZz6oiHqbU= 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 1sF8tn-003wJX-S1; Thu, 06 Jun 2024 10:55:07 +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 1sF8tn-008x2v-AZ; Thu, 06 Jun 2024 10:55:07 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 0EF2A240053; Thu, 6 Jun 2024 10:55:07 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 996C3240050; Thu, 6 Jun 2024 10:55:06 +0200 (CEST) Received: from mschiller1.dev.tdt.de (unknown [10.2.3.20]) by mail.dev.tdt.de (Postfix) with ESMTPSA id 6D083379F6; Thu, 6 Jun 2024 10:55:06 +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 Subject: [PATCH net-next 13/13] net: dsa: lantiq_gswip: Improve error message in gswip_port_fdb() Date: Thu, 6 Jun 2024 10:52:34 +0200 Message-ID: <20240606085234.565551-14-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-purgate-type: clean X-purgate-ID: 151534::1717664107-834B4642-90B4C736/0/0 X-purgate: clean X-Patchwork-Delegate: kuba@kernel.org From: Martin Blumenstingl Print the port which is not found to be part of a bridge so it's easier to investigate the underlying issue. Signed-off-by: Martin Blumenstingl --- drivers/net/dsa/lantiq_gswip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index 4bb894e75b81..69035598e8a4 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -1377,7 +1377,8 @@ static int gswip_port_fdb(struct dsa_switch *ds, int port, } if (fid == -1) { - dev_err(priv->dev, "Port not part of a bridge\n"); + dev_err(priv->dev, + "Port %d is not known to be part of bridge\n", port); return -EINVAL; }