Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp325390pxf; Thu, 18 Mar 2021 00:48:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqHuHymxJRv2WjXlvK44BZx2r3VGkUeq46bQT55FgvCx48+3Ogn4q1k3ug3rL+MgGTuY/H X-Received: by 2002:a17:906:ca02:: with SMTP id jt2mr39700769ejb.312.1616053687437; Thu, 18 Mar 2021 00:48:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616053687; cv=none; d=google.com; s=arc-20160816; b=Qh5PdwGe7jdZRFoPip39emyXQzZrc98YRpZV8537cRV+RiCl/+Mldqk0WipCi6lfQ6 CGZBjdrA8Egk+Sjf9ZEdgrf53XRJw4epa2zmTOq9ZSvGdDlQfs9+YmFVbsfbOP+VdwmE /oJAZy9zf1lxbNd5spzELqGXulJ6meTZeBoOMoONidwOGyDQNK4VM0jbs5/ECiv48lmP icLe8S58yE57/x5DM7SlRs0ltJTsAsuhubagK1IAKatLHvxIW2bBxe9NimTXROvD3yrJ 1UbyvQmKsXiVCgoiMRft84HUx2aklYDcXHs32Aemgeo7tKDWG/MS/M4SEsDDFF7lxmyc 2f+A== 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:ironport-sdr :ironport-sdr; bh=Hj62irxHwXZZlnq+wjz919HAqCelE9vWsHgh9lSDtG0=; b=ORr9FUcC6cTCCRTW2K63+/34RDZ6xzMMNS9oEicbA9/GFbB5aiC0r9+APOsAMG+as2 5aIRXxEUgd5Hh+WOeOiLWsUIDoQZfL0/ms0U2zMjrpoSlW5yn/MPMLFcqHsJ37CJmQ1N axj1ztDyFeZPrxHrcsMJeqCeHs+deq50Kc8PKylEOOrA+A0kGTzyWmLCwhJHWc8nKYXi J8d5nkUzIs692gwqqwCq5mTC8zwhHohj4p2+ZINEczg3ejwb7OacqzbjGT1aYt5ngs+7 QATSoHPDxP6OUte14jxqC0MS2PDNOB0Ekia8LEznYurTAWVwDetswkX73tiLdGdjgyca U/Zg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si974781edv.488.2021.03.18.00.47.44; Thu, 18 Mar 2021 00:48:07 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229712AbhCRHqt (ORCPT + 99 others); Thu, 18 Mar 2021 03:46:49 -0400 Received: from mga02.intel.com ([134.134.136.20]:56852 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229559AbhCRHqq (ORCPT ); Thu, 18 Mar 2021 03:46:46 -0400 IronPort-SDR: hZSCAXDf4+xCl2M1dURLAuNY9zQ9fmTKxj3QX4oywcgvqOYZmkuppBMZ8RiL/xj70Boo4pVBPf OpToGRsMw+fA== X-IronPort-AV: E=McAfee;i="6000,8403,9926"; a="176754624" X-IronPort-AV: E=Sophos;i="5.81,257,1610438400"; d="scan'208";a="176754624" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 00:46:45 -0700 IronPort-SDR: bJY+i5jTopDL5s+varut7NkUmH/LGg42WFaFyk/Osa8R/Au8lCvllNkyG3XAcjl6OAjxf/rsAF Dtawzqnkt9tw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,257,1610438400"; d="scan'208";a="512018798" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 18 Mar 2021 00:46:42 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Thu, 18 Mar 2021 09:46:42 +0200 Date: Thu, 18 Mar 2021 09:46:42 +0200 From: Heikki Krogerus To: Badhri Jagan Sridharan Cc: Guenter Roeck , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v1] usb: typec: tcpm: Skip sink_cap query only when VDM sm is busy Message-ID: References: <20210318064805.3747831-1-badhri@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210318064805.3747831-1-badhri@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 17, 2021 at 11:48:05PM -0700, Badhri Jagan Sridharan wrote: > When port partner responds "Not supported" to the DiscIdentity command, > VDM state machine can remain in NVDM_STATE_ERR_TMOUT and this causes > querying sink cap to be skipped indefinitely. Hence check for > vdm_sm_running instead of checking for VDM_STATE_DONE. > > Fixes: 8dc4bd073663f ("usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)") > Signed-off-by: Badhri Jagan Sridharan Acked-by: Heikki Krogerus > --- > drivers/usb/typec/tcpm/tcpm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index 11d0c40bc47d..39e068d60755 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -5219,7 +5219,7 @@ static void tcpm_enable_frs_work(struct kthread_work *work) > goto unlock; > > /* Send when the state machine is idle */ > - if (port->state != SNK_READY || port->vdm_state != VDM_STATE_DONE || port->send_discover) > + if (port->state != SNK_READY || port->vdm_sm_running || port->send_discover) > goto resched; > > port->upcoming_state = GET_SINK_CAP; > -- > 2.31.0.rc2.261.g7f71774620-goog thanks, -- heikki