Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp990387lqh; Sat, 1 Jun 2024 05:06:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWZzLK2SQUmfkLR77sdBM23T58y4FZoMl8uDbJI0krpN3ygNQTYRUyq5iyHkGz2HGZtWUCdG6AYr5qzIK4Y60L1D/oUKuz4rLVVUgBgMQ== X-Google-Smtp-Source: AGHT+IF629Y3hWE59Nqu/MzfKURpWLUtZ/E7G5KhteMj0Ey/vO2nivUjO0mDUSuDi6Vl+jAB8k8x X-Received: by 2002:a05:620a:408a:b0:794:af72:3cd with SMTP id af79cd13be357-794f5b8f720mr564503785a.0.1717243561400; Sat, 01 Jun 2024 05:06:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717243561; cv=pass; d=google.com; s=arc-20160816; b=gF9nafOrnx3E5CgFdM3jFb+ZGKwlYz9jM9poBF3iYfOWcKNKDBPr9PZ83lkGu/Kld6 tWhNLqFSBXtVHVl8TUiyFS7ChGdTkdz4p1TUNqaC48DJM/vuYoyRLe6gTmzaBf2Pj2SD rFF9Dzg+tNP/Gwt7/1+VwxlRvlfDqhUR5TPRUrMcd/1kafyaOs4pEVcZIVNkhE9KV3eT Vwz45KWtHj7kxbj4A9Tce81vO2ixdkqn17gBvNrud1VHBvEo9rCiLR3Z50wgYclcjx3Q sR2SgpjXAmpJDvsgc04I7XmpZq9uveUFXb6YwoW+z3olut4NffMW7WD5/YAeNI9yFMOI YztQ== 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=P4dXapTwx8H0EjdBQoRcHobQ4bDqfkRiA/2NnzNpLVE=; fh=6Tb4syYpE3k5tO9xzPQuhLRJy0GQornzQayJdZ31tTs=; b=jGpg0hf7t9wMraSH8wuVHDzd55hrF9eUqF0o9NWjy4eXQA4MvxXFp2SHfzG4LWekYf OedvHirXNopBdXus1APHwOyNS8gY661AC1+zMV35oOGK9c/NhbrbVw537uJtmz8gcT+T rhx1YCjIPt4dF2vrqaXhoS49U9HNJF80R3fCV1Pjk1G6AtcMKRiM6jGgpq9ZaPkf+61W bbuE5sBQuSJtuJ4emAFvVpkJCW9xqQXwUbV/EK1TgyAVwNZpx/Sv+wWlueJFXfTKHuwt GFiOF4bpDYayGb3rnXLoPFdekpzmGmei6dVidcH4oEcZSnq4rZ1vIV5NfdjyO3Ev0iSs 9FOA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qUCEfpMz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197823-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197823-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794f318be52si410263485a.499.2024.06.01.05.06.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 05:06:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197823-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qUCEfpMz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197823-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197823-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 239241C20F09 for ; Sat, 1 Jun 2024 12:06:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6340150985; Sat, 1 Jun 2024 12:05:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qUCEfpMz" 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 DF80D14F11D; Sat, 1 Jun 2024 12:05:50 +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=1717243551; cv=none; b=tePdjFkQ1+stiCDJEWIsHnmnDGkyvJxKcx5TO+kyp1RIQhQRCe0OlwOiYX/4EWBhm8AWnOG+/hqX77akC7Af+bZm4RPo12VfdYoZlXbjcM1W3n0g/5N4QrkLu/AdUu01597DWtT6k+u+G4EEnZ7BTDORZa6YzCQePYQqaIaS0GY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717243551; c=relaxed/simple; bh=gpmoHDNdcBUdXCxDIsEosMQ7ZR2VEkQU+Y3h+1Gc2Wo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VdwE/do03ylMVkOz8h9wCQsYn+aZH9Sl9UlYMcn8osY2GLGn/769tyeyLerRkGxyqPv36jU7tRmxkF6LqwjdeBuT2xRKf/ZvsdsRkvPaOrZhYoKZCkTVMB6L0XCgEJqUx71r659H1Dr+tUXH0moqRwYptWTVqmT7FUMZHkjt034= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qUCEfpMz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CD5AC116B1; Sat, 1 Jun 2024 12:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717243550; bh=gpmoHDNdcBUdXCxDIsEosMQ7ZR2VEkQU+Y3h+1Gc2Wo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qUCEfpMzmRd6IJpzlNuwa8H3GBtfPJUFkylGL2QCA67KbPBUlFjqiomnHe0WlioMp Axljd74C/sSzzRsXlSAQr9PHkoc0Hue/yseoOf3ZT0JoOO1JWoUl4W4Dh166tQDFyj pEdC7be4YM7Vo1mv+vup7A9vIQOcKL7hLVd9goAarKk7gIHC9AgUnbGs7nj5pe+jUd rEWEjjFLpQG2uOMDb72aaC28MgK3IMJQDkWlITxzcNXIJLiqKyTUERQ4HEVT4FB6Xb S2smLA/TplgTyz1Phw1VIkjXRVCXoFBHMkKL/vtjqa3iN3FF3NQcpO/YcQfDJ/Jr6E txaL0yaQsNM2Q== Date: Sat, 1 Jun 2024 13:05:45 +0100 From: Simon Horman To: Tristram.Ha@microchip.com Cc: Woojung.Huh@microchip.com, andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, 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: <20240601120545.GG491852@kernel.org> References: <1716932145-3486-1-git-send-email-Tristram.Ha@microchip.com> <20240531190234.GT491852@kernel.org> 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: On Fri, May 31, 2024 at 07:19:54PM +0000, Tristram.Ha@microchip.com wrote: > > Subject: Re: [PATCH net] net: dsa: microchip: fix initial port flush problem > > > > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content > > is safe > > > > 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 > > Setting SW_FLUSH_STP_TABLE and SW_FLUSH_MSTP_TABLE bits are wrong as they > are action bits. The bit should be set only when doing an action like > flushing. Understood, thanks. And I guess that only bits that are being configured should be changed, thus the values other bits are preserved with this change. FWIIW, I do think it would be worth adding something about this to the patch description. > > > > > > > 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 > > > > > > >