Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp227218rdb; Mon, 18 Sep 2023 13:09:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEbY4M2FE6ZF0ZKbAASczcp4sBnYh54BbRlCmCXqdabkptZeQNA9fiuZMOhpw+UVusA8txK X-Received: by 2002:a17:903:22cc:b0:1bd:e85f:700e with SMTP id y12-20020a17090322cc00b001bde85f700emr12178050plg.69.1695067760409; Mon, 18 Sep 2023 13:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695067760; cv=none; d=google.com; s=arc-20160816; b=RvvORihZEY2ALcP1gMzoQnneNMbcoeIVPCCJLSlo6PJWswRcnVpkOROygz71jiT071 9jtN6uyvuWsaaMq8BrEfen0P8j9eU8aU5ILfja3EVzPrIn+YtrEZlky/ge2tyV6/vJN5 ka2HkKdg891LMsjXH3gCwHxYU1hGQE08gNmRSXi1/vT9ubXZFGcoLEY3xDcgnQsWMIKo x+ySg/9xdKUqCpC+YtyMWcUgw/MmFt4MeuFBR6ROcZcVTbe/0Vy4oCjmNpBug5trTCAx Y8LDv8kr3QyhvcNNJTdkc01ljG/8ydWU8rdBxIiiXwsvhwihMNRtzsnBW3NSYESiezRi k9uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2iH5XUWuJN0CUoFrEtaa+R5mcGN0tZWwN9oTvMA3Vck=; fh=mm5GhUzm/JBRmdT/fEYx60eJpGDyNBskrt4GfeHVOSk=; b=P9jrLNGBjear0yN0ZNSQj52B/p1PFdxoyJKEaeZsASImJeDMGQP1qtQXPkyMV/BEHn GTLzmXyewrKKWDCPPihJWEQyxrFb79/B1ygiWATozHM/SoN4fHmc3rwI8YrmJjNx2/fK vH0LKqcl+hY5DPZ/KATETs/C472gTzrMNPVAtz6d0oRrvR+ElBOAA1cl/SnwMYrMUVuV EE7GyiAkamw1KHED/Fj2YBEDkJMcZ9+vyngLMEdo7II2n+GWyjD189sdXimUWpoylMGK 8nCHZ76/vBEaxj4S/y45u/zERFCGTYgBfwurlCSTIsFaEK/EzoIpouy2jbRWksTmkqnQ CTbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JeixJUGq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id t1-20020a17090340c100b001a94b91f402si8402959pld.218.2023.09.18.13.09.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:09:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JeixJUGq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id B81FE80B79D0; Mon, 18 Sep 2023 03:45:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241184AbjIRKpW (ORCPT + 99 others); Mon, 18 Sep 2023 06:45:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241122AbjIRKo6 (ORCPT ); Mon, 18 Sep 2023 06:44:58 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FDF6A2; Mon, 18 Sep 2023 03:44:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695033893; x=1726569893; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=YuADBYyJPbfyS00a+dZYSYo97GWD7ip/0k5iF9oNauE=; b=JeixJUGq59gwH+GUvowa2egT0n8qoTR0kQWgqAliXKul+skBXTHaWnCr fgLwB2usaaJ0m9M2h4MB3X9xS/tJIJvvI6myGtCkzzIs9hFjlwyqRHUlZ 6fMUP5D/f3PCMQkvT5i6mKoibbCyIfHBR4Vsk4kLZvQ2UbHgCeHZCVHyw l5YxgZl+1wEy4vnf9F9Vn/sQVCuTS7UOrpTycvu1ME61OXUu66HZW6jat cYhGnd7NgYCGd/A4uyVVq0lMyDFi5Jl9DsvIOwkjNi/14NhCZlMB0qKBD nX0U0860YL8YiSczHr8cu69e+sr4nIsVZ5lCiyvurW6Qog+i0+q7BcCvX w==; X-IronPort-AV: E=McAfee;i="6600,9927,10836"; a="383445202" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="383445202" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2023 03:44:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10836"; a="739086164" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="739086164" Received: from kuha.fi.intel.com ([10.237.72.185]) by orsmga007.jf.intel.com with SMTP; 18 Sep 2023 03:44:48 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Mon, 18 Sep 2023 13:44:48 +0300 Date: Mon, 18 Sep 2023 13:44:48 +0300 From: Heikki Krogerus To: Abdel Alkuor Cc: krzysztof.kozlowski+dt@linaro.org, bryan.odonoghue@linaro.org, gregkh@linuxfoundation.org, robh+dt@kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org, linux-kernel@vger.kernel.org, abdelalkuor@geotab.com Subject: Re: [PATCH v5 02/15] USB: typec: Add cmd timeout and response delay Message-ID: References: <20230917152639.21443-1-alkuor@gmail.com> <20230917152639.21443-3-alkuor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230917152639.21443-3-alkuor@gmail.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 18 Sep 2023 03:45:57 -0700 (PDT) On Sun, Sep 17, 2023 at 11:26:26AM -0400, Abdel Alkuor wrote: > Some commands in tps25750 take longer than 1 second > to complete, and some responses need some delay before > the result becomes available. > > Signed-off-by: Abdel Alkuor > --- > drivers/usb/typec/tipd/core.c | 18 ++++++++++++------ > 1 file changed, 12 insertions(+), 6 deletions(-) > > diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c > index 37b56ce75f39..a8aee4e1aeba 100644 > --- a/drivers/usb/typec/tipd/core.c > +++ b/drivers/usb/typec/tipd/core.c > @@ -284,7 +284,8 @@ static void tps6598x_disconnect(struct tps6598x *tps, u32 status) > > static int tps6598x_exec_cmd(struct tps6598x *tps, const char *cmd, > size_t in_len, u8 *in_data, > - size_t out_len, u8 *out_data) > + size_t out_len, u8 *out_data, > + u32 cmd_timeout_ms, u32 res_delay_ms) It looks like 1s/0s is still the "default", so you could have just made this old function a wrapper: static int tps6598x_exec_cmd(struct tps6598x *tps, const char *cmd, size_t in_len, u8 *in_data, size_t out_len, u8 *out_data) { return tps6598x_exec_cmd_tmo(tps, cmd, in_len, in_data, out_len, out_data, 1000, 0); } thanks, -- heikki