Lines Matching full:we
31 /* If we get a NAK, wait this long before retrying */
120 * @num_bits: The number of bits we need per period we want to reserve
122 * @interval: How often we need to be scheduled for the reservation this
126 * the interval or we return failure right away.
127 * @only_one_period: Normally we'll allow picking a start anywhere within the
128 * first interval, since we can still make all repetition
130 * here then we'll return failure if we can't fit within
133 * The idea here is that we want to schedule time for repeating events that all
138 * To keep things "simple", we'll represent our schedule with a bitmap that
140 * but does mean that we need to handle things specially (and non-ideally) if
142 * intervals that we're trying to schedule.
144 * Here's an explanation of the scheme we'll implement, assuming 8 periods.
145 * - If interval is 1, we need to take up space in each of the 8
146 * periods we're scheduling. Easy.
147 * - If interval is 2, we need to take up space in half of the
149 * - If interval is 3, we actually need to fall back to interval 1.
150 * Why? Because we might need time in any period. AKA for the
151 * first 8 periods, we'll be in slot 0, 3, 6. Then we'll be
152 * in slot 1, 4, 7. Then we'll be in 2, 5. Then we'll be back to
153 * 0, 3, and 6. Since we could be in any frame we need to reserve
155 * if we were instead scheduling 8 * 3 = 24 we'd do much better, but
156 * then we need more memory and time to do scheduling.
158 * - If interval is 5, we again need interval 1. The schedule will be
160 * - If interval is 6, we need interval 2. 0, 6, 4, 2.
161 * - If interval is 7, we need interval 1.
162 * - If interval is 8, we need interval 8.
164 * If you do the math, you'll see that we need to pretend that interval is
220 /* If start has gotten us past interval then we can't schedule */ in pmap_schedule()
232 * We'll try to pick the first repetition, then see if that time in pmap_schedule()
234 * we'll adjust the start time for the next search of the first in pmap_schedule()
248 * We should get start >= end if we fail. We might be in pmap_schedule()
257 /* At this point we have a valid point for first one */ in pmap_schedule()
268 /* We got the right place, continue checking */ in pmap_schedule()
283 /* If didn't exit the for loop with a break, we have success */ in pmap_schedule()
337 * We'll always get the periodic map out of our TT. Note that even if we're
339 * a TT is allocated for us, so we'll use it. If that ever changes we can
493 * If we don't have tracing turned on, don't run unless the special in dwc2_qh_schedule_print()
544 * @search_slice: We'll start trying to schedule at the passed slice.
550 * Normally we schedule low speed devices on the map associated with the TT.
566 * parameters. Note that we use the "device_interval" here since in dwc2_ls_pmap_schedule()
567 * we want the low speed interval and the only way we'd be in this in dwc2_ls_pmap_schedule()
570 * If we happen to be doing low speed and high speed scheduling for the in dwc2_ls_pmap_schedule()
571 * same transaction (AKA we have a split) we always do low speed first. in dwc2_ls_pmap_schedule()
572 * That means we can always pass "false" for only_one_period (that in dwc2_ls_pmap_schedule()
573 * parameters is only useful when we're trying to get one schedule to in dwc2_ls_pmap_schedule()
574 * match what we already planned in the other schedule). in dwc2_ls_pmap_schedule()
613 * We'll start looking in qh->hs_transfers[index].start_schedule_us. We'll
614 * update this with the result upon success. We also use the duration from
619 * @only_one_period: If true we will limit ourselves to just looking at
620 * one period (aka one 100us chunk). This is used if we have
623 * @index: The index into qh->hs_transfers that we're working with.
668 * This is the most complicated thing in USB. We have to find matching time
694 * We always try to find space in the low speed schedule first, then in dwc2_uframe_schedule_split()
695 * try to find high speed time that matches. If we don't, we'll bump in dwc2_uframe_schedule_split()
696 * up the place we start searching in the low speed schedule and try in dwc2_uframe_schedule_split()
697 * again. To start we'll look right at the beginning of the low speed in dwc2_uframe_schedule_split()
701 * We may eventually want to try to avoid this by either considering in dwc2_uframe_schedule_split()
722 * If we got an error here there's no other magic we in dwc2_uframe_schedule_split()
724 * helpful to redo things if we got a low speed slot in dwc2_uframe_schedule_split()
745 * If we were going to start in uframe 7 then we would need to in dwc2_uframe_schedule_split()
773 * For ISOC out we might need to do: in dwc2_uframe_schedule_split()
779 * For INTERRUPT in we might need to do: in dwc2_uframe_schedule_split()
785 * For INTERRUPT out we might need to do: in dwc2_uframe_schedule_split()
822 * the above cases. Until it's fixed we just won't be able in dwc2_uframe_schedule_split()
931 /* If we scheduled all w/out breaking out then we're all good */ in dwc2_uframe_schedule_split()
967 /* We'll have one transfer; init start to 0 before calling scheduler */ in dwc2_uframe_schedule_hs()
1044 * Takes a qh that has already been scheduled (which means we know we have the
1049 * running. It just picks the next frame that we can fit into without any
1071 * We wouldn't want to start any earlier than the next frame just in in dwc2_pick_first_frame()
1072 * case the frame number ticks as we're doing this calculation. in dwc2_pick_first_frame()
1074 * NOTE: if we could quantify how long till we actually get scheduled in dwc2_pick_first_frame()
1075 * we might be able to avoid the "+ 1" by looking at the upper part of in dwc2_pick_first_frame()
1076 * HFNUM (the FRREM field). For now we'll just use the + 1 though. in dwc2_pick_first_frame()
1091 * We're either at high speed or we're doing a split (which in dwc2_pick_first_frame()
1092 * means we're talking high speed to a hub). In any case in dwc2_pick_first_frame()
1121 * We know interval must divide (HFNUM_MAX_FRNUM + 1) now that we've in dwc2_pick_first_frame()
1125 * After this we might be before earliest_frame, but don't worry, in dwc2_pick_first_frame()
1126 * we'll fix it... in dwc2_pick_first_frame()
1131 * Actually choose to start at the frame number we've been in dwc2_pick_first_frame()
1138 * We actually need 1 frame before since the next_active_frame is in dwc2_pick_first_frame()
1139 * the frame number we'll be put on the ready list and we won't be on in dwc2_pick_first_frame()
1145 * By now we might actually be before the earliest_frame. Let's move in dwc2_pick_first_frame()
1146 * up intervals until we're not. in dwc2_pick_first_frame()
1223 /* No more unreserve pending--we're doing it */ in dwc2_do_unreserve()
1244 * "Reserved Bandwidth Transfers"), we need to keep a reservation active as
1245 * long as a device driver keeps submitting. Since we're using HCD_BH to give
1246 * back the URB we need to give the driver a little bit of time before we
1259 * Wait for the lock, or for us to be scheduled again. We in dwc2_unreserve_timer_fn()
1261 * - We started executing but didn't get the lock yet. in dwc2_unreserve_timer_fn()
1263 * because we already started executing. in dwc2_unreserve_timer_fn()
1274 * - We started executing but didn't get the lock yet. in dwc2_unreserve_timer_fn()
1276 * because we already started executing. in dwc2_unreserve_timer_fn()
1278 * We can't put this in the loop above because unreserve_pending needs in dwc2_unreserve_timer_fn()
1279 * to be accessed under lock, so we can only check it once we got the in dwc2_unreserve_timer_fn()
1347 * valid. Unreserve might still be pending even if we didn't cancel if in dwc2_schedule_periodic()
1358 * is still good. Note: we could also try to use the similar in dwc2_schedule_periodic()
1360 * tightly and we might need to hurry and queue things up. in dwc2_schedule_periodic()
1401 * We should never already be scheduled since dwc2_schedule_periodic() in dwc2_deschedule_periodic()
1405 * We add + 1 to the timer to guarantee that at least 1 jiffy has in dwc2_deschedule_periodic()
1406 * passed (otherwise if the jiffy counter might tick right after we in dwc2_deschedule_periodic()
1407 * read it and we'll get no delay). in dwc2_deschedule_periodic()
1424 * That means that when we encounter a NAK we're supposed to retry.
1426 * ...but if we retry right away (from the interrupt handler that saw the NAK)
1427 * then we can end up with an interrupt storm (if the other side keeps NAKing
1432 * ...so instead of retrying right away in the case of a NAK we'll set a timer
1449 * We'll set wait_timer_cancel to true if we want to cancel this in dwc2_wait_timer_fn()
1535 * Schedule low speed if we're running the host in low or in dwc2_qh_init()
1536 * full speed OR if we've got a "TT" to deal with to access this in dwc2_qh_init()
1543 /* We won't know num transfers until we schedule */ in dwc2_qh_init()
1551 /* We'll schedule later when we have something to do */ in dwc2_qh_init()
1663 * We don't have the lock so we can safely wait until the wait timer in dwc2_hcd_qh_free()
1664 * finishes. Of course, at this point in time we'd better have set in dwc2_hcd_qh_free()
1666 * won't do anything anyway, but we want it to finish before we free in dwc2_hcd_qh_free()
1780 * Periodic splits are single low/full speed transfers that we end up splitting
1782 * frame but might be split over several microframes (125 us each). We to put
1791 * Return: number missed by (or 0 if we didn't miss).
1818 * be 1 frame _before_ when we want to be scheduled. If we're 1 frame in dwc2_next_for_periodic_split()
1821 * It's _not_ OK, however, if we're more than one frame past. in dwc2_next_for_periodic_split()
1825 * OOPS, we missed. That's actually pretty bad since in dwc2_next_for_periodic_split()
1843 * Since we _always_ keep start_active_frame as the start of the previous
1844 * transfer this is normally pretty easy: we just add our interval to
1845 * start_active_frame and we've got our answer.
1847 * The tricks come into play if we miss. In that case we'll look for the next
1848 * slot we can fit into.
1854 * Return: number missed by (or 0 if we didn't miss).
1868 * with if we just incremented by a really large intervals since the in dwc2_next_periodic_start()
1869 * frame counter only goes to 0x3fff. It's terribly unlikely that we in dwc2_next_periodic_start()
1870 * will have missed in this case anyway. Just go to exit. If we want in dwc2_next_periodic_start()
1871 * to try to do better we'll need to keep track of a bigger counter in dwc2_next_periodic_start()
1881 * - We compare against prev_frame_number since start_active_frame in dwc2_next_periodic_start()
1882 * and next_active_frame are always 1 frame before we want things in dwc2_next_periodic_start()
1883 * to be active and we assume we can still get scheduled in the in dwc2_next_periodic_start()
1886 * next_active_frame if we got an EO MISS (even_odd miss) which in dwc2_next_periodic_start()
1887 * basically means that we detected there wasn't enough time for in dwc2_next_periodic_start()
1889 * at the last second. We want to make sure we don't schedule in dwc2_next_periodic_start()
1892 * we do two transfers in the same frame. in dwc2_next_periodic_start()
1899 * time. We can help with the dwc2 parts of this, but it's hard to in dwc2_next_periodic_start()
1901 * we have to be robust to some misses. in dwc2_next_periodic_start()
1968 * means we don't actually know if we've already handled the SOF in dwc2_hcd_qh_deactivate()
1994 * Note: we purposely use the frame_number from the "hsotg" structure in dwc2_hcd_qh_deactivate()
1995 * since we know SOF interrupt will handle future frames. in dwc2_hcd_qh_deactivate()