From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F28FC433EF for ; Sun, 20 Feb 2022 09:21:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241129AbiBTJWI (ORCPT ); Sun, 20 Feb 2022 04:22:08 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:48042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232377AbiBTJWI (ORCPT ); Sun, 20 Feb 2022 04:22:08 -0500 Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3480CCB; Sun, 20 Feb 2022 01:21:47 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 097D65802C7; Sun, 20 Feb 2022 04:21:47 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 20 Feb 2022 04:21:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=MQZZTj8nabcqXlOJo 8XpXYmPncZlkb2pDfrS1E/GCWs=; b=KPnK0JrrURZg2WB91bNRyRRM9j3C9wClc a9v83tOZN9Uut3wzny0nLKGJ/f70x9a6yywbUUGMcW4inDsa3EjQKwxNIayD6eBZ BQba8pBxL95XH2OWwCKBkidPeEatOhwZ1CKtNnrhKbttlBEkf/d9MRkXHubAZMzP NW3IW3VFXwVxYJnSZBQQzeaQe8EJnDwWVhUjjHwGt6n1BE/nQAKIfLhoYa4qgqP+ ngyEPPZ1PeX8qdcWEQzgGvhNC4Tjz6+FvVlzWDO3fzDuGNSFSbW3SgAW7CuyX1Z/ iWq0qjIqgwNev9+byaMnUftAdHnJANOhwvhtfmOeHZg9j2MBqlAQA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkeeggddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepkfguohcuufgt hhhimhhmvghluceoihguohhstghhsehiughoshgthhdrohhrgheqnecuggftrfgrthhtvg hrnheptdffkeekfeduffevgeeujeffjefhtefgueeugfevtdeiheduueeukefhudehleet necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihguoh hstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 20 Feb 2022 04:21:45 -0500 (EST) Date: Sun, 20 Feb 2022 11:21:43 +0200 From: Ido Schimmel To: Vladimir Oltean Cc: Hans Schultz , davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, Hans Schultz , Andrew Lunn , Vivien Didelot , Florian Fainelli , Roopa Prabhu , Nikolay Aleksandrov , Shuah Khan , Stephen Suryaputra , David Ahern , Ido Schimmel , Petr Machata , Amit Cohen , Po-Hsu Lin , Baowen Zheng , linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH net-next v3 4/5] net: dsa: mv88e6xxx: Add support for bridge port locked mode Message-ID: References: <20220218155148.2329797-1-schultz.hans+netdev@gmail.com> <20220218155148.2329797-5-schultz.hans+netdev@gmail.com> <20220219100034.lh343dkmc4fbiad3@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220219100034.lh343dkmc4fbiad3@skbuf> Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On Sat, Feb 19, 2022 at 12:00:34PM +0200, Vladimir Oltean wrote: > On Fri, Feb 18, 2022 at 04:51:47PM +0100, Hans Schultz wrote: > > diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c > > index ab41619a809b..46b7381899a0 100644 > > --- a/drivers/net/dsa/mv88e6xxx/port.c > > +++ b/drivers/net/dsa/mv88e6xxx/port.c > > @@ -1234,6 +1234,39 @@ int mv88e6xxx_port_set_mirror(struct mv88e6xxx_chip *chip, int port, > > return err; > > } > > > > +int mv88e6xxx_port_set_lock(struct mv88e6xxx_chip *chip, int port, > > + bool locked) > > +{ > > + u16 reg; > > + int err; > > + > > + err = mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_CTL0, ®); > > + if (err) > > + return err; > > + > > + reg &= ~MV88E6XXX_PORT_CTL0_SA_FILT_MASK; > > + if (locked) > > + reg |= MV88E6XXX_PORT_CTL0_SA_FILT_DROP_ON_LOCK; > > + > > + err = mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_CTL0, reg); > > + if (err) > > + return err; > > + > > + err = mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_ASSOC_VECTOR, ®); > > + if (err) > > + return err; > > + > > + reg &= ~MV88E6XXX_PORT_ASSOC_VECTOR_LOCKED_PORT; > > + if (locked) > > + reg |= MV88E6XXX_PORT_ASSOC_VECTOR_LOCKED_PORT; > > + > > + err = mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_ASSOC_VECTOR, reg); > > return mv88e6xxx_port_write(...); Not familiar with mv88e6xxx, but shouldn't there be a rollback of previous operations? Specifically mv88e6xxx_port_write() > > > + if (err) > > + return err; > > + > > + return 0; > > +}