Revert list_move() to list_move_tail() change from last commit since it
authormglocker <mglocker@openbsd.org>
Sat, 4 Sep 2021 10:19:28 +0000 (10:19 +0000)
committermglocker <mglocker@openbsd.org>
Sat, 4 Sep 2021 10:19:28 +0000 (10:19 +0000)
turned out that it has a negative impact to isoc transfers timing with our
driver implementation.

sys/dev/usb/dwc2/dwc2_hcd.c
sys/dev/usb/dwc2/dwc2_hcdddma.c
sys/dev/usb/dwc2/dwc2_hcdintr.c
sys/dev/usb/dwc2/dwc2_hcdqueue.c

index 9881c89..8da32b4 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dwc2_hcd.c,v 1.24 2021/07/27 13:36:59 mglocker Exp $  */
+/*     $OpenBSD: dwc2_hcd.c,v 1.25 2021/09/04 10:19:28 mglocker Exp $  */
 /*     $NetBSD: dwc2_hcd.c,v 1.15 2014/11/24 10:14:14 skrll Exp $      */
 
 /*
@@ -932,8 +932,7 @@ enum dwc2_transaction_type dwc2_hcd_select_transactions(
                 * periodic assigned schedule
                 */
                qh_ptr = qh_ptr->next;
-               list_move_tail(&qh->qh_list_entry,
-                              &hsotg->periodic_sched_assigned);
+               list_move(&qh->qh_list_entry, &hsotg->periodic_sched_assigned);
                ret_val = DWC2_TRANSACTION_PERIODIC;
        }
 
@@ -982,7 +981,7 @@ enum dwc2_transaction_type dwc2_hcd_select_transactions(
                 * non-periodic active schedule
                 */
                qh_ptr = qh_ptr->next;
-               list_move_tail(&qh->qh_list_entry,
+               list_move(&qh->qh_list_entry,
                          &hsotg->non_periodic_sched_active);
 
                if (ret_val == DWC2_TRANSACTION_NONE)
@@ -1026,8 +1025,7 @@ STATIC int dwc2_queue_transaction(struct dwc2_hsotg *hsotg,
 
        if (chan->do_split)
                /* Put ourselves on the list to keep order straight */
-               list_move_tail(&chan->split_order_list_entry,
-                              &hsotg->split_order);
+               list_move(&chan->split_order_list_entry, &hsotg->split_order);
 
        if (hsotg->core_params->dma_enable > 0 && chan->qh) {
                if (hsotg->core_params->dma_desc_enable > 0) {
@@ -1161,7 +1159,7 @@ STATIC void dwc2_process_periodic_channels(struct dwc2_hsotg *hsotg)
                         * Move the QH from the periodic assigned schedule to
                         * the periodic queued schedule
                         */
-                       list_move_tail(&qh->qh_list_entry,
+                       list_move(&qh->qh_list_entry,
                                  &hsotg->periodic_sched_queued);
 
                        /* done queuing high bandwidth */
index db1b632..a138cb2 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dwc2_hcdddma.c,v 1.18 2021/07/27 13:36:59 mglocker Exp $      */
+/*     $OpenBSD: dwc2_hcdddma.c,v 1.19 2021/09/04 10:19:28 mglocker Exp $      */
 /*     $NetBSD: dwc2_hcdddma.c,v 1.6 2014/04/03 06:34:58 skrll Exp $   */
 
 /*
@@ -1317,7 +1317,7 @@ void dwc2_hcd_complete_xfer_ddma(struct dwc2_hsotg *hsotg,
                        dwc2_hcd_qh_unlink(hsotg, qh);
                } else {
                        /* Keep in assigned schedule to continue transfer */
-                       list_move_tail(&qh->qh_list_entry,
+                       list_move(&qh->qh_list_entry,
                                       &hsotg->periodic_sched_assigned);
                        /*
                         * If channel has been halted during giveback of urb
index c9e4146..871564a 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dwc2_hcdintr.c,v 1.12 2021/07/27 13:36:59 mglocker Exp $      */
+/*     $OpenBSD: dwc2_hcdintr.c,v 1.13 2021/09/04 10:19:28 mglocker Exp $      */
 /*     $NetBSD: dwc2_hcdintr.c,v 1.11 2014/11/24 10:14:14 skrll Exp $  */
 
 /*
@@ -154,8 +154,8 @@ STATIC void dwc2_sof_intr(struct dwc2_hsotg *hsotg)
                         * Move QH to the ready list to be executed next
                         * (micro)frame
                         */
-                       list_move_tail(&qh->qh_list_entry,
-                                      &hsotg->periodic_sched_ready);
+                       list_move(&qh->qh_list_entry,
+                                 &hsotg->periodic_sched_ready);
        }
        tr_type = dwc2_hcd_select_transactions(hsotg);
        if (tr_type != DWC2_TRANSACTION_NONE)
@@ -865,8 +865,8 @@ STATIC void dwc2_halt_channel(struct dwc2_hsotg *hsotg,
                         * halt to be queued when the periodic schedule is
                         * processed.
                         */
-                       list_move_tail(&chan->qh->qh_list_entry,
-                                      &hsotg->periodic_sched_assigned);
+                       list_move(&chan->qh->qh_list_entry,
+                                 &hsotg->periodic_sched_assigned);
 
                        /*
                         * Make sure the Periodic Tx FIFO Empty interrupt is
index 91c105a..172e418 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dwc2_hcdqueue.c,v 1.11 2021/07/27 13:36:59 mglocker Exp $     */
+/*     $OpenBSD: dwc2_hcdqueue.c,v 1.12 2021/09/04 10:19:28 mglocker Exp $     */
 /*     $NetBSD: dwc2_hcdqueue.c,v 1.11 2014/09/03 10:00:08 skrll Exp $ */
 
 /*
@@ -831,11 +831,9 @@ void dwc2_hcd_qh_deactivate(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
             dwc2_frame_num_le(qh->sched_frame, frame_number)) ||
            (hsotg->core_params->uframe_sched <= 0 &&
             qh->sched_frame == frame_number))
-               list_move_tail(&qh->qh_list_entry,
-                              &hsotg->periodic_sched_ready);
+               list_move(&qh->qh_list_entry, &hsotg->periodic_sched_ready);
        else
-               list_move_tail(&qh->qh_list_entry,
-                              &hsotg->periodic_sched_inactive);
+               list_move(&qh->qh_list_entry, &hsotg->periodic_sched_inactive);
 }
 
 /**