Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp880107pxb; Wed, 1 Sep 2021 11:58:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUr06xckj+FASuL6jrKftwZAvIzPgHnYAQkfoGO3gYpSiHWYJFEs4QFbOp8STAiTbVpm9s X-Received: by 2002:a05:6638:e8f:: with SMTP id p15mr939578jas.114.1630522720924; Wed, 01 Sep 2021 11:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630522720; cv=none; d=google.com; s=arc-20160816; b=bT/+TAQ+I6fJp24Y/ihQpT1hORqMpq/b/wfzvko0GH9574nJG+ilnydR+PcSyHXiIW 3mtOGLHQtTOZ26PtIdgADvLB39mr1di8Mu+x0sxtQTo38Q7LMGtwAEYj9C2VATxUegD0 v26JJ1ZZpmrYq6wQLfKX20lE2OJkM+yVwyZQU/hZYX6q6CVTxDiypcBxyy8c5GsE1xpF BZveYNPRxyamISwKEm2uT5baY76eN0T5rCPvVDOTPxLOTwp4wwYpx9l/iNRMiXdR4Mea o25x7e++YgyfFB9c54Tds1s5eAJec34IBYfR2xdpHiBQpx5o8Tfhtop7Vf+JtWj7napc QtpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=wiSUdl1vtUUz70uwryD4e9cmkQejjifS4Cp0avv54PA=; b=YGN1j/RG+yMcFnBHLlVSGgY7f7J0/u6Ph1czfrdyzBAfT8QrChfkXoJHBqDYDIs50Z cKXT/wx9FKQLNnQQvOKzOQCdjf8f8HmdIgSXaR7M0KMO9itgZYNxbJLeMCZeDPrHiaMD 49a1FrO9qR/2W09iy9T37jTczVNbks7xj1t/1cUleJ/XnCjCPbIx2XztGKOC9TX7AuiG PaMz6vQFmrMglQmRKfgovwv/mHgLdnm8dMWmLU08Mr5x7fjW4RR2fUOi/aze2QFIUZVb fofnzt79xWZ1IAlBEmklcO5TeWq/4EDkLCfP0idRlh7ncWwHMlaBHmhH5kBQ8XXwy4DB YCOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XvUhBOu8; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g3si463364ile.29.2021.09.01.11.58.29; Wed, 01 Sep 2021 11:58:40 -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=@kernel.org header.s=k20201202 header.b=XvUhBOu8; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241667AbhIAQH2 (ORCPT + 99 others); Wed, 1 Sep 2021 12:07:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:54472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241778AbhIAQHZ (ORCPT ); Wed, 1 Sep 2021 12:07:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D6C896103A; Wed, 1 Sep 2021 16:06:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630512388; bh=7QX3Kxr7bXUh4h7TnUfEwUUan5kKwq4tFnWGdO/tCkQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XvUhBOu8DTpNcf94/RDbJnGx7anVZCA7eXI66B7eNfe/37VwrqJN9+dhojpjShF5M 6genJGxCPKyhRj0uH2Cm1+SurHDU+q6CEsVizHx0Z17Do+rA7CalEFHhk7SLvg8wXU KZDinRDyPEnfFkYT0zKakVag4k3P1ebdNl5YNbTI/TKxnka9pgZ4EnzLM0Zxjvp5yO eWDz6msjkMDACrrM+jlpZijZsfnwz9BgCTWyvOsi9hv4RMrsliIpNdnK1aCIPpw4ek XYHZyMIsnDYxsDGyJhFVk01gn4EYfHgyMbjGIWeg+ZrEmNutHC4hCjh6l0tLuZcSYE /lysZQ2Y6SNqw== Date: Wed, 1 Sep 2021 17:05:55 +0100 From: Mark Brown To: Thomas Gleixner 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 Message-ID: <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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7DO5AaGCk89r4vaK" Content-Disposition: inline In-Reply-To: <87bl5fggrf.ffs@tglx> X-Cookie: Who was that masked man? User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --7DO5AaGCk89r4vaK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. > 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. --7DO5AaGCk89r4vaK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmEvpOIACgkQJNaLcl1U h9AFIQf/bE5viYQeyIDVsUQaOdSbUGtzoUNU4V3tf1pDOpXf/OJGxUeekjut/A36 LI+l575vY04LCU33tvlHnQ1KWKjphXKxc5xBrFvtjLl3pLqD89LBedMZw6RUs4xP GgyiIelfxz2ei2U65yRAM+CqnJJ7zWvHiMYKODMyoNTeB1r6X2B3oHsLJj8VaODJ K0WmtEmicRaxoC4+wye89csiwT0jvBbMtBjGY/eSmXH/yQR4krARZQ+O3XTP8Z+7 OsMh8toL5f00yvCiyVEvIWGT6XT/QXeqpmz/734FHtt005I+Cy/iyN9wFM9jNj4N dwSVMsl85U1rV5VkLIjDXLx30eqeTw== =br0m -----END PGP SIGNATURE----- --7DO5AaGCk89r4vaK--