-
Notifications
You must be signed in to change notification settings - Fork 0
/
m
142 lines (135 loc) · 9.38 KB
/
m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
Return-Path: <[email protected]>
X-Original-To: lists [email protected]
Delivered-To: lists [email protected]
Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20])
by mail.lfdr.de (Postfix) with ESMTP id 0D3B5781E79
for <lists [email protected]>; Sun, 20 Aug 2023 17:15:10 0200 (CEST)
Received: ([email protected]) by vger.kernel.org via listexpand
id S231305AbjHTPPH (ORCPT <rfc822;lists [email protected]>);
Sun, 20 Aug 2023 11:15:07 -0400
Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47720 "EHLO
lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
with ESMTP id S231278AbjHTPPF (ORCPT
<rfc822;[email protected]>); Sun, 20 Aug 2023 11:15:05 -0400
Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2072.outbound.protection.outlook.com [40.107.22.72])
by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DF691988
for <[email protected]>; Sun, 20 Aug 2023 08:11:07 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=eRk eo yBHyVhlL0N0abfYdoRBwhKZBmkIMiUYX5QWaCEVrEt5A 0GRtHXOeP92lyPtGb/vhUT9dirjwv66v6doCJH9YsLLE/TCVLNTvTsbiJv1v5gAhwbG8WV u3lCebXHeqXtvr9G6AkFWwXoWlDG7SsuDPX/S1LPyW pQ2Xy9dWXCYsEKr5Yuhng6GZUXl8jM4qrzqHeJL5N1xG9W4KRRgIGBPvlX7N0KGrxNTK13hO7MX8ppOt1BkUcetLVgAz82OYdsSIS56OGoLjCOO D1GUw9W J26urGsOwWWZIKws3lT vTKM0DSvR2cBuIpRGAP7q1pMrQzjwm/0ewjQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=HzC5cBWMvvz84Qp1MR45JcJOnQydpoCPMHHUUCXHO38=;
b=c/6EeLlWvmbgtizCDYXyZ MePmUp1R8hKeKgqglZMSd c/N4jlvZNutvKG1y0175U0xbsSKdH0NHcTejdzIxYecEu4pSryo4pAJSRtmxwnTRoS9F8FZIqXs/8XY1lI bHNq4tmUsFEt0m8uCkJAQjSj/LI r9f5PtA6uhlF6behf49ljjUktMW9oIODK258bsckvBkH E4/aNk03839fbRUY7332nC2ktM5K4puY0LITK6Dn1laMtmnlPhoKXLD9EmJuwKb9SeUvFiG2fokiTUmMHjqWVdfiF00Jh 8UV85brOIjtdy5TkUP/bNdMgxjABGkGmUC6lt8fr9UjoPb9Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass
header.d=nxp.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=HzC5cBWMvvz84Qp1MR45JcJOnQydpoCPMHHUUCXHO38=;
b=mIqVfK1YtYsjEEN1MXDpd144WCfWfemw34n/igK30kziBn0jka3bQSur04LWbwezUH9ql8Sb7BoA5IkpbK4vppteHsb5lgpSEn0y P7N5i0sDLOYULf971vgq5of95p350bWLfF2 Qrn648vfIUaq8bo1I3KH43AoKYRjppDmVs=
Authentication-Results: dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=nxp.com;
Received: from DB7PR04MB4505.eurprd04.prod.outlook.com (2603:10a6:5:39::26) by
DU2PR04MB8983.eurprd04.prod.outlook.com (2603:10a6:10:2e2::7) with Microsoft
SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.20.6678.29; Sun, 20 Aug 2023 15:11:04 0000
Received: from DB7PR04MB4505.eurprd04.prod.outlook.com
([fe80::6444:e07a:e7f7:3923]) by DB7PR04MB4505.eurprd04.prod.outlook.com
([fe80::6444:e07a:e7f7:3923%6]) with mapi id 15.20.6699.020; Sun, 20 Aug 2023
15:11:04 0000
From: Xu Yang <[email protected]>
Subject: [PATCH] usb: typec: tcpm: reset counter when enter into unattached state after try role
Date: Sun, 20 Aug 2023 23:15:18 0800
Message-Id: <[email protected]>
X-Mailer: git-send-email 2.34.1
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: SG2PR02CA0131.apcprd02.prod.outlook.com
(2603:1096:4:188::6) To DB7PR04MB4505.eurprd04.prod.outlook.com
(2603:10a6:5:39::26)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DB7PR04MB4505:EE_|DU2PR04MB8983:EE_
X-MS-Office365-Filtering-Correlation-Id: 68bfd753-3c3c-402a-a75e-08dba18fac01
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: E13bmrXMtZxqNpxTsXm9SMiR7FHRQnGdrNOQCsGcy7sm5mksfZTD7suT8vFeveWAz IWANHvIdpz4BQf2mn35c6nuLSw6GDG25jDZHsadapppnPnmcmKdbFXJbkUeuhEyM4tXVDatFFCEDZMFzgmPIA8ipKZWyEd70DcrTIL5CZXDe5LHQ8PA3AiymZfoZPgkf2fai8V/1WWjsoUbwUdr8D/XS8C50n9cLdfUtD5b16SUf2zLEf8tHic9LMOmP9YCiuxhridLUUOMSxHEQdilT3zZCAgxESciZQvBtCjgVGim0Ntz9B3XDOt3xKCZv0ytu3m4LnD5VVsGSYjh YjllvCBtqhrV1d pLUMEuQM2yo0NBuE9jq0bwv6hDjSafYBfidzCFTxnic8Vp4H83mXCHhE46t ymLdpyuxpQS/rcZDp/j8Ha ZMqn7VLral8f9UU2f4wxqM73 k2Pq6gSyChsDiWAzjqJ1RbDJXCcP0pVfHnw4QIjgxbXojbbS4okRXbP2wY//ETo3m57e6nVvcFdaqGNeokOuD0D1GVC9IHE87qpXm6HcdyG7IHgrBXpv8eGXXeyveGmxzKFR8zxaSVHSWwsNUDx5EYNXZ/F9zs=
X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR04MB4505.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(376002)(136003)(39850400004)(366004)(451199024)(186009)(1800799009)(316002)(66946007)(66556008)(66476007)(41300700001)(5660300002)(38100700002)(38350700002)(4326008)(8676002)(8936002)(26005)(2906002)(4744005)(478600001)(86362001)(6506007)(6512007)(36756003)(52116002)(6666004)(6486002)(1076003)(2616005);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Rawb0H05pQn0HwfIypoCHeNCDbrBNDWqTmyXcaDIfYAxQqxY52y0dAjg5K53?=
=?us-ascii?Q?2g MfJZzFj8oLYEwP45cqww0zS5wLtaiMaH3cPHftYuWhhVoBT7CcDj92xJ ?=
=?us-ascii?Q?XQoubZYPxMs78nEsYRuUlHc2rHnNzNcwsygZ2mq7 RxFoOD2mQwHn7dSB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1XqcD24mnIapjTZxt RZMBC1Jdjm Gmv9ExsjZD?=
=?us-ascii?Q?aEreZxU2YMi2cfqSXMU8Pu0gHRzQGPJs7 cUuI7Hw79gkF9hVCr1V3wrM74c?=
=?us-ascii?Q?j8 sagHn4 tSNHL5P8UEthdDTyfHNYzy8bzOCw3MaZPcA/lO3jYLbcNNgNgh?=
=?us-ascii?Q?DhpAQlJ6YKHyTrMeqPI tbSbiG9aN9YwNAN2DrpVYN/xfCya0My03UOlu5P ?=
=?us-ascii?Q?Gb9chlfCoKJuzPzmF9Hqq03AUKKgthWemY7kw3vriSSndxR1SFXHghddF1vy?=
=?us-ascii?Q?JHWX1KPsUlBsMtb1hwkW1xcpkuyreir1RbJpEN06WzlayH8BcAO3aISCgGXo?=
=?us-ascii?Q?7GZZkCcVw49y63Hu86G/yQL1iEYHGaOXWqcsZL0eIJodY824I7sOgmIDqsBR?=
=?us-ascii?Q?0XPAZVtuYdMldEJrSn1JuxxMVZ6Y1FHFQ9daaAnoi85GNyBuG87mGJBhYrEY?=
=?us-ascii?Q?iJZgGmyRFWuZr6EPR/HLbJVugbfsNVUAF14Ru/bX87yDKYxKo4PoSlwiTnP6?=
=?us-ascii?Q? ytpkiD1sMOHDp6FPXb b05W498KNWLjKQ0TA8QC?=
X-OriginatorOrg: nxp.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 68bfd753-3c3c-402a-a75e-08dba18fac01
X-MS-Exchange-CrossTenant-AuthSource: DB7PR04MB4505.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2023 15:11:04.4682
(UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: EolPVObJR3WxdbZ9mQoG8WPv/d2NUmvdpXf1lhfdSoB9w8KGqsofvCfVoxur0Z/kZFtaVtHF/hezTmouABqCxg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8983
X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,
RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
lindbergh.monkeyblade.net
Precedence: bulk
List-ID: <linux-usb.vger.kernel.org>
X-Mailing-List: [email protected]
The try_src_count and try_snk_count may still be 1 after enter into
unattached state. This may be caused by below case:
- SNK_TRY->SNK_TRY_WAIT->SRC_TRYWAIT->SNK_UNATTACHED
- SRC_TRY->SRC_TRY_WAIT->SNK_TRYWAIT->SNK_UNATTACHED
The port->attached is not true at the end and tcpm_reset_port() will not
be called. This will reset counter into for these cases, otherwise the tcpm
won't try role when new cable attached.
Signed-off-by: Xu Yang <[email protected]>
---
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 5639b9a1e0bf..c9a186a8c58c 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
b/drivers/usb/typec/tcpm/tcpm.c
@@ -3719,6 3719,9 @@ static void tcpm_detach(struct tcpm_port *port)
if (tcpm_port_is_disconnected(port))
port->hard_reset_count = 0;
port->try_src_count = 0;
port->try_snk_count = 0;
if (!port->attached)
return;
--
2.34.1