Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6090532rdb; Thu, 14 Dec 2023 08:05:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZ7/KbH04PunMko223vIyoqBzb2Ax0PoEYVXcvNg7GfcavGvhv7w4gciChg650U7UrEI5I X-Received: by 2002:a05:6a21:a582:b0:190:8d36:5502 with SMTP id gd2-20020a056a21a58200b001908d365502mr13766802pzc.44.1702569941157; Thu, 14 Dec 2023 08:05:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702569941; cv=none; d=google.com; s=arc-20160816; b=pwGFwWOYrYHTx93x/f09cnuqp2LwNvC0JU9tvqxCYQe/56UIiqQJgNnQKBhWiOUPt3 UK+SwdY22Nxe2Sux5WJDkiTERa34r4cV5fq0s0rwNaIcRrtqHdG5AX+v0XwV4wa1sU3y NY0wahzuFitVtIepwZXZn+FPb9x93LsG/Zj81baV5WdkEE1qE8DJEnstg0PCtnPwsuYO W9EkIdjzjunyaJ6rrqFWv6kY50Lahz04A3CCacw/Qj4yadqnWaVMDV1taVIxI5ZJNzDV CL/tp+bbZUnhh2f6SgXbUq6+2IFLsPVoB9id/naLdyeMVhOWMD/0wcbUs1C5izl5u3c7 ObRA== 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=+pSA4tfgqLwZZDsdzvywAZIXpKtEO31/z/D4LSeqZJw=; fh=w3yeO0Q+7yApRIBQ5jppSTwFcTlt1VKBrJmqR4dAHYY=; b=qIZWjaFH/hpZazj0u8jQBBZ77eo47VHRHxFA4RuSMohmGimRAel5ecPprg82OAbmtA irg9MtUWSFX8P/kQRLbTNsqO+/Ri2qWnyvUZY4ik5vFgOiK2FL+Tx58gFCTLW3rGdeNh WZWK4tyBRIgSztqisGSRqv/NTZ0m5AdQ2MHPaFgosM4KmHUyMLJV0hBIC/YH6TLHh/f6 RvfZlBOdoPMBawlcKOvTfIMvQnalIT4dEfyJIczMUNaow7Md/VFlXz9OqHRK7DE4DUNa AOELxeKZxSDVYRRVrAOpZrrAZCf1dZfuPLjoeuiwjcMzIYEwcWloyWBfUsY0Ogq2Mfc/ z1xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iqO4XEIp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id k16-20020aa788d0000000b006ce38c8412esi11355711pff.151.2023.12.14.08.05.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 08:05:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iqO4XEIp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 65DC8801B484; Thu, 14 Dec 2023 08:05:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443492AbjLNQF0 (ORCPT + 99 others); Thu, 14 Dec 2023 11:05:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230252AbjLNQFZ (ORCPT ); Thu, 14 Dec 2023 11:05:25 -0500 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0D8110F; Thu, 14 Dec 2023 08:05:31 -0800 (PST) Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-5ca29c131ebso3405822a12.0; Thu, 14 Dec 2023 08:05:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702569931; x=1703174731; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=+pSA4tfgqLwZZDsdzvywAZIXpKtEO31/z/D4LSeqZJw=; b=iqO4XEIp8Ci+uYegRHlOcNFlMR0HphiC+76/xqad/2VY5Up6AmLozPYmpZnLwnNR74 EhVizv1Ba8UbBZzrftqnTNJF6/YSMgGh8r+GXh5s4g2nngekfMoB8BoH+Ah9ijVrg0cD 675AIPw6Iphh/+qozEhMHI3koAOq9GlOrUOmUZd8gvM4+bZSrVXhKIj4DJkNjlISfzR+ xJoRjOJ8L9GcEyrOtbG/n103hcs2InUM+S+BZeJw3q1KnZZw8SxBzFv4xP4MIcDQCBGo n7te4sre57jKSwYpiuBmFRAw3OX35lQU5JKfbcpvjC/hivOE/HNx2aSXgpLfhLmXwauS 1wuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702569931; x=1703174731; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+pSA4tfgqLwZZDsdzvywAZIXpKtEO31/z/D4LSeqZJw=; b=Bu9+/OLjxSAbhZhtezYWOAJBrA7MnwuE9TklmPwrTfiZvsDbd0nwVYkzK+oTvgLse0 zL852ao6ZqFuBgEmPk7hwk0EMbN7b1Cw99cVUC5qCb7cE0j5O4OMjUEF6aIGuQlohjpN SQLyFHYE5FA2+7jyfFuYd3z64TQziVB+OfaOx/XJpZHQ3S+4roB19MhamRL44ZgLGcKy HshhPYqInvqUmVG67jB1ERmvg80+xZVglJUFIRK0Vd37K0/jo8tQJhEaGiuNmO0vPx1T fWq1zThQvMJ0yU+VmNBbByqdQ/E1d3n+0f9EFTPj1+BOUq6OINRnLdXR4HmPkeJtCTSs 3h+w== X-Gm-Message-State: AOJu0YwSBRB8Z2FPeDkWShprtxXFxXmTny5pYy0HhWk+1Y9I8h7lLfTa xNz9vfqZyvgRhF5pmX3r1Ju1KarNv+g= X-Received: by 2002:a17:90b:38c8:b0:286:da6d:c41 with SMTP id nn8-20020a17090b38c800b00286da6d0c41mr7592458pjb.70.1702569931356; Thu, 14 Dec 2023 08:05:31 -0800 (PST) Received: from rigel (60-241-235-125.tpgi.com.au. [60.241.235.125]) by smtp.gmail.com with ESMTPSA id 8-20020a17090a19c800b0028b0848f0edsm1818455pjj.9.2023.12.14.08.05.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 08:05:30 -0800 (PST) Date: Fri, 15 Dec 2023 00:05:26 +0800 From: Kent Gibson To: Andy Shevchenko Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, brgl@bgdev.pl, linus.walleij@linaro.org Subject: Re: [PATCH v2 4/5] gpiolib: cdev: reduce locking in gpio_desc_to_lineinfo() Message-ID: References: <20231214095814.132400-1-warthog618@gmail.com> <20231214095814.132400-5-warthog618@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 14 Dec 2023 08:05:38 -0800 (PST) On Thu, Dec 14, 2023 at 05:50:16PM +0200, Andy Shevchenko wrote: > On Thu, Dec 14, 2023 at 11:34:44PM +0800, Kent Gibson wrote: > > On Thu, Dec 14, 2023 at 05:27:29PM +0200, Andy Shevchenko wrote: > > > On Thu, Dec 14, 2023 at 11:19:01PM +0800, Kent Gibson wrote: > > > > On Thu, Dec 14, 2023 at 05:10:23PM +0200, Andy Shevchenko wrote: > > > > > On Thu, Dec 14, 2023 at 05:58:13PM +0800, Kent Gibson wrote: > > ... > > > > > > > - spin_lock_irqsave(&gpio_lock, flags); > > > > > > > > > > Shouldn't this be covered by patch 1 (I mean conversion to scoped_guard() > > > > > instead of spinlock)? > > > > > > > > Read the cover letter. > > > > Doing that made the change larger, as flags gets removed then restored. > > > > I had also thought the flag tests would get indented then unindented, but > > > > if we use guard() the indentation should remain unchanged. > > > > > > I'm fine with that as I pointed out (have you received that mail? I had > > > problems with my mail server) the dflags is better semantically, so restoration > > > with _different_ name is fine. > > > > I have noted that some of your replies have been delayed, and I can't be sure > > of what I might not've received. I can't say I've seen one that mentions the > > dflags name being preferable. > > > > I prefer the plain flags name, if there is only one flag variable in the > > function. > > I pointed out that lflags / dflags is kinda idiomatic internally to gpiolib* > code base. Using flags might feel misleading and otherwise will hint about > semantics of the variable. That said, I prefer it being named dflags. > Application of that idiom in gpiolib-cdev looks to be mixed, but I guess it can't hurt to lean into it. Cheers, Kent.