From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C84B1514DC; Tue, 2 Jul 2024 17:28:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941290; cv=none; b=YB6oY1jQdvSCS3W+rldlq1Qi0dwb2+jf0Zib/6NfoWdBYefblsdRRuaFcabLDqKA+7Ev+huIcgGBEbIJnIsI+gc/t6gaHl/nsf65aa68yuxt7ncVaWjkEpixAERsfEZRUb1bxmcPxux5DemoUAQ2dfOUZl0AgeNXF+lFbVvD0t4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941290; c=relaxed/simple; bh=469W6/9kolHu3e6Jtvt9ImMq21NKP+t+n5rqYZzqJSI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sxpHTdFcbc5B6m+SpwyyQTGbfQVnvDmkJh7NYmJ+TKx5Kvnjf3rBJzRg84wC+SE737kYAEJCVO3Ki7GHE3iVxKI8ALasmXf1Kk8vmC+Zto7NbgXxjlfFjNGlvhwiZEW8ZaH3d+RKy66Zm7t0aiKnNB487H2MVXJ/qXwC7rTxokY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0aK6i72C; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="0aK6i72C" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0A5AC116B1; Tue, 2 Jul 2024 17:28:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1719941290; bh=469W6/9kolHu3e6Jtvt9ImMq21NKP+t+n5rqYZzqJSI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0aK6i72CFWDT6e6dOJ5+FtoRDDQ1uKnuq21fcGuoKMjSnjss8N3TIbv/UEsxJh0QM HpImswTfE00vRThu3decAllJ8gCLGzTnx+SdXH7P2UqaoW6QXiF4tvU5f4sb3CITMZ FzaKOknWx9p33RlRkE+/jlavG0dDbqSqCMY9KZJA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tristram Ha , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1 020/128] net: dsa: microchip: fix initial port flush problem Date: Tue, 2 Jul 2024 19:03:41 +0200 Message-ID: <20240702170226.996925837@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702170226.231899085@linuxfoundation.org> References: <20240702170226.231899085@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tristram Ha [ Upstream commit ad53f5f54f351e967128edbc431f0f26427172cf ] The very first flush in any port will flush all learned addresses in all ports. This can be observed by unplugging the cable from one port while additional ports are connected and dumping the fdb entries. This problem is caused by the initially wrong value programmed to the REG_SW_LUE_CTRL_1 register. Setting SW_FLUSH_STP_TABLE and SW_FLUSH_MSTP_TABLE bits does not have an immediate effect. It is when ksz9477_flush_dyn_mac_table() is called then the SW_FLUSH_STP_TABLE bit takes effect and flushes all learned entries. After that call both bits are reset and so the next port flush will not cause such problem again. Fixes: b987e98e50ab ("dsa: add DSA switch driver for Microchip KSZ9477") Signed-off-by: Tristram Ha Link: https://patch.msgid.link/1718756202-2731-1-git-send-email-Tristram.Ha@microchip.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/dsa/microchip/ksz9477.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c index a736971470534..9181be2d8abb2 100644 --- a/drivers/net/dsa/microchip/ksz9477.c +++ b/drivers/net/dsa/microchip/ksz9477.c @@ -183,10 +183,8 @@ int ksz9477_reset_switch(struct ksz_device *dev) SPI_AUTO_EDGE_DETECTION, 0); /* default configuration */ - ksz_read8(dev, REG_SW_LUE_CTRL_1, &data8); - data8 = SW_AGING_ENABLE | SW_LINK_AUTO_AGING | - SW_SRC_ADDR_FILTER | SW_FLUSH_STP_TABLE | SW_FLUSH_MSTP_TABLE; - ksz_write8(dev, REG_SW_LUE_CTRL_1, data8); + ksz_write8(dev, REG_SW_LUE_CTRL_1, + SW_AGING_ENABLE | SW_LINK_AUTO_AGING | SW_SRC_ADDR_FILTER); /* disable interrupts */ ksz_write32(dev, REG_SW_INT_MASK__4, SWITCH_INT_MASK); -- 2.43.0