Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp193020ybd; Tue, 25 Jun 2019 19:34:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3KU5Qkq9DJ/tj2yHa/RGZgTIHTGtobyIQVHCCJ9r5dT0MXvIViNZzlF07rt8wvdzN/zWh X-Received: by 2002:a63:85c6:: with SMTP id u189mr236646pgd.451.1561516488611; Tue, 25 Jun 2019 19:34:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561516488; cv=none; d=google.com; s=arc-20160816; b=EUqCxst4tYz6PyxG7pp2h9WxVZ7ChK2zXUehoWEdwEzCpJndBf9TLa92JarlOwYN9k v+VCuu18Tz//x34cFS9nfvaI7zAdVDLG9KRayvo+BcrCQ6YOP9NztYUZcCyho17DunVD ARzNxaYvdXqclkkdQVSUFgrDVOE2CX7Bsg0DVA5rGOlflrQWewio2M69zryPFDfwIC7w YlZxUvrP/IZIvg+w+8rw3M12TZUGtx/ibd4UKCnuhR2ntrFpU2TjtDPoFx4VTZe4RJRE ijyfwKrCYA7BH9M9g97uHMtsauTiZq8k/UjR0q3xTgBDwJzr7vaJ2c2ImreoVwKmHV9u OTFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=ePZztCyQe2js0sX+BuhWJQpekxMgoRb5cm3Tv+wx2UU=; b=ci+52MWFe2KBnujCHDaGZ+C/TCQYNyZ6oZd0el1P/n33++XT3Yfs09drWjnJChabGr +VdPtFTDXnRqpuOitvss+TJF/vF9IaYVNHhdNwyyqPHa6K9syWl+7bXS9Jh2BqVGsKyr WRwaKGYFtuUEFJi9rVGchmBhlgOkdYdl4h3bX07Av0vO0o0vLMA+eOk4hxdyIKF3MOF4 9B6MMB2VvO8+wnvB02z9/vVf78IXMYqkkoogJRZxGPO1RaAgW6/eVbZIjz3MigP/HwsE rfNpXKTaKHj9+xgBIeFbJGzDwfkXolG9G9eZ77UFBpqRWASyWmKonhR2hJY8zTL0kMzU EaNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9si13873724pgs.312.2019.06.25.19.34.32; Tue, 25 Jun 2019 19:34:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726554AbfFZCdN convert rfc822-to-8bit (ORCPT + 99 others); Tue, 25 Jun 2019 22:33:13 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:60725 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726537AbfFZCdM (ORCPT ); Tue, 25 Jun 2019 22:33:12 -0400 Received: from mail-wr1-f70.google.com ([209.85.221.70]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hfxkE-0005K5-HK for linux-kernel@vger.kernel.org; Wed, 26 Jun 2019 02:33:10 +0000 Received: by mail-wr1-f70.google.com with SMTP id q2so313184wrr.18 for ; Tue, 25 Jun 2019 19:33:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=2/ZHlWC5YNQjm9JD+S58TuCvob2sXAmvXNIrsp942FI=; b=nG137xtXjIimb0EBhtX6YKdM5vPMgdCu6V/uM1odjZHbLJHuTjWpTl9YtwKOp76p7s XnYqhvwpx+53nasISHjdJNO/RYH+ftuwozaR3N2D26D5oY/g/aU3KRdxoDPzuLH9naX6 5ZHanCs0OZZfJa1PUnNRzF+Z20PWQCGjQkwpp0yEoKvPwQ5CwWLxopD2l5PTUWNISDYQ fjNItycHex3DDwp0DCJ70hyKs2Jlt7Wee75Xt98lhBDPKU0dEm9V9KEHM0hzUYddmK6a enr/pCdf2matAKL6Lzi8MHERuNQzrPaBc8x8QR/FrZnLvZ0RwYxEexhk0LkmWcHDvtIu 5tYw== X-Gm-Message-State: APjAAAX9qrCrr69x74fVffSa+qEccvmTcSk2VpKtzuW3JQ0dGw1yOUWZ JcHwPsXJ3GKuSqI8n1DnGp+XpX7h3YutoVXMQvIvjvJ/iqwrlvk77xAP88D1QiTs7O+wtjiD0bv Ez0Qkthda8rwK/fQiSJufPkmaaJhuHEc4WKlMe6EabyaF4AX8JMpFGs+WlQ== X-Received: by 2002:a1c:9d86:: with SMTP id g128mr621727wme.51.1561516390048; Tue, 25 Jun 2019 19:33:10 -0700 (PDT) X-Received: by 2002:a1c:9d86:: with SMTP id g128mr621691wme.51.1561516389693; Tue, 25 Jun 2019 19:33:09 -0700 (PDT) MIME-Version: 1.0 References: <20190625083051.30332-1-acelan.kao@canonical.com> In-Reply-To: From: AceLan Kao Date: Wed, 26 Jun 2019 10:32:57 +0800 Message-ID: Subject: Re: [PATCH] i2c: designware: Add disable runtime pm quirk To: Jarkko Nikula Cc: Andy Shevchenko , Mika Westerberg , linux-i2c@vger.kernel.org, "Linux-Kernel@Vger. Kernel. Org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding I2C_HID_QUIRK_NO_RUNTIME_PM quirk doesn't help on this issue. Actually, Goodix touchpad already has that PM quirk in the list for other issue. { I2C_VENDOR_ID_GOODIX, I2C_DEVICE_ID_GOODIX_01F0, I2C_HID_QUIRK_NO_RUNTIME_PM }, I also modify the code as you suggested, but no luck. It's not Goodix takes time to wakeup, it's designware I2C controller. Designware doesn't do anything wrong here, it's Goodix set the interrupt timeout that leads to the issue, so we have to prevent designware from runtime suspended. Jarkko Nikula 於 2019年6月25日 週二 下午9:38寫道: > > On 6/25/19 11:30 AM, AceLan Kao wrote: > > Dell machines come with goodix touchpad IC suffer from the double click > > issue if the Designware I2C adapter enters runtime suspend. > > > > It's because the goodix re-assert the interrupt if host doesn't read the > > data within 100ms and designware takes a longer time to wake up from > > runtime suspend. In the case, it got a second interrupt during > > resuming, so it thinks it's a double click. > > > > There is no simple way to fix this, it's a firmware issue and goodix > > agrees to fix this in their firmware on next release, but this issue > > still affects the machines that don't come with an updated firmware. So, > > add a quirk to mark those machines and avoid the designware from > > entering runtime suspend. > > > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=202683 > > > > Signed-off-by: AceLan Kao > > --- > > drivers/i2c/busses/i2c-designware-master.c | 30 ++++++++++++++++++++-- > > 1 file changed, 28 insertions(+), 2 deletions(-) > > > I think better place to have this fixed is in > drivers/hid/i2c-hid/i2c-hid-core.c by forcing the adapter device active > when communicating with such touchpad. > > In that way only bus where touchpad is connected stays active, not all > and makes sure issue is handled also if that touchpad is ever connected > to any other I2C adapter than Designware. > > I did something similar in the commit 72bfcee11cf8 ("i2c: Prevent > runtime suspend of adapter when Host Notify is required"). Not exactly > same issue but similar idea. > > By looking at i2c-hid-core.c I saw a few i2c-hid devices have > I2C_HID_QUIRK_NO_RUNTIME_PM. Could you test how does this Goodix behave > if only i2c-hid device runtime PM is prevented not I2C adapter? > > A very quick test would be to comment out those lines below: > > diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c > b/drivers/hid/i2c-hid/i2c-hid-core.c > index 90164fed08d3..bd3e6570c45e 100644 > --- a/drivers/hid/i2c-hid/i2c-hid-core.c > +++ b/drivers/hid/i2c-hid/i2c-hid-core.c > @@ -1156,8 +1156,8 @@ static int i2c_hid_probe(struct i2c_client *client, > goto err_mem_free; > } > > - if (!(ihid->quirks & I2C_HID_QUIRK_NO_RUNTIME_PM)) > - pm_runtime_put(&client->dev); > +// if (!(ihid->quirks & I2C_HID_QUIRK_NO_RUNTIME_PM)) > +// pm_runtime_put(&client->dev); > > return 0; > > @@ -1183,8 +1183,8 @@ static int i2c_hid_remove(struct i2c_client *client) > struct i2c_hid *ihid = i2c_get_clientdata(client); > struct hid_device *hid; > > - if (!(ihid->quirks & I2C_HID_QUIRK_NO_RUNTIME_PM)) > - pm_runtime_get_sync(&client->dev); > +// if (!(ihid->quirks & I2C_HID_QUIRK_NO_RUNTIME_PM)) > +// pm_runtime_get_sync(&client->dev); > pm_runtime_disable(&client->dev); > pm_runtime_set_suspended(&client->dev); > pm_runtime_put_noidle(&client->dev); > > -- > Jarkko