Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6039692rdb; Thu, 14 Dec 2023 06:57:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IF5HZfEujoWpUee5kTyk/jftExb38baXyYooa/ni0CJw1ugYh0JhhKhQxv8Vv3Cb7XUVMaw X-Received: by 2002:a05:6358:5e0f:b0:170:ad0e:c222 with SMTP id q15-20020a0563585e0f00b00170ad0ec222mr12259237rwn.9.1702565823249; Thu, 14 Dec 2023 06:57:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702565823; cv=none; d=google.com; s=arc-20160816; b=KsjQyJqQ54h3r3DC+BeKOLLgfHra66UVnuqT9vuqZAdJP8kcrwpvlpVymfJWfEdIDF 1m1mFAqy4zkvO+ojx5CDdRkZAxCOvEm+YMTmkEbZMDS3I/mOqjjvrqjVkKH8OG6QgSyx IcjyZRrCBtSiGc8CnbxAx5Lu8G7iW5RjQlH4Q6nwhAlPQu8tMES4qYpc4hZW+cCC9VW0 j+iaCLUZ61HIpyll1RykNQZ4tsaCzGGJAv1wtVXSrabevn9qwN23wWeAKvgQ1U0mHpVA 2i/RDCya7yiLOM7YY/zM6UiODsQNCSuFiVdnydHtdZLew6hYWWcFctnisFXGgnozXbH7 NX3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=QXGU7uxzdx9Ei/zDB1+ErYmoyAxKtQT/JcBiEtryWB8=; fh=erCAZt8TqRv2/z+YQ9HTYE4a5f7Y9g1zasafOXpHI3M=; b=CHFFlVIl72ZRQMS+wFwtACtrTy7YMPVoeYOcmN16jn5ypF0EKAq/Cl08WZv+doub3p 0yi7C/pTgPhLeByQa/gt/PKMdx5IL0Sv4N9+ISr22Te57PGGXqZtO6Wk/12GIzsDZrr5 Hcy/nnCla1Ef+xypSMlfTIi2zBhteHx7MNLM5IzrDyOEzcWVxvuyDjWv/tj34mhY7FdH m5nWp7FiC1m9U786xde7S737oOUIex1VE0KrUj9Klu9s79aC8PjOX6ZXpzEAwwW3jwOd UQPwe4/+AeCdsI72i6zUTAgr/9vO9X3J7HWZY+/Uwl5ueu1uB9AYCX1DCdLH4MNPbFnS a+Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=DA0GCRET; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id m19-20020a656a13000000b005c663eae37asi11946958pgu.252.2023.12.14.06.57.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 06:57:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=DA0GCRET; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 9D24B83EB321; Thu, 14 Dec 2023 06:57:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573569AbjLNO4p (ORCPT + 99 others); Thu, 14 Dec 2023 09:56:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230149AbjLNO4o (ORCPT ); Thu, 14 Dec 2023 09:56:44 -0500 Received: from mail-ua1-x929.google.com (mail-ua1-x929.google.com [IPv6:2607:f8b0:4864:20::929]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9477121 for ; Thu, 14 Dec 2023 06:56:49 -0800 (PST) Received: by mail-ua1-x929.google.com with SMTP id a1e0cc1a2514c-7c5060a9e5bso2529825241.0 for ; Thu, 14 Dec 2023 06:56:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1702565809; x=1703170609; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=QXGU7uxzdx9Ei/zDB1+ErYmoyAxKtQT/JcBiEtryWB8=; b=DA0GCRETHjh2t2x//pla5xlpAu9Lv9r0HluBKMCO+7yymArkZpzaB4j7DSOyPDcTdS 9npQei5l2AS2LaKEYA5PtD0mO13gp97/yeafxQesOFFPOyNldhXbcL0ykINYEx6mF7u/ kdiUNaOhpvtgOwqRyZHXDGD3z3PXnGGJAtsy/E+HCrxso5LCrDMaGNcxnaJTH0zQdZDp j1oMxlr7YG6pnKeM6TZUDdShV6XeWoEukfIqYVUSba26G7QRWEqMYXmJ6gaDHYTQE/jP JQPW5m16FEKBPEuJX40+bqq6rdZnBy8LYFmGqiOVuwo3BHTlQPc0quZMuv7TJNc5xeHC P43g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702565809; x=1703170609; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QXGU7uxzdx9Ei/zDB1+ErYmoyAxKtQT/JcBiEtryWB8=; b=rcde1wycnuBmLwyB/KBK5Re17pPTEgQtezpAsJO9qswUgxlYRe0WW16rWqZUvNLWv3 CaCaAWvl7LYbErPJZMWBAorTzY3TZJHtiBVM2o6MrbkeXZQ8MclaSZ80YJIMA2kJF64R Bw6dOiojtEizGqflcn9MB8xRqTGCf2a2X1WPeFktHKGNMdAB+jl8QzLssp97/q7b1q0I pbAg77xNFCgWxz22q/Q1zPCdKKziPci8QKwQZXkLSGg4VvMioaUD2Di6GAeHxcjw+PIy djogGdGfCldGzyQdwaFg31toYvl0d2mey1Oa0z2Tbw8bkuBhTyOZopbZFAeJPeKgLvtQ gLcg== X-Gm-Message-State: AOJu0YyULMCXslcw9NYG3Bk4FwNkdq77yO8R36OhO4QpR58i23xG1wba Fg7g5idKeGormNKDlq8b0LgS+ZKhIHZl118BCdxOxQ== X-Received: by 2002:a05:6102:dcd:b0:464:93fd:f4a4 with SMTP id e13-20020a0561020dcd00b0046493fdf4a4mr7694324vst.25.1702565808851; Thu, 14 Dec 2023 06:56:48 -0800 (PST) MIME-Version: 1.0 References: <20231214095814.132400-1-warthog618@gmail.com> <20231214095814.132400-3-warthog618@gmail.com> In-Reply-To: From: Bartosz Golaszewski Date: Thu, 14 Dec 2023 15:56:37 +0100 Message-ID: Subject: Re: [PATCH v2 2/5] gpiolib: cdev: relocate debounce_period_us from struct gpio_desc To: Kent Gibson Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linus.walleij@linaro.org, andy@kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 howler.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 (howler.vger.email [0.0.0.0]); Thu, 14 Dec 2023 06:57:00 -0800 (PST) On Thu, Dec 14, 2023 at 3:45=E2=80=AFPM Kent Gibson = wrote: > > On Thu, Dec 14, 2023 at 03:29:28PM +0100, Bartosz Golaszewski wrote: > > On Thu, Dec 14, 2023 at 10:58=E2=80=AFAM Kent Gibson wrote: > > > > > > > > > +/* > > > + * Used to populate gpio_v2_line_info with cdev specific fields not = contained > > > + * in the struct gpio_desc. > > > + * A line is determined to contain supplemental information by > > > + * line_is_supplemental(). > > > + */ > > > +static struct { > > > + /* a rbtree of the struct lines containing the supplemental i= nfo */ > > > + struct rb_root tree; > > > + /* covers tree */ > > > + spinlock_t lock; > > > > Looks like this is never taken from atomic context? Can this be a mutex= instead? > > > > Correct, only from thread context. > > Can be a mutex, but it only covers tree lookups which should be quick > as the tree is kept minimal, and I wouldn't expect it to ever get to the > mutex slowpath, so a spinlock seemed more appropriate. > Fair enough. Bart > Cheers, > Kent.