Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp385372ybd; Tue, 25 Jun 2019 23:29:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWMSrICX0HieZZcRKuCXKcQb9P4j6mBBJgswWpkeDL9aPbWcuUf350GsQy1e8dY4u6DXAe X-Received: by 2002:a17:902:59c8:: with SMTP id d8mr3512295plj.55.1561530559282; Tue, 25 Jun 2019 23:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561530559; cv=none; d=google.com; s=arc-20160816; b=X15tTeGFqlr3Z7bN0yXhroe91zO/w3L7TFeuhVQxpDc730BTqZtdM8RVNgkeXe87Ut /3PRrM4zXG75aJnFqiyS6Gybl27JVcE+zsD1aSXATlOb0tbqgxMe0HP1sU+bXWji/Cfs m/k8vTUPEk6yo3nasDlNLGiqjPqNF7L9Yf98ybXJT7uf0bybtd+eybVdu55IsLM2vhVZ iDlgROtxNI4P/vziP8bUPKhQhZgt4aq78+AUSPuZeLFmChiX5YjCy5bkQGW9muiP3abT x7iTth4UP4mE0qREWEFFsOC41On3zgPwElFu5IydXwYEG6o5n90n9SKlwqbQz8gM29cO BXqQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=h+QeKdLZsVMQ7g1x2Tb9Nck5yKTwGv5AJjmi3IuvsZ0=; b=vNu1benjLNo50LKxWlGcSWRgVswXJw+7S8U67mvGbnZvQ3WcbcNcdtcuPNK7b2b9dh yChHM0JWTPCLGbY6BLp19nM86QmMqCFXKuLZVdbzvKtx5e+gSHMsGKqhKstlrx2Hi8uH ROQMnsus+5Gd/NHwYjBCP68Rlbsp4FG7m7LaPquqsCYsINmmr6pEYslDn8f+nV0FbObS s5lgqnITokPNtLwPsSIWmjexjA4tLO1Vupce3SvfwM1R+PJNnjpfX+tRtDeLzKxcfi+C YndUKhebn8sURhSMsHBRoRANvODeaMGAiIIcrnzi/sAte1PbA1Zu6QVzA1BQvfgiIDPc oRuA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6si2451344plm.94.2019.06.25.23.29.02; Tue, 25 Jun 2019 23:29:19 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726791AbfFZG1a (ORCPT + 99 others); Wed, 26 Jun 2019 02:27:30 -0400 Received: from mga05.intel.com ([192.55.52.43]:53074 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725954AbfFZG13 (ORCPT ); Wed, 26 Jun 2019 02:27:29 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jun 2019 23:27:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,418,1557212400"; d="scan'208";a="166931790" Received: from mylly.fi.intel.com (HELO [10.237.72.158]) ([10.237.72.158]) by orsmga006.jf.intel.com with ESMTP; 25 Jun 2019 23:27:27 -0700 Subject: Re: [PATCH] i2c: designware: Add disable runtime pm quirk To: AceLan Kao Cc: Andy Shevchenko , Mika Westerberg , linux-i2c@vger.kernel.org, "Linux-Kernel@Vger. Kernel. Org" References: <20190625083051.30332-1-acelan.kao@canonical.com> From: Jarkko Nikula Message-ID: <5c14537d-b6aa-b478-fdd8-29f690b15e07@linux.intel.com> Date: Wed, 26 Jun 2019 09:27:27 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/26/19 5:32 AM, AceLan Kao wrote: > 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. > Yeah, I realized it won't help as the i2c-hid device is anyway powered on constantly when the device is open by the pm_runtime_get_sync() call in i2c_hid_open(). > 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. > But only on that bus where Goodix is connected and open by user space. What I mean something like below: diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c index 90164fed08d3..bbeaa39ddc23 100644 --- a/drivers/hid/i2c-hid/i2c-hid-core.c +++ b/drivers/hid/i2c-hid/i2c-hid-core.c @@ -795,6 +795,9 @@ static int i2c_hid_open(struct hid_device *hid) struct i2c_hid *ihid = i2c_get_clientdata(client); int ret = 0; + /* some quirk test here */ + pm_runtime_get_sync(&client->adapter->dev); + ret = pm_runtime_get_sync(&client->dev); if (ret < 0) return ret; @@ -812,6 +815,9 @@ static void i2c_hid_close(struct hid_device *hid) /* Save some power */ pm_runtime_put(&client->dev); + + /* some quirk test here */ + pm_runtime_put(&client->adapter->dev); } static int i2c_hid_power(struct hid_device *hid, int lvl) -- Jarkko