Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6049461rdb; Thu, 14 Dec 2023 07:08:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxMzSSKsUPBydDW6FTQ/gk4ygvX9ukG6YZUC3AqQPYsBrRHlebywpoPmPvqskiO7aarvFA X-Received: by 2002:a17:902:7795:b0:1cf:fa64:6e50 with SMTP id o21-20020a170902779500b001cffa646e50mr5676778pll.62.1702566508651; Thu, 14 Dec 2023 07:08:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702566508; cv=none; d=google.com; s=arc-20160816; b=DuU6HN49xP0pTUKHgHmvfsNra916MuJXa6Ehq8nToWDWdd5l6Ael0ZPGawU82Uv48s vadGFPZngIUK7vynD+GmuzNLZE/5oFIjNt3YBhVmUWqZvm5uTuseUxRQX3Hk8Iw2EhGb kgceYpl7RgQ1xZUto07aR3AKC6bJ8wt25fOg3axm4ETib/A/T4T2RV3gTkT8ekXMw5FO 3UvZQmxAi28LHZaFOVMId17GbrX7iSLZktRqJjPH9+fPxJ0f36RTJeofhkpSAm5tpvIf 52HIwAuoHIpvnI4oB2G0zVdedQoT4kFFi3kRy+VubBG6pSujPXgYNca7dLTDOGzfGG6f AFwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+Vk5vGqMfI0jrxtf/OidVbCY3Nu25fYb1sjU0YfaOb4=; fh=T8qTeTG/xrJTvg2Z1oBpeMPGvtzClTADDKlK46Z/Q1E=; b=l5RRnOdwjRfURygzMAuYOxqPFMc62YGyQbTpsv2p1OHAqL9fOVsHSrhPBcLSzkFdj/ Ei/Pfu5zpxyl6LJ9dIEzoe5NStahEf0wIS+xHVQrMSVXaK6ZK3ECL/m2xZaCrB/cmdo3 7ThV2A0v66bQrIceqAynAaZOmZhzhf67ab1en2h1A0igD12F8UQNUhKwYXLfgvHJEGOc u/mH7GcTd0C+A1TfU2D3TRvXSrik8kTzBVm0IW3itg+arX5TVsTL4fGNMJIWLZo9hGXz 4CGB6iEtR/oWX2lnq7prqORA8xfoig+atRrL0ApjT3I2UKlI+LPLx9VOg1rJNWGSjwGx z2UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Pf96+4Hj; 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 s9-20020a170902988900b001cfafa3a897si11169658plp.646.2023.12.14.07.08.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 07:08:28 -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=Pf96+4Hj; 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 81E8780A138C; Thu, 14 Dec 2023 07:08:20 -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 S1573648AbjLNPIG (ORCPT + 99 others); Thu, 14 Dec 2023 10:08:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573643AbjLNPIF (ORCPT ); Thu, 14 Dec 2023 10:08:05 -0500 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C4F712A; Thu, 14 Dec 2023 07:08:11 -0800 (PST) Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6ceb27ec331so5356076b3a.1; Thu, 14 Dec 2023 07:08:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702566491; x=1703171291; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=+Vk5vGqMfI0jrxtf/OidVbCY3Nu25fYb1sjU0YfaOb4=; b=Pf96+4HjHSmofVr1XYlUVkA5vFGavVdSzTJN9Ccy17ycswGT3bkEG/i4h4kOAkOUGg h4kFmMyrQHiKOVi9u0UCj5yked+BeUXcdMeKXAt/DEX0PN6zBiReteKaYPBGjO+M8Zst 8vEcxPG0UKsppspf49estqbo6G/v0ETIY/qhn9/UwddonlU3DMQdiXLUtQG8SrIUa+Bq 1jb5xNEIiS0UMb+Tr+7dv1w9RVoK2C0svnc/p8SnxKGJ+ftoE5eh64n4PToxdN6rA+th pKOfRVakU1/qBeFVUo0+awJlPYl7OzlIzd9FVe++c4vO1dod3oONyKCOl+ECFiTl4Tku gZkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702566491; x=1703171291; h=in-reply-to:content-transfer-encoding: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=+Vk5vGqMfI0jrxtf/OidVbCY3Nu25fYb1sjU0YfaOb4=; b=sba5nNwLqusMMHCJ5fmRV6C5rpBcn6MsgXhcQilKEpfPoxYM2uiFsT8XEqAIiXTDRP SqIOOlwB/SUFn6vrwMmGn6eRuZLgmsgZpCr8BKCefbGtUy4+YAI/eS++NpTD/SWtckU+ G3Tb5kk7gT7CyUKkCVYj3bXsNU6e+fpH7zJM49ih/LA4yM+2uMmjKSs8LMwjA0XcJUd8 2d9skS4yMP3wz703MczLUl83H6Ip5Zcr+FEJdnKkXCaB1+AHFNIJKnvrMbHUlOWYduB9 1G4m7HZ5yc/2kWr6jTM4pl5uqaFrc4IYMe7B1DUdxuqv1V30xcgF2UlNTVFaa2s225t6 FD5g== X-Gm-Message-State: AOJu0YwU4chdEL/jA1Hg3z3Nr7qvjdIvvA9GqAem/IEbtdYrzpKJT9rO ENOgy8AM2pfVT5/t/bUtaEE= X-Received: by 2002:a05:6a00:2286:b0:6ce:4288:f749 with SMTP id f6-20020a056a00228600b006ce4288f749mr6708017pfe.14.1702566489680; Thu, 14 Dec 2023 07:08:09 -0800 (PST) Received: from rigel (60-241-235-125.tpgi.com.au. [60.241.235.125]) by smtp.gmail.com with ESMTPSA id y19-20020a056a00191300b006ce75111ce7sm11808980pfi.162.2023.12.14.07.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 07:08:09 -0800 (PST) Date: Thu, 14 Dec 2023 23:08:05 +0800 From: Kent Gibson To: Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linus.walleij@linaro.org, andy@kernel.org Subject: Re: [PATCH v2 2/5] gpiolib: cdev: relocate debounce_period_us from struct gpio_desc Message-ID: References: <20231214095814.132400-1-warthog618@gmail.com> <20231214095814.132400-3-warthog618@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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]); Thu, 14 Dec 2023 07:08:20 -0800 (PST) On Thu, Dec 14, 2023 at 03:56:37PM +0100, Bartosz Golaszewski wrote: > On Thu, Dec 14, 2023 at 3:45 PM Kent Gibson wrote: > > > > On Thu, Dec 14, 2023 at 03:29:28PM +0100, Bartosz Golaszewski wrote: > > > On Thu, Dec 14, 2023 at 10:58 AM 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 info */ > > > > + 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 > While I think of it, what tree should I be basing on? These patches are based on v6.7-rc5, and I'm not aware of any other changes they may contend with, but best to be on the right tree to be sure. Cheers, Kent.