Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2534137pxj; Sun, 6 Jun 2021 05:34:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpmp114dcmxVtjchP6ecCK/FF/c3maYZMmfLOPDYnuFiVIz/p0h1UXtOlTlIPKyfZOu3FV X-Received: by 2002:aa7:d590:: with SMTP id r16mr15259206edq.355.1622982852246; Sun, 06 Jun 2021 05:34:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622982852; cv=none; d=google.com; s=arc-20160816; b=czAL0jiqQ0wboPVixtTYYGQrZrWn/gKzNDRS8ynwFAvyqwDdJysdLowQAghYmVT6CP lfKo067+KzAfpkCN9q20rnvakfKJDHzeLCxODfLgbIHH6nOwTOuWo8eycFpi8YnTmT0z YzMPs9BX9SA/us9kddlCpep1BOBWEQyW0afZSRaKyol8nNViK5omM0lqsSLAR+dPzbX3 cwCG+w96v6/GCQ24gxc42cJlAVUTWpBceQj3hQx/q5ieaN4RcELUb0mo/gWMlD4x3XLm 32cOctOzbo4NzFPbaFhW5Y1XY/VThKY+cOnPAMCorfvdFjG3zm+ixe0zb+ElN2SQ0eaV 6Fjw== 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:sender:dkim-signature; bh=ENd7sSyq/iEYvgSgyS1HxAHWvKgBszoennu7z1+uEUw=; b=rAblzNORG8Q47N7rqL7XyS+2Jx+keP/SVD0BjV6ohQ2+PEbP+5MpKP1OUeqAQnUVAf wsK+FcS3T/SplEfEubGRPjUSGBxN2r5fRDuxkv+sAO63Nirx8oXB/hXQtHHqIrYSN6b1 RsKiJ+6NaD0vsUIVEbw1FEuvNDxVopQZ4D9m7xkh1+tgipuyv2jOgpmdSsgw+mO0uupo plM7LWxh7AounkPtgRexOnMoILwq1e2K9hw3toKTzTiUaVHghGXVwUEMh/21Ecl9vE8j 9afbSacq7xSpLSHRYrDCivdDMH1aEccM2SctsVMS1wNTw4tZKasDX66bJ27/nXvgu9hA g9Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kF4HUvN2; 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 p21si10881610eds.559.2021.06.06.05.33.36; Sun, 06 Jun 2021 05:34:12 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kF4HUvN2; 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 S230104AbhFFMcM (ORCPT + 99 others); Sun, 6 Jun 2021 08:32:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbhFFMcJ (ORCPT ); Sun, 6 Jun 2021 08:32:09 -0400 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 213E6C061766; Sun, 6 Jun 2021 05:30:20 -0700 (PDT) Received: by mail-oi1-x230.google.com with SMTP id z3so15091768oib.5; Sun, 06 Jun 2021 05:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ENd7sSyq/iEYvgSgyS1HxAHWvKgBszoennu7z1+uEUw=; b=kF4HUvN2KAuEhbH3GAYIzOvQB69iaHttxskOZ9HfBu713RIjsxLLPNNeMDZBg/3VR/ 1V6V59CcL1+YoL9DowoU+CyWEKdkv2fQQq4YC4qpoI/vqsK5G/3THnpfmgbIhxU+WYFa 5JAd5ZF+pYvslR7P8LqdHnyunrqcAbpHESVhG53P4CUg1k/NRk3xA8uIZRjPPlvXKxHb pGgHykbEAnkdHrRJahH4UmHpkD4her0sLydk96rJIfAsdKVTOGa/F6MrV+dSfbJKOJhB 0KKeCyLDzjk9THL3OQFztUdWBnzI0kXKvLWWrTate/Lha/UXygdY5UTABigCm/Rgksqh Uu7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=ENd7sSyq/iEYvgSgyS1HxAHWvKgBszoennu7z1+uEUw=; b=gGn+TcavHIC+zEAM+AO0ONdgG3/ZAwMvtFvZlgyXAAXqcPOmPiG6aXrmN5Qur0Zqu/ TVG6va1ADaYitAI7R3plKGUO7BHzJHkgv+4MXg7Y+DmKqz4t2VvYfHTMknN2jdNN2fVO cE7adfvHFo3NiQZT432PT6a0d7ObfZwNGBcUGKyEbvuCcs2aAvt9i2ePbKiUa/JS8FoA ZtclHiWoGmuBNh93T4U4RI34oWtvc8RgWXRt937QimqtJzjHu18OvmvbOPLI0DXoDNi1 Q/+ejAHuvG+VJSsmDyO1Imd/vpjhFh+V3l6ijb68HoU9rjPndRzdOS1Tkx8kCe0casnQ X5Cg== X-Gm-Message-State: AOAM5305mU46lGfVNxLK2ddTVhVZYWfqH3lSVheQ2kqNLlFilOA/K4iO 9Z44jNi4kyogLBlil7m6Puk= X-Received: by 2002:aca:efc1:: with SMTP id n184mr16525909oih.23.1622982619340; Sun, 06 Jun 2021 05:30:19 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id w200sm1621336oie.10.2021.06.06.05.30.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Jun 2021 05:30:18 -0700 (PDT) Sender: Guenter Roeck Date: Sun, 6 Jun 2021 05:30:17 -0700 From: Guenter Roeck To: Kyle Tso Cc: heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org, badhri@google.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: typec: tcpm: Do not finish VDM AMS for retrying Responses Message-ID: <20210606123017.GA2886010@roeck-us.net> References: <20210606081452.764032-1-kyletso@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210606081452.764032-1-kyletso@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 06, 2021 at 04:14:52PM +0800, Kyle Tso wrote: > If the VDM responses couldn't be sent successfully, it doesn't need to > finish the AMS until the retry count reaches the limit. > > Fixes: 0908c5aca31e ("usb: typec: tcpm: AMS and Collision Avoidance") > Signed-off-by: Kyle Tso Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/tcpm.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index 0db685d5d9c0..08fabe1fc31d 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -1965,6 +1965,9 @@ static void vdm_run_state_machine(struct tcpm_port *port) > tcpm_log(port, "VDM Tx error, retry"); > port->vdm_retries++; > port->vdm_state = VDM_STATE_READY; > + if (PD_VDO_SVDM(vdo_hdr) && PD_VDO_CMDT(vdo_hdr) == CMDT_INIT) > + tcpm_ams_finish(port); > + } else { > tcpm_ams_finish(port); > } > break; > -- > 2.32.0.rc1.229.g3e70b5a671-goog >