[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241030142833.v2.7.Ic14738918e3d026fa2d85e95fb68f8e07a0828d0@changeid>
Date: Wed, 30 Oct 2024 14:28:38 -0700
From: Abhishek Pandit-Subedi <abhishekpandit@...omium.org>
To: heikki.krogerus@...ux.intel.com,
tzungbi@...nel.org,
linux-usb@...r.kernel.org,
chrome-platform@...ts.linux.dev
Cc: dmitry.baryshkov@...aro.org,
jthies@...gle.com,
akuchynski@...gle.com,
pmalani@...omium.org,
Abhishek Pandit-Subedi <abhishekpandit@...omium.org>,
Benson Leung <bleung@...omium.org>,
Guenter Roeck <groeck@...omium.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 7/7] platform/chrome: cros_ec_typec: Disable tbt auto_enter
Altmodes with cros_ec are either automatically entered by the EC or
entered by the AP if TBT or USB4 are supported on the system. Due to the
security risk of PCIe tunneling, TBT modes should not be auto entered by
the kernel at this time and will require user intervention.
With this change, a userspace program will need to explicitly activate
the thunderbolt mode on the partner in order to enter the mode and the
thunderbolt driver will not automatically enter when a partner is
connected.
Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@...omium.org>
---
Changes in v2:
- Only disable auto-enter for Thunderbolt
- Update commit message to clearly indicate the need for userspace
intervention to enter TBT mode
drivers/platform/chrome/cros_ec_typec.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index 3e043b1c1cc8..aadd2704e445 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -313,7 +313,8 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec,
if (typec->ap_driven_altmode) {
memset(&desc, 0, sizeof(desc));
desc.svid = USB_TYPEC_TBT_SID;
- desc.mode = TYPEC_ANY_MODE;
+ desc.mode = USB_TYPEC_TBT_MODE;
+ desc.no_auto_enter = true;
amode = cros_typec_register_thunderbolt(port, &desc);
if (IS_ERR(amode))
return PTR_ERR(amode);
--
2.47.0.163.g1226f6d8fa-goog
Powered by blists - more mailing lists