Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp7019295rdb; Fri, 15 Dec 2023 15:29:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IH3HBHR7u6erRHwmkWsRYAR+FPppH3UIDt0BSKK10mSokihA247aD+96uLC9aQ4LwEmDO3M X-Received: by 2002:a19:4358:0:b0:50d:1479:f9e4 with SMTP id m24-20020a194358000000b0050d1479f9e4mr5679388lfj.73.1702682943675; Fri, 15 Dec 2023 15:29:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702682943; cv=none; d=google.com; s=arc-20160816; b=mDgGU36pJzT7xYKNEo0haSihLS3g9irT53cs03Z7YixbSJlYzDVxTURAKyhKi+owsk SjaRldsSQz1Ops7ZIq3/d4un2XDHPTt3TDBKcOaAMDb9cHhID88U3JaI2RL0DDGDlO0z zW2Dt1cPxgKqsAVm1yJHDofQ5/2Ls0vNBFA+pVRf3RDJDdmKGuT5DQ1qNg1WKvHv74pc vpitsDlBxDH1gKhPUFo99QA7xIBuALbikgY1xMxdtTgKecp+yM6E2m2fiIcV9bmxErEk A4aw1Pn1hoPwwiVPU4m8Rp3ZdJIxYSNsbJHffHeaCW7jNI9Do8JUC8XNLjTVEMTpJRTW Hd7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SUijnMG3eQXM+CVKamx2ToNpricn5q+qhrLr2Z8uHac=; fh=w3yeO0Q+7yApRIBQ5jppSTwFcTlt1VKBrJmqR4dAHYY=; b=06TQxCiE2Eou4g0tIUcI2b05tp13Bz+6JMZdzR5BxB3YBAcMO/Own++eAe3acXJ2rE OtQTsBxo1Ln5MD/JdX7g6DwUcPGeO8MV/yUTrr6vbSIh9Vcgcx3qA3+NUeV9W3JpadO9 3/U/hAisuHQb157CmSLMfQTNvJVepJQ6Zl730QYq3VInrVoQwZlgp+Phv/ssZv6ngmem Ejg3ooa2gxElAHom1hT+9Ah+df5JDkpoBQmbLtAXV1kySpsMFVW2ENjUF91occDLyZg6 qrpBikpYreNBvPENLj123PbzSPQRATctEvdIqrP0QMF8iWw+4u0lmyAAX0I+0KdVPNh7 mzJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HFy7ZrvP; spf=pass (google.com: domain of linux-kernel+bounces-1820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1820-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id oz20-20020a170906cd1400b00a22ea410614si3845713ejb.540.2023.12.15.15.29.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 15:29:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HFy7ZrvP; spf=pass (google.com: domain of linux-kernel+bounces-1820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1820-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5E1871F226AE for ; Fri, 15 Dec 2023 23:29:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C501419452; Fri, 15 Dec 2023 23:27:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HFy7ZrvP" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B23766AA6; Fri, 15 Dec 2023 23:27:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1d39afa1eecso316705ad.2; Fri, 15 Dec 2023 15:27:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702682846; x=1703287646; 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=SUijnMG3eQXM+CVKamx2ToNpricn5q+qhrLr2Z8uHac=; b=HFy7ZrvPnH/oHGRrRduk4JtNmCwXzSrT4FeqiTK6R/tDnaXXINCavimCTf8a1QMF+n 0cRPTU2xvnumnyFMZJDFyHDN76exXL03cd/11xS/Bz/rt99Fg87fUJ9qX/yYDpeZcqlA VXOV/RuveMQjU0jv+5GiqIW/cJwoUQBtnrR+4pwcAftFjyd8vM2F2TC1SgzK3fGBXvZv ws1SPYqKf79aFRngIADq52IimG4N0FTf9N1xnoH7tDZXXiZoX6qnPTBk3Ak2QlGViaJW IjCxEc4ZlOwJPnymJvtqHxrt13uxZoiA2G66ViC2l/nARR/tiNjFcNktksxs3H124Qiq ez5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702682846; x=1703287646; 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=SUijnMG3eQXM+CVKamx2ToNpricn5q+qhrLr2Z8uHac=; b=OBqTm5/vc29IHslUUok3ZJoR+Ynna9HHj6/EZTUSBDhwKeCkWYugTTtb4ST7h4KG5k QJSw2Xk2Mqfz6B9YL+EMpnhGA+fL3dcc1XmLdvI7hVFtnCrw5eTHgDPR+hArPDVjMOvL lp1SPPiS+po31uuZyMxi6A5v0aRB5WgKTlvro81BwuHccyfdI5bIfWnJ2xnfgdK6MAX1 8qJOpV1voU8BvTeDJ590M8QJMhiQsGmT2MyGkrixlBieRBCLQ0yAOo4o+aTNjWQ5pXz2 brij5c/BvyWg9wha4TLws90K0pXdQf/CjHtCFp/R68A92VuvQkW+WlbMkC/xUNOilmMC fl0g== X-Gm-Message-State: AOJu0YwmM6OGQEz6OR7mpGZ5ossA1W2vu0fm1fzZRU6dYm8vDsUEhLr+ REjZy+sqQ0s/UrmRlGPHjoE= X-Received: by 2002:a17:902:7d8e:b0:1d3:45b7:bc09 with SMTP id a14-20020a1709027d8e00b001d345b7bc09mr5647033plm.55.1702682845703; Fri, 15 Dec 2023 15:27:25 -0800 (PST) Received: from rigel (60-241-235-125.tpgi.com.au. [60.241.235.125]) by smtp.gmail.com with ESMTPSA id y24-20020a17090aa41800b00287731b0ceasm7756536pjp.13.2023.12.15.15.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 15:27:25 -0800 (PST) Date: Sat, 16 Dec 2023 07:27:20 +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 v3 3/5] gpiolib: cdev: reduce locking in gpio_desc_to_lineinfo() Message-ID: References: <20231215023805.63289-1-warthog618@gmail.com> <20231215023805.63289-4-warthog618@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Dec 15, 2023 at 06:36:23PM +0200, Andy Shevchenko wrote: > On Fri, Dec 15, 2023 at 10:38:03AM +0800, Kent Gibson wrote: > > Reduce the time holding the gpio_lock by snapshotting the desc flags, > > rather than testing them individually while holding the lock. > > > > Accept that the calculation of the used field is inherently racy, and > > only check the availability of the line from pinctrl if other checks > > pass, so avoiding the check for lines that are otherwise in use. > > Just wondering if you are using --histogram (diff algo) when preparing > the patches... > Was just using the default myers. Only changes patch 4, which it does make slightly more readable, so will use it for v4. Cheers, Kent.