]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Dec 2022 14:35:15 +0000 (15:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Dec 2022 14:35:15 +0000 (15:35 +0100)
added patches:
extcon-usbc-tusb320-call-the-type-c-irq-handler-only-if-a-port-is-registered.patch

queue-5.15/extcon-usbc-tusb320-call-the-type-c-irq-handler-only-if-a-port-is-registered.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/extcon-usbc-tusb320-call-the-type-c-irq-handler-only-if-a-port-is-registered.patch b/queue-5.15/extcon-usbc-tusb320-call-the-type-c-irq-handler-only-if-a-port-is-registered.patch
new file mode 100644 (file)
index 0000000..76728a2
--- /dev/null
@@ -0,0 +1,42 @@
+From 341fd15e2e18c24d5c738496cfc3d7a272241201 Mon Sep 17 00:00:00 2001
+From: Yassine Oudjana <y.oudjana@protonmail.com>
+Date: Mon, 7 Nov 2022 18:33:17 +0300
+Subject: extcon: usbc-tusb320: Call the Type-C IRQ handler only if a port is registered
+
+From: Yassine Oudjana <y.oudjana@protonmail.com>
+
+commit 341fd15e2e18c24d5c738496cfc3d7a272241201 upstream.
+
+Commit bf7571c00dca ("extcon: usbc-tusb320: Add USB TYPE-C support")
+added an optional Type-C interface to the driver but missed to check
+if it is in use when calling the IRQ handler. This causes an oops on
+devices currently using the old extcon interface. Check if a Type-C
+port is registered before calling the Type-C IRQ handler.
+
+Fixes: bf7571c00dca ("extcon: usbc-tusb320: Add USB TYPE-C support")
+Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
+Reviewed-by: Marek Vasut <marex@denx.de>
+Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
+Link: https://lore.kernel.org/r/20221107153317.657803-1-y.oudjana@protonmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/extcon/extcon-usbc-tusb320.c |    8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/drivers/extcon/extcon-usbc-tusb320.c
++++ b/drivers/extcon/extcon-usbc-tusb320.c
+@@ -327,7 +327,13 @@ static irqreturn_t tusb320_state_update_
+               return IRQ_NONE;
+       tusb320_extcon_irq_handler(priv, reg);
+-      tusb320_typec_irq_handler(priv, reg);
++
++      /*
++       * Type-C support is optional. Only call the Type-C handler if a
++       * port had been registered previously.
++       */
++      if (priv->port)
++              tusb320_typec_irq_handler(priv, reg);
+       regmap_write(priv->regmap, TUSB320_REG9, reg);
index 2f76265e0583236753ba6e6dafb91385f758ee21..c581c5143a0ed8533b60803afe7d09aad712b063 100644 (file)
@@ -728,3 +728,4 @@ scsi-qla2xxx-fix-crash-when-i-o-abort-times-out.patch
 net-stmmac-fix-errno-when-create_singlethread_workqueue-fails.patch
 media-dvbdev-fix-build-warning-due-to-comments.patch
 media-dvbdev-fix-refcnt-bug.patch
+extcon-usbc-tusb320-call-the-type-c-irq-handler-only-if-a-port-is-registered.patch