Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1615875pxb; Mon, 11 Oct 2021 09:32:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwehkGyPBqxn3t9VGEaAO3pzvE3JCmARxCia40F9ugXCEmwALSDopoqov1YYPogKhdy9Vrl X-Received: by 2002:a05:6402:21ef:: with SMTP id ce15mr41666540edb.19.1633969964851; Mon, 11 Oct 2021 09:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633969964; cv=none; d=google.com; s=arc-20160816; b=je3j8ycyn+PyUdldywExELxs38Mv9eaWhl7zV4d5hHA4NS9LY68hxOSm7429AVozK5 jAdxLgczdecfajHagjUs7+OkMoHJTCS0UCtUNP6/UW4yG7b3lUeT7OUyH1Y/v556yBK2 FftciUBWQegN5k55I0SSHpdU9pqcSwjdcnLKnDyTLBE2V5jn2caoaCZjkEO3uqXmICb5 c9iOw6hEUx+qMcj+tA6ybMVsd2mxwCi9o/xbZIei8RfOozKqGhym5GhQc/KU2VuTSx/D Gs3h0U23wESsd1FNaA1ngar9Sdr4XG/KdssIScHG/JFd2kDQvqsJol2V1g1z9ZzZZ//4 wwOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=W0I1XaL9YTMo0GsICgIg6XfUaA4DdOEFi5Oy4/FbDCs=; b=zkBsxfH/khmS+NJUoPbkMcgBtUg8zeeGLtHIouhq7ofGiAxHpouoSEIXD0L4H0+49s vTApvWRS8QuDZt5ceS0OY715uy+hZhF/osPJKH0bANBKV6LvF398BwbQcsqFBq5/2y2a w7rqIFY4RktNGXPXzohsbf5nuGcmbAqdB9UupY1wyu4I+LsGUsHchGRnYUlJxeLOCy1v kjv2edVssHy8nEpO2zAR9LlGpJ1yFNM2lH1XvxVimj/KyjaIzAwh7upOqzNUoI2rTxZJ sPs/8xSlwCSzIhcP9k7/jnaP2nCTOXo65zASPZMHmIhWP8eu/uV+RlV9hMKtokt8xVXu Mlfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wgkGysMk; 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 c11si13058144ejm.510.2021.10.11.09.32.20; Mon, 11 Oct 2021 09:32:44 -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=wgkGysMk; 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 S237516AbhJKN4q (ORCPT + 99 others); Mon, 11 Oct 2021 09:56:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:40614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237818AbhJKNyp (ORCPT ); Mon, 11 Oct 2021 09:54:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 49FE1610C7; Mon, 11 Oct 2021 13:52:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633960351; bh=hxLPLFEEOip7IrS/05/cNzSz8oozAA/DJyozwFDDfSM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wgkGysMkDAAQQSguUJWrhy/+jr5kM9t0ipZ+VXInhUu03ZZjv9LLwTSij3tbRXpEu H+pB7fcBu7WRV7PKQOMhe/OWgp62RcRO+Gw9ZxZnrqI508bcDGgOwl9p8NiIIL2jiA sdTwSZ0VEFr/uB8ceuaBKsdLjYsrKH5rLyzyAmmg= 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.10 05/83] usb: typec: tcpm: handle SRC_STARTUP state if cc changes Date: Mon, 11 Oct 2021 15:45:25 +0200 Message-Id: <20211011134508.543738609@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134508.362906295@linuxfoundation.org> References: <20211011134508.362906295@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 @@ -3922,6 +3922,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) ||