Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3284095lqo; Tue, 21 May 2024 12:02:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX5zQ+vnIZr1lKkjWDLlZak+Ay3hJOf7kfufGVw1EcIoH21R8zvoJtUCQpjXNwE6SSvcgQO5cqXEOqOveKdmlNqznsmOU3ovvxdO3/Zsg== X-Google-Smtp-Source: AGHT+IH/kZRqN6rxiC6YlRrZFTHc90Fx6dMba2uLm6FxZXdvXhJBFyExGLWtxUFF2tJgxAO3xwFZ X-Received: by 2002:a05:620a:8cb:b0:794:8876:1b78 with SMTP id af79cd13be357-79488761c40mr539557785a.54.1716318146377; Tue, 21 May 2024 12:02:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716318146; cv=pass; d=google.com; s=arc-20160816; b=DOvyeq/ehX/PRrrIl6AINotxwxS2nD07kRG5YPaPilHJ+/MjPacrl/VqF7g1BvCSX7 Z6PFi0g2Npht6M/YazbfpxU/poHeyN88Sv+wb59Ra3RcE2OsQbR98N59pl3XzL7xID1A feYFfV+i7OrBO/v9n/PAsUopwaOmYEUPOFJ6Z0CmFuxrAo6C3+nZoXt08mVovIiShzK1 HYrG+/exa87vwSLuiTmcZiZau9Bq5boXEtlB7CHOHe219o7LFlh4quqk+w9t+RL5t9TB ahrHMhFv7B73SyxWCrPQVdDPseqh88uk4mDDdqaXMMGdHREY1JVmikNnyBkpsdQavgOI x2bg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ieOcrROY88eFXiF3iyrjvokKG2LbcORrubf++ALbDxA=; fh=wU/jXBYrdvZG2ZG2aDeNzJA6XXP9BCeV1NBsLDbUJxw=; b=U5kdSArvqjjhdymybDTfHLIQGvPqPZC3biFjGap6LphBCyENozachT2jELvea9bkuH KXEcoiE9TBMnf86xQP8hcGnPLpdt0gv6PojjMasLcWjsJyTJKFKXR0/NlpekkIkoWM47 RU0Lr+IeSfhI7s2PEU4bAWiBgCdMWj6HS0EcLfqUlq5ZNBPGYZlDokiEeEoEW8TTZk7S saSd8/5L+7auG7kel+tUwjOp6pNCwyDJReILChkKlbmaivAQzk/4LEDvLq3cXoTn5q7l AyDwxrNTsG0hT3S23NMLFL35jLTBXGmDaYKIIdZVdKtGPZaxLtiwGxY143RgANlXvIlL VHcw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=I9eMgMS2; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-185038-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185038-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792bf278097si2754075285a.31.2024.05.21.12.02.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 12:02:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185038-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=I9eMgMS2; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-185038-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185038-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EE3B61C225D8 for ; Tue, 21 May 2024 13:54:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B3B57F46C; Tue, 21 May 2024 13:54:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="I9eMgMS2" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 E062C55783; Tue, 21 May 2024 13:54:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716299652; cv=none; b=Hfk9QFOTLlX0hk2mmNLTqB22m4LwzoqeKa9cL7VGkq//n/o098ltQmfcMA8Pc/xkqeq5bGrL0/D3j6OaKRwr/MPLoZRYAu12Y1hsA1CLaLu7tNYmsjnSZjdOoHPHr4sgD9uNIwRCOSn4ceTxGlvUTNku0cC8rtDBlWVqYdbV3eY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716299652; c=relaxed/simple; bh=b+us2QBIkA4Jbr1GcKU9KO+HMN2AR2yA2pAOg0jMe34=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KYhwJtq7fm85+CyAJ3Nvh/jJXvJN2z+V7r9k+Bhk6Pg5bHCfKkJfn5winsPUcacIhU/bGDo7fF0CDsMpDYxpTTOsDLsqNhTpi4mOoki2xPRa7brumMNZFLYxtYIrZvx/XJ5bt1BmQp36XrEFA4oFqqvE6qmB+50+eMYKeDdbKWw= 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=I9eMgMS2; arc=none smtp.client-ip=198.175.65.14 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=1716299652; x=1747835652; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=b+us2QBIkA4Jbr1GcKU9KO+HMN2AR2yA2pAOg0jMe34=; b=I9eMgMS27qYXVDH8FGUS2jwI9OyPNI948QyghwlhRrh5PKVeqJ9q2T29 Uf8yEmc2ogiHcMONzbDghfLGldSrs2Pn/e/EkSI4y2HWvxddON/R/tJHq cmZIQNFMgKrSPClNFxxpqbd0J0quSz60URBFXWkyPaygovm0CIZyJDKb7 jEEp1Z0q4KCijkuJhnVeEWEtX1zF/7Lah/Pcb4zLOD6WRIdi5wNEUchNu K4axf2v++dSBDNbzCWZNLleYmbDT6e0hvSso7VLWrYV+bTcjrvvYz8Qh7 payw/oL0ZHUMTpP18UUdJCvFnoubeUirEpsfQFj1Dh6yAM7meJZDhgtdQ w==; X-CSE-ConnectionGUID: fWLLQm7nQ22KBk747S+Qew== X-CSE-MsgGUID: 9I7kiUKVRsiM7Q5TSPfOBg== X-IronPort-AV: E=McAfee;i="6600,9927,11078"; a="16320755" X-IronPort-AV: E=Sophos;i="6.08,177,1712646000"; d="scan'208";a="16320755" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2024 06:54:11 -0700 X-CSE-ConnectionGUID: IXx87xooSIm76cT5A+yq5Q== X-CSE-MsgGUID: wgth+0zMReSIgyEQnwSMLQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,177,1712646000"; d="scan'208";a="33053699" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmviesa010.fm.intel.com with SMTP; 21 May 2024 06:54:07 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 21 May 2024 16:54:06 +0300 Date: Tue, 21 May 2024 16:54:06 +0300 From: Heikki Krogerus To: Kyle Tso Cc: linux@roeck-us.net, gregkh@linuxfoundation.org, badhri@google.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] usb: typec: tcpm: Ignore received Hard Reset in TOGGLING state Message-ID: References: <20240520154858.1072347-1-kyletso@google.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240520154858.1072347-1-kyletso@google.com> On Mon, May 20, 2024 at 11:48:58PM +0800, Kyle Tso wrote: > Similar to what fixed in Commit a6fe37f428c1 ("usb: typec: tcpm: Skip > hard reset when in error recovery"), the handling of the received Hard > Reset has to be skipped during TOGGLING state. > > [ 4086.021288] VBUS off > [ 4086.021295] pending state change SNK_READY -> SNK_UNATTACHED @ 650 ms [rev2 NONE_AMS] > [ 4086.022113] VBUS VSAFE0V > [ 4086.022117] state change SNK_READY -> SNK_UNATTACHED [rev2 NONE_AMS] > [ 4086.022447] VBUS off > [ 4086.022450] state change SNK_UNATTACHED -> SNK_UNATTACHED [rev2 NONE_AMS] > [ 4086.023060] VBUS VSAFE0V > [ 4086.023064] state change SNK_UNATTACHED -> SNK_UNATTACHED [rev2 NONE_AMS] > [ 4086.023070] disable BIST MODE TESTDATA > [ 4086.023766] disable vbus discharge ret:0 > [ 4086.023911] Setting usb_comm capable false > [ 4086.028874] Setting voltage/current limit 0 mV 0 mA > [ 4086.028888] polarity 0 > [ 4086.030305] Requesting mux state 0, usb-role 0, orientation 0 > [ 4086.033539] Start toggling > [ 4086.038496] state change SNK_UNATTACHED -> TOGGLING [rev2 NONE_AMS] > > // This Hard Reset is unexpected > [ 4086.038499] Received hard reset > [ 4086.038501] state change TOGGLING -> HARD_RESET_START [rev2 HARD_RESET] > > Fixes: f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)") > Cc: stable@vger.kernel.org > Signed-off-by: Kyle Tso Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/tcpm/tcpm.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index 8a1af08f71b6..9c1cb8c11bd6 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -6172,6 +6172,7 @@ static void _tcpm_pd_hard_reset(struct tcpm_port *port) > port->tcpc->set_bist_data(port->tcpc, false); > > switch (port->state) { > + case TOGGLING: > case ERROR_RECOVERY: > case PORT_RESET: > case PORT_RESET_WAIT_OFF: > -- > 2.45.0.rc1.225.g2a3ae87e7f-goog -- heikki