Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp351725pxb; Thu, 26 Aug 2021 04:51:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGqJmCqEl8M7wO+j6kPz4g0X61NVs+NFoMcsN6DnymdUt+DrVhdAOR3Fo74oNLPczqx64x X-Received: by 2002:a5e:d60e:: with SMTP id w14mr2653419iom.135.1629978672472; Thu, 26 Aug 2021 04:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629978672; cv=none; d=google.com; s=arc-20160816; b=qpyoC0nWLrdYhyeBIW1kcCFVAMn2vvsg7RlXCr+CF04BiLYE5xz3VLsQXrZJrUtEfF zXPpau2SHz945wYBjfPFCbgdjq1q8/Yi8aBQCRYbuYGvq7ljrk+mWueco7ly5j5VvZ8d U9BJg6HXjbBBMGivjCc1mruauD0Ok3V5Ik0GZz7BbPLakSUhMiAI2QlXSFhjl+doU7bA D7qRi13yIGsvl1PmVD0f5ESD/ZQQ88gY18CscmfiYoneG7DQCyAgQnDA+QR2GpWVxUWx JKq9OCi+fWRk7E21JD9qOyIBBaRB9MyYw6VbUNIIYsj49yPiAS9gcSinBAbq+JnJIOa+ Y2uw== 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=eGi/V7zyo0J+MA1A+aJKgTVyYRUdkl1GKuKc5VAP2N8=; b=bOFTsKP97qjzOmEKjzs04/zGZn4pELakukZo1i/V+10WCKpdmN1tfb4QrqqZ13kxga m7x9jjN0z+C3ARUxD5S1K40yK+yyYyKGJPlMNsAaPGT6Ov6GShype85gj2d0f8+7F+Ux WFRx6VqqKFAawpS6cBvtijSzOqOcHX0zAYAeOYtoaJFjCsxnD9oqt1GJx+SVHy0oj1hO xiTPjIbsJ3p+owkWIsICr09zQ9Ggc1u+xGg/HeFCH3jlGkhRyibsoNT8q5QMRLDRdzou /CUUZTdkSRVs/b1M0ybf67iJtBj2VSgSFxke97x/IxS6SZt2PF/hFDSh+Yq92385uLQP NvgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jFxIa3zS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si2518673ioo.37.2021.08.26.04.51.00; Thu, 26 Aug 2021 04:51: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=@linuxfoundation.org header.s=korg header.b=jFxIa3zS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242267AbhHZLti (ORCPT + 99 others); Thu, 26 Aug 2021 07:49:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:42198 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233829AbhHZLtg (ORCPT ); Thu, 26 Aug 2021 07:49:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C833761002; Thu, 26 Aug 2021 11:48:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1629978529; bh=5eIeVxoctzWgFmx2RW/0E9lnkFB8VE2eB8wk0K2Y9mM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jFxIa3zS3qh98lGeqCaFuH1g32dMabFj/VPYPSX7ZMC7pPo1sMc/ybgpe1g9RId+f ImlJk3XhS9T5oBGSdvM7TKwt0T18ZWeSOYUUmY8F2WimkZnYuCK12RYC74M2Tl81g0 m4x5XPjPamJdnZxOZE2M9EDxoLIh+pjFEdlzcGjE= Date: Thu, 26 Aug 2021 13:48:45 +0200 From: Greg KH To: Kyle Tso Cc: linux@roeck-us.net, heikki.krogerus@linux.intel.com, badhri@google.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: typec: tcpm: Raise vdm_sm_running flag only when VDM SM is running Message-ID: References: <20210816075449.2236547-1-kyletso@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210816075449.2236547-1-kyletso@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 16, 2021 at 03:54:49PM +0800, Kyle Tso wrote: > If the port is going to send Discover_Identity Message, vdm_sm_running > flag was intentionally set before entering Ready States in order to > avoid the conflict because the port and the port partner might start > AMS at almost the same time after entering Ready States. > > However, the original design has a problem. When the port is doing > DR_SWAP from Device to Host, it raises the flag. Later in the > tcpm_send_discover_work, the flag blocks the procedure of sending the > Discover_Identity and it might never be cleared until disconnection. > > Since there exists another flag send_discover representing that the port > is going to send Discover_Identity or not, it is enough to use that flag > to prevent the conflict. Also change the timing of the set/clear of > vdm_sm_running to indicate whether the VDM SM is actually running or > not. > > Fixes: c34e85fa69b9 ("usb: typec: tcpm: Send DISCOVER_IDENTITY from dedicated work") > Cc: Badhri Jagan Sridharan > Signed-off-by: Kyle Tso > --- > drivers/usb/typec/tcpm/tcpm.c | 81 ++++++++++++++++------------------- > 1 file changed, 38 insertions(+), 43 deletions(-) This does not apply to my usb-linus branch :( Please rebase and resend, collecting the acks that others have done. thanks, greg k-h