Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6357743ybi; Mon, 8 Jul 2019 01:45:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0f6jH/ABHJ/8YFDEYpUzqqfcJ38PppV1RGIiqlEl2jR7hf/23lLGAhpf1c7L04jAHrFTA X-Received: by 2002:a65:5202:: with SMTP id o2mr20387295pgp.199.1562575528921; Mon, 08 Jul 2019 01:45:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562575528; cv=none; d=google.com; s=arc-20160816; b=WqUkrSn0PDUvNgdnlMlOBhcVv98kLcWzfO3yoAlnrYdfFwS3aeR8ka5ITAtj2lULKj yvHFmS7/mfEanm9sHsgFKC1R5hk6L9+gTkfQAdoh94RN9PKjT2L3TxVRUHJynmtvLYrx q/uz5w1ex5sw47ui00KarMitWx9zLWSypCsspKo9k1cfA9QUpOm/ojLO00f8JWdW1AnK kcEBqaRtiqrWVaKi5wPs0sg1Y2O2ol662AT/x9kD9Kbz/AqIsTQObg7RV+4LrwSU1CbO +ukPu8Vb4HuLJvbaVVNtCq87yNhSllILl3fxAStb4ytRzyAmYpYfpUIAckJJNUMNpj1c t+KA== 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=FwCGNz2A/67PYCJZhmzzR4fQVEzE7aacF+CFUclu9Y8=; b=IItDVA6CWsRM0N499/ApPwaEDW8cVQM44dZ4OjKbtggeT1QZhMaNZhWHbFCy24+IuU YPMOKXc7iHAoDAbKKGNkgofjJMSDspabWJeNBV+vOvcoGoGjYJhgvvemPvp5mjPWEeE2 7YNRcE5H0TQcJKLxx9O1PnrIaAZx4GLuy0vN5neKheGFa72Kos16Zq1RB/xlInHVJsb7 rPKXm8qY4HJQxXgjJ63caWmvTfMDr/bOdSWC1aCsHG+XSyNBCyOqEYHd79VqLHL61oiN DUaogQZStwJ73gh196G0Aw+roAkBBPtK7hUdz2NbT1+rfEu3lB4lPoodUmiiAiaux/06 NIsg== 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 w3si18256489pgh.525.2019.07.08.01.45.13; Mon, 08 Jul 2019 01:45:28 -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 S1729053AbfGHGSX convert rfc822-to-8bit (ORCPT + 99 others); Mon, 8 Jul 2019 02:18:23 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:60212 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729044AbfGHGSX (ORCPT ); Mon, 8 Jul 2019 02:18:23 -0400 Received: from mail-wm1-f69.google.com ([209.85.128.69]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hkMyj-0007Kd-8u for linux-kernel@vger.kernel.org; Mon, 08 Jul 2019 06:18:21 +0000 Received: by mail-wm1-f69.google.com with SMTP id u19so3857126wmj.0 for ; Sun, 07 Jul 2019 23:18:21 -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=ni/ZsRUHJQeGte3cJaCva9RYqIeypB1jmcG6EYYS4M0=; b=dzGUSMS7NzFs6G5RdLmMjB70WtLj4dRk/ubaB0SjCqVEMT+Aaw/Xr8lVASqP02N0ce X3vTp598zxgJtzNP7SbedZErONPM5j/Su6yhSka8NUGxpZ+EqUPMo3IqWv6y87tPMeds 8DLGDZrR+qJjGeCKXClpeSF67uuzNkF0jr1Ymuk3ladKvkxzynDXpzqajPjgSSldZe7o rl+6AowsgijktIQhXThxgzqxIhL1TsUVUPZSInUg7gecZM6MgX624kuBxITp+0+Hg1ts hZV1ffAmxPEdZ/sNLtYSsESW0yaMs01vaxR6TG5A72bJMRRDNsVrtgbcXYzOIvzI5DKx qsFQ== X-Gm-Message-State: APjAAAWuRAZGaldZVGksFV86SVvZsvM1bRsIei/y11LpL9F2DIR09cn3 OIOaGZ8GyJiMvx6T/357eUzke+stCaG3Ga+Edu6FC+Gl4vMgScs6wsRN/g+Ym+d9dVTbAhL82yu FSj42f2VmaaPlMJ2FBVBlsKB65UlycitVlEVpIRrDkVvjNekGebxVO0zhbg== X-Received: by 2002:adf:ec0f:: with SMTP id x15mr16856900wrn.165.1562566700888; Sun, 07 Jul 2019 23:18:20 -0700 (PDT) X-Received: by 2002:adf:ec0f:: with SMTP id x15mr16856867wrn.165.1562566700631; Sun, 07 Jul 2019 23:18:20 -0700 (PDT) MIME-Version: 1.0 References: <20190625083051.30332-1-acelan.kao@canonical.com> <5c14537d-b6aa-b478-fdd8-29f690b15e07@linux.intel.com> In-Reply-To: <5c14537d-b6aa-b478-fdd8-29f690b15e07@linux.intel.com> From: AceLan Kao Date: Mon, 8 Jul 2019 14:18:09 +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" , Kai Heng Feng , Lee Jones 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 Hi Jarkko, Sorry, I lost track of this thread and didn't understand what you want me to try. I'm willing to try it if you can explain it more. My colleague comes out another solution for this issue https://lkml.org/lkml/2019/7/5/17 and it explains why it takes up to 100ms to wake up. This solution is more aggressive to zero the d3cold_delay and it looks like the delay is not necessary. Anyway, we have two different proposed solutions now, my proposed solution is specific to the listed platforms, but we may have to extent the list(platforms which uses the old firmware), the other proposed solution from my colleague is generic and apply to all platforms which loads intel-lpss-pci driver, it may lead to unexpected regressions which we don't see now. Please give some suggestions, thanks. Best regards, AceLan Kao. Jarkko Nikula 於 2019年6月26日 週三 下午2:27寫道: > > 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