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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18193C433E6 for ; Tue, 1 Sep 2020 16:01:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F003B2078B for ; Tue, 1 Sep 2020 16:01:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725949AbgIAQBO (ORCPT ); Tue, 1 Sep 2020 12:01:14 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:36322 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730331AbgIAP7z (ORCPT ); Tue, 1 Sep 2020 11:59:55 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kD8hF-00CmnA-Sz; Tue, 01 Sep 2020 17:59:45 +0200 Date: Tue, 1 Sep 2020 17:59:45 +0200 From: Andrew Lunn To: Vladimir Oltean Cc: Kurt Kanzenbach , Vivien Didelot , Florian Fainelli , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org, Sebastian Andrzej Siewior , Richard Cochran , Kamil Alkhouri , ilias.apalodimas@linaro.org Subject: Re: [PATCH v4 2/7] net: dsa: Add DSA driver for Hirschmann Hellcreek switches Message-ID: <20200901155945.GG2403519@lunn.ch> References: <20200901125014.17801-1-kurt@linutronix.de> <20200901125014.17801-3-kurt@linutronix.de> <20200901134020.53vob6fis5af7nig@skbuf> <87y2ltegnd.fsf@kurt> <20200901142243.2jrurmfmh6znosxd@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200901142243.2jrurmfmh6znosxd@skbuf> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > > > > > > What is the register lock protecting against, exactly? > > > > A lot of the register operations work by: > > > > * Select port, priority, vlan or counter > > * Configure it > > > > These sequences have to be atomic. That's what I wanted to ensure. > > > > So, let me rephrase. Is there any code path that is broken, even if only > theoretically, if you remove the reg_lock? Maybe, at the moment, RTNL is keeping things atomic. But that is because there is no HWMON, or MDIO bus. Those sort of operations don't take the RTNL, and so would be an issue. I've also never audited the network stack to check RTNL really is held at all the network stack entry points to a DSA driver. It would be an interesting excesses to scatter some ASSERT_RTNL() in a DSA driver and see what happens. Andrew