Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2906553ybk; Tue, 12 May 2020 11:00:24 -0700 (PDT) X-Google-Smtp-Source: APiQypLmWulBHohqlRKnu48HYy8PsyrPd5b2NcWjxxxcsVX0p0vKHtJZ2lx24RSZSps+4RiqfQk8 X-Received: by 2002:a17:906:48db:: with SMTP id d27mr15691834ejt.281.1589306424360; Tue, 12 May 2020 11:00:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589306424; cv=none; d=google.com; s=arc-20160816; b=m7L8hJkmP22Bt793wQQzBI7f6dxgI33d6aiz9lEOhdcEv2NVFnD/WPjbYWHWzt4Ssr qg47faVJsNGoeXPA1R1Bpz36Xxz0ifwMDFyx4XIiNfef9DHKyvgF71pjfrxKDjAr9hZG m3dje9WmqG0/Pw3b9CyO/34ExzQaIkpegPupxZM27RHgspziDb8THu4m5snF2vh7+626 GPtabMKFr5m7vIEs7rDt4BQNZL2oN25sEYu0uBf6d70wVHsIiOgZBPrA0Hu1Rkt5gIgi Uaggo5NOI2AXghVHeSXUNt3po79zeoqkKWQUehM5gM04DIkPC0noO+mF+Vi0WfWkFrWc UDfQ== 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=3bulAdEa0YtKfLDEvgJtXxjULACbMmllrhnt0TNqof4=; b=UrChc4X3FzfmsH3woGN4UtqJLOrFD0tNUV20CpxQEMsJeocW1F8TkbkXH+95r8QUP4 AGNnl3AiKHIyjDVKhS2vHIFlXMnt06Va0ONYcvGMKpEPImUSxmF9hdXBJkvzfyWRHoQV SEsea0nL6nrv/XczyDL/EHqcnb+aQ+iE0G3QYSp0SCt9u5tAH3f67DNYs/fyaqdZjMwP SOwIIa3LWwBeOAcUbuw5bL5wjQio5IXdy1njdcDvt06c3f5d5eHzb+vtAx0wKknwqh6l gLscYtKV9Aa+/r3oFoPtjrf09pLUcvvfOJkTilsKYW+5hM8ZMlZFKFVZVcAovxh2cUXV zngQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CWdQqBq1; 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 d1si4666780edd.268.2020.05.12.10.59.59; Tue, 12 May 2020 11:00:24 -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=CWdQqBq1; 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 S1726465AbgELRz4 (ORCPT + 99 others); Tue, 12 May 2020 13:55:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725938AbgELRzz (ORCPT ); Tue, 12 May 2020 13:55:55 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EA57C061A0C for ; Tue, 12 May 2020 10:55:55 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id e25so14714343ljg.5 for ; Tue, 12 May 2020 10:55:55 -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=3bulAdEa0YtKfLDEvgJtXxjULACbMmllrhnt0TNqof4=; b=CWdQqBq1nuGjhJoclSNUa09Dolztaz1qyxLzybRgOWH7y6Ivq+vHLMs+I0nOQr1YiA uoujI+0guXsvOyLdafj1E2h+Zf6USlqbOJXX7UD0YJoir1Wy4RBNAnnV9Y3CI3Bgp2Uw AsIEhnHzYauu2pddTvUCz0gmyPah5iLyZepsNGIILsejF5o3R6JY5cAfkis56zOAJpk6 9ri55ILWUPS510A6izprONAhGJKX0CLsIsNnkzX38ikEbtPpYognCa5YSKjWnHEOWBw7 UUBnCe5svoHBKfW+O14ceTksj/JOIll6zDZCTuaDoXxPCsT4fhof5njy4pdAASe0IY15 88Xw== 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=3bulAdEa0YtKfLDEvgJtXxjULACbMmllrhnt0TNqof4=; b=OeybWJTF8Rg49rGW3xeqUWS0HxHgm0nvmv/dP6xOi3MmcI0cwhSM/EH3W1Q8cl2/Ra ERrGYLVhxS4tCaSHuAJlvht8iRZ5Ej3l0HXDzhJU/3jGkpTBxo+V8mcDdZ6D7bfapyLE oPxJYc0zBcaBPMZgAKp+IdElXfO2xReUKOYSQU0D14kKUxCkDwfOVabNTJBu+7h0zO0J BnKb3mFCuv64cYTbku3gVCnuOmHNz/vHZC/zMnAWnoYyu0MgNq1NLhunmLnqrgxbuKBL kfNRvnO278k/YH8cXQKClePD+JkLuGnw+2pYytlqDB3bOw7cg6ryrm26BVQR4D5fJjyL MSGw== X-Gm-Message-State: AOAM530YcBwwCtzNKnE1GholjhHqA8v2CFcda68kB96+kvMWMsTaFmyQ uyTGTL1rJJuGy5+5GE2txEmosh1ZfJpcVwrysVB0gA== X-Received: by 2002:a2e:b6cf:: with SMTP id m15mr13942720ljo.168.1589306153711; Tue, 12 May 2020 10:55:53 -0700 (PDT) MIME-Version: 1.0 References: <20200419001858.105281-1-hector.bujanda@digi.com> <20200430145844.GA28588@sol> In-Reply-To: From: Linus Walleij Date: Tue, 12 May 2020 19:55:42 +0200 Message-ID: Subject: Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL To: Bartosz Golaszewski Cc: Kent Gibson , "Bujanda, Hector" , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Andy Shevchenko 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 4, 2020 at 12:32 PM Bartosz Golaszewski wrote: > Ideally we'd have to introduce new versions of gpioevent_request, > gpioline_request, gpioline_info and gpioevent_data structs - this time > with enough additional padding and no alignment issues. Then we could > add the debounce properly. Hm that sounds massive. Is it really that bad? > This would of course add a lot of cruft to the uAPI code. I'd start by > moving it out of drivers/gpio/gpiolib.c into a new file: > drivers/gpio/gpiolib-cdev.c. This way we'd have everything related to > the character device in one place. It would make it easier to: a) add > a config option for disabling it entirely and b) add a config option > to disable the v1 of the ioctl()s. Its good to break out for code maintenance no matter what we do with it :) I would however not make it in any way totally optional, because the big win with the character device over the legacy sysfs is to always be available. > Linus: about the software-debounce you mentioned: do you think it > somehow plugs the hole we identified here? Hm, I don't quite understand what the hole is I guess... Linus