Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3424027pxb; Sun, 20 Feb 2022 19:42:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzAMBoLTGtnpm7tE0pf1aR/RcMi0MECV1gIcH3dSXXmmgafU/LnovgTOlygLynW4Yy7y7GA X-Received: by 2002:a63:4c55:0:b0:36c:54eb:fc44 with SMTP id m21-20020a634c55000000b0036c54ebfc44mr14456808pgl.323.1645414961638; Sun, 20 Feb 2022 19:42:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645414961; cv=none; d=google.com; s=arc-20160816; b=T6TDPvW8HjE9p46OMJLNqCMw3qF17Ce+EY6HZrC4lg8gXmRkgPUr69xLaUxCrXVlaJ gzkvvtoeCA6HmHpQCSXXJrJyYj/oZfacc9GF2VhGIi+oM761g+2lKwngQMkTcRpwNCNN /ZB2+rmy79zkyuntAcYGKr1yAvp3KBNNNZxtU/iC9Rf92B0CbTg0aQ/lYCvok3wOQxIu Sz99/11SAYEER7tSj2YqgNckOBDw+16BHot2TwOkG3x2DIKxCXK5a/G20IBQuigsHpQP DsGv8tX8SHaYnBAoTYA+/CwNK03nfzO97siU53ZHA4evtgUhXcO3L5n3oNnda/eNcUnF qiEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MQZZTj8nabcqXlOJo8XpXYmPncZlkb2pDfrS1E/GCWs=; b=JL5Y+K0jAUp73ZwCb++6Cqk2gbFw/vKpuaErxs0K0NhCs9rlwk+Lts+WOxcDzlCvaG es36JcELksr1+L5SVjyhYnB0qgnBydjQWlXeUeotIBBXtnif8ElXZhEnQEADSohKvUoO tVny0m9AGQwUs1fJWANGT5E28keZWoGbdj5Yon0myeBDfVjhy1L6mjAgIT+6/eUQJcAb Ul/KOLfSDjISyCaw4wqoMgB6ovNrPyXphUqE46y+DkJhz9naPgPZgqwoeCZZNDzyL+N6 rYmL781r4yqh50wLKT7Q9OPGO3k4qYXBsISLcaNNn24gdkvn83aJ6GZyZvwEGJHEf9Zk lhKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=KPnK0Jrr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s6si2960848plr.142.2022.02.20.19.42.26; Sun, 20 Feb 2022 19:42:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=KPnK0Jrr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243004AbiBTJWK (ORCPT + 99 others); Sun, 20 Feb 2022 04:22:10 -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> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; > > +}