]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.10
authorSasha Levin <sashal@kernel.org>
Sun, 10 Sep 2023 14:39:25 +0000 (10:39 -0400)
committerSasha Levin <sashal@kernel.org>
Sun, 10 Sep 2023 14:39:25 +0000 (10:39 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.10/series
queue-5.10/usb-typec-tcpci-clear-the-fault-status-bit.patch [new file with mode: 0644]

index b23513a59fe518e3824dae50e23fb88f082ffbe7..1b0417a0521c372db5d2596a8353f03ec177bfbd 100644 (file)
@@ -307,3 +307,4 @@ usb-typec-bus-verify-partner-exists-in-typec_altmode_attention.patch
 usb-core-unite-old-scheme-and-new-scheme-descriptor-reads.patch
 usb-core-change-usb_get_device_descriptor-api.patch
 usb-core-fix-race-by-not-overwriting-udev-descriptor-in-hub_port_init.patch
+usb-typec-tcpci-clear-the-fault-status-bit.patch
diff --git a/queue-5.10/usb-typec-tcpci-clear-the-fault-status-bit.patch b/queue-5.10/usb-typec-tcpci-clear-the-fault-status-bit.patch
new file mode 100644 (file)
index 0000000..b76625e
--- /dev/null
@@ -0,0 +1,65 @@
+From d0826dc415fe6cfe1ff2f139572bae7353e977b7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 16 Aug 2023 14:25:02 -0300
+Subject: usb: typec: tcpci: clear the fault status bit
+
+From: Marco Felsch <m.felsch@pengutronix.de>
+
+[ Upstream commit 23e60c8daf5ec2ab1b731310761b668745fcf6ed ]
+
+According the "USB Type-C Port Controller Interface Specification v2.0"
+the TCPC sets the fault status register bit-7
+(AllRegistersResetToDefault) once the registers have been reset to
+their default values.
+
+This triggers an alert(-irq) on PTN5110 devices albeit we do mask the
+fault-irq, which may cause a kernel hang. Fix this generically by writing
+a one to the corresponding bit-7.
+
+Cc: stable@vger.kernel.org
+Fixes: 74e656d6b055 ("staging: typec: Type-C Port Controller Interface driver (tcpci)")
+Reported-by: "Angus Ainslie (Purism)" <angus@akkea.ca>
+Closes: https://lore.kernel.org/all/20190508002749.14816-2-angus@akkea.ca/
+Reported-by: Christian Bach <christian.bach@scs.ch>
+Closes: https://lore.kernel.org/regressions/ZR0P278MB07737E5F1D48632897D51AC3EB329@ZR0P278MB0773.CHEP278.PROD.OUTLOOK.COM/t/
+Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
+Signed-off-by: Fabio Estevam <festevam@denx.de>
+Reviewed-by: Guenter Roeck <linux@roeck-us.net>
+Link: https://lore.kernel.org/r/20230816172502.1155079-1-festevam@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/usb/typec/tcpm/tcpci.c | 4 ++++
+ drivers/usb/typec/tcpm/tcpci.h | 1 +
+ 2 files changed, 5 insertions(+)
+
+diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
+index 069affa5cb1ee..e34e46df80243 100644
+--- a/drivers/usb/typec/tcpm/tcpci.c
++++ b/drivers/usb/typec/tcpm/tcpci.c
+@@ -475,6 +475,10 @@ static int tcpci_init(struct tcpc_dev *tcpc)
+       if (time_after(jiffies, timeout))
+               return -ETIMEDOUT;
++      ret = tcpci_write16(tcpci, TCPC_FAULT_STATUS, TCPC_FAULT_STATUS_ALL_REG_RST_TO_DEFAULT);
++      if (ret < 0)
++              return ret;
++
+       /* Handle vendor init */
+       if (tcpci->data->init) {
+               ret = tcpci->data->init(tcpci, tcpci->data);
+diff --git a/drivers/usb/typec/tcpm/tcpci.h b/drivers/usb/typec/tcpm/tcpci.h
+index 5ef07a56d67aa..95ce89139c6ef 100644
+--- a/drivers/usb/typec/tcpm/tcpci.h
++++ b/drivers/usb/typec/tcpm/tcpci.h
+@@ -84,6 +84,7 @@
+ #define TCPC_POWER_STATUS_VBUS_PRES   BIT(2)
+ #define TCPC_FAULT_STATUS             0x1f
++#define TCPC_FAULT_STATUS_ALL_REG_RST_TO_DEFAULT BIT(7)
+ #define TCPC_ALERT_EXTENDED           0x21
+-- 
+2.40.1
+