Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9185112pxu; Mon, 28 Dec 2020 08:42:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPAf6G2zImBxNsA/wQIetRniS+MXACx8BBXZYgpKSjQd/++QR6Z4zEg3S6hZZgb9T9xQbI X-Received: by 2002:a17:906:c2ca:: with SMTP id ch10mr35567079ejb.157.1609173764226; Mon, 28 Dec 2020 08:42:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609173764; cv=none; d=google.com; s=arc-20160816; b=TskjNmUQOMjBIXf+NCp9q374Eg2KfLUpq+5BTShpmmMcXNI25QIttLkmwCu1Ix1/OT yq2KYpAQpBqLORqqUtzbt9MzxIYJ7b5QnxaIs9bhdqatHY62TrgEM5AUWS3HTYtqbT04 VelGFkRf25rVl2mFXPo8PurmCeCARpbeZYj1H5KysuZzJ0gqzLouCyjnHUNKkyV+sdTI WnmrmbG1TxduwlYnIsfCNJLNUfni2p8zAw5uIcRiRqGtIzLdiYBpqUK53A6TUaBGTWP3 pSjTMhZrxrlIwHJNnDRqUis4ZAhP32rIIyAlFaiJeB+NdRzYWUhDuGV6om1KJWC3+23t kVQQ== 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=lKMFFpgetXNYUYVm9q9RlLrPglsJUFkDXNXGrECQQrM=; b=FzRsU0ZHtE8BLkGVRrb2SyFNZHhm5Iv1vpdM+pG0GU5SABK/v/aPdyMK54YlqiRnT2 KHHrNHcD16LLvl9kK7zZfh1ju0jx5fAL8xgw/LR65DcqsFTvnYyYn3ppwFL50tejXBFc ziN94Bg73pioWVW44sUb4s90pMybWxym5YRkVlpmJMo6qLJDOBd8U8EC+yR0n0WShwVo jDrHEb2qZpdW8SCvvnArPm5bHR3bx/obefPWhPiA2lnbUOyceVUab7ygIr0PVsYoB2ER Fl2zp7LFn1Hijv7YmGYOX0kXV9FhGF8ikSQT+JcUQ5+ZSa93JutkWw3mjE7E3l7thKdf WEFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0nSiA2Kc; 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 g10si18677156ejw.16.2020.12.28.08.42.18; Mon, 28 Dec 2020 08:42:44 -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=0nSiA2Kc; 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 S1729320AbgL1M7t (ORCPT + 99 others); Mon, 28 Dec 2020 07:59:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:55612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728898AbgL1M7l (ORCPT ); Mon, 28 Dec 2020 07:59:41 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 958EE22AAA; Mon, 28 Dec 2020 12:59:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160365; bh=FwRUHDdPGtpKSW/WBJ6ArrHLmmHoqdAXZgw0/96+PxY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0nSiA2KcZ2o/QwmISzbJdpIUttQGYgDfIhFynjqmUbo+e8Tmzc6kFtaHIspzxLdZ0 FHgEskAAVfHUDoiEsChRcM2mhLIp8tviZ2z2Wkt6Wm5IN97AB5KM3u+GdHQ1ciQRIP W0844zV8Qw/2HlNueygOWDZivZR9qzsogaOZDm3s= 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.9 009/175] pinctrl: amd: remove debounce filter setting in IRQ type setting Date: Mon, 28 Dec 2020 13:47:42 +0100 Message-Id: <20201228124853.700206948@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@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 @@ -404,7 +404,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; @@ -412,7 +411,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; @@ -420,7 +418,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; @@ -428,8 +425,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; @@ -437,8 +432,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;