summaryrefslogtreecommitdiff
path: root/payloads/libpayload
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2015-11-06 22:22:56 -0800
committerPatrick Georgi <pgeorgi@google.com>2015-11-13 00:53:02 +0100
commitfe35623f20c4e94e59630143e6a01717f69851e8 (patch)
tree80921d4569022dc59bb40c3074853d4be2203723 /payloads/libpayload
parent1dcb10eeb6912824ddf257dab8121a2a87260a3d (diff)
downloadcoreboot-fe35623f20c4e94e59630143e6a01717f69851e8.tar.xz
libpayload: udc/dwc2: Ignore setup packet in check for queue empty
during shutdown DWC2 UDC controller always requires an active packet to be present in EP0-OUT to ensure proper operation of control plane. Thus, during shutdown ignore EP0-OUT for queue empty check if only 1 packet is present. BUG=b:24676003 BRANCH=None TEST=Compiles successfully. "fastboot reboot-bootloader" reboots device without timeout in udc shutdown. Change-Id: Iafe46c80f58c4cd57f8d58f060d805b603506bbd Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 4e7c27d849c0411aae58e60a24d8170a27ab8485 Original-Change-Id: Ifa493ce0e41964ee7ca8bb3a1f4bb8726fa11173 Original-Signed-off-by: Furquan Shaikh <furquan@google.com> Original-Reviewed-on: https://chromium-review.googlesource.com/311257 Original-Commit-Ready: Furquan Shaikh <furquan@chromium.org> Original-Tested-by: Furquan Shaikh <furquan@chromium.org> Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/12413 Reviewed-by: Furquan Shaikh <furquan@google.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'payloads/libpayload')
-rw-r--r--payloads/libpayload/drivers/udc/dwc2.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/payloads/libpayload/drivers/udc/dwc2.c b/payloads/libpayload/drivers/udc/dwc2.c
index dc9eb7c3f5..cde3a76c06 100644
--- a/payloads/libpayload/drivers/udc/dwc2.c
+++ b/payloads/libpayload/drivers/udc/dwc2.c
@@ -704,9 +704,21 @@ static void dwc2_shutdown(struct usbdev_ctrl *this)
is_empty = 1;
this->poll(this);
for (i = 0; i < 16; i++)
- for (j = 0; j < 2; j++)
+ for (j = 0; j < 2; j++) {
+ /*
+ * EP0-OUT needs to always have an active packet
+ * for proper operation of control packet
+ * flow. Thus, ignore if only 1 packet is
+ * present in EP0-OUT.
+ */
+ if ((i == 0) && (j == 0) &&
+ SIMPLEQ_SINGLETON(&p->eps[0][0].job_queue,
+ queue))
+ continue;
+
if (!SIMPLEQ_EMPTY(&p->eps[i][j].job_queue))
is_empty = 0;
+ }
}
if (timer_us(shutdown_timer_us) >= shutdown_timeout_us)