Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4435895rdb; Mon, 11 Dec 2023 21:43:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IHvOllPQtEbZgmz7Mhwkb4NxNOKDKa+2trXoCZIA3FiPpZbD8jsBoiGvOhfqHOnLtAXneBH X-Received: by 2002:a05:6a20:144d:b0:18f:97c:614f with SMTP id a13-20020a056a20144d00b0018f097c614fmr7402946pzi.76.1702359807480; Mon, 11 Dec 2023 21:43:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702359807; cv=none; d=google.com; s=arc-20160816; b=G54JLTpMFCjVRcAWXkBUQ5873Q6zekimHtiow3XfHcVOH6brvZNHp3t0Xa4RdVc7Ol Ynu0pHh9NcqqlyV/H+AdrZCst2X7+5dEMpfYh08l6z5Qga/R5lPXzSjkW7p8YG4vvq9l yAlaN7GurqZkkxHhM+Zr+VXK2pdr4JayeD7+9qVPbY51GHeeawfxg1bLg/AzxduSKkyx 22fYe0+W58pfSQNftZYsDWJUAguY7EUzPO4wjy+fOcGGEDVsSvrXuaEnwxwlnDJ205ls kMwogGdGQGAw4z+k7Q+p7JGROu0mObiyXJeLmbbTz5OSozbePU2VN7neHBTTMHz5cCY5 hxmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=sKaFlL9xl746TmzT27qUJD5WRcj1vFRppCdyKVFw/p4=; fh=GNOA1jdeAuH+tfAEzFx15vIukVGFZnqrW9xHApUHjl0=; b=S5ssC9BBSqI3jtTODkgNsWmvQTd4DbHyxDa0PaMltbjPnKYdYkd2T0/LA50ojIEaPK 5/3oAdWWZ0xaNWoMTkTSZwJDljjf+mrbkTQ6nBrOvEqHW2AeVBW62nXd+DkrLBOscCaf Y3iqH+JYAJTvosE/Nx+xc/Orj9/FFGx8/vnFIRywzk/+09voaLPmXNUMxO7LIYJ/Ccmh Pub//uWDIg7jA8R1ktld0x+Btc6GwzuWOBiIaZjtq5cowduPxTV4X+jBzyC0aul42JD4 rj40fwoCgF2TnE+k2+vRG+XhuRK+057kJoTP7V8tavWhOs0991votL0F3AupO5moidbA tl6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bFOppSMZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id jx6-20020a17090b46c600b00286b88f8c45si8587975pjb.164.2023.12.11.21.43.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 21:43:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bFOppSMZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 4D25F8042D1A; Mon, 11 Dec 2023 21:43:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229537AbjLLFnM (ORCPT + 99 others); Tue, 12 Dec 2023 00:43:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbjLLFnL (ORCPT ); Tue, 12 Dec 2023 00:43:11 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B977CBD; Mon, 11 Dec 2023 21:43:17 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1d098b87eeeso46391385ad.0; Mon, 11 Dec 2023 21:43:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702359797; x=1702964597; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sKaFlL9xl746TmzT27qUJD5WRcj1vFRppCdyKVFw/p4=; b=bFOppSMZ+J2WQt/dg37AMkUMnlyVHaNnQUr/zbnNwSYlbKRL4/O+o8AaphDrl080ap lZV35Fzb+8Hp3gWU7n5C/GM/LkRkfESCXw3P1q7B1QKxzpd2FQwepnilpQvQRTHQMOar 8DEkifOquuuTy549uK67yu4Oa7YN5PHxprJ8G8uRgysJhsY8W8L1tXsxpv0kM1lRHxc4 6jLFvtdb8Cof28F2SJRx+Yy9aHg0dXsWcXLVK33szxvLUL75SZInkxwkp/UHeVkh+Rsw UMMpkrOQYYLBJ570dYLVynWTWOjcvgtYt8CVCeqdZt4uOZs65oNiYCkDGeO2XtNUgafH Hv1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702359797; x=1702964597; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sKaFlL9xl746TmzT27qUJD5WRcj1vFRppCdyKVFw/p4=; b=OhPhYOPYX7pwU9JyBCzp0wk+SCCZHNarbx3GQuk27+5yLEkD/5ADpi+s0NFHj+VfhT seONoemibWudBE1Ylywf29/gWQOPo0yTOnPsu1z1ZgcMwzz/zzalsn91qikGMjAUGyU4 h4E7VVAK3QxR4inwC5ZLTW2FTQ7H8rnClbcyN/CZolNeUBIWpEXCLuJRu2Syz69Y/kUV 4+GayvYFKnnquM+PlIdwC4LJlmJTN/8KC+c4wKqmacZrbfMTZZxJz2MM86EHKjLSW0+t OpPxq3fwh0g19aZLQPUAQCS5S/0C83ibO2txUfAWSjjzSIeJ7zbug4+elSrB+HFQ8luO 4+6w== X-Gm-Message-State: AOJu0YzRrW/MXn0DicamRube9OZgmsBWfLiaedcSXT7I19958FvdWH9X iioJJyWW+Sv/yMWBPt3D1gTVkQwN8AI= X-Received: by 2002:a17:902:d203:b0:1d0:910e:5028 with SMTP id t3-20020a170902d20300b001d0910e5028mr5957423ply.47.1702359796931; Mon, 11 Dec 2023 21:43:16 -0800 (PST) Received: from rigel.home.arpa (194-223-186-106.tpgi.com.au. [194.223.186.106]) by smtp.gmail.com with ESMTPSA id u13-20020a170902e5cd00b001d0be32b0basm7591836plf.217.2023.12.11.21.43.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 21:43:16 -0800 (PST) From: Kent Gibson To: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, brgl@bgdev.pl, linus.walleij@linaro.org, andy@kernel.org Cc: Kent Gibson Subject: [PATCH 0/4] gpiolib: cdev: relocate debounce_period_us Date: Tue, 12 Dec 2023 13:42:49 +0800 Message-Id: <20231212054253.50094-1-warthog618@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 morse.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 (morse.vger.email [0.0.0.0]); Mon, 11 Dec 2023 21:43:25 -0800 (PST) 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. The first patch stores the field locally in cdev. The second removes the now unused field from gpiolib. The third patch 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. Give 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. The fourth patch is unrelated to debounce or info, but addresses Andy's recent assertion that the linereq get/set values functions are confusing and under documented. Figured I may as well add that while I was in there. Kent Gibson (4): gpiolib: cdev: relocate debounce_period_us from struct gpio_desc gpiolib: remove debounce_period_us from struct gpio_desc gpiolib: cdev: reduce locking in gpio_desc_to_lineinfo() gpiolib: cdev: improve documentation of get/set values drivers/gpio/gpiolib-cdev.c | 257 ++++++++++++++++++++++++++++-------- drivers/gpio/gpiolib.c | 3 - drivers/gpio/gpiolib.h | 5 - 3 files changed, 201 insertions(+), 64 deletions(-) -- 2.39.2