Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp589300pxb; Wed, 27 Jan 2021 16:01:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyydZfOtHFAVomVP4KsTZSLTsFftq2FuRQq6LZeOA4+9cfzcsGJWff0mSMb+Z5c6eK0HYl7 X-Received: by 2002:a17:906:c049:: with SMTP id bm9mr8294271ejb.535.1611792113840; Wed, 27 Jan 2021 16:01:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611792113; cv=none; d=google.com; s=arc-20160816; b=xysCGm9FYRkXgHsjOOzIXssdYftlntnUwAEsBScRe7llZe86qhqvHEFIH6ccZbYnbX K+YufGMdWb6IeKrd4di+X08nhdvGJvrRZE2IOj36FruFTmHr3t+UTGsELRLDyLxF+PBx YZ8z/A4SC/COOodk51V5testWgADeKq4q/NvVA5uzTSFn5MRAhlVdlHZlJgJtVph/5aj flcivJemBgQnQVOSA+W0pcS/HXWwTJZqyD5R341oetupwAbj1KV7p3EnzhGDByAvt6Fi O8g/J3ds7Fto+4qPSp+TFw2WVyD45E1Oxl3vff2GeZzKGq+dJ2oNHKGFSXUOV/0rvPCX FvXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cTb1qG9GkgwXMpUhNx1t/diaUHaqrqbu1GRsagpeLwM=; b=UnqVY/wNK7O0/qqb2q7TnYZydJOv4iB22kUNNStk0ymMTYDUhmxN2CM1glEyPqDrUp JPfX4SvLF48wT+v5ioct4LWe9Ew6dT27RfQeT8GT5tBLi0zCbjlBU40SMPNIpeKxxpoe GMAs1ereLPWVlp6e8LP/GiDbFJgosPE5DmETVbbr+SXY7ARqXdOtrNu3QDO8Mhh5Dj+X uSZkXiNLiF5LSCOiFfX6PTxz/Ke+UDVTBPqhqvJAI1wVOWN2x/NVmFjisvv7KWFNbcwA 63FV+R/mB8+yIx2PLZYCtxLoL2HBwZf4jzuw/m9HVS7lcYhB/EzirkfuqwD+nZPzxUzq XbQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=ILnM+OVz; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si1840983edv.236.2021.01.27.16.01.29; Wed, 27 Jan 2021 16:01:53 -0800 (PST) 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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=ILnM+OVz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235748AbhA0PGQ (ORCPT + 99 others); Wed, 27 Jan 2021 10:06:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235332AbhA0PAu (ORCPT ); Wed, 27 Jan 2021 10:00:50 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA99FC0613D6 for ; Wed, 27 Jan 2021 06:51:48 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id bx12so2763295edb.8 for ; Wed, 27 Jan 2021 06:51:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cTb1qG9GkgwXMpUhNx1t/diaUHaqrqbu1GRsagpeLwM=; b=ILnM+OVztpAnYmVrO1FVr4Vx9kHcIQGC83QQvcgFKlG6GqybeWuPWtzo+hjn1g1+eY otRFOGVi5Xw/X21KkCGw7iVOnhZoDIlEvHU42/SsY+VJE20CEZNz9hM3uDT2VeOYTbfl f1nFs8LzId+9cfBGFgcSMNyN7j9p8L/e0JGeOpuJMFGO2GsJ/XcWkMQoP+oi5b8eSZSP exgSYYivVrn3jKxSmec7IINWa/r4+iQgGlDzkUq6Qo5kBsJarkVgsDIelg84AYqvGCof XTuIe4trKwoe0EfFdpZ9OaBNuagie1GmEaQrVQc/zE1FOctgq9cmVSg8cgds556LlKrE rs9Q== 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=cTb1qG9GkgwXMpUhNx1t/diaUHaqrqbu1GRsagpeLwM=; b=afr2ejdPOlYV+ViyOIG4GjlJVyNhDpSfjACikumpKbTAKjrLjkGs9DUzc7C8fPHc0z 0MyVr/w6bkrM5NGjgNA760LiccDc9Kgo/G60eJInk0coYoXpEZReHHtr1bw6YkY9MQj3 jsfX1poyZAFwv5QA3XQIp8kEZ2bvtoUKmVfV3ujJFpRnCGX0GgkcaF7zx5dtZNlrQG56 W9riET0Ey/hJMOLsDjajbi+vBrVzy58pEqTtSEX6TxuweG88U+RJjEitStqE37hOYtiA R4UolTuZ/i/sk1mAv7csWyOL/4/YhuZROoAgYignOgtZvCRrjo2cFlJGofLJaT2Iyn6L S+fw== X-Gm-Message-State: AOAM532cLJFC8o4YheoHYKSrC1ZjOwGV1YxXnj9aGY3QULRAC2OG+P3O EdM62v7pDGtOhOuAleYT12DCTGEWFN4XMXbb6obt4A== X-Received: by 2002:aa7:d60f:: with SMTP id c15mr9179966edr.232.1611759107579; Wed, 27 Jan 2021 06:51:47 -0800 (PST) MIME-Version: 1.0 References: <20210121141038.437564-1-warthog618@gmail.com> In-Reply-To: <20210121141038.437564-1-warthog618@gmail.com> From: Bartosz Golaszewski Date: Wed, 27 Jan 2021 15:51:36 +0100 Message-ID: Subject: Re: [PATCH] gpiolib: cdev: clear debounce period if line set to output To: Kent Gibson Cc: LKML , linux-gpio , Linus Walleij Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 21, 2021 at 3:11 PM Kent Gibson wrote: > > When set_config changes a line from input to output debounce is > implicitly disabled, as debounce makes no sense for outputs, but the > debounce period is not being cleared and is still reported in the > line info. > > So clear the debounce period when the debouncer is stopped in > edge_detector_stop(). > > Fixed: 65cff7047640 ("gpiolib: cdev: support setting debounce") The actual hash for this commit is 65cff7046406 - I fixed that locally. Patch applied for fixes, thanks! Bartosz > Signed-off-by: Kent Gibson > --- > drivers/gpio/gpiolib-cdev.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c > index 12b679ca552c..3551aaf5a361 100644 > --- a/drivers/gpio/gpiolib-cdev.c > +++ b/drivers/gpio/gpiolib-cdev.c > @@ -776,6 +776,8 @@ static void edge_detector_stop(struct line *line) > cancel_delayed_work_sync(&line->work); > WRITE_ONCE(line->sw_debounced, 0); > WRITE_ONCE(line->eflags, 0); > + if (line->desc) > + WRITE_ONCE(line->desc->debounce_period_us, 0); > /* do not change line->level - see comment in debounced_value() */ > } > > -- > 2.30.0 >