Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9176629pxu; Mon, 28 Dec 2020 08:29:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwkKKsfgP62i+bKg3hQgWfQMKm41BffsmzFbbPX3vYxyDuIWyoAs8ztdqUzmEeghe640jo/ X-Received: by 2002:a17:906:f9da:: with SMTP id lj26mr41253586ejb.467.1609172953578; Mon, 28 Dec 2020 08:29:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609172953; cv=none; d=google.com; s=arc-20160816; b=CXLoddxzZ8x12W3kTrZjp1lZgght/RNXVRSQ+cdaSbRVSMYkaKG1H+WrwHu4tIrua6 fkgFuspl3ChXkHIVSgiz5WaB8toSWfwxyp/2ekm2GznSCIh/kilz7tjzMALogEHaO77e hGf1A4VmFB13BC4++fsE3Bos/GfwG3Ufeu5nRCDFiqziNSMfMsAJgHxF/ny8irAZSIXz 2wYsYFSu//tfUp60BJg546a0nffqQ3j7FjtltCydw9p4LWXlWGuMQT4kLPWE1TE5/kMf CQTbSRQANtReIsSlU45Rr31YNs80aLHgTXTtKgA/TNL2GCa6dk7Ua8W27oRPfXagNs/5 WNhA== 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=ZmhHk6027yHawP8+PMufgWocFOmNo1B/nGh0qrvGf4Q=; b=PNhSWSaSaEohDTXD4qweEZLUeQB0QBG4+WS/ZVwj8qNc8Jez8taz0vz8hUJ1SLqbiU ANM4WMxDzRxcB/7pMKbv6+b1qvb82Ov0RY96yf/OCvMqpXFoLEzAVJ2C++t9PaDWngL6 qdLLD9C0HkGPDpPuFU9PzdZQwy5zSVVu3q6pUZvw4YqbxCx3YRXcvUJVA5QJMsZXp4Bp GdQAcwwikd47Y/4kRFPanTna0RXzR6bwNamfReUPBWO758KULr+wXwO08L48Da9K2nFQ KSZOWC2hFf/w1U/y8wEYbuekGSN5DrN/JHLhJsAgOx5t7/mhvJvsQQmy8FElrxnIiIm3 5gnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NcWh9ZvB; 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 gz21si19217855ejb.604.2020.12.28.08.28.50; Mon, 28 Dec 2020 08:29:13 -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=NcWh9ZvB; 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 S2633359AbgL1QZc (ORCPT + 99 others); Mon, 28 Dec 2020 11:25:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:37302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731138AbgL1NJa (ORCPT ); Mon, 28 Dec 2020 08:09:30 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B3AD320776; Mon, 28 Dec 2020 13:08:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160929; bh=MK5htw5oQY5CJZH4kSaSeRhFTTdyJbcuuSJCELMzFDY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NcWh9ZvB04udNJtRnegBl19X6lyX4tMKda0wzDGqRt4HAVEHC3PWFLK8usu26ovJs rZ0wc0iedak0Q1EFeYTsNaYt4hhigvHMwS2tk9eVLOUcAMiMlr3nDqdV6JHxaF/bMC GCnQzE0NDbwqdw3sgm2CnROQ/IrgoHSKyodmmDBE= 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.14 012/242] pinctrl: amd: remove debounce filter setting in IRQ type setting Date: Mon, 28 Dec 2020 13:46:57 +0100 Message-Id: <20201228124905.265447890@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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 @@ -426,7 +426,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; @@ -434,7 +433,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; @@ -442,7 +440,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; @@ -450,8 +447,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; @@ -459,8 +454,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;