From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B906BC433F5 for ; Mon, 11 Oct 2021 14:02:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2BEB61278 for ; Mon, 11 Oct 2021 14:02:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236746AbhJKOE6 (ORCPT ); Mon, 11 Oct 2021 10:04:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:49408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238139AbhJKOCK (ORCPT ); Mon, 11 Oct 2021 10:02:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 73B9660E94; Mon, 11 Oct 2021 13:57:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633960669; bh=liZqNcJSbnDwL22mpQ707l6zN/3eIvncyziWN3sfxFA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dCsEhqiY14caznpAJxx/0xr0SW2BTJ8NL1u5WaRWNc3UcTBiZhyRtK1Y22gpUagji YcEw3EM9Z0lXdpY4Vs4OPORYGqmy371X0HigP8kEKV7TrEfaQcnPXs1z0HtxyFhKQ4 /ywYG+IGFhFnshyEyHXGyqNWcclnaFxb9fW6Vk0I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guenter Roeck , Heikki Krogerus , Xu Yang Subject: [PATCH 5.14 008/151] usb: typec: tcpm: handle SRC_STARTUP state if cc changes Date: Mon, 11 Oct 2021 15:44:40 +0200 Message-Id: <20211011134518.110954801@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134517.833565002@linuxfoundation.org> References: <20211011134517.833565002@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xu Yang commit 6d91017a295e9790eec02c4e43f020cdb55f5d98 upstream. TCPM for DRP should do the same action as SRC_ATTACHED when cc changes in SRC_STARTUP state. Otherwise, TCPM will transition to SRC_UNATTACHED state which is not satisfied with the Type-C spec. Per Type-C spec: DRP port should move to Unattached.SNK instead of Unattached.SRC if sink removed. Fixes: 4b4e02c83167 ("typec: tcpm: Move out of staging") cc: Reviewed-by: Guenter Roeck Acked-by: Heikki Krogerus Signed-off-by: Xu Yang Link: https://lore.kernel.org/r/20210928111639.3854174-1-xu.yang_2@nxp.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/typec/tcpm/tcpm.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -4846,6 +4846,7 @@ static void _tcpm_cc_change(struct tcpm_ tcpm_set_state(port, SRC_ATTACH_WAIT, 0); break; case SRC_ATTACHED: + case SRC_STARTUP: case SRC_SEND_CAPABILITIES: case SRC_READY: if (tcpm_port_is_disconnected(port) ||