Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp183622pxb; Thu, 2 Sep 2021 01:36:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIq7QXp//t30S6US00WtiTS54f0kATcYA1X1zhCBHAU8JWO3PzW1Jki5nrkLpVn9MnRgLl X-Received: by 2002:a05:6638:1484:: with SMTP id j4mr1898470jak.80.1630571771867; Thu, 02 Sep 2021 01:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630571771; cv=none; d=google.com; s=arc-20160816; b=xRaihFg24z3f1kONqnNp2z66x8qLtgjs9M/G5ZsK/gCSXPOB6/yXC+JFaEf2j/qS9E nL18DPVH5pNUzbk2qZwxTPvonJxRX5wIa+88PTJaCYnkquctecMRomwO6YZw4VpCMXp4 3unXKWgIbayil5Bn+/RIVwGh3YmJBVpvmrnnQut8YK9gTZlzeFa2fI97av9JpfBTbpwa 7BGEUmIvMlLybaUVmyUfYFhDwrXQd7p8H+Gmpi1KI7FlGIg9oesfoxSLvT+S5B9LDtcx L+3YhoNjHVnrfwB2mAM68246alFxGfbMtn8m7XSaMXtEx5ISKRfBeq+9R1ZvdbYeX8Hm NDDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=26hkUZMTAIuPsDbRry9NtcujPmWxDHtM97Byjsbf4VU=; b=sK0KtA7NYbTAm0A9biv/C1D44+i/0AIXus8AF7Q3j1dktFYLUJnxgV8/VCia6Jhez6 K3rEmtnpHuAFkwdwgg2PWM/tq+pLAMxc6Rdd/3FCH7+hRBEXP248BghIQGoWqKXnWsTw norLvJ+OPiYuzCF7TcxoFjgsjbA7LDs4pwoOmRzsMZfEjoX6VlyjguFrQS5ygQ8nNmSq VjEtxNghsbJb5WAFNqQ9KqSuk/MeoicnTIH0Kv29ylgANirzDUkDF3pTULWxKDZdNXN7 q6qi6VL8Jw/06wOaFzcSX4CUlaLxMLA1YMdXnQUmRa8+osdx+ZvlAjp3viG7NuvVE4El vBUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lKjtdRW0; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y20si1308710ilc.24.2021.09.02.01.36.00; Thu, 02 Sep 2021 01:36:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lKjtdRW0; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243881AbhIBIgB (ORCPT + 99 others); Thu, 2 Sep 2021 04:36:01 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:42256 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233465AbhIBIgA (ORCPT ); Thu, 2 Sep 2021 04:36:00 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1630571701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=26hkUZMTAIuPsDbRry9NtcujPmWxDHtM97Byjsbf4VU=; b=lKjtdRW0u3sYGm4+vSfjAo0OzpkWECp42KzS5n5JY5XvpGsVgWBcf8whbztCmzFCGs3PDu nV1gJ9fRKRpE5fi0cGtIR3Uqh0R++WPigxUBn4Xi+WKYs34CoPRfgmRPnjDR7Vfor0r4kS 6iVa/msdOE7dOTUbit+uHhTUNYSo8ySfSTkaS4E51NAFTKFDZz0t56S7qql/Guam81kDRw RkXDX6Q5w0d+kAr09+Tj5XyAp9sIFm7NS5nFjToXSHLalwtEwVKhy8p4ht/zuQVog+rhmu MFi3kOex8VMdJ5WN5bThLSHARHElo8uR8sUx5F/6l1IldSvmNkS1SZMvsC4uGA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1630571701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=26hkUZMTAIuPsDbRry9NtcujPmWxDHtM97Byjsbf4VU=; b=EtJOo8CSXZNbsMNbFYn0CfrweVhWqbWvcxgpj/BN2+i+f3Ksk3FEuYJblBUCZaFbKleVcw 8bCkGKsEKjt1XPDg== To: Mark Brown Cc: Vladimir Oltean , Rasmus Villemoes , Lee Jones , Arnd Bergmann , Marc Zyngier , Hou Zhiqiang , Biwen Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] regmap: teach regmap to use raw spinlocks if requested in the config In-Reply-To: <20210901160555.GG5976@sirena.org.uk> References: <20210825205041.927788-1-vladimir.oltean@nxp.com> <20210825205041.927788-2-vladimir.oltean@nxp.com> <875yvr3j5c.ffs@tglx> <87bl5fggrf.ffs@tglx> <20210901160555.GG5976@sirena.org.uk> Date: Thu, 02 Sep 2021 10:35:01 +0200 Message-ID: <874kb3cr4a.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 01 2021 at 17:05, Mark Brown wrote: > On Mon, Aug 30, 2021 at 04:16:04PM +0200, Thomas Gleixner wrote: >> On Mon, Aug 30 2021 at 13:19, Mark Brown wrote: > >> > That probably does make sense, I think we're just using regular >> > spinlocks for spinlocks mainly because they're the default rather >> > than because anyone put huge amounts of thought into it. IIRC >> > the first users were using spinlocks for their locking when they >> > were converted. > >> So if the actual spinlock protected operations are not doing any other >> business than accessing preallocated cache memory and a few MMIO >> operations then converting them to raw spinlocks should have no real >> impact on RT. > > I think Vladimir's point that something might try to use one of the APIs > that can do multiple register writes atomically to generate a very long > register write sequence is valid here. It's far from the common case > but it'd be hard to audit, it's going to be a lot easier to handle going > to raw spinlocks in the cases where it's specifically needed than to > keep on top of ensuring that none of the users are causing issues or > start causing issues in the future. This does make me feel it's a bit > safer to leave the default the way it is since if you get it wrong then > lockdep will tend to notice very quickly while it's less likely that > we'd get tooling spotting issues the other way around. Fair enough. >> One way to do that is obviously starting with the patch from Vladimir >> and then convert them one by one, so the assumption that they are not >> doing anything nasty (in the RT sense) can be validated. > > Vladimir's patch is in Linus' tree now so users that can safely do so > can start using raw spinlocks. ok