Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4256472pxb; Tue, 2 Mar 2021 10:20:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJyi9UtpUXDpSf9UIPLWVr2HhJPLYumT8Z4T53LUuRHmT1vTMpch98Z450kgAb1UxpUSH6Rk X-Received: by 2002:a17:906:c102:: with SMTP id do2mr22142019ejc.305.1614709256473; Tue, 02 Mar 2021 10:20:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614709256; cv=none; d=google.com; s=arc-20160816; b=YTYQaIGaG0nnziapYVGPBTUApJC8XuEsNDfq09KFTPE6GdOqlB755+ugic24OdOhre 8L5J7ETXrEHxEg7HRFzg3660VJ0Xu4hjO0gdOyEJzbryNWJsQ8BdMdtedpugV/QS0ZRl W5jX33IoymAX99dVezOujW93jpg/NpB7T4fY8GBPlrWI049z3BNVcx5k6aWfYLTYJIMA swmClZry2KxsrnScGUN2UZVlKLlsVuDNM+UOdb2Dfl0wejTRhTBkyqWJMNQOIfVsBcxt FtgJQ1RK1Yaxqe+Z5QBIA8DMoiotWfItELsC2Ap3mmJbEiO+NzXr/IgezYvFXxJ4AtO2 suxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date:cc :to:references:in-reply-to:message-id:subject:reply-to:from; bh=RZXF2MYHs+hfhA+1ooZUAFmr4iv45qu6hdmmtAPF7yE=; b=tuylZlJlR0LZJV2YI7NWDaL1ySvavO9L8hjm99XaJTE5heokhEVRClumROPpZYtbMT eCLj0cHS1esCHTn31EIRsN6mJ2InYSNfT6vW1TJ/YAtKPpx648sDxlJiMzOhwcHi8BPn zlrcnLhxqV77qry9aXjEnzwm08WpIkFFWsaRF712mSjuBPCoTB0bsk49YCMlNi/X21O4 Juz8JKKVunUcvVQl4gnb+bvvv0jdFky2/67fEHoqSb5s+2Pa/DkUjcPSBfrQ0Zv3DxS0 KJ5dINy9yVGFbtS4WFJ7/kghPTkzcWo5eKBdGXCwPw5PsALtrMP93xJUF7Kkab11NKxQ 2PRA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y23si14367450eds.278.2021.03.02.10.20.32; Tue, 02 Mar 2021 10:20:56 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1576243AbhCBE0b convert rfc822-to-8bit (ORCPT + 99 others); Mon, 1 Mar 2021 23:26:31 -0500 Received: from emcscan.emc.com.tw ([192.72.220.5]:24209 "EHLO emcscan.emc.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378365AbhCBBFl (ORCPT ); Mon, 1 Mar 2021 20:05:41 -0500 X-IronPort-AV: E=Sophos;i="5.56,253,1539619200"; d="scan'208";a="39591814" Received: from unknown (HELO webmail.emc.com.tw) ([192.168.10.1]) by emcscan.emc.com.tw with ESMTP; 02 Mar 2021 09:04:58 +0800 Received: from 192.168.10.23 by webmail.emc.com.tw with MailAudit ESMTP Server V5.0(177115:0:AUTH_RELAY) (envelope-from ); Tue, 02 Mar 2021 09:04:58 +0800 (CST) Received: By OpenMail Mailer;Tue, 02 Mar 2021 09:04:57 +0800 (CST) From: "jingle.wu" Reply-To: "jingle.wu" Subject: Re: [PATCH] Input: elan_i2c - Reduce the resume time for new dev ices Message-ID: <1614647097.9201.jingle.wu@emc.com.tw> In-Reply-To: References: <20210226073537.4926-1-jingle.wu@emc.com.tw> To: "Dmitry Torokhov" Cc: "linux-kernel" , "linux-input" , "phoenix" , "dave.wang" , "josh.chen" Date: Tue, 02 Mar 2021 09:04:57 +0800 (CST) MIME-Version: 1.0 Content-Type: text/plain; charset=big5 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org HI Dmitry: So data->ops->initialize(client) essentially performs reset of the controller (we may want to rename it even) and as far as I understand you would want to avoid resetting the controller on newer devices, right? -> YES My question is how behavior of older devices differ from the new ones (are they stay in "undefined" state at power up) and whether it is possible to determine if controller is in operating mode. For example, what would happen on older devices if we call elan_query_product() below without resetting the controller? -> But there may be other problems, because ELAN can't test all the older devices , -> so use quirk to divide this part. I also think that while I can see us skipping reset in resume paths we probably want to keep it in probe as we really do not know the state of the device (was it powered up properly earlier, etc). -> In this part, at PROBE state will be called data->ops->initialize(client) function. -> Because quirk's setting (data->quirks = elan_i2c_lookup_quirk(data->ic_type, data->product_id);) -> is after data->ops->initialize(client) and elan_query_product() function. THANKS JINGLE -----Original message----- From:Dmitry Torokhov To:jingle.wu Cc:linux-kernel@vger.kernel.org,linux-input@vger.kernel.org,phoenix@emc.com.tw,dave.wang@emc.com.tw,josh.chen@emc.com.tw Date:Mon, 01 Mar 2021 13:31:31 Subject:Re: [PATCH] Input: elan_i2c - Reduce the resume time for new devices Hi Jingle, On Fri, Feb 26, 2021 at 03:35:37PM +0800, jingle.wu wrote: > @@ -273,10 +318,12 @@ static int __elan_initialize(struct elan_tp_data *data) > bool woken_up = false; > int error; > > - error = data->ops->initialize(client); > - if (error) { > - dev_err(&client->dev, "device initialize failed: %d\n", error); > - return error; > + if (!(data->quirks & ETP_QUIRK_SET_QUICK_WAKEUP_DEV)) { > + error = data->ops->initialize(client); > + if (error) { > + dev_err(&client->dev, "device initialize failed: %d\n", error); > + return error; > + } So data->ops->initialize(client) essentially performs reset of the controller (we may want to rename it even) and as far as I understand you would want to avoid resetting the controller on newer devices, right? My question is how behavior of older devices differ from the new ones (are they stay in "undefined" state at power up) and whether it is possible to determine if controller is in operating mode. For example, what would happen on older devices if we call elan_query_product() below without resetting the controller? I also think that while I can see us skipping reset in resume paths we probably want to keep it in probe as we really do not know the state of the device (was it powered up properly earlier, etc). > } > > error = elan_query_product(data); > @@ -366,6 +413,8 @@ static int elan_query_device_info(struct elan_tp_data *data) > if (error) > return error; > > + data->quirks = elan_i2c_lookup_quirk(data->ic_type, data->product_id); > + > error = elan_get_fwinfo(data->ic_type, data->iap_version, > &data->fw_validpage_count, > &data->fw_signature_address, > -- > 2.17.1 > Thanks. -- Dmitry