aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Anderson <dianders@chromium.org>2016-01-28 21:19:56 -0500
committerFelipe Balbi <balbi@kernel.org>2016-03-04 08:14:40 -0500
commit94ef7aee11c26e79441276ca43f0c25a04bd1303 (patch)
tree8d2a41f930cc138f67b8ab12fef28b9c19545961
parent16e80218816488f016418717d23c660abe073a67 (diff)
usb: dwc2: host: Always add to the tail of queues
The queues the the dwc2 host controller used are truly queues. That means FIFO or first in first out. Unfortunately though the code was iterating through these queues starting from the head, some places in the code was adding things to the queue by adding at the head instead of the tail. That means last in first out. Doh. Go through and just always add to the tail. Doing this makes things much happier when I've got: * 7-port USB 2.0 Single-TT hub * - Microsoft 2.4 GHz Transceiver v7.0 dongle * - Jabra speakerphone playing music Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Tested-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
-rw-r--r--drivers/usb/dwc2/hcd.c11
-rw-r--r--drivers/usb/dwc2/hcd_ddma.c4
-rw-r--r--drivers/usb/dwc2/hcd_intr.c4
-rw-r--r--drivers/usb/dwc2/hcd_queue.c6
4 files changed, 14 insertions, 11 deletions
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index e2d2e9be366e..349194342c90 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -969,7 +969,8 @@ enum dwc2_transaction_type dwc2_hcd_select_transactions(
969 * periodic assigned schedule 969 * periodic assigned schedule
970 */ 970 */
971 qh_ptr = qh_ptr->next; 971 qh_ptr = qh_ptr->next;
972 list_move(&qh->qh_list_entry, &hsotg->periodic_sched_assigned); 972 list_move_tail(&qh->qh_list_entry,
973 &hsotg->periodic_sched_assigned);
973 ret_val = DWC2_TRANSACTION_PERIODIC; 974 ret_val = DWC2_TRANSACTION_PERIODIC;
974 } 975 }
975 976
@@ -1002,8 +1003,8 @@ enum dwc2_transaction_type dwc2_hcd_select_transactions(
1002 * non-periodic active schedule 1003 * non-periodic active schedule
1003 */ 1004 */
1004 qh_ptr = qh_ptr->next; 1005 qh_ptr = qh_ptr->next;
1005 list_move(&qh->qh_list_entry, 1006 list_move_tail(&qh->qh_list_entry,
1006 &hsotg->non_periodic_sched_active); 1007 &hsotg->non_periodic_sched_active);
1007 1008
1008 if (ret_val == DWC2_TRANSACTION_NONE) 1009 if (ret_val == DWC2_TRANSACTION_NONE)
1009 ret_val = DWC2_TRANSACTION_NON_PERIODIC; 1010 ret_val = DWC2_TRANSACTION_NON_PERIODIC;
@@ -1176,8 +1177,8 @@ static void dwc2_process_periodic_channels(struct dwc2_hsotg *hsotg)
1176 * Move the QH from the periodic assigned schedule to 1177 * Move the QH from the periodic assigned schedule to
1177 * the periodic queued schedule 1178 * the periodic queued schedule
1178 */ 1179 */
1179 list_move(&qh->qh_list_entry, 1180 list_move_tail(&qh->qh_list_entry,
1180 &hsotg->periodic_sched_queued); 1181 &hsotg->periodic_sched_queued);
1181 1182
1182 /* done queuing high bandwidth */ 1183 /* done queuing high bandwidth */
1183 hsotg->queuing_high_bandwidth = 0; 1184 hsotg->queuing_high_bandwidth = 0;
diff --git a/drivers/usb/dwc2/hcd_ddma.c b/drivers/usb/dwc2/hcd_ddma.c
index a41274aa52ad..faca7aaec1a5 100644
--- a/drivers/usb/dwc2/hcd_ddma.c
+++ b/drivers/usb/dwc2/hcd_ddma.c
@@ -1326,8 +1326,8 @@ void dwc2_hcd_complete_xfer_ddma(struct dwc2_hsotg *hsotg,
1326 dwc2_hcd_qh_unlink(hsotg, qh); 1326 dwc2_hcd_qh_unlink(hsotg, qh);
1327 } else { 1327 } else {
1328 /* Keep in assigned schedule to continue transfer */ 1328 /* Keep in assigned schedule to continue transfer */
1329 list_move(&qh->qh_list_entry, 1329 list_move_tail(&qh->qh_list_entry,
1330 &hsotg->periodic_sched_assigned); 1330 &hsotg->periodic_sched_assigned);
1331 /* 1331 /*
1332 * If channel has been halted during giveback of urb 1332 * If channel has been halted during giveback of urb
1333 * then prevent any new scheduling. 1333 * then prevent any new scheduling.
diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c
index 0d0fd2a7f1f9..13e505a6eeda 100644
--- a/drivers/usb/dwc2/hcd_intr.c
+++ b/drivers/usb/dwc2/hcd_intr.c
@@ -143,7 +143,7 @@ static void dwc2_sof_intr(struct dwc2_hsotg *hsotg)
143 * Move QH to the ready list to be executed next 143 * Move QH to the ready list to be executed next
144 * (micro)frame 144 * (micro)frame
145 */ 145 */
146 list_move(&qh->qh_list_entry, 146 list_move_tail(&qh->qh_list_entry,
147 &hsotg->periodic_sched_ready); 147 &hsotg->periodic_sched_ready);
148 } 148 }
149 tr_type = dwc2_hcd_select_transactions(hsotg); 149 tr_type = dwc2_hcd_select_transactions(hsotg);
@@ -802,7 +802,7 @@ static void dwc2_halt_channel(struct dwc2_hsotg *hsotg,
802 * halt to be queued when the periodic schedule is 802 * halt to be queued when the periodic schedule is
803 * processed. 803 * processed.
804 */ 804 */
805 list_move(&chan->qh->qh_list_entry, 805 list_move_tail(&chan->qh->qh_list_entry,
806 &hsotg->periodic_sched_assigned); 806 &hsotg->periodic_sched_assigned);
807 807
808 /* 808 /*
diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c
index e0933a9dfad7..bc632a72f611 100644
--- a/drivers/usb/dwc2/hcd_queue.c
+++ b/drivers/usb/dwc2/hcd_queue.c
@@ -732,9 +732,11 @@ void dwc2_hcd_qh_deactivate(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
732 dwc2_frame_num_le(qh->sched_frame, frame_number)) || 732 dwc2_frame_num_le(qh->sched_frame, frame_number)) ||
733 (hsotg->core_params->uframe_sched <= 0 && 733 (hsotg->core_params->uframe_sched <= 0 &&
734 qh->sched_frame == frame_number)) 734 qh->sched_frame == frame_number))
735 list_move(&qh->qh_list_entry, &hsotg->periodic_sched_ready); 735 list_move_tail(&qh->qh_list_entry,
736 &hsotg->periodic_sched_ready);
736 else 737 else
737 list_move(&qh->qh_list_entry, &hsotg->periodic_sched_inactive); 738 list_move_tail(&qh->qh_list_entry,
739 &hsotg->periodic_sched_inactive);
738} 740}
739 741
740/** 742/**