Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9191521pxu; Mon, 28 Dec 2020 08:53:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJy83EoRpINHRQbAwP8+fcJ7xF45vlgNDuIPYGZyYvTAUbg8X8j3BM482sxDxBaR90fAcw3w X-Received: by 2002:a17:906:5f97:: with SMTP id a23mr43597148eju.128.1609174406099; Mon, 28 Dec 2020 08:53:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609174406; cv=none; d=google.com; s=arc-20160816; b=gJbJrd20JXuje/7J/92d4/7JPlFV9Y/5byfDGzSH5sUkuMtPQHXbYZPHj3M+o0AD86 2kNmjR9vbjLiNu8lLauyaDBMRpjdIx5DY1ToVfnn6EKoDDzWYH9K6KYLvJAznGd1Gqcf ykLzHtspw2AKzCejLIM+gG6cL/UueTDANKOQj4NuQaY0jl1yII7DzSy+DiwQ2/ZkuONy RAAEIvrGM9BHXpQpRjwiVoC68YYDHG5FyJuj0jtAMfWpeM3DV37b8tudWLwSqHUlo6RY H7v9/zgZByD0wv/d+a8eUwn5dkaWY2nAbPLUS8/TtYKqJ0LQWdFhfsMEuECZXqudJOLi 3B+Q== 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=39t5CZeAtPznuLksWqIvprXCggwx3U4Vzrri+4Mp0iQ=; b=sh7Pb0qEoIqygKQSfXqScud2SSkzwNRZrL0r/WdLgld9AYjjQEslynP53Uce+ikfXA 3NjVIACaaWhZ/Mv09iuEUh6BZtfDSCQAiLvkUYuAbHJDEYaMwpJoOBuPyA5xecwg8/7F +6PX/DzPgrHFzQDeXl+DfhGN4ZMVS16GutH45xwgcuOqn1tN1bHzXpGCxPYuWlcVWgwh Epu/ilo8vQXUsW3Csrb8KsYEim/WyCizja+vaky0QHpcq5m15Pazyk8S4i7G0pkqCmgv G43MvAz2ZNBrACIX7iq9fNK71R2B/QwcFj4XY9WmuqhZBMJoRg0SlA5nMo4sHlHmPdxH oKfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=D5QlC+QL; 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 z1si5859043edp.150.2020.12.28.08.53.02; Mon, 28 Dec 2020 08:53:26 -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=D5QlC+QL; 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 S2633821AbgL1Qsq (ORCPT + 99 others); Mon, 28 Dec 2020 11:48:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:50408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728153AbgL1Mx2 (ORCPT ); Mon, 28 Dec 2020 07:53:28 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 23DF6208BA; Mon, 28 Dec 2020 12:52:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609159935; bh=D50ocQ46Y0usibPJqOjqYiZXPOXd36kJIs18QMt4zFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D5QlC+QL0h5yS7EzjvNHJRZIjjuwdRqbgbtgmifBVCQ0SJpMZrfYvQMlLFJHS9PhN ileoyYFh4Bv+FVETjdhChMmTgbSyFabH57ovg0baWY0hCeju2Eev+LymJRdn4YNbnL zyX7lp5luFNvWI3Gi0njHaOMNWrfaH7MFEhbhsrE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Coiby Xu , Andy Shevchenko , Hans de Goede , Benjamin Tissoires , Linus Walleij Subject: [PATCH 4.4 007/132] pinctrl: amd: remove debounce filter setting in IRQ type setting Date: Mon, 28 Dec 2020 13:48:11 +0100 Message-Id: <20201228124846.772979076@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124846.409999325@linuxfoundation.org> References: <20201228124846.409999325@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: Coiby Xu commit 47a0001436352c9853d72bf2071e85b316d688a2 upstream. Debounce filter setting should be independent from IRQ type setting because according to the ACPI specs, there are separate arguments for specifying debounce timeout and IRQ type in GpioIo() and GpioInt(). Together with commit 06abe8291bc31839950f7d0362d9979edc88a666 ("pinctrl: amd: fix incorrect way to disable debounce filter") and Andy's patch "gpiolib: acpi: Take into account debounce settings" [1], this will fix broken touchpads for laptops whose BIOS set the debounce timeout to a relatively large value. For example, the BIOS of Lenovo AMD gaming laptops including Legion-5 15ARH05 (R7000), Legion-5P (R7000P) and IdeaPad Gaming 3 15ARH05, set the debounce timeout to 124.8ms. This led to the kernel receiving only ~7 HID reports per second from the Synaptics touchpad (MSFT0001:00 06CB:7F28). Existing touchpads like [2][3] are not troubled by this bug because the debounce timeout has been set to 0 by the BIOS before enabling the debounce filter in setting IRQ type. [1] https://lore.kernel.org/linux-gpio/20201111222008.39993-11-andriy.shevchenko@linux.intel.com/ 8dcb7a15a585 ("gpiolib: acpi: Take into account debounce settings") [2] https://github.com/Syniurge/i2c-amd-mp2/issues/11#issuecomment-721331582 [3] https://forum.manjaro.org/t/random-short-touchpad-freezes/30832/28 Signed-off-by: Coiby Xu Reviewed-by: Andy Shevchenko Cc: Hans de Goede Cc: Andy Shevchenko Cc: Benjamin Tissoires Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-gpio/CAHp75VcwiGREBUJ0A06EEw-SyabqYsp%2Bdqs2DpSrhaY-2GVdAA%40mail.gmail.com/ BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1887190 Link: https://lore.kernel.org/r/20201125130320.311059-1-coiby.xu@gmail.com Signed-off-by: Linus Walleij Signed-off-by: Greg Kroah-Hartman --- drivers/pinctrl/pinctrl-amd.c | 7 ------- 1 file changed, 7 deletions(-) --- a/drivers/pinctrl/pinctrl-amd.c +++ b/drivers/pinctrl/pinctrl-amd.c @@ -399,7 +399,6 @@ static int amd_gpio_irq_set_type(struct pin_reg &= ~BIT(LEVEL_TRIG_OFF); pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF); pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF; - pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF; irq_set_handler_locked(d, handle_edge_irq); break; @@ -407,7 +406,6 @@ static int amd_gpio_irq_set_type(struct pin_reg &= ~BIT(LEVEL_TRIG_OFF); pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF); pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF; - pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF; irq_set_handler_locked(d, handle_edge_irq); break; @@ -415,7 +413,6 @@ static int amd_gpio_irq_set_type(struct pin_reg &= ~BIT(LEVEL_TRIG_OFF); pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF); pin_reg |= BOTH_EADGE << ACTIVE_LEVEL_OFF; - pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF; irq_set_handler_locked(d, handle_edge_irq); break; @@ -423,8 +420,6 @@ static int amd_gpio_irq_set_type(struct pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF; pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF); pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF; - pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF); - pin_reg |= DB_TYPE_PRESERVE_LOW_GLITCH << DB_CNTRL_OFF; irq_set_handler_locked(d, handle_level_irq); break; @@ -432,8 +427,6 @@ static int amd_gpio_irq_set_type(struct pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF; pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF); pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF; - pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF); - pin_reg |= DB_TYPE_PRESERVE_HIGH_GLITCH << DB_CNTRL_OFF; irq_set_handler_locked(d, handle_level_irq); break;