Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp652958lqh; Fri, 31 May 2024 12:02:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXbmpKzGArBsgTnOAyDXYrKyyAV8zgt51xjgknxCTLNRhg/jkWEjWMjZLcDNxWWmsgk2+Ls2CNNbBOhMbyPXAup5hrGQQX23MuP3UR2bw== X-Google-Smtp-Source: AGHT+IEHLMHOVuoTM8bH8ViSGxgPb0wNsLCMUQ7WMBV6Q5gwjEuDuBJEHNcWVnxL1z7qR87xPrLN X-Received: by 2002:a50:d753:0:b0:57a:2274:850b with SMTP id 4fb4d7f45d1cf-57a363ad0d9mr1596168a12.24.1717182175042; Fri, 31 May 2024 12:02:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717182175; cv=pass; d=google.com; s=arc-20160816; b=HK5+INA9+k8tD6NRmGfDjp06TPoK3TlF5ybMnM9j0JJOOK3HeAuxDErR5G1pFrGnQs ITEBChXnDO40aNIjmNs1eEB1JYBjxSmUlBgPFaYqfsfwebWvmNU+Cj7gDoJiOr3wHFBI sh4KWN/ooS6CkH27gR8F0YBnxyLzbjMmVh7r40axogoG0ot+LYG+zyB2OAT040L5Ikb6 R7KsK3pE30AHMYgKQZm3vWoyd9lXvyCe47YY/LcNUtkDNlAk726jxCq3Cm4Av+lF9Hrz UjXJUFTf5Uis1dXLXgH7DVDSVmYW51jd+Moz3XFDWGq1rwxeLeeBwR8WtPrO+hWRTaJi 6dnQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Y1LH7kh0+1krkYtaxJW1PqLYQl7oXe7nklR7YsUK4cY=; fh=FH6b9P7QvKbpNQRhjTQ/pYE79TRr81fKag50t3DYCxg=; b=s+i4nrsx6MHqH5/kYuVf3qwPdrmndvofrCzE0n5qVSf/Q6VZUksq05eoMKDVuv+Gg1 V/aZ9LPVWysDcHGwMq5Ci5brNdQ2MsdTdAWEiaiIu0dRc5GEHwP7xIAMFUw5exk87ifN GOnQ/tiwIa02/daQPAbszkh6ghcTxnXKfXm4Z1tJ26Mtb/xycPPZBywvWUnRFpM8QpIF VefheNKIS1JKHM0Vr+c8NEA3GCsaqcPzDVHpECv9zTz5y0rm2oG/RtwOJFJIZbPadw4e lyXlsJsr0cteJ24BtL8q7SVt2+OqtIR5mqhIylBeuF5Fa1PND+ck6n5NZvbGIGZaGEbw 1mdg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=clO6WlOV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197327-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197327-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31ba82a6si1209367a12.169.2024.05.31.12.02.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 12:02:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197327-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=clO6WlOV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197327-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197327-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B1E441F27060 for ; Fri, 31 May 2024 19:02:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B9C680626; Fri, 31 May 2024 19:02:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="clO6WlOV" 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 8EFE47C6C9; Fri, 31 May 2024 19:02:39 +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=1717182159; cv=none; b=f7f10Rz6J2mVZ050hGuNTabOSJX7GuaqP5rGi898A5mjbVgc2IA3cEnoMOhAQ/jC3PaH0bdhaTaCwPtuqnbx5yYpgHn5Dxm5pkPfnce/beseyw0+KVWoOjsxHKYnPEX9bBe58/JBp3AQxtWvGRURdAShoHySLhA4q+1fuR+XEEY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717182159; c=relaxed/simple; bh=pCOmk1nKWaAgFuK1NF4rUoo/cWiU7vuNtYV5z/Eozdo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LwS1wwS9C43xPK+S4NBH333YYuGk7xxhi1+kGbs14/Z4Ktsxfe2VU3y7JqzgMJiQJc9jEoPXycYoxALjvBMpwO1CiFxvrT2TxxWD0tcl/Ws0FsItokqDATIdxHSKuS4YD1g8s63/8qG9mqn1n9fOmkEU+IK16+VYmqS0/VKA034= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=clO6WlOV; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57582C116B1; Fri, 31 May 2024 19:02:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717182159; bh=pCOmk1nKWaAgFuK1NF4rUoo/cWiU7vuNtYV5z/Eozdo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=clO6WlOVUctdpP66XQRtk2+Sgb6XmJ2r2DY+DUD3cdtpCzCmxRwCP9kRTO7psEfyy oN6OWIpUetQkcxNSLbJKNkk5w1w6tauzOJcBYjCf+VupXtdmA5pnwbu27UbqQ2Jmcs KX0+s3+uDISsK9etAQnBWwvkUOh3vs/+WwVyu84w0j18kvDze4TfJjm22r92vKRJsA 6bXhYDs+16wceyJfw+HxY9/jcysSUtulZN/wFLUkH4G+g2LFz+jhOv5PXIwFIZezQe 6InCkwC55yVRMfO8FArNcSas1G9bVFBp94NxqjUX9/yswBaVlGDz0Dr6aO8dDkHhza 46J/3TxfmXSmQ== Date: Fri, 31 May 2024 20:02:34 +0100 From: Simon Horman To: Tristram.Ha@microchip.com Cc: Woojung Huh , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , UNGLinuxDriver@microchip.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: dsa: microchip: fix initial port flush problem Message-ID: <20240531190234.GT491852@kernel.org> References: <1716932145-3486-1-git-send-email-Tristram.Ha@microchip.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1716932145-3486-1-git-send-email-Tristram.Ha@microchip.com> On Tue, May 28, 2024 at 02:35:45PM -0700, Tristram.Ha@microchip.com wrote: > From: Tristram Ha > > The very first flush in any port will flush all learned addresses in all > ports. This can be observed by unplugging a 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 > register. After the first flush the value is reset back to the normal so > the next port flush will not cause such problem again. Hi Tristram, I think it would be worth spelling out why it is correct to: 1. Not set SW_FLUSH_STP_TABLE or SW_FLUSH_MSTP_TABLE; and 2. Preserve the value of the other bits of REG_SW_LUE_CTRL_1 > > Fixes: b987e98e50ab ("dsa: add DSA switch driver for Microchip KSZ9477") > Signed-off-by: Tristram Ha > --- > drivers/net/dsa/microchip/ksz9477.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c > index f8ad7833f5d9..7cc92b90ffea 100644 > --- a/drivers/net/dsa/microchip/ksz9477.c > +++ b/drivers/net/dsa/microchip/ksz9477.c > @@ -356,8 +356,7 @@ int ksz9477_reset_switch(struct ksz_device *dev) > > /* 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; > + data8 |= SW_AGING_ENABLE | SW_LINK_AUTO_AGING | SW_SRC_ADDR_FILTER; > ksz_write8(dev, REG_SW_LUE_CTRL_1, data8); > > /* disable interrupts */ > -- > 2.34.1 > >