]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 May 2023 02:18:05 +0000 (11:18 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 May 2023 02:18:05 +0000 (11:18 +0900)
added patches:
ima-allow-fix-uml-builds.patch
ipmi-fix-ssif-not-responding-under-certain-cond.patch
mips-fw-allow-firmware-to-pass-a-empty-env.patch
perf-sched-cast-pthread_stack_min-to-int-as-it-may-turn-into-sysconf-__sc_thread_stack_min_value.patch
staging-iio-resolver-ads1210-fix-config-mode.patch
stmmac-debugfs-entry-name-is-not-be-changed-when-udev-rename-device-name.patch
usb-dwc3-fix-runtime-pm-imbalance-on-unbind.patch
xhci-fix-debugfs-register-accesses-while-suspended.patch

queue-4.19/asoc-intel-bytcr_rt5640-add-quirk-for-the-acer-iconi.patch
queue-4.19/ima-allow-fix-uml-builds.patch [new file with mode: 0644]
queue-4.19/ipmi-fix-ssif-not-responding-under-certain-cond.patch [new file with mode: 0644]
queue-4.19/mips-fw-allow-firmware-to-pass-a-empty-env.patch [new file with mode: 0644]
queue-4.19/perf-sched-cast-pthread_stack_min-to-int-as-it-may-turn-into-sysconf-__sc_thread_stack_min_value.patch [new file with mode: 0644]
queue-4.19/series
queue-4.19/staging-iio-resolver-ads1210-fix-config-mode.patch [new file with mode: 0644]
queue-4.19/stmmac-debugfs-entry-name-is-not-be-changed-when-udev-rename-device-name.patch [new file with mode: 0644]
queue-4.19/usb-dwc3-fix-runtime-pm-imbalance-on-unbind.patch [new file with mode: 0644]
queue-4.19/xhci-fix-debugfs-register-accesses-while-suspended.patch [new file with mode: 0644]

index f805437f7c7b665f6ba9db6373d97f3a02b041ca..a2aa19329fba5044460f524bd35dd9eda4ba0de5 100644 (file)
@@ -19,14 +19,12 @@ Link: https://lore.kernel.org/r/20230322145332.131525-1-hdegoede@redhat.com
 Signed-off-by: Mark Brown <broonie@kernel.org>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- sound/soc/intel/boards/bytcr_rt5640.c | 12 ++++++++++++
+ sound/soc/intel/boards/bytcr_rt5640.c |   12 ++++++++++++
  1 file changed, 12 insertions(+)
 
-diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c
-index 2001bc774c643..d27dd170bedaf 100644
 --- a/sound/soc/intel/boards/bytcr_rt5640.c
 +++ b/sound/soc/intel/boards/bytcr_rt5640.c
-@@ -400,6 +400,18 @@ static int byt_rt5640_aif1_hw_params(struct snd_pcm_substream *substream,
+@@ -400,6 +400,18 @@ static int byt_rt5640_aif1_hw_params(str
  
  /* Please keep this list alphabetically sorted */
  static const struct dmi_system_id byt_rt5640_quirk_table[] = {
@@ -45,6 +43,3 @@ index 2001bc774c643..d27dd170bedaf 100644
        {       /* Acer Iconia Tab 8 W1-810 */
                .matches = {
                        DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Acer"),
--- 
-2.39.2
-
diff --git a/queue-4.19/ima-allow-fix-uml-builds.patch b/queue-4.19/ima-allow-fix-uml-builds.patch
new file mode 100644 (file)
index 0000000..4a704dc
--- /dev/null
@@ -0,0 +1,51 @@
+From 644f17412f5acf01a19af9d04a921937a2bc86c6 Mon Sep 17 00:00:00 2001
+From: Randy Dunlap <rdunlap@infradead.org>
+Date: Thu, 23 Feb 2023 19:27:03 -0800
+Subject: IMA: allow/fix UML builds
+
+From: Randy Dunlap <rdunlap@infradead.org>
+
+commit 644f17412f5acf01a19af9d04a921937a2bc86c6 upstream.
+
+UML supports HAS_IOMEM since 0bbadafdc49d (um: allow disabling
+NO_IOMEM).
+
+Current IMA build on UML fails on allmodconfig (with TCG_TPM=m):
+
+ld: security/integrity/ima/ima_queue.o: in function `ima_add_template_entry':
+ima_queue.c:(.text+0x2d9): undefined reference to `tpm_pcr_extend'
+ld: security/integrity/ima/ima_init.o: in function `ima_init':
+ima_init.c:(.init.text+0x43f): undefined reference to `tpm_default_chip'
+ld: security/integrity/ima/ima_crypto.o: in function `ima_calc_boot_aggregate_tfm':
+ima_crypto.c:(.text+0x1044): undefined reference to `tpm_pcr_read'
+ld: ima_crypto.c:(.text+0x10d8): undefined reference to `tpm_pcr_read'
+
+Modify the IMA Kconfig entry so that it selects TCG_TPM if HAS_IOMEM
+is set, regardless of the UML Kconfig setting.
+This updates TCG_TPM from =m to =y and fixes the linker errors.
+
+Fixes: f4a0391dfa91 ("ima: fix Kconfig dependencies")
+Cc: Stable <stable@vger.kernel.org> # v5.14+
+Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
+Cc: Fabio Estevam <festevam@gmail.com>
+Cc: Richard Weinberger <richard@nod.at>
+Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
+Cc: Johannes Berg <johannes@sipsolutions.net>
+Cc: linux-um@lists.infradead.org
+Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ security/integrity/ima/Kconfig |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/security/integrity/ima/Kconfig
++++ b/security/integrity/ima/Kconfig
+@@ -7,7 +7,7 @@ config IMA
+       select CRYPTO_HMAC
+       select CRYPTO_SHA1
+       select CRYPTO_HASH_INFO
+-      select TCG_TPM if HAS_IOMEM && !UML
++      select TCG_TPM if HAS_IOMEM
+       select TCG_TIS if TCG_TPM && X86
+       select TCG_CRB if TCG_TPM && ACPI
+       select TCG_IBMVTPM if TCG_TPM && PPC_PSERIES
diff --git a/queue-4.19/ipmi-fix-ssif-not-responding-under-certain-cond.patch b/queue-4.19/ipmi-fix-ssif-not-responding-under-certain-cond.patch
new file mode 100644 (file)
index 0000000..166feb2
--- /dev/null
@@ -0,0 +1,73 @@
+From 6d2555cde2918409b0331560e66f84a0ad4849c6 Mon Sep 17 00:00:00 2001
+From: Zhang Yuchen <zhangyuchen.lcr@bytedance.com>
+Date: Wed, 12 Apr 2023 15:49:07 +0800
+Subject: ipmi: fix SSIF not responding under certain cond.
+
+From: Zhang Yuchen <zhangyuchen.lcr@bytedance.com>
+
+commit 6d2555cde2918409b0331560e66f84a0ad4849c6 upstream.
+
+The ipmi communication is not restored after a specific version of BMC is
+upgraded on our server.
+The ipmi driver does not respond after printing the following log:
+
+    ipmi_ssif: Invalid response getting flags: 1c 1
+
+I found that after entering this branch, ssif_info->ssif_state always
+holds SSIF_GETTING_FLAGS and never return to IDLE.
+
+As a result, the driver cannot be loaded, because the driver status is
+checked during the unload process and must be IDLE in shutdown_ssif():
+
+        while (ssif_info->ssif_state != SSIF_IDLE)
+                schedule_timeout(1);
+
+The process trigger this problem is:
+
+1. One msg timeout and next msg start send, and call
+ssif_set_need_watch().
+
+2. ssif_set_need_watch()->watch_timeout()->start_flag_fetch() change
+ssif_state to SSIF_GETTING_FLAGS.
+
+3. In msg_done_handler() ssif_state == SSIF_GETTING_FLAGS, if an error
+message is received, the second branch does not modify the ssif_state.
+
+4. All retry action need IS_SSIF_IDLE() == True. Include retry action in
+watch_timeout(), msg_done_handler(). Sending msg does not work either.
+SSIF_IDLE is also checked in start_next_msg().
+
+5. The only thing that can be triggered in the SSIF driver is
+watch_timeout(), after destory_user(), this timer will stop too.
+
+So, if enter this branch, the ssif_state will remain SSIF_GETTING_FLAGS
+and can't send msg, no timer started, can't unload.
+
+We did a comparative test before and after adding this patch, and the
+result is effective.
+
+Fixes: 259307074bfc ("ipmi: Add SMBus interface driver (SSIF)")
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Zhang Yuchen <zhangyuchen.lcr@bytedance.com>
+Message-Id: <20230412074907.80046-1-zhangyuchen.lcr@bytedance.com>
+Signed-off-by: Corey Minyard <minyard@acm.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/char/ipmi/ipmi_ssif.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/char/ipmi/ipmi_ssif.c
++++ b/drivers/char/ipmi/ipmi_ssif.c
+@@ -772,9 +772,9 @@ static void msg_done_handler(struct ssif
+               } else if (data[0] != (IPMI_NETFN_APP_REQUEST | 1) << 2
+                          || data[1] != IPMI_GET_MSG_FLAGS_CMD) {
+                       /*
+-                       * Don't abort here, maybe it was a queued
+-                       * response to a previous command.
++                       * Recv error response, give up.
+                        */
++                      ssif_info->ssif_state = SSIF_IDLE;
+                       ipmi_ssif_unlock_cond(ssif_info, flags);
+                       pr_warn(PFX "Invalid response getting flags: %x %x\n",
+                               data[0], data[1]);
diff --git a/queue-4.19/mips-fw-allow-firmware-to-pass-a-empty-env.patch b/queue-4.19/mips-fw-allow-firmware-to-pass-a-empty-env.patch
new file mode 100644 (file)
index 0000000..43f29e9
--- /dev/null
@@ -0,0 +1,35 @@
+From ee1809ed7bc456a72dc8410b475b73021a3a68d5 Mon Sep 17 00:00:00 2001
+From: Jiaxun Yang <jiaxun.yang@flygoat.com>
+Date: Tue, 11 Apr 2023 12:14:26 +0100
+Subject: MIPS: fw: Allow firmware to pass a empty env
+
+From: Jiaxun Yang <jiaxun.yang@flygoat.com>
+
+commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.
+
+fw_getenv will use env entry to determine style of env,
+however it is legal for firmware to just pass a empty list.
+
+Check if first entry exist before running strchr to avoid
+null pointer dereference.
+
+Cc: stable@vger.kernel.org
+Link: https://github.com/clbr/n64bootloader/issues/5
+Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
+Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/mips/fw/lib/cmdline.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/mips/fw/lib/cmdline.c
++++ b/arch/mips/fw/lib/cmdline.c
+@@ -51,7 +51,7 @@ char *fw_getenv(char *envname)
+ {
+       char *result = NULL;
+-      if (_fw_envp != NULL) {
++      if (_fw_envp != NULL && fw_envp(0) != NULL) {
+               /*
+                * Return a pointer to the given environment variable.
+                * YAMON uses "name", "value" pairs, while U-Boot uses
diff --git a/queue-4.19/perf-sched-cast-pthread_stack_min-to-int-as-it-may-turn-into-sysconf-__sc_thread_stack_min_value.patch b/queue-4.19/perf-sched-cast-pthread_stack_min-to-int-as-it-may-turn-into-sysconf-__sc_thread_stack_min_value.patch
new file mode 100644 (file)
index 0000000..d176cc2
--- /dev/null
@@ -0,0 +1,49 @@
+From d08c84e01afa7a7eee6badab25d5420fa847f783 Mon Sep 17 00:00:00 2001
+From: Arnaldo Carvalho de Melo <acme@redhat.com>
+Date: Wed, 14 Jul 2021 13:06:38 -0300
+Subject: perf sched: Cast PTHREAD_STACK_MIN to int as it may turn into sysconf(__SC_THREAD_STACK_MIN_VALUE)
+
+From: Arnaldo Carvalho de Melo <acme@redhat.com>
+
+commit d08c84e01afa7a7eee6badab25d5420fa847f783 upstream.
+
+In fedora rawhide the PTHREAD_STACK_MIN define may end up expanded to a
+sysconf() call, and that will return 'long int', breaking the build:
+
+    45 fedora:rawhide                : FAIL gcc version 11.1.1 20210623 (Red Hat 11.1.1-6) (GCC)
+      builtin-sched.c: In function 'create_tasks':
+      /git/perf-5.14.0-rc1/tools/include/linux/kernel.h:43:24: error: comparison of distinct pointer types lacks a cast [-Werror]
+         43 |         (void) (&_max1 == &_max2);              \
+            |                        ^~
+      builtin-sched.c:673:34: note: in expansion of macro 'max'
+        673 |                         (size_t) max(16 * 1024, PTHREAD_STACK_MIN));
+            |                                  ^~~
+      cc1: all warnings being treated as errors
+
+  $ grep __sysconf /usr/include/*/*.h
+  /usr/include/bits/pthread_stack_min-dynamic.h:extern long int __sysconf (int __name) __THROW;
+  /usr/include/bits/pthread_stack_min-dynamic.h:#   define PTHREAD_STACK_MIN __sysconf (__SC_THREAD_STACK_MIN_VALUE)
+  /usr/include/bits/time.h:extern long int __sysconf (int);
+  /usr/include/bits/time.h:# define CLK_TCK ((__clock_t) __sysconf (2))        /* 2 is _SC_CLK_TCK */
+  $
+
+So cast it to int to cope with that.
+
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Cc: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/perf/builtin-sched.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/tools/perf/builtin-sched.c
++++ b/tools/perf/builtin-sched.c
+@@ -659,7 +659,7 @@ static void create_tasks(struct perf_sch
+       err = pthread_attr_init(&attr);
+       BUG_ON(err);
+       err = pthread_attr_setstacksize(&attr,
+-                      (size_t) max(16 * 1024, PTHREAD_STACK_MIN));
++                      (size_t) max(16 * 1024, (int)PTHREAD_STACK_MIN));
+       BUG_ON(err);
+       err = pthread_mutex_lock(&sched->start_work_mutex);
+       BUG_ON(err);
index 954c89604fa79bb5d92bfa075ceb9c50403fd0ae..935f6c645e179951727f43d62013a9318e1938a3 100644 (file)
@@ -3,3 +3,11 @@ bluetooth-perform-careful-capability-checks-in-hci_sock_ioctl.patch
 usb-serial-option-add-unisoc-vendor-and-tozed-lt70c-product.patch
 iio-adc-palmas_gpadc-fix-null-dereference-on-rmmod.patch
 asoc-intel-bytcr_rt5640-add-quirk-for-the-acer-iconi.patch
+stmmac-debugfs-entry-name-is-not-be-changed-when-udev-rename-device-name.patch
+ima-allow-fix-uml-builds.patch
+usb-dwc3-fix-runtime-pm-imbalance-on-unbind.patch
+perf-sched-cast-pthread_stack_min-to-int-as-it-may-turn-into-sysconf-__sc_thread_stack_min_value.patch
+staging-iio-resolver-ads1210-fix-config-mode.patch
+xhci-fix-debugfs-register-accesses-while-suspended.patch
+mips-fw-allow-firmware-to-pass-a-empty-env.patch
+ipmi-fix-ssif-not-responding-under-certain-cond.patch
diff --git a/queue-4.19/staging-iio-resolver-ads1210-fix-config-mode.patch b/queue-4.19/staging-iio-resolver-ads1210-fix-config-mode.patch
new file mode 100644 (file)
index 0000000..c5c9b78
--- /dev/null
@@ -0,0 +1,37 @@
+From 16313403d873ff17a587818b61f84c8cb4971cef Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nuno=20S=C3=A1?= <nuno.sa@analog.com>
+Date: Mon, 27 Mar 2023 16:54:14 +0200
+Subject: staging: iio: resolver: ads1210: fix config mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Nuno Sá <nuno.sa@analog.com>
+
+commit 16313403d873ff17a587818b61f84c8cb4971cef upstream.
+
+As stated in the device datasheet [1], bits a0 and a1 have to be set to
+1 for the configuration mode.
+
+[1]: https://www.analog.com/media/en/technical-documentation/data-sheets/ad2s1210.pdf
+
+Fixes: b19e9ad5e2cb9 ("staging:iio:resolver:ad2s1210 general driver cleanup")
+Cc: stable <stable@kernel.org>
+Signed-off-by: Nuno Sá <nuno.sa@analog.com>
+Link: https://lore.kernel.org/r/20230327145414.1505537-1-nuno.sa@analog.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/staging/iio/resolver/ad2s1210.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/iio/resolver/ad2s1210.c
++++ b/drivers/staging/iio/resolver/ad2s1210.c
+@@ -85,7 +85,7 @@ struct ad2s1210_state {
+ static const int ad2s1210_mode_vals[4][2] = {
+       [MOD_POS] = { 0, 0 },
+       [MOD_VEL] = { 0, 1 },
+-      [MOD_CONFIG] = { 1, 0 },
++      [MOD_CONFIG] = { 1, 1 },
+ };
+ static inline void ad2s1210_set_mode(enum ad2s1210_mode mode,
diff --git a/queue-4.19/stmmac-debugfs-entry-name-is-not-be-changed-when-udev-rename-device-name.patch b/queue-4.19/stmmac-debugfs-entry-name-is-not-be-changed-when-udev-rename-device-name.patch
new file mode 100644 (file)
index 0000000..95a8514
--- /dev/null
@@ -0,0 +1,82 @@
+From 481a7d154cbbd5ca355cc01cc8969876b240eded Mon Sep 17 00:00:00 2001
+From: Jiping Ma <jiping.ma2@windriver.com>
+Date: Tue, 7 Jan 2020 14:34:00 +0800
+Subject: stmmac: debugfs entry name is not be changed when udev rename device name.
+
+From: Jiping Ma <jiping.ma2@windriver.com>
+
+commit 481a7d154cbbd5ca355cc01cc8969876b240eded upstream.
+
+Add one notifier for udev changes net device name.
+Fixes: b6601323ef9e ("net: stmmac: debugfs entry name is not be changed when udev rename")
+
+Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Gou Hao <gouhao@uniontech.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |   32 ++++++++++++++++++++++
+ 1 file changed, 32 insertions(+)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+@@ -114,6 +114,7 @@ MODULE_PARM_DESC(chain_mode, "To use cha
+ static irqreturn_t stmmac_interrupt(int irq, void *dev_id);
+ #ifdef CONFIG_DEBUG_FS
++static const struct net_device_ops stmmac_netdev_ops;
+ static int stmmac_init_fs(struct net_device *dev);
+ static void stmmac_exit_fs(struct net_device *dev);
+ #endif
+@@ -4034,6 +4035,34 @@ static const struct file_operations stmm
+       .release = single_release,
+ };
++/* Use network device events to rename debugfs file entries.
++ */
++static int stmmac_device_event(struct notifier_block *unused,
++                             unsigned long event, void *ptr)
++{
++      struct net_device *dev = netdev_notifier_info_to_dev(ptr);
++      struct stmmac_priv *priv = netdev_priv(dev);
++
++      if (dev->netdev_ops != &stmmac_netdev_ops)
++              goto done;
++
++      switch (event) {
++      case NETDEV_CHANGENAME:
++              if (priv->dbgfs_dir)
++                      priv->dbgfs_dir = debugfs_rename(stmmac_fs_dir,
++                                                       priv->dbgfs_dir,
++                                                       stmmac_fs_dir,
++                                                       dev->name);
++              break;
++      }
++done:
++      return NOTIFY_DONE;
++}
++
++static struct notifier_block stmmac_notifier = {
++      .notifier_call = stmmac_device_event,
++};
++
+ static int stmmac_init_fs(struct net_device *dev)
+ {
+       struct stmmac_priv *priv = netdev_priv(dev);
+@@ -4072,6 +4101,8 @@ static int stmmac_init_fs(struct net_dev
+               return -ENOMEM;
+       }
++      register_netdevice_notifier(&stmmac_notifier);
++
+       return 0;
+ }
+@@ -4079,6 +4110,7 @@ static void stmmac_exit_fs(struct net_de
+ {
+       struct stmmac_priv *priv = netdev_priv(dev);
++      unregister_netdevice_notifier(&stmmac_notifier);
+       debugfs_remove_recursive(priv->dbgfs_dir);
+ }
+ #endif /* CONFIG_DEBUG_FS */
diff --git a/queue-4.19/usb-dwc3-fix-runtime-pm-imbalance-on-unbind.patch b/queue-4.19/usb-dwc3-fix-runtime-pm-imbalance-on-unbind.patch
new file mode 100644 (file)
index 0000000..f160eca
--- /dev/null
@@ -0,0 +1,34 @@
+From 44d257e9012ee8040e41d224d0e5bfb5ef5427ea Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan+linaro@kernel.org>
+Date: Tue, 4 Apr 2023 09:25:15 +0200
+Subject: USB: dwc3: fix runtime pm imbalance on unbind
+
+From: Johan Hovold <johan+linaro@kernel.org>
+
+commit 44d257e9012ee8040e41d224d0e5bfb5ef5427ea upstream.
+
+Make sure to balance the runtime PM usage count on driver unbind by
+adding back the pm_runtime_allow() call that had been erroneously
+removed.
+
+Fixes: 266d0493900a ("usb: dwc3: core: don't trigger runtime pm when remove driver")
+Cc: stable@vger.kernel.org     # 5.9
+Cc: Li Jun <jun.li@nxp.com>
+Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
+Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
+Link: https://lore.kernel.org/r/20230404072524.19014-3-johan+linaro@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/dwc3/core.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/usb/dwc3/core.c
++++ b/drivers/usb/dwc3/core.c
+@@ -1563,6 +1563,7 @@ static int dwc3_remove(struct platform_d
+       dwc3_core_exit(dwc);
+       dwc3_ulpi_exit(dwc);
++      pm_runtime_allow(&pdev->dev);
+       pm_runtime_disable(&pdev->dev);
+       pm_runtime_put_noidle(&pdev->dev);
+       pm_runtime_set_suspended(&pdev->dev);
diff --git a/queue-4.19/xhci-fix-debugfs-register-accesses-while-suspended.patch b/queue-4.19/xhci-fix-debugfs-register-accesses-while-suspended.patch
new file mode 100644 (file)
index 0000000..08d9821
--- /dev/null
@@ -0,0 +1,33 @@
+From 735baf1b23458f71a8b15cb924af22c9ff9cd125 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan+linaro@kernel.org>
+Date: Wed, 5 Apr 2023 11:03:42 +0200
+Subject: xhci: fix debugfs register accesses while suspended
+
+From: Johan Hovold <johan+linaro@kernel.org>
+
+commit 735baf1b23458f71a8b15cb924af22c9ff9cd125 upstream.
+
+Wire up the debugfs regset device pointer so that the controller is
+resumed before accessing registers to avoid crashing or locking up if it
+happens to be runtime suspended.
+
+Fixes: 02b6fdc2a153 ("usb: xhci: Add debugfs interface for xHCI driver")
+Cc: stable@vger.kernel.org # 4.15: 30332eeefec8: debugfs: regset32: Add Runtime PM support
+Cc: stable@vger.kernel.org # 4.15
+Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
+Link: https://lore.kernel.org/r/20230405090342.7363-1-johan+linaro@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/host/xhci-debugfs.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/usb/host/xhci-debugfs.c
++++ b/drivers/usb/host/xhci-debugfs.c
+@@ -132,6 +132,7 @@ static void xhci_debugfs_regset(struct x
+       regset->regs = regs;
+       regset->nregs = nregs;
+       regset->base = hcd->regs + base;
++      regset->dev = hcd->self.controller;
+       debugfs_create_regset32((const char *)rgs->name, 0444, parent, regset);
+ }