Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6804455rdb; Fri, 15 Dec 2023 08:43:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IG06ADS6RYpkzhoyNLEzA0tFX76+60lfuWLknYQ+LRGxu6t2Jr+GfC1GpCfmGgRPovIrFXV X-Received: by 2002:a05:6a00:8c15:b0:6ce:7926:c3e5 with SMTP id ih21-20020a056a008c1500b006ce7926c3e5mr11123299pfb.63.1702658626538; Fri, 15 Dec 2023 08:43:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702658626; cv=none; d=google.com; s=arc-20160816; b=rfkidsYrv47OvXPvS9yVUnd2c1qRafR5sWpB4O0BNFpZFgS+SVuvfr5SUMhHJ604Zp mgdxPa29zh8aXQtbY3FKb+eScsOoS5CNpnPHSwptJsGC9Ghde4znKQdKjBOdg9x2MM5w S1tZhRAQ4Aomtc4RLZpT2/JnVhj/dbYLx+rUAUo33/bG9X95b250Yab9Vj6VWot6qZok L5eQvHxReXJz72NFTyjIqXGeqx7ux9S7IZTNbMpQBetvWaZGJRQEtH2D8qhl9rM3dm1M kOuMxMWIGb/FheNDpxzyMF6slePEdfC+XkaOqI0cesYfSLMNPOfLoBVPxPwhJIieW6Ur 3n9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=Ygqjip1ETJHVXFIV+uTQWlp3Pde4qfcT9/GprW1Arj0=; fh=BiTih3HBn05OJvpBeKJCJhFgvirybBPBq65CdTV6sMo=; b=uiwqbaw5JSVZ/qk063HEEUqVV2WKSZTfDb3nxBM10fGQ1yCt0y7GbvOoNGfFudfqra 7KPM9yQigB8140NOtIo04W9D8vP5FHcFBkZoE7+ws5nyl6NzcKPclRGX0FqT91t364Tf nuTWbcEjSvWNu0/ihUlBgCxpBw9mrUE/FXjCZZE6zAN/xWVAu52CUOW9FKuQxiyFpPn+ eIs848cup88ZF9MF6Qqwrr45IhjvTSAcNu3vJ0w+tOrM5/lgjWgA6LJ6bufkKT/PmRq5 7y25715407wDoajG0F4ksgr4CnIW7fFg62+mb0mo+Y/y3uvIZr2Ec2Q096PPtZdySwxm 88Sg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1318-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1318-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g5-20020a056a00078500b006d0810d9bf3si9718450pfu.129.2023.12.15.08.43.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 08:43:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1318-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1318-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1318-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 18CA12817F6 for ; Fri, 15 Dec 2023 16:43:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E995C3DBB9; Fri, 15 Dec 2023 16:43:38 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37E27381C3; Fri, 15 Dec 2023 16:43:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=kernel.org X-IronPort-AV: E=McAfee;i="6600,9927,10924"; a="426427620" X-IronPort-AV: E=Sophos;i="6.04,279,1695711600"; d="scan'208";a="426427620" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2023 08:43:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10924"; a="1106173081" X-IronPort-AV: E=Sophos;i="6.04,279,1695711600"; d="scan'208";a="1106173081" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga005.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2023 08:43:32 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rEBHd-00000006Ag8-3BCB; Fri, 15 Dec 2023 18:43:29 +0200 Date: Fri, 15 Dec 2023 18:43:29 +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 v3 0/5] gpiolib: cdev: relocate debounce_period_us Message-ID: References: <20231215023805.63289-1-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: <20231215023805.63289-1-warthog618@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Fri, Dec 15, 2023 at 10:38:00AM +0800, Kent Gibson wrote: > This series contains minor improvements to gpiolib-cdev. > > The banner change is relocating the debounce_period_us from gpiolib's > struct gpio_desc to cdev's struct line. Patch 1 stores the field > locally in cdev. Patch 2 removes the now unused field from gpiolib. > > Patch 3 is somewhat related and removes a FIXME from > gpio_desc_to_lineinfo(). The FIXME relates to a race condition in > the calculation of the used flag, but I would assert that from > the userspace perspective the read operation itself is inherently racy. > The line being reported as unused in the info provides no guarantee - > it just an indicator that requesting the line is likely to succeed - > assuming the line is not otherwise requested in the meantime. > Given the overall operation is racy, trying to stamp out an unlikely > race within the operation is pointless. Accept it as a possibility > that has negligible side-effects and reduce the number of locks held > simultaneously and the duration that the gpio_lock is held. > > Patches 1 and 3 introduce usage of guard() and scoped_guard() to cdev. > Patch 4 replaces any remaining discrete lock/unlock calls around > critical sections with guard() or scoped_guard(). > > Patch 5 is unrelated to debounce or info, but addresses Andy's > recent lamentation that the linereq get/set values functions are > confusing and under documented. > Figured I may as well add that while I was in there. This version LGTM, few minor comments here and there, but feel free to add Reviewed-by: Andy Shevchenko -- With Best Regards, Andy Shevchenko