Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6033571rdb; Thu, 14 Dec 2023 06:46:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IGRurVdFen5+pJc+cUMUUq3bBPxNHWC/W0FYe+N/BG7Ye/mV9HMbp94ZVD7GDwEN1StKRbW X-Received: by 2002:a17:903:483:b0:1d3:5f2e:7e9c with SMTP id jj3-20020a170903048300b001d35f2e7e9cmr1181120plb.92.1702565182282; Thu, 14 Dec 2023 06:46:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702565182; cv=none; d=google.com; s=arc-20160816; b=QVNCmum3hkEn3hVK53cEU3o87zrUY0uz2ojpGJlWMIGAS7cuJMSenFqEjxMwWSHW0K OvlSInUj+pjlMjNgrmAqXTpcQWBMt5BSb6NCJx8vIIK8SAKXwF3YY4v6Ktojgh5DfvfN 1RLtnZznfWrP7oQzSjJrI3V2nhIXVb8AHBrxF1HBmZNuFnPmJXpA/OyaMEa/qTDb2t5G 6fdvaIBfeiD1vpSqp2oJ36PaHah3DWxjMb2qK0CnbciXXZg8pKmxgEOpWn7JwGLpNUZG H03Rqo33h/ZKH9GYpPP4YSXEM2dGi1FPidwoU2MJjrjtcODqYh/mIC9kh6/EE+WfzoCe c65w== 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=0OGUCjiWquGGsTrpvsPwR69C78xlzg3lziD6TLbqES8=; fh=T8qTeTG/xrJTvg2Z1oBpeMPGvtzClTADDKlK46Z/Q1E=; b=KYlRtlvWQosAp8TN/yv0LFq44wNrDR08S7jYjDxUn1z07T8yKMIMBQPYBedc512Tf5 j70zsTjH5eF3ZNSJLcdXiLrOOwVT1RA67xGiIz6dXDJ8e8V4EkHSZq3FVE6l9K1kLAYT 8T97BMN8JkW7oAtHTi484EMe/NtydM1CCHqGgMoNKw5z6HSc6HCHI8QjOLkw8z5nhb9S /OoCQcOmpNUpalw2abVUZT79FfLPe0x6uOfKYN/CtbPuSfyfEombZtHDJXaiIRUBKEW2 YA0hodM7vTuHO6PTCZV8LN8Lh8/hIm42RZmhhOQCOmvUgHJUGJoxLzFknciXFw3pdyCt ztFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RZ8Zs4fy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id bh12-20020a170902a98c00b001cfc9c9f736si11266446plb.93.2023.12.14.06.46.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 06:46:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RZ8Zs4fy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 23C8180A1903; Thu, 14 Dec 2023 06:45:35 -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 S230082AbjLNOpR (ORCPT + 99 others); Thu, 14 Dec 2023 09:45:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230012AbjLNOpR (ORCPT ); Thu, 14 Dec 2023 09:45:17 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6548D91; Thu, 14 Dec 2023 06:45:23 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-28af2f9a0f6so1015417a91.0; Thu, 14 Dec 2023 06:45:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702565123; x=1703169923; 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=0OGUCjiWquGGsTrpvsPwR69C78xlzg3lziD6TLbqES8=; b=RZ8Zs4fy02E4KcM8ysZ3MCN0dhSQ34LVTlyv1f/WCBY3+b6GjRZgQt9wnb51rwNm2N Bje+Shd0RS5STqjPkfaG9p6yuxGYT3HlBl8pvzqW2U5/JncQyFWBFXpmOR1MT3A+UoWk /6TJBEM5nfmKoKuQMpTV1cgrnY+c6asTb4L0ATMFKBn0+m6ODcxU7A0/GtETemNEEGuv qSq2HkJWJLTQjX3lZTZ8luy4jpEYo5usbs6pkQNpgzDlFRHVxImL5SebUFT/b+Yj9tA4 k6JgRcaxzXgGZn9Xe3mmOJpGeztW33bJFqUhMaAuJ/+ZPFJcLSSYdpVTqi13RVxC/YAB bVdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702565123; x=1703169923; 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=0OGUCjiWquGGsTrpvsPwR69C78xlzg3lziD6TLbqES8=; b=k9/bqfWw0bodtTytzGiM/5XLdfS6MftupSzwleull5BHsvXyPcMZEOnhcM3EagxEQu fH89JmvrDOBcCi4+xRDK0t1ve5aKyYlBHOSC18Q74s65ypP2daVcmXoC7YWGexnGsimu fgN1mC+rriM1mpno/lpWYPIwa3QoQqJsvkMInMxtoz37jCN3cE5j/RqxqhEaEARVA+nh ryJRUdhMoOJ8Ehgi7nNHq88ekb6r6hg6cK75VjjzuLJSb/up60fAR+WDcy7vZTH9V1AV YpHwblYKOrN63trTjgLSoGmLIY8m3EYjP//6E4tWeIkaNQmLNiSrtj5OOjqY06MvIR9N FIcw== X-Gm-Message-State: AOJu0Yx3lpFvFAGMOdtAb+PHfWkd4qhJkU7Jainpl63H3OCgacnBu0sJ bVSeOyfpZ07gWLkp+EO8U/k= X-Received: by 2002:a17:90b:1d0d:b0:286:6cc1:2cc2 with SMTP id on13-20020a17090b1d0d00b002866cc12cc2mr4538662pjb.76.1702565122780; Thu, 14 Dec 2023 06:45:22 -0800 (PST) Received: from rigel (60-241-235-125.tpgi.com.au. [60.241.235.125]) by smtp.gmail.com with ESMTPSA id nb11-20020a17090b35cb00b0028017a2a8fasm13360780pjb.3.2023.12.14.06.45.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 06:45:22 -0800 (PST) Date: Thu, 14 Dec 2023 22:45:17 +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 06:45:35 -0800 (PST) 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. Cheers, Kent.