From patchwork Thu Feb 15 19:33:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ond=C5=99ej_Jirman?= X-Patchwork-Id: 201719 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp74678dyb; Thu, 15 Feb 2024 11:34:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUxPm4MWfPuVnsm4XwUZqAZLhRbx+Por/R3GqAyEQiU71mJLCyfQl6iLzJ1b2xS6NKIZ6KzUSzM78/Ekr029Y/X3TYzKQ== X-Google-Smtp-Source: AGHT+IGRWINzYQoBG5x2OcfyHA5UmpukpQpslwYJ5XxvlqY32HpADZedUpYRhJ1tcmnVPUFbRrWS X-Received: by 2002:a05:622a:15c6:b0:42c:6795:568d with SMTP id d6-20020a05622a15c600b0042c6795568dmr3198456qty.12.1708025667889; Thu, 15 Feb 2024 11:34:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708025667; cv=pass; d=google.com; s=arc-20160816; b=xPgsc83wJBtiT2IQounDFeWQ5wBeRinqzlVDX7orlMG6Lqwal3fPn1InNEvy8wNDJd oXgiAfFx05tERdz7o7h7hR6rP2bWnxDznOl7/T4JpiuBoGNYSrsvct8x8u8G9nQincVR VV2lLRZdByaM6tNT0r0nyHRkyV0KXXg/HS2cbVaiShzWTX77cbT1jcTQvF1pjHv0pmLz 5aJ3hUXOjPKrEbtHrUFd6yhUS8wv2flor9cYzFRL1ayzRBewvJrSWEEUXi0F8Qcys6PC 7lCo94wwZ7O7F8G2EIMJJ2pUqN8fxwvYsu+3sj8pXtpNKZYprv/Y2y0QNnLEKrC4kF5y nuLg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=Jk37+nLVWDV9af4rNfPFbZ3MtCowlPMO1ZEypY/JJBI=; fh=a1kzkIFaww/2WfNllHgcAkHrBWafO7ZK97WHcWyBezM=; b=g5SL5ED2OsSyCEq6X63OvxDWzIzR6Vqt90364/X1J3i1HvTDgCF2zZbRlfGnKr2ygl qQ9fCrF6YOBryQgHniALl1YZxySPJ1p0shX1Q10ZiMfz1YXMAliEb8IZqGgyijj6vGZv oImrU6oKT0E+8ZfSeQZvJdOJrJMkVwwcckF6ueL4jfM4LoVOX2ozQ7cQOP6MCM+c49sw udIbY61EfC+QEWyv18wfLzPQzqZ9UCYLeW/ylpR1AuaGxaFJ+s9oUsNjuXXsUoXR1hJV HcR0+jUQrgS8BLY27aqjZzThqKl+LwNLf16FYfJtcbwxf6QUTHXg7nn7cxl4ILvLTI/X q3iw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=g02ySvEJ; arc=pass (i=1 spf=pass spfdomain=xff.cz dkim=pass dkdomain=xff.cz dmarc=pass fromdomain=xff.cz); spf=pass (google.com: domain of linux-kernel+bounces-67589-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67589-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h8-20020ac87448000000b0042dbe72f60fsi1915515qtr.233.2024.02.15.11.34.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 11:34:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67589-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=g02ySvEJ; arc=pass (i=1 spf=pass spfdomain=xff.cz dkim=pass dkdomain=xff.cz dmarc=pass fromdomain=xff.cz); spf=pass (google.com: domain of linux-kernel+bounces-67589-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67589-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A97651C2404B for ; Thu, 15 Feb 2024 19:34:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B7C7E13A864; Thu, 15 Feb 2024 19:34:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xff.cz header.i=@xff.cz header.b="g02ySvEJ" Received: from vps.xff.cz (vps.xff.cz [195.181.215.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CAFB31386AE; Thu, 15 Feb 2024 19:34:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.181.215.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708025648; cv=none; b=hwqSypCUdgYvaU3H7bCMm+ML9UqidyM3hZvWBWDzQD6fAG1frSiF+6SLFNgZbw6nVbvR+dOB6XWFR8cu+M3LLa2oy4V+kPffTkmwoGY28j+3B3p5DNtIlgVxTPFa37OsinS+iAZhNJtVRZBQGWtwdqjyNyjRkswGSAUQSVMwqKo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708025648; c=relaxed/simple; bh=pwr40pe20aNMHUfTjs/G++NlbzwOhpj6C+tL7b0oO2A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YUUtOERJ3epL3o/nPj2XZQFUkl7E/1VE53S9ger5MyYvaYoD8alkWdm0Sk2v2pvXhKI/7EOZNHzoC2oG981jvlIt2n3wyi005+qw2ieEGLNpEwq9QZ7dRu+kOEhdR2fUGkuFDN5Yls5FkVLHo2ynFSF9CfD7sKVjMeoqNgm25hs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=xff.cz; spf=pass smtp.mailfrom=xff.cz; dkim=pass (1024-bit key) header.d=xff.cz header.i=@xff.cz header.b=g02ySvEJ; arc=none smtp.client-ip=195.181.215.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=xff.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xff.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xff.cz; s=mail; t=1708025635; bh=pwr40pe20aNMHUfTjs/G++NlbzwOhpj6C+tL7b0oO2A=; h=From:To:Cc:Subject:Date:From; b=g02ySvEJW41OZpOAIQqt+yYPmbgc12PSVMzwqFuTFh0V683CfHdTtB0FHTTmmxY30 7gjC18Wmp6M36jJ5KhHgC2rNnZ+3JqpJkU1SqX6bPQp6HMImVhsPMuYyqo3wEv/UH/ s7JFEWsqUUlRSlkFF+bZmE+8JFsTwtyOytylQ6NY= From: =?utf-8?q?Ond=C5=99ej_Jirman?= To: linux-usb@vger.kernel.org Cc: Ondrej Jirman , Guenter Roeck , Heikki Krogerus , Greg Kroah-Hartman , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] Revert "usb: typec: tcpm: reset counter when enter into unattached state after try role" Date: Thu, 15 Feb 2024 20:33:50 +0100 Message-ID: <20240215193352.1026707-1-megi@xff.cz> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790994722440024272 X-GMAIL-MSGID: 1790994722440024272 From: Ondrej Jirman The reverted commit makes the state machine only ever go from SRC_ATTACH_WAIT to SNK_TRY in endless loop when toggling. After revert it goes to SRC_ATTACHED after initially trying SNK_TRY earlier, as it should for toggling to ever detect the power source mode and the port is again able to provide power to attached power sinks. This reverts commit 2d6d80127006ae3da26b1f21a65eccf957f2d1e5. --- drivers/usb/typec/tcpm/tcpm.c | 3 --- 1 file changed, 3 deletions(-) See https://lore.kernel.org/all/odggrbbgjpardze76qiv57mw6tllisyu5sbrta37iadjzwamcv@qr3ubwnlzqqt/ for more. diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index f7d7daa60c8d..295ae7eb912c 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -3743,9 +3743,6 @@ 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;