Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5396190rdb; Wed, 13 Dec 2023 07:34:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYtteoDfMV2em/M1S6Puu4AN9qhCiK5nadWERWZhU1cU9Cs/NdFteNJCqA4W22dzXjxgfD X-Received: by 2002:a17:902:b197:b0:1d1:ce10:d703 with SMTP id s23-20020a170902b19700b001d1ce10d703mr8628011plr.91.1702481650872; Wed, 13 Dec 2023 07:34:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702481650; cv=none; d=google.com; s=arc-20160816; b=yfga1o2zvluOEhK760bnTCrEt5sg0F9qgrkn3eMBnexIqhRsxev3Je/aX/rmF6/nfD y3lYr7R6RGuyXTtkTY+lTPjyXQJQD9A1rZg0mNz66ezvPCYUB+j61Y84MZmnuq1Hg9VQ W3xZlgChEmeUVS+izfAItN5JC4adK5N1I3wYhw5IiEyRhS5VFhrayP18NajgNo1i73GG szYy1VzKAqXR223+hmIHvBpC/1QixiEav7FOvITIs/BsgyE456HbqkHarIV4sNW+tRwG /OtCe6MorISWtr00A7w3uowFQRw9CqC6dBi66ISOk0Gd4MaoL2YY5FsJiBGel5HInsny OrQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=dlMWKSPyuI41IExuIX7YOUKN0ycRdIwIkS91p5BihJM=; fh=BiTih3HBn05OJvpBeKJCJhFgvirybBPBq65CdTV6sMo=; b=NBsO4KTgoNCVFf4fkAcvqeQ5wZwRKw8dRsYm0rbcOZORVEBy/RhG4c4RsnarNBhbvW bVD8nwWRXAKibZ51MevHhxcJ1wc5EJS+J/M4hkIk81E20uJn9zDHb6rBIfFbHHsg6Ofk A+5IYrqZfrgqOzOgbrCpcz4Iv/ms8ZlyObZep+Ts8I2K3FRXd8UEFvOSOG5d1LK92ykM tygtZSRppbWTuw988Sg1Iob4nl4xG+bG87aDABMdD+uVcFa+W/GkIgkLE/dPABDQq6e5 mdQRoXtCNYI5cDzPY6LBgUGjR+ViYnGfLQxf0081TOlqKrNMe7x7iBvVnAVOs6TW0pf0 +Ylg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id t8-20020a1709028c8800b001d08be55d01si9509633plo.101.2023.12.13.07.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 07:34:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 6E0FE807E45D; Wed, 13 Dec 2023 07:34:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442262AbjLMPdv (ORCPT + 99 others); Wed, 13 Dec 2023 10:33:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442378AbjLMPdk (ORCPT ); Wed, 13 Dec 2023 10:33:40 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C18293856; Wed, 13 Dec 2023 07:30:55 -0800 (PST) X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="2061516" X-IronPort-AV: E=Sophos;i="6.04,273,1695711600"; d="scan'208";a="2061516" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 07:28:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="917691498" X-IronPort-AV: E=Sophos;i="6.04,273,1695711600"; d="scan'208";a="917691498" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 07:28:39 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rDRA5-00000005YiE-1JVP; Wed, 13 Dec 2023 17:28:37 +0200 Date: Wed, 13 Dec 2023 17:28:36 +0200 From: Andy Shevchenko To: Kent Gibson Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, brgl@bgdev.pl, linus.walleij@linaro.org Subject: Re: [PATCH 3/4] gpiolib: cdev: reduce locking in gpio_desc_to_lineinfo() Message-ID: References: <20231212054253.50094-1-warthog618@gmail.com> <20231212054253.50094-4-warthog618@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-1.0 required=5.0 tests=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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 13 Dec 2023 07:34:08 -0800 (PST) On Wed, Dec 13, 2023 at 11:11:34PM +0800, Kent Gibson wrote: > On Wed, Dec 13, 2023 at 10:07:28PM +0800, Kent Gibson wrote: > > On Wed, Dec 13, 2023 at 03:56:27PM +0200, Andy Shevchenko wrote: > > > On Tue, Dec 12, 2023 at 01:42:52PM +0800, Kent Gibson wrote: ... > > > > - unsigned long flags; > > > > + unsigned long iflags, dflags; > > > > > > With a preliminary conversion to cleanup.h this whole change becomes cleaner, > > > no? > > > > You mean the scoped guards? Dunno - haven't used them. > > Care to provide more detail? > > Ok, so changing the spin_lock/unlock to > > scoped_guard(spinlock_irqsave, &gpio_lock) { > ... > } > > you no longer need the iflags at all, and can rename dflags to flags. Yes, but I prefer still dflags as it is a distinction from the lock flags and we use lflags/dflags a lot in GPIO library, so reading the code will give a hint about the semantics. > Got it. -- With Best Regards, Andy Shevchenko