From 1b0e35cd28ad683367923b91d8efa73eff86e1ef Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 22 Jan 2024 11:09:50 -0800 Subject: [PATCH] drop usb-dwc3-gadget-handle-ep0-request-dequeuing-properly.patch from 5.10 5.15 and 6.1 --- queue-5.10/series | 1 - ...andle-ep0-request-dequeuing-properly.patch | 67 ------------------- queue-5.15/series | 1 - ...andle-ep0-request-dequeuing-properly.patch | 67 ------------------- queue-6.1/series | 1 - ...andle-ep0-request-dequeuing-properly.patch | 67 ------------------- 6 files changed, 204 deletions(-) delete mode 100644 queue-5.10/usb-dwc3-gadget-handle-ep0-request-dequeuing-properly.patch delete mode 100644 queue-5.15/usb-dwc3-gadget-handle-ep0-request-dequeuing-properly.patch delete mode 100644 queue-6.1/usb-dwc3-gadget-handle-ep0-request-dequeuing-properly.patch diff --git a/queue-5.10/series b/queue-5.10/series index 6e0b718c772..2c32b22a2c5 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -210,7 +210,6 @@ binder-fix-race-between-mmput-and-do_exit.patch tick-sched-fix-idle-and-iowait-sleeptime-accounting-vs-cpu-hotplug.patch usb-phy-mxs-remove-config_usb_otg-condition-for-mxs_phy_is_otg_host.patch usb-dwc-ep0-update-request-status-in-dwc3_ep0_stall_restart.patch -usb-dwc3-gadget-handle-ep0-request-dequeuing-properly.patch revert-usb-dwc3-soft-reset-phy-on-probe-for-host.patch revert-usb-dwc3-don-t-reset-device-side-if-dwc3-was-configured-as-host-only.patch usb-chipidea-wait-controller-resume-finished-for-wakeup-irq.patch diff --git a/queue-5.10/usb-dwc3-gadget-handle-ep0-request-dequeuing-properly.patch b/queue-5.10/usb-dwc3-gadget-handle-ep0-request-dequeuing-properly.patch deleted file mode 100644 index a6be8e53307..00000000000 --- a/queue-5.10/usb-dwc3-gadget-handle-ep0-request-dequeuing-properly.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 730e12fbec53ab59dd807d981a204258a4cfb29a Mon Sep 17 00:00:00 2001 -From: Wesley Cheng -Date: Wed, 6 Dec 2023 12:18:14 -0800 -Subject: usb: dwc3: gadget: Handle EP0 request dequeuing properly - -From: Wesley Cheng - -commit 730e12fbec53ab59dd807d981a204258a4cfb29a upstream. - -Current EP0 dequeue path will share the same as other EPs. However, there -are some special considerations that need to be made for EP0 transfers: - - - EP0 transfers never transition into the started_list - - EP0 only has one active request at a time - -In case there is a vendor specific control message for a function over USB -FFS, then there is no guarantee on the timeline which the DATA/STATUS stage -is responded to. While this occurs, any attempt to end transfers on -non-control EPs will end up having the DWC3_EP_DELAY_STOP flag set, and -defer issuing of the end transfer command. If the USB FFS application -decides to timeout the control transfer, or if USB FFS AIO path exits, the -USB FFS driver will issue a call to usb_ep_dequeue() for the ep0 request. - -In case of the AIO exit path, the AIO FS blocks until all pending USB -requests utilizing the AIO path is completed. However, since the dequeue -of ep0 req does not happen properly, all non-control EPs with the -DWC3_EP_DELAY_STOP flag set will not be handled, and the AIO exit path will -be stuck waiting for the USB FFS data endpoints to receive a completion -callback. - -Fix is to utilize dwc3_ep0_reset_state() in the dequeue API to ensure EP0 -is brought back to the SETUP state, and ensures that any deferred end -transfer commands are handled. This also will end any active transfers -on EP0, compared to the previous implementation which directly called -giveback only. - -Fixes: fcd2def66392 ("usb: dwc3: gadget: Refactor dwc3_gadget_ep_dequeue") -Cc: stable -Signed-off-by: Wesley Cheng -Acked-by: Thinh Nguyen -Link: https://lore.kernel.org/r/20231206201814.32664-1-quic_wcheng@quicinc.com -Signed-off-by: Greg Kroah-Hartman ---- - drivers/usb/dwc3/gadget.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - ---- a/drivers/usb/dwc3/gadget.c -+++ b/drivers/usb/dwc3/gadget.c -@@ -1802,7 +1802,17 @@ static int dwc3_gadget_ep_dequeue(struct - - list_for_each_entry(r, &dep->pending_list, list) { - if (r == req) { -- dwc3_gadget_giveback(dep, req, -ECONNRESET); -+ /* -+ * Explicitly check for EP0/1 as dequeue for those -+ * EPs need to be handled differently. Control EP -+ * only deals with one USB req, and giveback will -+ * occur during dwc3_ep0_stall_and_restart(). EP0 -+ * requests are never added to started_list. -+ */ -+ if (dep->number > 1) -+ dwc3_gadget_giveback(dep, req, -ECONNRESET); -+ else -+ dwc3_ep0_reset_state(dwc); - goto out; - } - } diff --git a/queue-5.15/series b/queue-5.15/series index 28f9e9de0c7..b6dcdee6eb1 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -252,7 +252,6 @@ binder-fix-race-between-mmput-and-do_exit.patch tick-sched-fix-idle-and-iowait-sleeptime-accounting-vs-cpu-hotplug.patch usb-phy-mxs-remove-config_usb_otg-condition-for-mxs_phy_is_otg_host.patch usb-dwc-ep0-update-request-status-in-dwc3_ep0_stall_restart.patch -usb-dwc3-gadget-handle-ep0-request-dequeuing-properly.patch revert-usb-dwc3-soft-reset-phy-on-probe-for-host.patch revert-usb-dwc3-don-t-reset-device-side-if-dwc3-was-configured-as-host-only.patch usb-chipidea-wait-controller-resume-finished-for-wakeup-irq.patch diff --git a/queue-5.15/usb-dwc3-gadget-handle-ep0-request-dequeuing-properly.patch b/queue-5.15/usb-dwc3-gadget-handle-ep0-request-dequeuing-properly.patch deleted file mode 100644 index fa427df9b8e..00000000000 --- a/queue-5.15/usb-dwc3-gadget-handle-ep0-request-dequeuing-properly.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 730e12fbec53ab59dd807d981a204258a4cfb29a Mon Sep 17 00:00:00 2001 -From: Wesley Cheng -Date: Wed, 6 Dec 2023 12:18:14 -0800 -Subject: usb: dwc3: gadget: Handle EP0 request dequeuing properly - -From: Wesley Cheng - -commit 730e12fbec53ab59dd807d981a204258a4cfb29a upstream. - -Current EP0 dequeue path will share the same as other EPs. However, there -are some special considerations that need to be made for EP0 transfers: - - - EP0 transfers never transition into the started_list - - EP0 only has one active request at a time - -In case there is a vendor specific control message for a function over USB -FFS, then there is no guarantee on the timeline which the DATA/STATUS stage -is responded to. While this occurs, any attempt to end transfers on -non-control EPs will end up having the DWC3_EP_DELAY_STOP flag set, and -defer issuing of the end transfer command. If the USB FFS application -decides to timeout the control transfer, or if USB FFS AIO path exits, the -USB FFS driver will issue a call to usb_ep_dequeue() for the ep0 request. - -In case of the AIO exit path, the AIO FS blocks until all pending USB -requests utilizing the AIO path is completed. However, since the dequeue -of ep0 req does not happen properly, all non-control EPs with the -DWC3_EP_DELAY_STOP flag set will not be handled, and the AIO exit path will -be stuck waiting for the USB FFS data endpoints to receive a completion -callback. - -Fix is to utilize dwc3_ep0_reset_state() in the dequeue API to ensure EP0 -is brought back to the SETUP state, and ensures that any deferred end -transfer commands are handled. This also will end any active transfers -on EP0, compared to the previous implementation which directly called -giveback only. - -Fixes: fcd2def66392 ("usb: dwc3: gadget: Refactor dwc3_gadget_ep_dequeue") -Cc: stable -Signed-off-by: Wesley Cheng -Acked-by: Thinh Nguyen -Link: https://lore.kernel.org/r/20231206201814.32664-1-quic_wcheng@quicinc.com -Signed-off-by: Greg Kroah-Hartman ---- - drivers/usb/dwc3/gadget.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - ---- a/drivers/usb/dwc3/gadget.c -+++ b/drivers/usb/dwc3/gadget.c -@@ -2022,7 +2022,17 @@ static int dwc3_gadget_ep_dequeue(struct - - list_for_each_entry(r, &dep->pending_list, list) { - if (r == req) { -- dwc3_gadget_giveback(dep, req, -ECONNRESET); -+ /* -+ * Explicitly check for EP0/1 as dequeue for those -+ * EPs need to be handled differently. Control EP -+ * only deals with one USB req, and giveback will -+ * occur during dwc3_ep0_stall_and_restart(). EP0 -+ * requests are never added to started_list. -+ */ -+ if (dep->number > 1) -+ dwc3_gadget_giveback(dep, req, -ECONNRESET); -+ else -+ dwc3_ep0_reset_state(dwc); - goto out; - } - } diff --git a/queue-6.1/series b/queue-6.1/series index 5a379356dfd..f7e8431ebd2 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -258,7 +258,6 @@ powerpc-64s-increase-default-stack-size-to-32kb.patch tick-sched-fix-idle-and-iowait-sleeptime-accounting-vs-cpu-hotplug.patch usb-phy-mxs-remove-config_usb_otg-condition-for-mxs_phy_is_otg_host.patch usb-dwc-ep0-update-request-status-in-dwc3_ep0_stall_restart.patch -usb-dwc3-gadget-handle-ep0-request-dequeuing-properly.patch revert-usb-dwc3-soft-reset-phy-on-probe-for-host.patch revert-usb-dwc3-don-t-reset-device-side-if-dwc3-was-configured-as-host-only.patch usb-chipidea-wait-controller-resume-finished-for-wakeup-irq.patch diff --git a/queue-6.1/usb-dwc3-gadget-handle-ep0-request-dequeuing-properly.patch b/queue-6.1/usb-dwc3-gadget-handle-ep0-request-dequeuing-properly.patch deleted file mode 100644 index c9ce30bf416..00000000000 --- a/queue-6.1/usb-dwc3-gadget-handle-ep0-request-dequeuing-properly.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 730e12fbec53ab59dd807d981a204258a4cfb29a Mon Sep 17 00:00:00 2001 -From: Wesley Cheng -Date: Wed, 6 Dec 2023 12:18:14 -0800 -Subject: usb: dwc3: gadget: Handle EP0 request dequeuing properly - -From: Wesley Cheng - -commit 730e12fbec53ab59dd807d981a204258a4cfb29a upstream. - -Current EP0 dequeue path will share the same as other EPs. However, there -are some special considerations that need to be made for EP0 transfers: - - - EP0 transfers never transition into the started_list - - EP0 only has one active request at a time - -In case there is a vendor specific control message for a function over USB -FFS, then there is no guarantee on the timeline which the DATA/STATUS stage -is responded to. While this occurs, any attempt to end transfers on -non-control EPs will end up having the DWC3_EP_DELAY_STOP flag set, and -defer issuing of the end transfer command. If the USB FFS application -decides to timeout the control transfer, or if USB FFS AIO path exits, the -USB FFS driver will issue a call to usb_ep_dequeue() for the ep0 request. - -In case of the AIO exit path, the AIO FS blocks until all pending USB -requests utilizing the AIO path is completed. However, since the dequeue -of ep0 req does not happen properly, all non-control EPs with the -DWC3_EP_DELAY_STOP flag set will not be handled, and the AIO exit path will -be stuck waiting for the USB FFS data endpoints to receive a completion -callback. - -Fix is to utilize dwc3_ep0_reset_state() in the dequeue API to ensure EP0 -is brought back to the SETUP state, and ensures that any deferred end -transfer commands are handled. This also will end any active transfers -on EP0, compared to the previous implementation which directly called -giveback only. - -Fixes: fcd2def66392 ("usb: dwc3: gadget: Refactor dwc3_gadget_ep_dequeue") -Cc: stable -Signed-off-by: Wesley Cheng -Acked-by: Thinh Nguyen -Link: https://lore.kernel.org/r/20231206201814.32664-1-quic_wcheng@quicinc.com -Signed-off-by: Greg Kroah-Hartman ---- - drivers/usb/dwc3/gadget.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - ---- a/drivers/usb/dwc3/gadget.c -+++ b/drivers/usb/dwc3/gadget.c -@@ -2075,7 +2075,17 @@ static int dwc3_gadget_ep_dequeue(struct - - list_for_each_entry(r, &dep->pending_list, list) { - if (r == req) { -- dwc3_gadget_giveback(dep, req, -ECONNRESET); -+ /* -+ * Explicitly check for EP0/1 as dequeue for those -+ * EPs need to be handled differently. Control EP -+ * only deals with one USB req, and giveback will -+ * occur during dwc3_ep0_stall_and_restart(). EP0 -+ * requests are never added to started_list. -+ */ -+ if (dep->number > 1) -+ dwc3_gadget_giveback(dep, req, -ECONNRESET); -+ else -+ dwc3_ep0_reset_state(dwc); - goto out; - } - } -- 2.47.3