Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3828403pxb; Tue, 10 Nov 2020 00:37:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNZjKIR7KUzyLJICa3/crtbeyZWqgLlU+9WO2L6hqq/cNrm5jtpjJdbVVUWIcR/ejo3GPJ X-Received: by 2002:a17:906:170f:: with SMTP id c15mr19510855eje.347.1604997460349; Tue, 10 Nov 2020 00:37:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604997460; cv=none; d=google.com; s=arc-20160816; b=N5r7SPDwotUPI5MkVRnByyYFM/hjnAwveptBjgESBOgEYKQfUsMjgChRb20xHhLLrl AfOJ8OefCWsIO12h2k/HawGvANjbaz2K/y8F2vjPh9vIYinnPq8/uRziu4fvj/hDhDO9 hB7QZ0ZEKctbL0Qz1P38dAwIYVqERpci8VuVkKIaiTV0gvsEE01UdyiRv2WkbMSbx1sf 49+tZWEBbMftcSZ0zDXEJsKEEQJBnII+EYc7XjnUDdzPs1TFEnZxVTWyHBazatbnibtk 4HFR+IlVHxrM0Sh0xQ4Ah3SUjH6qg45ofaAj5eKl42mlT49vOiFdUunRB4ogccsN32o0 p8/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:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=rkN7D/hgSNweMvBM06mGIOugGufcW/6sK1YGZnNu8jY=; b=HqcAAaVKvWTEk7WMW9KGBlfIByWGzvypc1aO/qgYzpB+kc0e0O+bWn1x+UX3pgbaRj mpyMwkZTYNIVJMSrJqDJ5xPzCTGv0DDx+sMbM80rZ/sJnt8Knv6vHxmYGLDGrc/9rBJO EAuD0fGa4rk/uc8joOiPSlK8ZyEB/MkMQ+JJI6zshAkO52hDG0b2gVurXbFhKi1cfRln Aer6Ny/NHIvdAlF+sktc83rJjlwkrFZRpr2+pH2Y7orJa5eHnxy6rYmQHe2r3+LgG595 kVdKiz5mHXGP26JeV6ttiZOuTur1qDI1YGW8Q2lm4pEU0GcIOcaM1JYgz6f91i+y7s0e SeAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NPs80fVm; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si2587565ejb.186.2020.11.10.00.37.15; Tue, 10 Nov 2020 00:37:40 -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=@redhat.com header.s=mimecast20190719 header.b=NPs80fVm; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727013AbgKJIfv (ORCPT + 99 others); Tue, 10 Nov 2020 03:35:51 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39762 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726690AbgKJIfv (ORCPT ); Tue, 10 Nov 2020 03:35:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604997349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rkN7D/hgSNweMvBM06mGIOugGufcW/6sK1YGZnNu8jY=; b=NPs80fVmn5FUwnnC+88zBLfk/LEII57xsqx+Zqj2Aex95ZLtwuqjc1SmAwHtutwlxjbmv4 sx/xaqSrn6SeZLEWhrxrO16Vf6Bws9YUrvEfMpjmhofYTAbt9o4Dk7+zJ+42AntGa1WhO5 oPm/+mygmFkxxm3l+9su9tKK4qEtKkY= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-259-Vm3mYJ5lNyClBNyycdIfig-1; Tue, 10 Nov 2020 03:35:44 -0500 X-MC-Unique: Vm3mYJ5lNyClBNyycdIfig-1 Received: by mail-ed1-f71.google.com with SMTP id bs10so3878829edb.22 for ; Tue, 10 Nov 2020 00:35:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rkN7D/hgSNweMvBM06mGIOugGufcW/6sK1YGZnNu8jY=; b=eBTEiud0x5d+/so+IMzCpFfMKWadADeb1ckvWEpk526IZHSUFo64rVhYDgzJODLGTu mfzjxkvK1LJWbPUx9GBQvy/iTaJD8LewmK5WLiBSdrWhqvL72Gyqxps9hcRKzNAnorRJ PHKrgpDtZNVDG88pOvV2gbL12oGdV0YPy60+Q7YuV2rFmJG53gDd0C5c4NB0Bh+nrfvl pYIF/m3qVMxM5cR8i35ptnEWY6E3Msq57EndShps0OYq/FSVtx7/ZUClSDiECa9DY9v4 JMa8BXhM94+6dkDuYmCDy+UN3B/ARTpY0C9VXgPw0D3CaDUaa+JpWOh7jWR/eNp+glQj V3eQ== X-Gm-Message-State: AOAM531/3Jq32zf0oygjsKfm6EGKE9YL5CVaUvOdvz7Nsz3V3tBVwRVf pNg3fx1FaLHYfrIn93jTZ/F+q8DaEmtok1+3VtDfQSPpucOFWSf956vKtiz10Lt/+SVwI2BmUkq +PWtH9nKX+/EsD5eDtLcmTN6kcIdcoZn2skFDSr0D8S1Z9Ofd8s3Gmd6v8Zpp1+kS6hL60ksAz9 sQ X-Received: by 2002:a17:906:1c84:: with SMTP id g4mr20093415ejh.155.1604997342749; Tue, 10 Nov 2020 00:35:42 -0800 (PST) X-Received: by 2002:a17:906:1c84:: with SMTP id g4mr20093393ejh.155.1604997342489; Tue, 10 Nov 2020 00:35:42 -0800 (PST) Received: from x1.localdomain (2001-1c00-0c0c-fe00-6c10-fbf3-14c4-884c.cable.dynamic.v6.ziggo.nl. [2001:1c00:c0c:fe00:6c10:fbf3:14c4:884c]) by smtp.gmail.com with ESMTPSA id j5sm5280780eja.47.2020.11.10.00.35.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Nov 2020 00:35:41 -0800 (PST) Subject: Re: [PATCH v3 4/4] pinctrl: amd: remove debounce filter setting in IRQ type setting To: Coiby Xu Cc: Linus Walleij , Andy Shevchenko , linux-gpio@vger.kernel.org, Benjamin Tissoires , stable@vger.kernel.org, open list References: <20201105231912.69527-1-coiby.xu@gmail.com> <20201105231912.69527-5-coiby.xu@gmail.com> <20201110082633.2rtmegilva2hgst4@Rk> From: Hans de Goede Message-ID: <0aed4370-ed79-7f23-56c2-27b9df4af46e@redhat.com> Date: Tue, 10 Nov 2020 09:35:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: <20201110082633.2rtmegilva2hgst4@Rk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 11/10/20 9:26 AM, Coiby Xu wrote: > On Mon, Nov 09, 2020 at 02:52:17PM +0100, Hans de Goede wrote: >> Hi, >> >> On 11/6/20 12:19 AM, Coiby Xu wrote: >>> 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(). >>> >>> This will fix broken touchpads for laptops whose BIOS set the debounce >>> timeout to a relatively large value. For example, the BIOS of Lenovo >>> Legion-5 AMD gaming laptops including 15ARH05 (R7000) and R7000P 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 [1][2] 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://github.com/Syniurge/i2c-amd-mp2/issues/11#issuecomment-721331582 >>> [2] https://forum.manjaro.org/t/random-short-touchpad-freezes/30832/28 >>> >>> Cc: Hans de Goede >>> Cc: Andy Shevchenko >>> Cc: Benjamin Tissoires >>> Cc: stable@vger.kernel.org >>> Reviewed-by: Andy Shevchenko >>> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1887190 >>> Link: https://lore.kernel.org/linux-gpio/CAHp75VcwiGREBUJ0A06EEw-SyabqYsp%2Bdqs2DpSrhaY-2GVdAA%40mail.gmail.com/ >>> Signed-off-by: Coiby Xu >> >> I'm not entirely sure about this patch. This is consistent with how we >> already stopped touching the debounce timeout setting during init, so >> that speaks in favor of this change. >> >> Still I'm worried a bit that this might have undesirable side effects. >> > Now I can only confirm this patch won't affect the mentioned touchpads. > I'll see if other distributions like Manjaro are willing to test it > through the unstable channel. > >> I guess this should be landed together with Andy's series to apply >> the debounce setting from the ACPI GPIO resources. > > Thank you for the reminding! You are right, Andy's patch > "gpiolib: acpi: Take into account debounce settings" is needed to > fix this kind of touchpad issues. Since that patch hasn't been > merged, is there a way to refer to it in the commit message? You can always refer to it by subject, as you did above. Regards, Hans >>> --- >>>  drivers/pinctrl/pinctrl-amd.c | 7 ------- >>>  1 file changed, 7 deletions(-) >>> >>> diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c >>> index e9b761c2b77a..2d4acf21117c 100644 >>> --- a/drivers/pinctrl/pinctrl-amd.c >>> +++ b/drivers/pinctrl/pinctrl-amd.c >>> @@ -468,7 +468,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type) >>>          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; >>> >>> @@ -476,7 +475,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type) >>>          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; >>> >>> @@ -484,7 +482,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type) >>>          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; >>> >>> @@ -492,8 +489,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type) >>>          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; >>> >>> @@ -501,8 +496,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type) >>>          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; >>> >>> >> > > -- > Best regards, > Coiby >