From patchwork Thu Oct 6 20:56:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1687189 X-Patchwork-Delegate: sander@svanheule.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=uuoO2+D8; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=QfOUxC1F; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mk3k271cqz23jg for ; Fri, 7 Oct 2022 08:00:26 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gVThrZrA00hgvbuCDnxN+6iDDYwAW++4epGtkzB4y20=; b=uuoO2+D8u4eW4F XKZlkeGI1VwS5WacNITYD/Fx78ABylLiEC5SDF8+MEKChSRik3rfTDOmzs5dL91P7VkWSRMFXMG/v LiSTAa0bRWyBJ8doIxAElA6wTUFs9/LXSK4KQFpR10QAKnUUy1jsSfqDc/6y/cfOga+ogK7fLaCkz aqPjEvAnTKssTyfBVNxQgN2fCeXSvcLQokvq92p26EgMoTkXZeLmU4OvEsA7iMQObtYHLGW/Xl1O+ RDGnG4E99Rt+m6Xrs7h1X24kHPIVs3jHINEXHws/lfhjkP5rzcYbW1R+TV/bNfv0NNq0VKn34frFu 5T8i7OEIRzWj0qk5RCkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogXvb-005B4K-Hn; Thu, 06 Oct 2022 20:57:11 +0000 Received: from polaris.svanheule.net ([2a00:c98:2060:a004:1::200]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogXvC-005Aox-EF for openwrt-devel@lists.openwrt.org; Thu, 06 Oct 2022 20:56:54 +0000 Received: from terra.. (247.72-129-109.adsl-dyn.isp.belgacom.be [109.129.72.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id E6D5F32CD24; Thu, 6 Oct 2022 22:56:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1665089799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rkSVcFoFDHGC+5rrSRjf3zc3vIAmukiUBF9YE7P57Ts=; b=QfOUxC1FX6gcqT09FTz93ht6FyzYUmfQdPXCO7RHimc6mwd10u2WRX5t4l40M0NTqo6Aub scPcIXX/waChcllmXc8V5tNe6SScZwDUJUHLSPR0CYp8ThXAcSOn6TpqlRyyhMOKnWBlRu 0PiyeGxqoApVWxgdDsrL2dugf/I/XzR9jo7vxX3Nzrf0frna/iX+0YfvrJwbSEKRsC/HEJ flQOTMzoN8xvpFIW82GhdrNoybEiKG/NmEewTPIei0n6ez6xckvSyy61LDz4jxz3WDjXz6 qWpAIvr/lqFyRvNHxhJXyRxvHaIP2nurMNT1g1cFQAiTfyj/k7cY0L3j5TcxzQ== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Cc: Sander Vanheule , INAGAKI Hiroshi Subject: [PATCH 1/8] realtek: separate lock of RTL8231 from phy driver Date: Thu, 6 Oct 2022 22:56:26 +0200 Message-Id: <5166139771aabbf3f1dedf27eb4cfd5ef2ca05a3.1665089731.git.sander@svanheule.net> X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221006_135652_813605_41A4D387 X-CRM114-Status: UNSURE ( 8.52 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: INAGAKI Hiroshi RTL8231 and ethernet phys are not on the same bus, so separate the lock to each own to cut off the unnecessary dependency. Signed-off-by: INAGAKI Hiroshi --- .../files-5.10/drivers/gpio/gpio-rtl8231.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [2a00:c98:2060:a004:1:0:0:200 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: INAGAKI Hiroshi RTL8231 and ethernet phys are not on the same bus, so separate the lock to each own to cut off the unnecessary dependency. Signed-off-by: INAGAKI Hiroshi --- .../files-5.10/drivers/gpio/gpio-rtl8231.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c b/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c index 7a1d6aa136ad..368c4fa60fb9 100644 --- a/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c +++ b/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c @@ -29,9 +29,10 @@ struct rtl8231_gpios { int ext_gpio_indrt_access; }; -extern struct mutex smi_lock; extern struct rtl83xx_soc_info soc_info; +DEFINE_MUTEX(miim_lock); + static u32 rtl8231_read(struct rtl8231_gpios *gpios, u32 reg) { u32 t = 0, n = 0; @@ -187,9 +188,9 @@ static int rtl8231_direction_input(struct gpio_chip *gc, unsigned int offset) struct rtl8231_gpios *gpios = gpiochip_get_data(gc); pr_debug("%s: %d\n", __func__, offset); - mutex_lock(&smi_lock); + mutex_lock(&miim_lock); err = rtl8231_pin_dir(gpios, offset, 1); - mutex_unlock(&smi_lock); + mutex_unlock(&miim_lock); return err; } @@ -199,9 +200,9 @@ static int rtl8231_direction_output(struct gpio_chip *gc, unsigned int offset, i struct rtl8231_gpios *gpios = gpiochip_get_data(gc); pr_debug("%s: %d\n", __func__, offset); - mutex_lock(&smi_lock); + mutex_lock(&miim_lock); err = rtl8231_pin_dir(gpios, offset, 0); - mutex_unlock(&smi_lock); + mutex_unlock(&miim_lock); if (!err) err = rtl8231_pin_set(gpios, offset, value); return err; @@ -213,9 +214,9 @@ static int rtl8231_get_direction(struct gpio_chip *gc, unsigned int offset) struct rtl8231_gpios *gpios = gpiochip_get_data(gc); pr_debug("%s: %d\n", __func__, offset); - mutex_lock(&smi_lock); + mutex_lock(&miim_lock); rtl8231_pin_dir_get(gpios, offset, &v); - mutex_unlock(&smi_lock); + mutex_unlock(&miim_lock); return v; } @@ -224,9 +225,9 @@ static int rtl8231_gpio_get(struct gpio_chip *gc, unsigned int offset) u16 state = 0; struct rtl8231_gpios *gpios = gpiochip_get_data(gc); - mutex_lock(&smi_lock); + mutex_lock(&miim_lock); rtl8231_pin_get(gpios, offset, &state); - mutex_unlock(&smi_lock); + mutex_unlock(&miim_lock); if (state & (1 << (offset % 16))) return 1; return 0; From patchwork Thu Oct 6 20:56:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1687191 X-Patchwork-Delegate: sander@svanheule.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=ikG8QVbb; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=ehmlyGuZ; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mk3k263lwz1yqk for ; Fri, 7 Oct 2022 08:00:26 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hBboVRCGs3AYt+eSKwaaD1x4OTI0YgxTWpmPaZFQK3s=; b=ikG8QVbbo+wbnL dArTMVWpNtiDfdOKLuOYO9fv6bR4U9l+1pDaWKOWW81ZIY8m8eAzow0PF6bwUgOj7Mn+iEAqZ/YXy afkS6WHpBcgCV/OS0VqnpCUEFJjiM1z8JiCAii6UftWSmhfTCYm+mzSZNBvJyYrhkFCMjxl1w56RB LZSrJvHeW98cuqDub389NHMvHUjwZMbPQMIYApEqe/BTqHT0ipjWXN6tamEim4CAAMPK2D9Zhh3RP kRk70O5ugcEUk2zkDrpahaU3JW4h3vg21CwEThV+Ae5QIFwQPrUjaXZC0sjT/y18r/ra5JxhCgl5H AGnv3W1O5sNWLFaKULPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogXw1-005B9o-A6; Thu, 06 Oct 2022 20:57:37 +0000 Received: from polaris.svanheule.net ([84.16.241.116]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogXvC-005ApA-Nh for openwrt-devel@lists.openwrt.org; Thu, 06 Oct 2022 20:56:55 +0000 Received: from terra.. (247.72-129-109.adsl-dyn.isp.belgacom.be [109.129.72.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 5559632CD25; Thu, 6 Oct 2022 22:56:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1665089799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U5C0HQmoM/chD7m4gBd2N6Xjk1tSu1h5KKNQNdnZdB8=; b=ehmlyGuZjHqKOIiP5mexLT9fElpc0YOAnQ43QQETWGd4qVpCJvN2tqwKaDmxKqseRNViDq Brxwm7mfc0qkXVsJxa+9YwGIB6se0InZJBmYMefNIVFJ0m1FK5hh1qFa0yhtU66nxROhvT GVrWmz7AUjDO+Y1uA04LZ28jvVp5FnDi+YjPV1AfhqbUssl1mvj/1cBSctPebJ1JvyvTpb RqOen/4c4dhZuu06k/iwhsP0et48+Ud0z3FkLi966LsplKcluyr3J3cNnXpYXX8DLds9IN Btw+aIlPooW6dh9JZnyiTtl19JXYFmLpKlJeXCKloSFYek+I1IZrBJidVx0FRQ== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Cc: Sander Vanheule , INAGAKI Hiroshi Subject: [PATCH 2/8] realtek: update SMP-related calls in prom_init() Date: Thu, 6 Oct 2022 22:56:27 +0200 Message-Id: <64d892f6d07176bfb4a9b3cdc6552803df2b6624.1665089731.git.sander@svanheule.net> X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221006_135652_818957_A8B0C296 X-CRM114-Status: GOOD ( 10.19 ) X-Spam-Score: -2.5 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: INAGAKI Hiroshi The availabibity of probing CPC depends on CONFIG_MIPS_CPC symbol and it will be checked in arch/mips/include/asm/mips-cpc.h. RTL9310 selects this symbol, so the family check is redudant. Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [84.16.241.116 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: INAGAKI Hiroshi The availabibity of probing CPC depends on CONFIG_MIPS_CPC symbol and it will be checked in arch/mips/include/asm/mips-cpc.h. RTL9310 selects this symbol, so the family check is redudant. Furthermore, mips_cm_probe() is already called from setup_arch() in mips/kernel/setup.c before prom_init(), and as such is not required. Also move mips_cpc_probe() to run just before registering SMP ops. Signed-off-by: INAGAKI Hiroshi [squash SMP change commits, reword commit message] Signed-off-by: Sander Vanheule --- This patch only really has an impact on the rtl931x subtarget, which has no devices. Noboby is currently set up to test these patches either, but the end result is closer to MIPS_GENERIC, so I do not expect it to cause issues. --- target/linux/realtek/files-5.10/arch/mips/rtl838x/prom.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/target/linux/realtek/files-5.10/arch/mips/rtl838x/prom.c b/target/linux/realtek/files-5.10/arch/mips/rtl838x/prom.c index 1428c01a3302..d04d77e438fc 100644 --- a/target/linux/realtek/files-5.10/arch/mips/rtl838x/prom.c +++ b/target/linux/realtek/files-5.10/arch/mips/rtl838x/prom.c @@ -214,14 +214,10 @@ void __init prom_init(void) pr_info("SoC Type: %s\n", get_system_type()); - /* Early detection of CMP support */ - if(soc_info.family == RTL9310_FAMILY_ID) { - mips_cm_probe(); - mips_cpc_probe(); - } - prom_init_cmdline(); + mips_cpc_probe(); + if (!register_cps_smp_ops()) return; From patchwork Thu Oct 6 20:56:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1687192 X-Patchwork-Delegate: sander@svanheule.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=TS12jIPz; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=HPJbSTez; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mk3k54mdvz1yqk for ; Fri, 7 Oct 2022 08:00:29 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vfnu4oCErfBTIzbtwD3qlsk3PaukYDgKwn9ZqHW3z4k=; b=TS12jIPz3UOr/p h2W2VEYhRr18Ye8pHRnaxNncWY1UJdqWIW9GroKwrMHBz2XRdtHtJIg8DIdpUo3Tt8NuurWqAPfn0 HioOzn4dlUPpntGbidYdkES9gnwWd1Eo/h4uGsceT1Qia+8HEGy1hY/+EgHabfAbZP9zEW0WKcAdI oEI4/Unzzoccjg8ZTfQuMvQeBf6zTkmrnHPkMcP7L3EZfJ6AoAMj/99z5lJEiBmnBd31Jk+++Stbh JZlbVZv8kHiDE4PF0qBdsELSwlCcb75ON4unZsDneltfZGO60AF/pzrhqNJFiPChppzqnXdlfwF7z LsLEsofkxyLEJ9oElP5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogXvN-005AxU-Qy; Thu, 06 Oct 2022 20:56:58 +0000 Received: from polaris.svanheule.net ([84.16.241.116]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogXvC-005ApK-Iy for openwrt-devel@lists.openwrt.org; Thu, 06 Oct 2022 20:56:54 +0000 Received: from terra.. (247.72-129-109.adsl-dyn.isp.belgacom.be [109.129.72.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id B1BB632CD26; Thu, 6 Oct 2022 22:56:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1665089799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PNPQ3ImR3yb9dLEnQ4x/eZzGbIGn7xG5AnL49jPysTw=; b=HPJbSTezhSDMJEt7R0qPpjvqKhQrkRIbgLfUTKWFOp7QlQqqzn6XJVYAOft/6PSWxQssys xt35+EV6OynRQ8iWPoeHLZg3BeTAg2nbNdlVqWzT5W2D2XLuUjMcjgXx4cSATVlXSTquHV NgDcXCrH+BZ0tX4JRLhTKMdeb/4OMyS5sHBGLmD8BAOlzxyz5UEC44U1V3ysmrWzK9KX3Y aENe7HDUQx9Gv9YCwVWYYgSBRBiqkRLjFlDBbr/PYLQ3Cea6z8YbIPOa+Yg6voSe24tBJY cU6+Us5x2N5eEypBC+8gpAyfu7VjFWTX7KXmr88j3Yi+ivqclUQa1myts8SIvA== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Cc: Sander Vanheule , INAGAKI Hiroshi Subject: [PATCH 3/8] realtek: use MIPS fw_init_cmdline() Date: Thu, 6 Oct 2022 22:56:28 +0200 Message-Id: <90b3c99ab8cc0f8d3f04d4b0a9e6dc3edb1b5092.1665089731.git.sander@svanheule.net> X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221006_135652_817556_C58F4754 X-CRM114-Status: UNSURE ( 8.79 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: INAGAKI Hiroshi Use the generic function of MIPS in Linux Kernel instead of open coding our own initialisation. Signed-off-by: INAGAKI Hiroshi [amend commit message] Signed-off-by: Sander Vanheule --- .../files-5.10/arch/mips/rtl838x/prom.c | 22 ++ [...] Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [84.16.241.116 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: INAGAKI Hiroshi Use the generic function of MIPS in Linux Kernel instead of open coding our own initialisation. Signed-off-by: INAGAKI Hiroshi [amend commit message] Signed-off-by: Sander Vanheule --- .../files-5.10/arch/mips/rtl838x/prom.c | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/target/linux/realtek/files-5.10/arch/mips/rtl838x/prom.c b/target/linux/realtek/files-5.10/arch/mips/rtl838x/prom.c index d04d77e438fc..dd1b2b170d31 100644 --- a/target/linux/realtek/files-5.10/arch/mips/rtl838x/prom.c +++ b/target/linux/realtek/files-5.10/arch/mips/rtl838x/prom.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -78,25 +79,6 @@ void __init device_tree_init(void) unflatten_and_copy_device_tree(); } -static void __init prom_init_cmdline(void) -{ - int argc = fw_arg0; - char **argv = (char **) KSEG1ADDR(fw_arg1); - int i; - - arcs_cmdline[0] = '\0'; - - for (i = 0; i < argc; i++) { - char *p = (char *) KSEG1ADDR(argv[i]); - - if (CPHYSADDR(p) && *p) { - strlcat(arcs_cmdline, p, sizeof(arcs_cmdline)); - strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline)); - } - } - pr_info("Kernel command line: %s\n", arcs_cmdline); -} - void __init identify_rtl9302(void) { switch (sw_r32(RTL93XX_MODEL_NAME_INFO) & 0xfffffff0) { @@ -214,7 +196,7 @@ void __init prom_init(void) pr_info("SoC Type: %s\n", get_system_type()); - prom_init_cmdline(); + fw_init_cmdline(); mips_cpc_probe(); From patchwork Thu Oct 6 20:56:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1687193 X-Patchwork-Delegate: sander@svanheule.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=iLuvYvaM; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=eqEr6aTH; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mk3kL2tQrz1yqk for ; Fri, 7 Oct 2022 08:00:42 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YCcTGjy3Vpngk0Gixwp8266o5tCkijQ0qTBP7EfmFu0=; b=iLuvYvaMI/SVSu dA56ejTg/qesodLmo9QXsEPPwI9jS88zhhjUAS1bYVs0iAaBOrASd6cFVjWp+DubN0hRDaS4sWdoM E/deX7WcoFzcQVj6ItLYL7W/l1DOqH3nf8YqcBCLSqHnESa0gjFO8tfWVmcGQJfVP6Md+vGrrHMF5 OftoS0zvMp5opr1KCuATEL9aPCyhtJLnsgGT1inUHmIYGxNgzcdyPCuvxp8J9w9i2UjiVmML7ZZWE zrKT7VQdIvx3AA/sh2jSd5aGYl+LmfLWf/YZgVWUkrMQq1ANgJsiZ/HJx6yQEInrDlq5MF5Ob9nOC CkNm5SlpzQcenUSmgYVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogXvn-005B7N-PG; Thu, 06 Oct 2022 20:57:23 +0000 Received: from polaris.svanheule.net ([2a00:c98:2060:a004:1::200]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogXvC-005ApL-CJ for openwrt-devel@lists.openwrt.org; Thu, 06 Oct 2022 20:56:55 +0000 Received: from terra.. (247.72-129-109.adsl-dyn.isp.belgacom.be [109.129.72.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 38CDA32CD27; Thu, 6 Oct 2022 22:56:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1665089800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QYluau1dj6Mfrdrsbh1ywrJxebhK8sd7IlogWHTVfSU=; b=eqEr6aTHK4OgZR6GVug26JC/mWVieAIeFZU03fyvPSXKn4UjPvMn8ldHzYciUPUD6auqdG vg86U59YGmsToGsTIt0AYG3ndpbJdqL1sx7KO/hoZP5+suZGIIdd1Awba6C2dPPiBZpMUq NMrkR1+//u6zTzKbJq68nWrXN2lfl9U3iA+jE669931S42A0zgFWnl9f8p7GxoUkRQzrXl e+1Db+XPzcNQowHesYWE+Sq/sh+4iyOf5aOpJFEbeU3ngx2Jyiinmu1kUbRtqqTeLagvxS s8kPuDwPtNLvCHc6K2AYs2ExgzwqXojyMES41KuO/OH6/qVAO5sXK4b9FiG5Ew== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Cc: Sander Vanheule , INAGAKI Hiroshi Subject: [PATCH 4/8] realtek: fix use of uninitialized sds_mode Date: Thu, 6 Oct 2022 22:56:29 +0200 Message-Id: <89b1c40dd3767491d403c0ff9ce0444b3e2c2142.1665089731.git.sander@svanheule.net> X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221006_135652_837842_6C70A80F X-CRM114-Status: UNSURE ( 7.02 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: INAGAKI Hiroshi The initial state of sds_mode in rtl9300_force_sds_mode() is null and it will be configured in switch-case. So print message after it. Signed-off-by: INAGAKI Hiroshi [amend commit message] Signed-off-by: Sander Vanheule --- target/linux/realtek/files-5.10/drivers/net/phy/rtl83xx-phy.c [...] Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [2a00:c98:2060:a004:1:0:0:200 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: INAGAKI Hiroshi The initial state of sds_mode in rtl9300_force_sds_mode() is null and it will be configured in switch-case. So print message after it. Signed-off-by: INAGAKI Hiroshi [amend commit message] Signed-off-by: Sander Vanheule --- target/linux/realtek/files-5.10/drivers/net/phy/rtl83xx-phy.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/realtek/files-5.10/drivers/net/phy/rtl83xx-phy.c b/target/linux/realtek/files-5.10/drivers/net/phy/rtl83xx-phy.c index 4175b950435e..259458b1beef 100644 --- a/target/linux/realtek/files-5.10/drivers/net/phy/rtl83xx-phy.c +++ b/target/linux/realtek/files-5.10/drivers/net/phy/rtl83xx-phy.c @@ -1697,7 +1697,6 @@ void rtl9300_force_sds_mode(int sds, phy_interface_t phy_if) u32 v, cr_0, cr_1, cr_2; u32 m_bit, l_bit; - pr_info("%s --------------------- serdes %d forcing to %x ...\n", __func__, sds, sds_mode); pr_info("%s: SDS: %d, mode %d\n", __func__, sds, phy_if); switch (phy_if) { case PHY_INTERFACE_MODE_SGMII: @@ -1740,7 +1739,7 @@ void rtl9300_force_sds_mode(int sds, phy_interface_t phy_if) return; } - pr_info("%s: SDS mode %x\n", __func__, sds_mode); + pr_info("%s --------------------- serdes %d forcing to %x ...\n", __func__, sds, sds_mode); // Power down SerDes rtl9300_sds_field_w(sds, 0x20, 0, 7, 6, 0x3); if (sds == 5) pr_info("%s after %x\n", __func__, rtl930x_read_sds_phy(sds, 0x20, 0)); From patchwork Thu Oct 6 20:56:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1687190 X-Patchwork-Delegate: sander@svanheule.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=y0BePhZa; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=qtZOg2Lg; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mk3k26XSRz23jd for ; Fri, 7 Oct 2022 08:00:26 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6GFpJ7uj/KVWFgIdPBb44eEJ5C2ktDp1f7VBpA2g950=; b=y0BePhZaQ4s06N ycnczRyArHFbdgdL0hGKzPDfhMs+70WNa4nDHM43F8OFNCIuxPW3+Q/y0IBxpDxp82l0/MoKo1MQ+ OvGqpOJMOWWQexptt6XCl+ZfoYmhU1GYbPQLgKylW6we4NCkp2Z3EDL/l6mre0aRW1uRKUWDTmkFf FBjMBWa9y3SgeBxjt9/WxC1CiCenoagv7GYz4jusSAz8tk5S54GrfVIx84GkC8wQCgh7EEiHNUE9o Yw9E78xOmf07njuX5jrhOUg4wwAfJhj/o0CqbVTPH/P6s7MD8+capBRol4/1XblTCxe3+CowQnPvq bveaQBLesaBC93i+mkeg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogXwl-005BPF-NE; Thu, 06 Oct 2022 20:58:24 +0000 Received: from polaris.svanheule.net ([84.16.241.116]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogXvL-005Avo-J9 for openwrt-devel@lists.openwrt.org; Thu, 06 Oct 2022 20:56:57 +0000 Received: from terra.. (247.72-129-109.adsl-dyn.isp.belgacom.be [109.129.72.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id AF66232CD28; Thu, 6 Oct 2022 22:56:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1665089800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xmupE49/Vr2A1KV56k1bl7e3kHncZlmTCev0gjxyFRE=; b=qtZOg2LgH4BCkQxuA50l0+lMel89zLgDTG1QiLB0CBShPr04B0Z1VR7o5WR4yv/mECnSlQ R5pV3aQYBowHr7dYt3M9gJSlXB0LWrtDFVbU3sMuxQyA9sbp4k1NRqEjVSw9TmQP5tY20C qE1pOStzGWYXAA5RnDoSKu+3JdZrTD/BuUlsczBmjgF7dzsAuTCzqibWmDxpYBgqdEue4h O6/WyfOJqEF8tllX0l4RdGobryNYmqFYSQoaWV7pPzOCUZGxMPhGQOMiq5d0ksaiRAIRcW dLd0nAZt1YggYNPtLNWT44Ko8DXRDNHAv2DyP6M34LHiGgDUmZX4fG8iW3C7MA== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Cc: Sander Vanheule , INAGAKI Hiroshi Subject: [PATCH 5/8] realtek: add missing of.h include in phy driver Date: Thu, 6 Oct 2022 22:56:30 +0200 Message-Id: X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221006_135655_813547_81B26399 X-CRM114-Status: UNSURE ( 6.77 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: INAGAKI Hiroshi of.h is required for of_property_read_u32(). Signed-off-by: INAGAKI Hiroshi [amend commit message] Signed-off-by: Sander Vanheule --- target/linux/realtek/files-5.10/drivers/net/phy/rtl83xx-phy.c [...] Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [84.16.241.116 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: INAGAKI Hiroshi of.h is required for of_property_read_u32(). Signed-off-by: INAGAKI Hiroshi [amend commit message] Signed-off-by: Sander Vanheule --- target/linux/realtek/files-5.10/drivers/net/phy/rtl83xx-phy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/realtek/files-5.10/drivers/net/phy/rtl83xx-phy.c b/target/linux/realtek/files-5.10/drivers/net/phy/rtl83xx-phy.c index 259458b1beef..491ceb48b6a0 100644 --- a/target/linux/realtek/files-5.10/drivers/net/phy/rtl83xx-phy.c +++ b/target/linux/realtek/files-5.10/drivers/net/phy/rtl83xx-phy.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include From patchwork Thu Oct 6 20:56:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1687195 X-Patchwork-Delegate: sander@svanheule.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=NK9CM3Xf; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=FuUAiCws; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mk3lL3d7pz1yqk for ; Fri, 7 Oct 2022 08:01:34 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8dazyNFojALpDxFMDJZBCxqhTSO5/4usQvhQrRVS4+w=; b=NK9CM3XfxCfkD0 Q4+AlOApPtI8JTW47P32t3irstgY8CkXvVJpsS7RxLWQFliUxEG3td8kBKeUKr6z3RtjbIIq+bAMR dLBtn83VyjvgMxt/2HxU1tsuNlQTRjfA9lFDJh2BQLl/pEQ3h2R4Ur3GHX/fSIA5v2Y+0tL6XO1Y1 0Q8gqnWfh12eszqSqzs6KAdhTbXxoTmdbF6Pti/8p4tJuMWwPz1ToUmH5kCk8wq+mYWia2xbcqRS4 LdGvMFNFL5usqMK5e+TNQCBNcEJGMbJa8VEgRCnsWAu0tSAwlkhdRf66I7DFCTqCBAAFcl7P6swA/ esuD256nNM2umkufjy2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogXxR-005BhN-GL; Thu, 06 Oct 2022 20:59:06 +0000 Received: from polaris.svanheule.net ([84.16.241.116]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogXvL-005Avw-Lj for openwrt-devel@lists.openwrt.org; Thu, 06 Oct 2022 20:56:57 +0000 Received: from terra.. (247.72-129-109.adsl-dyn.isp.belgacom.be [109.129.72.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 30F3232CD29; Thu, 6 Oct 2022 22:56:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1665089801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ltpw4v/CvUeb0LzreWe03XyQkxfhj5Em+BArkxy2rmU=; b=FuUAiCws1jKEZgvKfluuQe/txqBKrUJ6Guiaf8oTki0s+L2USqrly1uYWIqXpzRA8kHKr5 XE1wPr/n3+LBNaeNZOTJwmIayA+eVL6ruZ/A2j7bLlPMtrtYRrqWh7PS198ly9uYRVtTyp UAEWMCnlIL50uh0S+6Ggixr2WkYIAxyCWsazIZJkZJNFoOvbRQsUCcVaYhRcKXN4TRGoCH gM3VBqosyA8XpsYzGkrYlPII15RZVmIIRXXsGaQcj3DERgAdDt5MFUQrcrffFhqjgzM8KZ TXBYS1YnMy/+v6Z3GfHvs94Tb5u/zMN+06wLimqpwCBvlHmal2l0wjxaqQcgTA== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Cc: Sander Vanheule , INAGAKI Hiroshi Subject: [PATCH 6/8] realtek: fix place of fdb/mdb info messages Date: Thu, 6 Oct 2022 22:56:31 +0200 Message-Id: X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221006_135655_901876_860D455C X-CRM114-Status: UNSURE ( 8.12 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: INAGAKI Hiroshi Those messages should be printed when entry was found (idx >= 0). Move them to the right place to not print invalid entry indices. Signed-off-by: INAGAKI Hiroshi [amden commit message] Signed-off-by: Sander Vanheule --- target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c [...] Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [84.16.241.116 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: INAGAKI Hiroshi Those messages should be printed when entry was found (idx >= 0). Move them to the right place to not print invalid entry indices. Signed-off-by: INAGAKI Hiroshi [amden commit message] Signed-off-by: Sander Vanheule --- target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c index f54fdd298ac4..f08ede730b83 100644 --- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c +++ b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c @@ -1689,8 +1689,8 @@ static int rtl83xx_port_fdb_del(struct dsa_switch *ds, int port, idx = rtl83xx_find_l2_hash_entry(priv, seed, true, &e); - pr_info("Found entry index %d, key %d and bucket %d\n", idx, idx >> 2, idx & 3); if (idx >= 0) { + pr_info("Found entry index %d, key %d and bucket %d\n", idx, idx >> 2, idx & 3); e.valid = false; dump_l2_entry(&e); priv->r->write_l2_entry_using_hash(idx >> 2, idx & 0x3, &e); @@ -1870,8 +1870,8 @@ int rtl83xx_port_mdb_del(struct dsa_switch *ds, int port, idx = rtl83xx_find_l2_hash_entry(priv, seed, true, &e); - pr_debug("Found entry index %d, key %d and bucket %d\n", idx, idx >> 2, idx & 3); if (idx >= 0) { + pr_debug("Found entry index %d, key %d and bucket %d\n", idx, idx >> 2, idx & 3); portmask = rtl83xx_mc_group_del_port(priv, e.mc_portmask_index, port); if (!portmask) { e.valid = false; From patchwork Thu Oct 6 20:56:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1687196 X-Patchwork-Delegate: sander@svanheule.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=m+iT0DG0; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=edkKRaVw; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mk3mW4K4Hz1yqk for ; Fri, 7 Oct 2022 08:02:35 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KDHKBUH1JTQ1CTYmf9MfvqhLe1sO+pNDCjXwzVuvB8k=; b=m+iT0DG0MfIbuk /PIjB0YWyE30/LDMchviZgTdfI8XN6QhbHgPUaGhryeiqKhmwhjIsC+lPfPP/8r5gcG2cQdKC4YgG AvP/XU+JrJ/OrHdpsHQAx02k9FHri6lbZIF+N7S/WGdyK8MDJmVDukBigYuEIjL0b/eCoIe9qvcib ptAC+3okz+Lqzq4VAZhfLT2sf+Yxv1wuM/yBujq3JcO5m/YD5Q+TBaDEoR8clruLQXpnyUmk5jMsy 2TXhTLnWSGN88mRBtk50J2OLJ5hdc0XdtzshiG/9DzdKxiPaQJ8x75ZTajilbDSXDFP0rnsH5Oxkj TbhT0jJzdDXHacTswlCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogXyS-005CAT-Aa; Thu, 06 Oct 2022 21:00:08 +0000 Received: from polaris.svanheule.net ([84.16.241.116]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogXvN-005AxO-34 for openwrt-devel@lists.openwrt.org; Thu, 06 Oct 2022 20:56:59 +0000 Received: from terra.. (247.72-129-109.adsl-dyn.isp.belgacom.be [109.129.72.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id BAC3332CD2A; Thu, 6 Oct 2022 22:56:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1665089801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PEdib72/vwiYpGH1a7A14ycK0w2PhqfajVz8yVdOon0=; b=edkKRaVwiRjCxaQ9py5QzgFYKIYeAS/B/Frawgh755KCklqk645ckbqxUioSh53YrgSbT8 qJ5+aZaDMzrj0gbPNeV2/oVbNq/aRPns+gA8jLu8Nv/dI9LAaNOt9laUnF4/xL9d4+Ww0b woZcVgU2YTDTfZU4X4lBG4CW8lhW68R76QxsBvZ6BWLdcNGdIPgQkTt2C8elzESAR0A0F8 LwH9/heocw1RJQLIFHtjfQctW6F6i3OK+Bilj+fr/1zLR+4txi+j2IS3lJP1UxZO7P53Um 1FZBJbjXN3dUt5Jvu5HlWv4MAzah7SScNVeR+Ymc2jj1WB3b2KmgV+zu8duBuw== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Cc: Sander Vanheule , INAGAKI Hiroshi Subject: [PATCH 7/8] realtek: swap *_phylink_mac_link_down() contents Date: Thu, 6 Oct 2022 22:56:32 +0200 Message-Id: <0d2ecec08dad181c8f4b97688b3e503f62ae3d2e.1665089731.git.sander@svanheule.net> X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221006_135657_355669_60A0342F X-CRM114-Status: UNSURE ( 8.59 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: INAGAKI Hiroshi Fix the (accidentally?) swapped contents of rtl83xx_phylink_mac_link_down() and rtl93xx_phylink_mac_link_down(). Signed-off-by: INAGAKI Hiroshi [amend commit message] Signed-off-by: Sander Vanheule --- .../files-5.10/drivers/net/dsa/rtl83xx/dsa.c | 15 ++++++++--- [...] Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [84.16.241.116 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: INAGAKI Hiroshi Fix the (accidentally?) swapped contents of rtl83xx_phylink_mac_link_down() and rtl93xx_phylink_mac_link_down(). Signed-off-by: INAGAKI Hiroshi [amend commit message] Signed-off-by: Sander Vanheule --- .../files-5.10/drivers/net/dsa/rtl83xx/dsa.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c index f08ede730b83..3ff1a96ed680 100644 --- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c +++ b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c @@ -864,17 +864,12 @@ static void rtl83xx_phylink_mac_link_down(struct dsa_switch *ds, int port, phy_interface_t interface) { struct rtl838x_switch_priv *priv = ds->priv; - u32 v; /* Stop TX/RX to port */ sw_w32_mask(0x3, 0, priv->r->mac_port_ctrl(port)); // No longer force link - if (priv->family_id == RTL9300_FAMILY_ID) - v = RTL930X_FORCE_EN | RTL930X_FORCE_LINK_EN; - else if (priv->family_id == RTL9310_FAMILY_ID) - v = RTL931X_FORCE_EN | RTL931X_FORCE_LINK_EN; - sw_w32_mask(v, 0, priv->r->mac_port_ctrl(port)); + sw_w32_mask(0x3, 0, priv->r->mac_force_mode_ctrl(port)); } static void rtl93xx_phylink_mac_link_down(struct dsa_switch *ds, int port, @@ -882,11 +877,17 @@ static void rtl93xx_phylink_mac_link_down(struct dsa_switch *ds, int port, phy_interface_t interface) { struct rtl838x_switch_priv *priv = ds->priv; + u32 v = 0; + /* Stop TX/RX to port */ sw_w32_mask(0x3, 0, priv->r->mac_port_ctrl(port)); // No longer force link - sw_w32_mask(3, 0, priv->r->mac_force_mode_ctrl(port)); + if (priv->family_id == RTL9300_FAMILY_ID) + v = RTL930X_FORCE_EN | RTL930X_FORCE_LINK_EN; + else if (priv->family_id == RTL9310_FAMILY_ID) + v = RTL931X_FORCE_EN | RTL931X_FORCE_LINK_EN; + sw_w32_mask(v, 0, priv->r->mac_force_mode_ctrl(port)); } static void rtl83xx_phylink_mac_link_up(struct dsa_switch *ds, int port, From patchwork Thu Oct 6 20:56:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1687197 X-Patchwork-Delegate: sander@svanheule.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=2Xx/W7zy; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=9mRAylKd; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mk3nS2ws3z1yqk for ; Fri, 7 Oct 2022 08:03:24 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RbA3hNGDke/nlzQDPopec0m+BbIxVC8jW7+2zUZeJC0=; b=2Xx/W7zyGZFHph oNJpRAH8le4mSlU0rW4QI/6vTQ0M05pUJyoMlSmKqA7vs+KCFR6AwqCmv8OeVYKXoalsEaJeBIlyC w1ac8GqpQX5The9k0vcFDnFgza1nThln6839h2NuVwb3r2Q/fwlpWXqo7amJ/axEW5ep8vxh7hCn2 D5PWfjt5GQdKAUIP38u1GbEL21m7utELtNCTDPn37HYysyDqgB8KhY67Uirr52uv7gfuDXf0ibG2t Ks3LLfQGO8R/XAEpMyiXffO2NCqfRDQA/r97wz0mD9yoj7/w2XljFRvRGGe5mbXB7rWhXhsDX0N7q aEafV+LS4rSkXZ4E6cSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogXzY-005Cgk-1o; Thu, 06 Oct 2022 21:01:17 +0000 Received: from polaris.svanheule.net ([84.16.241.116]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogXvN-005AxQ-4F for openwrt-devel@lists.openwrt.org; Thu, 06 Oct 2022 20:56:59 +0000 Received: from terra.. (247.72-129-109.adsl-dyn.isp.belgacom.be [109.129.72.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 3D53832CD2B; Thu, 6 Oct 2022 22:56:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1665089802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P6x8Pp1R4ehCRDGKy4x13iH0XZH3mN0Q5MI5vsMQxW0=; b=9mRAylKd7fO7FXUzSri02XhxTPdFUvKNIwch9s4gr4jnb8Vzw5eUVIPqTGK27Ya27ZtpCx lu6SZlMby5pgYo3vDiYcg8BaBSCg/lJiaj4uqone4JatqVW9ps8869qmbdlSYjRgn4oHMd bp7hZWL19tbTDxfGy47EKGD5boLumOs0I2p+YPsnfhf84CbwAjg6gjCveTaetnxxrYK75N ALQ/efeJZmGy/QOcnso2QR4DVG+Z4ZzHWJx0kpjbmEBiYOeNpIoHeRxMGyuXLxWXPtgpyS vURE1hgE6Y3rxPDv277R4MpiztrP5YxNNtkqV1T4skC5g5Ul5yvuRR4W/vsNng== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Cc: Sander Vanheule , INAGAKI Hiroshi Subject: [PATCH 8/8] realtek: cleanup rtl83{8x,9x}_enable_learning/flood Date: Thu, 6 Oct 2022 22:56:33 +0200 Message-Id: <08a17ee85966a1d08a10d7f0a5f37859fa59b8cd.1665089731.git.sander@svanheule.net> X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221006_135657_418280_478F9D82 X-CRM114-Status: UNSURE ( 9.09 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: INAGAKI Hiroshi In *_enable_learning() only address learning should be configured, so remove enabling forwarding. Forwarding is configured by the respective *_enable_flood() functions. Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [84.16.241.116 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: INAGAKI Hiroshi In *_enable_learning() only address learning should be configured, so remove enabling forwarding. Forwarding is configured by the respective *_enable_flood() functions. Clean up both functions for RTL838x and RTL839x, and fix the comment on the number of entries. Signed-off-by: INAGAKI Hiroshi [squash RTL838x, RTL839x changes] Signed-off-by: Sander Vanheule --- .../drivers/net/dsa/rtl83xx/rtl838x.c | 32 ++++++----------- .../drivers/net/dsa/rtl83xx/rtl839x.c | 34 ++++++------------- 2 files changed, 22 insertions(+), 44 deletions(-) diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl838x.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl838x.c index 76b6cde7be8c..93fab7e6e30f 100644 --- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl838x.c +++ b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl838x.c @@ -515,32 +515,22 @@ static void rtl838x_l2_learning_setup(void) static void rtl838x_enable_learning(int port, bool enable) { - // Limit learning to maximum: 32k entries, after that just flood (bits 0-1) + // Limit learning to maximum: 16k entries - if (enable) { - // flood after 32k entries - sw_w32((0x3fff << 2) | 0, RTL838X_L2_PORT_LRN_CONSTRT + (port << 2)); - } else { - // just forward - sw_w32(0, RTL838X_L2_PORT_LRN_CONSTRT + (port << 2)); - } + sw_w32_mask(0x3fff << 2, enable ? (0x3fff << 2) : 0, + RTL838X_L2_PORT_LRN_CONSTRT + (port << 2)); } static void rtl838x_enable_flood(int port, bool enable) { - u32 flood_mask = sw_r32(RTL838X_L2_PORT_LRN_CONSTRT + (port << 2)); - - if (enable) { - // flood - flood_mask &= ~3; - flood_mask |= 0; - sw_w32(flood_mask, RTL838X_L2_PORT_LRN_CONSTRT + (port << 2)); - } else { - // drop (bit 1) - flood_mask &= ~3; - flood_mask |= 1; - sw_w32(flood_mask, RTL838X_L2_PORT_LRN_CONSTRT + (port << 2)); - } + /* + * 0: Forward + * 1: Disable + * 2: to CPU + * 3: Copy to CPU + */ + sw_w32_mask(0x3, enable ? 0 : 1, + RTL838X_L2_PORT_LRN_CONSTRT + (port << 2)); } static void rtl838x_enable_mcast_flood(int port, bool enable) diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl839x.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl839x.c index 7b838cb76b02..199ba347da38 100644 --- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl839x.c +++ b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl839x.c @@ -560,34 +560,22 @@ static void rtl839x_l2_learning_setup(void) static void rtl839x_enable_learning(int port, bool enable) { - // Limit learning to maximum: 32k entries, after that just flood (bits 0-1) - - if (enable) { - // flood after 32k entries - sw_w32((0x7fff << 2) | 0, RTL839X_L2_PORT_LRN_CONSTRT + (port << 2)); - } else { - // just forward - sw_w32(0, RTL839X_L2_PORT_LRN_CONSTRT + (port << 2)); - } + // Limit learning to maximum: 32k entries + sw_w32_mask(0x7fff << 2, enable ? (0x7fff << 2) : 0, + RTL839X_L2_PORT_LRN_CONSTRT + (port << 2)); } static void rtl839x_enable_flood(int port, bool enable) { - u32 flood_mask = sw_r32(RTL839X_L2_PORT_LRN_CONSTRT + (port << 2)); - - if (enable) { - // flood - flood_mask &= ~3; - flood_mask |= 0; - sw_w32(flood_mask, RTL839X_L2_PORT_LRN_CONSTRT + (port << 2)); - } else { - // drop (bit 1) - flood_mask &= ~3; - flood_mask |= 1; - sw_w32(flood_mask, RTL839X_L2_PORT_LRN_CONSTRT + (port << 2)); - } - + /* + * 0: Forward + * 1: Disable + * 2: to CPU + * 3: Copy to CPU + */ + sw_w32_mask(0x3, enable ? 0 : 1, + RTL839X_L2_PORT_LRN_CONSTRT + (port << 2)); } static void rtl839x_enable_mcast_flood(int port, bool enable)