Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp34955rdb; Mon, 18 Sep 2023 07:39:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFxA+3npJw3Td+Pb5FwOVDQHG2GyfLTckPocSLf+7VU9020ximD1LVPjGcL7rKou+HYoy5R X-Received: by 2002:a17:903:60e:b0:1c4:6cc2:a27e with SMTP id kg14-20020a170903060e00b001c46cc2a27emr4144182plb.69.1695047948238; Mon, 18 Sep 2023 07:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695047948; cv=none; d=google.com; s=arc-20160816; b=TM8cc4b5awqFd7rqpTR/qmNZzpKBwJ5GiNS4VXFBwRxpGQkuAhtXcSU/+kkRzYMGAe fUITFbx1ZOVIyItsET43GM3VBcdb10LSCveh1BN3BW9ukbTv68N2H82k+CS6XsJjwd6U hYuDeQrJiphe7tZrroNaNqFTmnFdh2W+gbwtbJaDp8Z9+5JINQYoUkWqrT+Bqr70D+/d To8SiplzgF6q1g4dIGBno7f7CZbsfim+23znql7Wxa2C2XtiUmyf8m0IvZm7MRRp0K+H RFLDPYaq2ToONCQjplI2wOiwdHz1SWCBRx+7xG960owXhf06WuboJnTZ8edFLP9ZAilI Y3gQ== 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=a89TqUZ0FZuSVKHBlTK3rutroaAJnEDSfdkUCgJ1rdY=; fh=Ud1JS9nXVkJYi7ZoANfeo/NBtOWUNR+KzQ5xJ3I1hM4=; b=X5tjB5QVAgHFO+rd/Y+gzKFU6DkK9eFxTzK96BNkrbdQ04QWNVQxS1Ka6YH8549vKF e1mz1B1IOPYKtmOSZMPmJSrxQEZTotXrFCvTiO5x6QIeqMwtNwXCBwe7G3awcL0CVCUg zp1XUTokQVeEI5T4XgED6XKp7WcUeyFnahTCOyUQDVMPFOiXVdbsxv4/EGdafn+d+yTd yjTFVN7/WqYo9jzjceQhLkDWscjINxDJlBD9kDnnqWN8x4CfvGAYkQLzgUyt7IKrv7qF c9BjJneKUJAKQ6BLU0DWwRHXzowD0g9vJy6cGHUfWxZhc0UHX0sDv5d1DPe6cEyO8wnE dTeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="MomIUwP/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id t10-20020a170902e84a00b001bba953ac2esi8623310plg.339.2023.09.18.07.39.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 07:39:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="MomIUwP/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 69F858030D30; Mon, 18 Sep 2023 03:32:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241243AbjIRKb4 (ORCPT + 99 others); Mon, 18 Sep 2023 06:31:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241248AbjIRKbe (ORCPT ); Mon, 18 Sep 2023 06:31:34 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75F81D9; Mon, 18 Sep 2023 03:31:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695033088; x=1726569088; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=MdFmQamjzg5uG3QQj1WFkrbL/ippuubUhgQZmGyME44=; b=MomIUwP/LikLmhP+HSh7JOR38xLye4bvicFoQL17BZ2DwsCbqYIlIZil exaUsH7A+221ZgxOGM8osDtu334y1hMOENMDQ58JHA3B5YbsomI9aGheZ rWqDqeITO/wzEGQ145lUK5YaVCM0j5YvDVGBHtAQgPYF3T/c52keZHYA4 Jp/2zDdDTrnhAbJT0v2VDJoH0tM5hLbwrTFr7K/fRp8kwXdKqa9/65x4Z B4hywHnIBe0kDWb0Q1lpv6Jh2WEXDr1AI7S9anO3JKa2NE7g7gf1AuZ/F b84UN07KTMqegVa/EQppuYlqL7qMiHnezHYYHn4aGErBIgYIPI55fOI09 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10836"; a="359036235" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="359036235" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2023 03:31:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10836"; a="835970674" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="835970674" Received: from kuha.fi.intel.com ([10.237.72.185]) by FMSMGA003.fm.intel.com with SMTP; 18 Sep 2023 03:31:25 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Mon, 18 Sep 2023 13:31:24 +0300 Date: Mon, 18 Sep 2023 13:31:24 +0300 From: Heikki Krogerus To: Michael Wu Cc: linux@roeck-us.net, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb:typec:tcpm:support double Rp to Vbus cable as sink Message-ID: References: <20230914003154.27977-1-michael@allwinnertech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230914003154.27977-1-michael@allwinnertech.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 18 Sep 2023 03:32:23 -0700 (PDT) On Thu, Sep 14, 2023 at 08:31:54AM +0800, Michael Wu wrote: > The USB Type-C Cable and Connector Specification defines the wire > connections for the USB Type-C to USB 2.0 Standard-A cable assembly > (Release 2.2, Chapter 3.5.2). > The Notes says that Pin A5 (CC) of the USB Type-C plug shall be connected > to Vbus through a resister Rp. > However, there is a large amount of such double Rp connected to Vbus > non-standard cables which produced by UGREEN circulating on the market, and > it can affects the normal operations of the state machine easily, > especially to CC1 and CC2 be pulled up at the same time. > In fact, we can regard those cables as sink to avoid abnormal state. > > Message as follow: > [ 58.900212] VBUS on > [ 59.265433] CC1: 0 -> 3, CC2: 0 -> 3 [state TOGGLING, polarity 0, connected] > [ 62.623308] CC1: 3 -> 0, CC2: 3 -> 0 [state TOGGLING, polarity 0, disconnected] > [ 62.625006] VBUS off > [ 62.625012] VBUS VSAFE0V > > Signed-off-by: Michael Wu > --- > drivers/usb/typec/tcpm/tcpm.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index d962f67c95ae6..beb7143128667 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -519,7 +519,8 @@ static const char * const pd_rev[] = { > > #define tcpm_port_is_sink(port) \ > ((tcpm_cc_is_sink((port)->cc1) && !tcpm_cc_is_sink((port)->cc2)) || \ > - (tcpm_cc_is_sink((port)->cc2) && !tcpm_cc_is_sink((port)->cc1))) > + (tcpm_cc_is_sink((port)->cc2) && !tcpm_cc_is_sink((port)->cc1)) || \ > + (tcpm_cc_is_sink((port)->cc1) && tcpm_cc_is_sink((port)->cc2))) > > #define tcpm_cc_is_source(cc) ((cc) == TYPEC_CC_RD) > #define tcpm_cc_is_audio(cc) ((cc) == TYPEC_CC_RA) This look OK to me, but I would still like to wait for comments from Guenter - just in case. thanks, -- heikki