summaryrefslogtreecommitdiff
path: root/drivers/usb/core/hub.c
diff options
context:
space:
mode:
authorJason Liu <jason.hui.liu@nxp.com>2022-09-26 12:56:22 -0500
committerJason Liu <jason.hui.liu@nxp.com>2022-09-26 12:56:22 -0500
commit2b53d4d52360709aebc699b18fde867a571b8c39 (patch)
treec2ff72465262fbd327e6e09361154c52047ef792 /drivers/usb/core/hub.c
parent36363d8623ba60858e2632b7d2b70dae932c9a8b (diff)
parent3e98e33d345e981800e03dd29f6f6343286d30b6 (diff)
Merge tag 'v5.15.70' into lf-5.15.y
This is the 5.15.70 stable release * tag 'v5.15.70': (2444 commits) Linux 5.15.70 ALSA: hda/sigmatel: Fix unused variable warning for beep power change cgroup: Add missing cpus_read_lock() to cgroup_attach_task_all() ... Signed-off-by: Jason Liu <jason.hui.liu@nxp.com> Conflicts: arch/arm/boot/dts/imx6ul.dtsi arch/arm/mm/mmu.c arch/arm64/boot/dts/freescale/imx8mp-evk.dts drivers/gpu/drm/imx/dcss/dcss-kms.c drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.h drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c drivers/soc/fsl/Kconfig drivers/soc/imx/gpcv2.c drivers/usb/dwc3/host.c net/dsa/slave.c sound/soc/fsl/imx-card.c
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r--drivers/usb/core/hub.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 292013bb35d5..7947147f7612 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -6044,6 +6044,11 @@ re_enumerate_no_bos:
* the reset is over (using their post_reset method).
*
* Return: The same as for usb_reset_and_verify_device().
+ * However, if a reset is already in progress (for instance, if a
+ * driver doesn't have pre_ or post_reset() callbacks, and while
+ * being unbound or re-bound during the ongoing reset its disconnect()
+ * or probe() routine tries to perform a second, nested reset), the
+ * routine returns -EINPROGRESS.
*
* Note:
* The caller must own the device lock. For example, it's safe to use
@@ -6077,6 +6082,10 @@ int usb_reset_device(struct usb_device *udev)
return -EISDIR;
}
+ if (udev->reset_in_progress)
+ return -EINPROGRESS;
+ udev->reset_in_progress = 1;
+
port_dev = hub->ports[udev->portnum - 1];
/*
@@ -6141,6 +6150,7 @@ int usb_reset_device(struct usb_device *udev)
usb_autosuspend_device(udev);
memalloc_noio_restore(noio_flag);
+ udev->reset_in_progress = 0;
return ret;
}
EXPORT_SYMBOL_GPL(usb_reset_device);