Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp581292ybm; Wed, 27 May 2020 02:56:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2Ked4S4jr/rmfhV7Y/MldeDFQ5cTI2dz6RIjwJbbPs/gnRo/T1TXzR7+FYxoAPvLISHXu X-Received: by 2002:a50:da06:: with SMTP id z6mr22650801edj.372.1590573411523; Wed, 27 May 2020 02:56:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590573411; cv=none; d=google.com; s=arc-20160816; b=m+pvcNJlXIQLQt8+8VkNTQzYxrFJCGsY+GnTiwLATNW6MpFH5srp2/mD1pL0+4MMze L1YwPrMG8caWM9jgTt50318biyB26nNRYPkwOjBm7Ch1Uaff80+Qc7+9arowV4VLEf2A D28SAgRLgTkaA+5yhSKKUfGVYODCLS2xVZ5jJlYiCGpLphIfgvDHpiQKG8985ATSun/y nH/qPKIVAo+WYdgjbM8U5cBsYrKvQPuDAKX47mfT9ypD7el6GautZ+RV0kRzu62kfnpw aUfT/WfMqFK0+uzks9s3EzTnYA7bjnVTDTlOq1K8dmXdpZMEdq/uy1DTgvrbbV2ahz7j L0cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=L4OE+Mzwhfdx0FQgVxh0WT9tQP++uOwkn495VNZ2ONM=; b=wDY2fERwSBU4q4iGsTw+5BfC/Y5wTiAWkkqYkeXTV8PhFAXwksGuEPRZOI1a/oOWMk Fqpy/7DJHfgMvhY0144j2yxrhddXnkciqKE4sEJxFRLquDdyAnqb1MGMtUDLNDhfybTR eImA8N2mb+dlDwLlKVzKzXLh4oanKg9pwS9Q0Jv/p6m0HB0mdUznN6Dzeqr7EAAInZTc FY167Pd3JXQ29TZ98u2FJd1pG5+tdp1m0XqTO2TMB+Md7RtsuVO1eQjllCAFIviHZ67F dcfbIf8hsP+VyDL6Mz+EeZEozo7CJNdLnqX3uQYlC8uB4ew8KL4WDPd+bVyI+hYtdQmO kZsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IAxSISwD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v12si1539853ejj.109.2020.05.27.02.56.28; Wed, 27 May 2020 02:56:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IAxSISwD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725768AbgE0Fbd (ORCPT + 99 others); Wed, 27 May 2020 01:31:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbgE0Fbd (ORCPT ); Wed, 27 May 2020 01:31:33 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ABEDC061A0F for ; Tue, 26 May 2020 22:31:32 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id m18so27324233ljo.5 for ; Tue, 26 May 2020 22:31:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=L4OE+Mzwhfdx0FQgVxh0WT9tQP++uOwkn495VNZ2ONM=; b=IAxSISwD9wL4huimHfBqzSMqnZJ5ZHP3M0ZR/gh9/KVhz5cj0bJVobmY7aBQixJutD A+oBYMzTgShxXvTAx0XErdaqsMesWUQM9bcRGNZmVt2GfFo0QIIL9m1q3tYDo9pJCk0s brzHOYWjQRMsYpt1x2qdy8VdcOjWS22OWuCeqJWJyMRUmpn7GSD05sfZDAMxGkF3yvxc CXYbWyRY2PdCrnkeyLKNZbL70qTITSADMjhyB2+LxwAJgnjyQ7FnyzjB9zA6/1aixyMY /K8pFSq3qPL/2bzWxYOPSBvYCjE4aOj8XbchporZb/3mBtpqZtGIIVhyDWUi28i11vLS KM+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=L4OE+Mzwhfdx0FQgVxh0WT9tQP++uOwkn495VNZ2ONM=; b=NFBml07j7P/m3ujfdTytJVk2tVxYjI7P0f+y96OlMtuTFZ0LRqUGR8Q79zshNEBu2l wXRBAHTsOSPyq8OSRGgfDTS+zEjuCIEBKQEngR/TKmMYEeESuuDOc0UEvjPjvUzKXWP2 EMDcEJcOS+b9AKLHUZLLe0LreoKx51DCH7MXWQsW8mI7kuNqsfIRF5G4p0ygUk074FZb T80lT4bdp6f5Der4zZkhA9AwnV5++YuhlN6seqSuC2boyMIAbn+ZNHXwo+gNL3Y1Nz9N 0jBy9S5zYzRUolA/n8f55Hf+9/gpAZJAY4O4XWDR+A9+a8QEWG+LFkJF+pVUAAgbCuDy xmYw== X-Gm-Message-State: AOAM533hsKi4N0u/WSCkFXTMYG0eSPJ600AjW8fMdka8N81ukOOSMC3Z cDjziiY1DG/SlX2SGgEGDn/WWz4BbqRDV5SnZCN/SA== X-Received: by 2002:a2e:9716:: with SMTP id r22mr2237717lji.293.1590557490905; Tue, 26 May 2020 22:31:30 -0700 (PDT) MIME-Version: 1.0 References: <20200419001858.105281-1-hector.bujanda@digi.com> <20200525022252.GA22956@sol> <20200525151736.GA32461@sol> In-Reply-To: <20200525151736.GA32461@sol> From: Linus Walleij Date: Wed, 27 May 2020 07:31:20 +0200 Message-ID: Subject: Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL To: Kent Gibson Cc: Bartosz Golaszewski , Hector Bujanda , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 25, 2020 at 5:17 PM Kent Gibson wrote: > > I suppose gpiolib would have to steal or intercept the interrupt > > by using e.g. IRQF_SHARED and then just return IRQ_HANDLED > > on the first IRQ so the underlying irq handler does not get called. > > And how would gpiolib ensure that it was first in the chain? I don't know. > Totally agree with the concept - just trying to work out how to > implement it seemlessly given the existing API and usage, and given my > limited knowledge of the kernel internals. The irqchip maintainers certainly know the answer for the question of shared interrupts at least. > > Failure is an option! Sorry if I push too complex ideas. > > I'm not as concerned about complexity as I am about fragility. > > I don't see any problem adding debounce for gpiolib-cdev. > Adding a more complete solution to gpiolib itself is certainly > non-trivial, if it is possible at all. I agree. It's just that I perceive it as more elegant if we can do that. > The path I'll probably be taking is adding a debouncer to gpiolib-cdev, > so at least we have a solution for userspace, then take a longer look at > the more general solution. That's fine! Thanks for looking into this. Linus Walleij