Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4521709rwl; Tue, 28 Mar 2023 08:01:39 -0700 (PDT) X-Google-Smtp-Source: AKy350b8MBTize2iPw10R5QJY3Zjig17Za01cwbhLtWKAFQ6kId8SxQ1BjfXeSWlDCqGpsMSz2Ao X-Received: by 2002:a17:906:9148:b0:932:29a7:56ee with SMTP id y8-20020a170906914800b0093229a756eemr15843282ejw.12.1680015699613; Tue, 28 Mar 2023 08:01:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680015699; cv=none; d=google.com; s=arc-20160816; b=D78AIFB5NZWpC0HhAh9GK2WNVeM23L0GjBp4A5vkI4dkfTVd15EUiuuuzrnXPzvDbw +XPxeavX5SdMG0HJbvOGZop0dYq5rQgmfqglMFeGnQjDNegpGBBJtjlEOO7V8dZXqQOs eNPwlc5URZjFryUsjIF6bZwtUkA2RkbOvYOSOOgsnKdBGNPxCuHEl3cd39eTuG8EpCQC dkK6dd8THedfveCp/rgi6uX0Bm4+ReVfqiASTV6iuCIRqmow2xxo483N3BBSsHlbdDNa K6xS3TFaI9AN4hHv8BL/AtQW8WkNZZmp8mYPL4EUkTtt5opvO+AYyGGCbI0nJ0bUcckp TWgw== 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; bh=OB4wfhtpOzRfLk2kLZNpSm2G3rfNhQDRIRU/cwoGYiM=; b=XHjjiEhLhs+UTgNbaZya9XbGBdIBBaF5s03PRQTn0fxJc4skAKpSHj0Ag+8aE2BtW0 tIiV5nMzbZsVoloaAYUsbuFlxvOtO8VSr6eKuWooUfXJzo12vahsjq5LrY+4hmYoEQhm DJA7cetgzy3SmDr+s2RY2Cuidbicjg8lgUegE9v2FnPmDD/Mc4TVmE7binnBwOd7Lh/m BEWBsx2CzM/eeN1B1sKidJCQFk6i1Y2lMSKr/xV0RgcIt3MAJsEYdUoRx2kW3m73bW21 UMDzIpysWYmHdv2YccoEKhTXYtGK+1NRLZkiWxEcARUpjA2cYvGE6d6DAXxlQzfHoo14 3E6Q== ARC-Authentication-Results: i=1; mx.google.com; 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 ia25-20020a170907a07900b0091fe6232debsi29596684ejc.293.2023.03.28.08.01.09; Tue, 28 Mar 2023 08:01:39 -0700 (PDT) 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; 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 S233741AbjC1PAp (ORCPT + 99 others); Tue, 28 Mar 2023 11:00:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233722AbjC1PAo (ORCPT ); Tue, 28 Mar 2023 11:00:44 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAADEE395; Tue, 28 Mar 2023 08:00:42 -0700 (PDT) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1phAoM-0008Nx-1D; Tue, 28 Mar 2023 17:00:34 +0200 Date: Tue, 28 Mar 2023 16:00:30 +0100 From: Daniel Golle To: Vladimir Oltean Cc: Andrew Lunn , netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Sean Wang , Landen Chao , DENG Qingfang , Philipp Zabel , Sam Shih , Lorenzo Bianconi , John Crispin , Felix Fietkau Subject: Re: [RFC PATCH net-next 2/2] net: dsa: mt7530: introduce MMIO driver for MT7988 SoC Message-ID: References: <20230328141628.ahteqtqniey45wb6@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230328141628.ahteqtqniey45wb6@skbuf> X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Tue, Mar 28, 2023 at 05:16:28PM +0300, Vladimir Oltean wrote: > On Tue, Mar 28, 2023 at 02:08:18PM +0100, Daniel Golle wrote: > > I agree that using regmap would be better and I have evaluated that > > approach as well. As regmap doesn't allow lock-skipping and mt7530.c is > > much more complex than xrs700x in the way indirect access to its MDIO bus > > and interrupts work, using regmap accessors for everything would not be > > trivial. > > > > So here we can of course use regmap_read_poll_timeout and a bunch of > > readmap_write operations. However, each of them will individually acquire > > and release the mdio bus mutex while the current code acquires the lock > > at the top of the function and then uses unlocked operations. > > regmap currently doesn't offer any way to skip the locking and/or perform > > locking manually. regmap_read, regmap_write, regmap_update_bits, ... always > > acquire and release the lock on each operation. > > What does struct regmap_config :: disable_locking do? I thought I can't use that on a per-operation base because the instance of struct regmap_config itself isn't protected by any lock and hence setting disable_locking=false before calling one of the accessor functions may affect also other congruent calls to the accessors which will then ignore locking and screw things up. Please correct me if I'm wrong there. Yet another way I thought about now could also be to have two regmap instances, one for locked and one for unlocked accessed to the same regmap_bus.