Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp338848rdb; Wed, 17 Jan 2024 03:48:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IFgdk3t7N+6JoCGUBWEEhacZxu06AlKtdFRsz18O86LrJckeg0Hn4HOggZj9/tUNw3Vs5C1 X-Received: by 2002:a05:6402:1286:b0:551:ec48:66ea with SMTP id w6-20020a056402128600b00551ec4866eamr763537edv.30.1705492085864; Wed, 17 Jan 2024 03:48:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705492085; cv=pass; d=google.com; s=arc-20160816; b=ixULA6h2C23XS+ydvveqVNRpDb8/YwZ9rPB88UwyRion8+m4jt4oZXUXGitR7rpBUr TR1J0gc0T6RFJQzj6yqJ61xNwqtT/1KBo6LigPCEvw/YeXHyOJRnGFEUwBBLGLcPZ+Fq HYg/P6bZIR60bTpbPxjasKLaa2TJ4SklxYIM3aliNjtcIel8lHKZ9GlvTVRRWAopYPtl yPw6mG328HDqTtQjHvboJY4vEDbqLLM1RdPe2VTWJvtBdw7KqdCFKW7n+pJZxYFRWfSN EnT4I03O46l5Zgrg3lAga9jERO/JQ44VEMcxkg3QliuCBgt0J+yw7nJi0NzwQJ2nEEsJ nzBg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=W4MUqY7qziRkIoVCBAjHtlR0P63yXdlU8r3ZOJ0yHa4=; fh=B+oj6DUB0h1EkKUqYsLPup2ZsjMvE42iJbI7wEnAyok=; b=OAVvCymL4D2jgf09qlS74lhWLBr9ZrzOiikVB/mRbfPZyU/2urO8QI8fCOMN5P6AxW eEfkv3VXSR7rQIQ37m/ShaMw3rKZS10uusJB/UuxlVs32poxt4AqQpcC28dg3bvbFvQz BxrRLKGM8O6xwar+j2TjIys74Kg+BoObR4T/uLZB1GkuxjNUraQKlfQB7sc2sTzYHmOm dyBbSxCk4JOkFe8gQbVLz577Zf0c8OywjzSnjS9QTdaBNrN+9r8QYoFncrwHkTV7+8lJ mJJ9j4CdwxRe3hYyLausSuEwg37zeNLZXHBK2oQY/YCiiAYWGMravv7CcUZJLviXzoPZ GQ3g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=EwsqLbLw; arc=pass (i=1 spf=pass spfdomain=flex--badhri.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-28928-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28928-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ee17-20020a056402291100b00559bb837a0dsi1184136edb.539.2024.01.17.03.48.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 03:48:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28928-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=EwsqLbLw; arc=pass (i=1 spf=pass spfdomain=flex--badhri.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-28928-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28928-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8B0331F23EF4 for ; Wed, 17 Jan 2024 11:48:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D8E41DFE1; Wed, 17 Jan 2024 11:47:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="EwsqLbLw" Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 37D571D697 for ; Wed, 17 Jan 2024 11:47:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705492068; cv=none; b=VESMJNMk945lEsdMD7gU6poSA6Jl2KH2zck8DUZdvbg+18cUuxY3vjhQGWZnKSqQTVsQYoM+tRbvS9MLgXUao+lJa7bQ86/GiC+AgAtqXTmmSXwUv1BrGf5f4WuNAH/ZRsWrY8k6qHrHYunf5Vob9M+xdfBcKAdoGkgMlGP0iXE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705492068; c=relaxed/simple; bh=Nui8zu8V3ndYddOaheaEne/imbsV07hHxFFahrvH2Sg=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Date: Mime-Version:X-Mailer:Message-ID:Subject:From:To:Cc:Content-Type; b=NIwt3HVCTMtoeUAR7mruhiK114qTKoCNUjL7qgNXj5v7bmDrYLzj+Vhdh6vN6chZgpY+KybmM7BcAw4utx9vSqXwDtAK+/6CXeg9IZwTJK09kZQcZr2Up62uvzQCTyn/f6zwm+RTbyAFCLgtdayvSwMlLc4LM47o7ZshtHB2+Go= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--badhri.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=EwsqLbLw; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--badhri.bounces.google.com Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-28bc9e1f43eso11160901a91.0 for ; Wed, 17 Jan 2024 03:47:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1705492065; x=1706096865; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=W4MUqY7qziRkIoVCBAjHtlR0P63yXdlU8r3ZOJ0yHa4=; b=EwsqLbLwrHC+6uec1zex3MPtORgYgWFtDZ6TP9jbVleJwmOBNJmyr49VRSFO3xKtje tGYknPHymYsxUZuWNYD7QahGByjQ8hFrsaaTDJa3YLPSshOgLuHfvBgWdqMHRse4FPVW mtm6xhudADl1OiO6tb1Xi1PSTh9mBlTQgWcxMHrCcERYI5QzBfS8G5YRc1yJcWAqP50Q J4iVDzbXCiI73XO8EP4KFFC8WZ/hYrG8uaViZVgTSYV9hvt3Yb/YvoBvNqtvS42MYLQp p0IOJ/qZpVVGdY4m8NoXLdWY5fm8P8R6ySNszP/bxDBtnjsjaOhM61w89c+A9ymhyN6a LrzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705492065; x=1706096865; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=W4MUqY7qziRkIoVCBAjHtlR0P63yXdlU8r3ZOJ0yHa4=; b=Mn/6kjpNdHwqIfmV+vHV72hnOTajzyA2WvCtUgCQxan+oKTRXag+ri6sqyvfUENlIG iAfrqIkMkMpNpI6R1wfnWGo3W0eI1rIu4qXRYB7GdiDjwQiV2A954Av2dCOdXpWqphhc 0mxhSIoH36FEwg19TZun9dQgOiFnsmwZlwtSYc9ssjIa1NRxOz+eRp4UF1A7Uu+dgDBB AVyAAcBbgt12OYo8/gZp5RMzH8jUcTwIquWUxtBCckw9eoxXXm/h/HDJGVpQmgmLX44Y AMPGfTgqaOUOPWci3HdvvCtEWHqM7vMuFW0NCVf2LV37wpXiDIB6I0PjFomXxOVs6qoJ Hn+A== X-Gm-Message-State: AOJu0Ywq/HzkZlrGe0KrLqXgAixu5uqw8EW31lRA8pJXDMVvOcHlko4r tZcbuZPZvIm3xTWQEtdw1R+6HL54kU9xNnEsZQ== X-Received: from badhri.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:6442]) (user=badhri job=sendgmr) by 2002:a17:90b:5292:b0:28b:d1dc:8836 with SMTP id si18-20020a17090b529200b0028bd1dc8836mr381586pjb.5.1705492065692; Wed, 17 Jan 2024 03:47:45 -0800 (PST) Date: Wed, 17 Jan 2024 11:47:42 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog Message-ID: <20240117114742.2587779-1-badhri@google.com> Subject: [PATCH v2] Revert "usb: typec: tcpm: fix cc role at port reset" From: Badhri Jagan Sridharan To: gregkh@linuxfoundation.org, linux@roeck-us.net, heikki.krogerus@linux.intel.com Cc: kyletso@google.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, rdbabiera@google.com, amitsd@google.com, stable@vger.kernel.org, frank.wang@rock-chips.com, Badhri Jagan Sridharan Content-Type: text/plain; charset="UTF-8" This reverts commit 1e35f074399dece73d5df11847d4a0d7a6f49434. Given that ERROR_RECOVERY calls into PORT_RESET for Hi-Zing the CC pins, setting CC pins to default state during PORT_RESET breaks error recovery. 4.5.2.2.2.1 ErrorRecovery State Requirements The port shall not drive VBUS or VCONN, and shall present a high-impedance to ground (above zOPEN) on its CC1 and CC2 pins. Hi-Zing the CC pins is the inteded behavior for PORT_RESET. CC pins are set to default state after tErrorRecovery in PORT_RESET_WAIT_OFF. 4.5.2.2.2.2 Exiting From ErrorRecovery State A Sink shall transition to Unattached.SNK after tErrorRecovery. A Source shall transition to Unattached.SRC after tErrorRecovery. Cc: stable@vger.kernel.org Cc: Frank Wang Fixes: 1e35f074399d ("usb: typec: tcpm: fix cc role at port reset") Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 5945e3a2b0f7..9d410718eaf4 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -4876,8 +4876,7 @@ static void run_state_machine(struct tcpm_port *port) break; case PORT_RESET: tcpm_reset_port(port); - tcpm_set_cc(port, tcpm_default_state(port) == SNK_UNATTACHED ? - TYPEC_CC_RD : tcpm_rp_cc(port)); + tcpm_set_cc(port, TYPEC_CC_OPEN); tcpm_set_state(port, PORT_RESET_WAIT_OFF, PD_T_ERROR_RECOVERY); break; base-commit: 933bb7b878ddd0f8c094db45551a7daddf806e00 -- 2.43.0.429.g432eaa2c6b-goog