Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp671901rdb; Thu, 15 Feb 2024 11:34:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWQKv8fxMUeTpOEZVz6mbyTMAU+PXdU+c3FdphMnpsOorA6yInoVWzWGsGEhdLc0SmT7H3spvAxG/Z0Gg23I5nQcvdEWvzSZD70cT5qRA== X-Google-Smtp-Source: AGHT+IGlE4jtOM/CM+pq8Iv2C2UcgwFOxsl2F571Ml2NmKr5T7SOwmSAmniXPbc3EWK34EaYyfIQ X-Received: by 2002:ac8:7185:0:b0:42d:d4de:f19c with SMTP id w5-20020ac87185000000b0042dd4def19cmr1347041qto.14.1708025659726; Thu, 15 Feb 2024 11:34:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708025659; cv=pass; d=google.com; s=arc-20160816; b=wvIwQsm7w4w801PYVykPhuKA8QMdQ0ROm86LsDjUZUYyphXwzYPvFvEIvvMjuIeZNe D277ABIRlz1xdgJZwYIuJOJdof/cpZH/ltzmbnvF8NQ6xultpWFjhI2STVmhWfaknV9K ALee9dMBVRuwemlMmQMEUDpCGsIw/ETuA1yPrluCy28FMbi1uskGiXZ84VCV/K/iCSgx J1Z4ZdJVzTzp4Dd9tVXhh8+XrqM4wXUp6g3QZZCEobLhzJ5ohUZ38wN90Onc4uQSuLNH t1Yuo3k7eE/7vnZnFYtV3JQLZfAkIVRS2HU06zDZT3ma1PVXEnzU/kp1jw2FZxmCCZvd 4DSg== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67589-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p22-20020ac87416000000b0042c6b42aa88si1926269qtq.653.2024.02.15.11.34.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 11:34:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67589-linux.lists.archive=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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67589-linux.lists.archive=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 79B441C2400F for ; Thu, 15 Feb 2024 19:34:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F03CC13A254; Thu, 15 Feb 2024 19:34:08 +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=20Jirman?= 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 Content-Transfer-Encoding: 8bit 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; -- 2.43.0