Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp38782lqo; Wed, 27 Mar 2024 06:29:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW2RmB7GfE45a4dEsjWXGSofwzXtvHKSYgDXagBJImdSXsqcY4hXmnfb+Vkx8YT3PQnNBgS6w3gKrfOWsB35yPlRVV/Wz/Wa+tQ+MVBzQ== X-Google-Smtp-Source: AGHT+IFE9vQYfO9yvObGl/jvCi2PypQHwLBS9alNGrjwB9T7u9wfdfTkYz5La36AdEeXy0ARNUtc X-Received: by 2002:a17:90b:785:b0:2a0:97a4:8743 with SMTP id l5-20020a17090b078500b002a097a48743mr1846607pjz.47.1711546154055; Wed, 27 Mar 2024 06:29:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711546154; cv=pass; d=google.com; s=arc-20160816; b=02EvLyEB0DLlofa9gDB/x8RgJa0IeK1bn8BXl1c+dkzgvh7eQlav2UtYpb3mN3b+eb l4PimcDo2Ad/fzPS8Jg81xGU1fNswW9kG5XqCIl3BulGyeTFPkdekQrNCy+4hHEmDYX+ RzrjvN8Fvb1QZVZU2iHs3vb5Yr5P9mKItsesQq2Jt/DjD4U3iMp7A2JcvQtsmOsTyXO9 KI7oogK9c9rSKNYwZLMWhAd0t2cEuuLcqxqvoc8pgUs8w9gutbglZrZXYvqHXupGyq9I 628VgsU26ARY7gDTkiFg3sQTw+WCh3i4ag0zRghJFGItxj9XRBnK6Jhd+/Oflkg95uSe tK+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aBxttPD/O9PsRzXvULlv1FKdgqnaWia+DamGPfoE+/w=; fh=mwXytm9+IBWaRgQaQ2JZZRPPLDPgv2t1tV14Pxg36o0=; b=uZW+MYKtvekyW3yrditKHBLVTH0WJ83H+JbyiR5hEAFzvxtfm318v31oIWJVQYGPN1 4xFl3CCzaGD6O3zWuph6JWfluDsRQ8mlF95tY0W1PUxSnvDeDsGVyNY7WEZCKkmCJDrg fM6mXYufNAIVXT/6qmznieyrhqcZ3rU0TuTua4Yx+VzwzICbYWri2yx5TSPC0i1peZzi BIA9mk8v4HqAuTAIM70nifFGiHDS53ZFBod3GTiaqEq2qENV67mASEI60TzJr5i4laBO nYG8Dprjs7nMZgN3qyiLc+xyrA0J4atkW3BeStjnTqO64W8lqPSpbxjk32ZUBdXhn0av OnNg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IgzwqvZU; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-120708-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120708-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id pd15-20020a17090b1dcf00b002a055045cb8si1521629pjb.18.2024.03.27.06.29.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 06:29:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120708-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IgzwqvZU; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-120708-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120708-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2781E295F52 for ; Wed, 27 Mar 2024 11:01:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 037FA52F8D; Wed, 27 Mar 2024 11:01:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="IgzwqvZU" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5A3654BC7; Wed, 27 Mar 2024 11:01:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711537292; cv=none; b=Fih/sPEiV63JhTy2HEYwJb8FQtwBREOMbzFTLxTRdEEZIw67ucKSMSlWoUGR6ocdcRdiLib9BaKSq8OWkrqEqYUPNFjntRO0dDgQNBXt2e6XPqGYpj3itajEj36jlUnSKsGACTGQpuZGhbtuQ/cXqPk/d0d0OmyBcOIcF0ixjM8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711537292; c=relaxed/simple; bh=FeuyH0m9/+zRJP3gPnzf/OHLdiZaQwQgOVM2wU/3j08=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dVcm3HHXQxe8gDJXGyDIyDl5I6OAHQmRBUwG52SXgJHPYQbMfsF58OAgyUUzsM47ClBjHMEyGKQ2QtTzjgRrlKboUTUtns81P45bFoyuIc7KKDg8HUGUOrLwiz3dcgb2LXhbECDehgYYvzj4ok2QWuKT+Ia3fM1jSPC/aFkbBJA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=IgzwqvZU; arc=none smtp.client-ip=192.198.163.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711537291; x=1743073291; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=FeuyH0m9/+zRJP3gPnzf/OHLdiZaQwQgOVM2wU/3j08=; b=IgzwqvZUk09aJmPVMtbQ6+YJEjQzZdFlqUlzpddBtQTD29cDR2Ikh5B4 IA/PUl/HT4l44XUpzUiH+5oLTnphIUpaOEQ7r3ShsY34T3YghNHeX4iZ/ MIvevHQfYxH91jACbqUV53n3VdFBofT5/jcd0tAdE7xxuVlD2LjUBlFpS xAhgilv2rSQMr31nhzGzWksHaKymSr7OlOfifnz/uA8YsdPUQzz6qkKNl FGicgQaFyGhP9VpPcUslWDZYe6F5mVzrFDrQZLb0LF1RQZg8U8dNkYOhW fHpnAbVml9fo9cwAK8nsYuieozqZo0NnmUqpZYZUBg+nnbjTtg53xWOWR g==; X-CSE-ConnectionGUID: BXSJ2w1jQhqp/fsgkKmcWA== X-CSE-MsgGUID: Xu3m23YvRw2tXgNGSZBgVQ== X-IronPort-AV: E=McAfee;i="6600,9927,11025"; a="17359807" X-IronPort-AV: E=Sophos;i="6.07,158,1708416000"; d="scan'208";a="17359807" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 04:01:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11025"; a="937074418" X-IronPort-AV: E=Sophos;i="6.07,158,1708416000"; d="scan'208";a="937074418" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 27 Mar 2024 04:01:27 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Wed, 27 Mar 2024 13:01:26 +0200 Date: Wed, 27 Mar 2024 13:01:26 +0200 From: Heikki Krogerus To: Pavan Holla Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Abhishek Pandit-Subedi Subject: Re: [PATCH] usb: typec: ucsi: Wait 20ms before retrying reset Message-ID: References: <20240325-ucsi-reset-delay-v1-1-d9e183e0f1e6@chromium.org> <2024032624-subtitle-crisped-f4f1@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Hi, Normally the driver does not retry the reset, so maybe you should just say "wait 20ms before reading the CCI after reset", or something like that. The idea here is to give the PPM time to actually update that field before reading it, right? On Tue, Mar 26, 2024 at 04:34:44PM -0700, Pavan Holla wrote: > On Tue, Mar 26, 2024 at 1:29 AM Greg Kroah-Hartman > wrote: > > > > On Mon, Mar 25, 2024 at 09:19:43PM +0000, Pavan Holla wrote: > > > The PPM might take time to process reset. Allow 20ms for the reset to > > > complete before issuing another reset. > > What commit id does this fix? Does it need to go to older kernels? > > This does not fix any commit. However, the time taken by a CCI read is > insufficient for a ChromeOS EC and PDC to perform a reset. Perhaps you could put that to the commit message. > > > There is a 20ms delay for a reset retry to complete. However, the first > > > reset attempt is expected to complete immediately after an async write > > > of the reset command. This patch adds 20ms between the async write and > > > the CCI read that expects the reset to be complete. The additional delay > > > also allows the PPM to settle after the first reset, which seems to be > > > the intention behind the original 20ms delay ( kernel v4.14 has a comment > > > regarding the same ) > > > > Why was the comment removed in newer kernels? > > The comment was removed when the old UCSI API was removed in > 2ede55468ca8cc236da66579359c2c406d4c1cba > > > Where does the magic 20ms number come from? What about systems that do > > not need that time delay, did things just slow down for them? > > I am not sure how 20ms was decided upon. However, UCSI v1.2 has > MIN_TIME_TO_RESPOND_WITH_BUSY=10ms. So, we need to provide at least > 10ms for the PPM to respond with CCI busy. Indeed, this patch slows down other > implementations by 20ms. UCSIv3 also defines a 200ms timeout for PPM_RESET. It does not slow down other implementations. The delay has always been there before the RESET_COMPLETE bit is actually checked. The change here makes sense to me. Just rewrite the commit message. thanks, -- heikki