Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2270962pxb; Thu, 11 Feb 2021 08:21:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxByJKqv6mGBIO7t6u0nzpIX1TO5l7O7hCG1CRMAmDTmQ+wV9fncgzZdu370qCilqGde64I X-Received: by 2002:aa7:c64a:: with SMTP id z10mr8975194edr.61.1613060480695; Thu, 11 Feb 2021 08:21:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613060480; cv=none; d=google.com; s=arc-20160816; b=cxjTb+W9qk2VUvTk0YDS7MU7hSN1KCcRDPf9KJn05p/R4kg3oYDAYoTFLu2aK3mkzm hDguUgmrGnmw/lIigMc/Gh5csH2HggRbXLfXK5pg8Ph41lgKwhl27QDgvM6N4FUTkf37 yikMLkr6TC78K+KcYMZMSL+jJzK/ulNDY7rdOjnfyIL/OEptu9dzKr2DdjCG0uBAaYIa UgsrVDNo/5IznEvKSGLVmPOudlMk30Cmtb7QHbeWH/ndNOT+9DVWhCfRdeb7eA5QNaPr gnRLaFZ3GWWlOgK/FMEJ1STAE7mLcEXSjGdG9T6e7zbJZLSmjZbor//Ro2pSG6IKQ35O cguA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RLti61Wqqxkqxl6RLWmzSO7xDS0utPbeOpspINa5XyQ=; b=ffj/BjJE1V7ytqUbSijxZxbyhRL5J+mfbxrs3+wIaFbeOCDvP4fzw63qUMjzSFBAam SBBQaeFm141q5UdB7V+GBLBgRXg+udeQ/M8pER0rijRwjh6dvqRLxr98xRk+79TxZWkd +0yMt979FFkJb4ugENpmu4mk6DS00hM/fcTN0tgGBOkAUpNDEFoJTPMNl/Xx1ImABz7J uNuLk+LAtYrUDMVB9/KvQA5g6XkLw37vd922AwHXUWXDqKIVy+KXuu9GLExWyoXgwGLf +u0UuOhhmQpINew/KScGKK2Ydn3DBz6YcoL0RC0aX+tGTwmAUAIlSgJPXJlhm5HfU8AA adcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=s08laOSv; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d4si3997912edu.106.2021.02.11.08.20.54; Thu, 11 Feb 2021 08:21:20 -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=@linuxfoundation.org header.s=korg header.b=s08laOSv; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229813AbhBKQT5 (ORCPT + 99 others); Thu, 11 Feb 2021 11:19:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:53660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230035AbhBKPX1 (ORCPT ); Thu, 11 Feb 2021 10:23:27 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4950A64EB9; Thu, 11 Feb 2021 15:03:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613055812; bh=5bBAisnUx/EivRlInogrC4oMUh7HMDN3q0XuLUb/r04=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s08laOSvDJQbzU6YqTegsipZtrwHl3jTBBAmk0fjeC4Ef1T+qdtIAFvawaSSa4tAj fYoLk8smYWbanrnz81bF2KygzLo6PWq2/+ao2gr82f3tf62Flje9h7mIESYmzD9Bbx GtAWmZ2q+463J6KBN5G/lvA/YHSdvC5QpMZKiYHA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kent Gibson , Linus Walleij , Bartosz Golaszewski Subject: [PATCH 5.10 17/54] gpiolib: cdev: clear debounce period if line set to output Date: Thu, 11 Feb 2021 16:02:01 +0100 Message-Id: <20210211150153.626682364@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210211150152.885701259@linuxfoundation.org> References: <20210211150152.885701259@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kent Gibson commit 03a58ea5905fdbd93ff9e52e670d802600ba38cd upstream. 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(). Fixes: 65cff7046406 ("gpiolib: cdev: support setting debounce") Cc: stable@vger.kernel.org Signed-off-by: Kent Gibson Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman --- drivers/gpio/gpiolib-cdev.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/gpio/gpiolib-cdev.c +++ b/drivers/gpio/gpiolib-cdev.c @@ -756,6 +756,8 @@ static void edge_detector_stop(struct li cancel_delayed_work_sync(&line->work); WRITE_ONCE(line->sw_debounced, 0); line->eflags = 0; + if (line->desc) + WRITE_ONCE(line->desc->debounce_period_us, 0); /* do not change line->level - see comment in debounced_value() */ }