Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3218798pxb; Mon, 9 Nov 2020 05:54:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzb9kGxeGi8rmTegRZk3k1K7iFY6WbopQS57u6KRg7uInwH/rImkfrAUq34A/Tq7C4XEZt2 X-Received: by 2002:a50:e183:: with SMTP id k3mr15381952edl.111.1604930048882; Mon, 09 Nov 2020 05:54:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604930048; cv=none; d=google.com; s=arc-20160816; b=Tc5x3iIdKtHCAn/QPS2KWgFX+zBckod+H3qQ5N2Ul+aeGt7NgoMA9+v2okMUjh3nj2 u1c48c97xXeXZMosaDQQ66Yv+HjVNIgzNAK8aZhXQJIH2zJn25YE4nLYvTOw5VttfDT1 oAXySVuSNVlH2ORbs8Am2GMft2Z7pvzPEcq0RhdXONQ+9dYBZy/qjHlPYYEtJdNuNFXY oBtit5grwF9hGvXVZXNbWLP2ewC5XOXF9D6xQccbDu4sWN/vYU3xGmW5L8M076PHfz6f MU7LwMT/J6vzPYhffLL65X9gz2sRsidvE2hQRv8sI4eC6vKfmV6rLa6iKUONmCDA7dka PQmQ== 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=5QdziHwnq2/sfnnSdLOUcvlJNqFq0ug8vC4I8a9Gu94=; b=05WVj4im+qYC4W7NaCGLbmJJAmkDHgMu2V31hyXNzVEzHL1a+g6kofQJgph9PV1J3m iU/S4cs9Sd52rrSxRVoNjOCKTwhPoRrQKXbMnSomVcoVec6kikoQxQpamGSZgNMOY54q g/6UyMqIZhXCnrPjfzDGmXBb2nmmOabBWVYKJD9Yz1ienDKsnLLqXXpsMX86WIkozM/s cvKwGDfHjNyzUJDeO4QqhgmG0YvBgmZ1dbiS2EOWQKIQ1wHLcSZHafq8KtVv/YlAVkV9 kKqOXdbqqP6M5B18nUya+wFcwKVCUAiDola7mBctqxxPSIUCNyF4v92c9QXaKdaD8duy KPlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=blFL8Sjn; 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 bx12si5779396edb.10.2020.11.09.05.53.45; Mon, 09 Nov 2020 05:54:08 -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=blFL8Sjn; 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 S1730548AbgKINw3 (ORCPT + 99 others); Mon, 9 Nov 2020 08:52:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25282 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730294AbgKINw0 (ORCPT ); Mon, 9 Nov 2020 08:52:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604929944; 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=5QdziHwnq2/sfnnSdLOUcvlJNqFq0ug8vC4I8a9Gu94=; b=blFL8SjngwWBNIc3+F43fOeNZqoJ93+em4qb+P2JscldXKM0ONGrVFRS65bfLo1viLUMzk DAmSY6AeAzepa15cmcZDrYdIa+XTudByB8zAcYu0zUVsOTR3pVVDDXtMj7tDtGLr4bP2wj jxn6+Rkxn8xOIGAelSmN6LsPVVpKe4w= 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-285-oXfiRaLDMzy9-68FGXh0OA-1; Mon, 09 Nov 2020 08:52:20 -0500 X-MC-Unique: oXfiRaLDMzy9-68FGXh0OA-1 Received: by mail-ed1-f71.google.com with SMTP id y8so2755584edj.5 for ; Mon, 09 Nov 2020 05:52:19 -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=5QdziHwnq2/sfnnSdLOUcvlJNqFq0ug8vC4I8a9Gu94=; b=REjIjXzsO6dMddqbkcMes5mvIjTHFq3h0ul/9Vh8gph0YpigtPJDbbcQEjAx1NI522 mA/q94KSlNcTjivmWxAVeNZSdP6yc8RNDkh/d889ErgwV3E7zZcVoN39TFYN47KCPP78 Ij1XI8pz5u2mf9FRo5ANL9j5KTi9qG9Xw8GP1kIIZCumfIN44caduDoVpc5dZ1vZmoWw nq0FoFb/QtDxZxq3kS3ezt7dxzIoOI4BlgUM9ErGZeFk3ybvqhwEITDr+Hje+qa1wEG1 H/BdpaJNPKu+npZNenlEj0O1JUU+e7J+gKKRNcV7JnfaEyunxOiKceCsIf1e7OQhndK3 ym4A== X-Gm-Message-State: AOAM530SfrOSq+otGytSRQlb5NRdd+NvsR5FQLCUXdJMPO6XlHTUxuCT SxB/pwnWZeBgCSkkKvy53wAdkXbN15x3hWFOEEemSoBCu+lAF1snU9kYPex9SJwtFhNLrcqnwXF 3yoXBOt2WjPiohOS9nSfIz7ZM X-Received: by 2002:a17:906:3547:: with SMTP id s7mr7195174eja.70.1604929938482; Mon, 09 Nov 2020 05:52:18 -0800 (PST) X-Received: by 2002:a17:906:3547:: with SMTP id s7mr7195162eja.70.1604929938254; Mon, 09 Nov 2020 05:52:18 -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 w3sm8853104edt.84.2020.11.09.05.52.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Nov 2020 05:52:17 -0800 (PST) Subject: Re: [PATCH v3 4/4] pinctrl: amd: remove debounce filter setting in IRQ type setting To: Coiby Xu , Linus Walleij Cc: 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> From: Hans de Goede Message-ID: Date: Mon, 9 Nov 2020 14:52:17 +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: <20201105231912.69527-5-coiby.xu@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. I guess this should be landed together with Andy's series to apply the debounce setting from the ACPI GPIO resources. 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; > >