Lines Matching full:we
70 /* If we get a NAK, wait this long before retrying */
159 * @num_bits: The number of bits we need per period we want to reserve
161 * @interval: How often we need to be scheduled for the reservation this
165 * the interval or we return failure right away.
166 * @only_one_period: Normally we'll allow picking a start anywhere within the
167 * first interval, since we can still make all repetition
169 * here then we'll return failure if we can't fit within
172 * The idea here is that we want to schedule time for repeating events that all
177 * To keep things "simple", we'll represent our schedule with a bitmap that
179 * but does mean that we need to handle things specially (and non-ideally) if
181 * intervals that we're trying to schedule.
183 * Here's an explanation of the scheme we'll implement, assuming 8 periods.
184 * - If interval is 1, we need to take up space in each of the 8
185 * periods we're scheduling. Easy.
186 * - If interval is 2, we need to take up space in half of the
188 * - If interval is 3, we actually need to fall back to interval 1.
189 * Why? Because we might need time in any period. AKA for the
190 * first 8 periods, we'll be in slot 0, 3, 6. Then we'll be
191 * in slot 1, 4, 7. Then we'll be in 2, 5. Then we'll be back to
192 * 0, 3, and 6. Since we could be in any frame we need to reserve
194 * if we were instead scheduling 8 * 3 = 24 we'd do much better, but
195 * then we need more memory and time to do scheduling.
197 * - If interval is 5, we again need interval 1. The schedule will be
199 * - If interval is 6, we need interval 2. 0, 6, 4, 2.
200 * - If interval is 7, we need interval 1.
201 * - If interval is 8, we need interval 8.
203 * If you do the math, you'll see that we need to pretend that interval is
259 /* If start has gotten us past interval then we can't schedule */ in pmap_schedule()
271 * We'll try to pick the first repetition, then see if that time in pmap_schedule()
273 * we'll adjust the start time for the next search of the first in pmap_schedule()
287 * We should get start >= end if we fail. We might be in pmap_schedule()
296 /* At this point we have a valid point for first one */ in pmap_schedule()
307 /* We got the right place, continue checking */ in pmap_schedule()
322 /* If didn't exit the for loop with a break, we have success */ in pmap_schedule()
376 * We'll always get the periodic map out of our TT. Note that even if we're
378 * a TT is allocated for us, so we'll use it. If that ever changes we can
532 * If we don't have tracing turned on, don't run unless the special in dwc2_qh_schedule_print()
583 * @search_slice: We'll start trying to schedule at the passed slice.
589 * Normally we schedule low speed devices on the map associated with the TT.
605 * parameters. Note that we use the "device_interval" here since in dwc2_ls_pmap_schedule()
606 * we want the low speed interval and the only way we'd be in this in dwc2_ls_pmap_schedule()
609 * If we happen to be doing low speed and high speed scheduling for the in dwc2_ls_pmap_schedule()
610 * same transaction (AKA we have a split) we always do low speed first. in dwc2_ls_pmap_schedule()
611 * That means we can always pass "false" for only_one_period (that in dwc2_ls_pmap_schedule()
612 * parameters is only useful when we're trying to get one schedule to in dwc2_ls_pmap_schedule()
613 * match what we already planned in the other schedule). in dwc2_ls_pmap_schedule()
652 * We'll start looking in qh->hs_transfers[index].start_schedule_us. We'll
653 * update this with the result upon success. We also use the duration from
658 * @only_one_period: If true we will limit ourselves to just looking at
659 * one period (aka one 100us chunk). This is used if we have
662 * @index: The index into qh->hs_transfers that we're working with.
707 * This is the most complicated thing in USB. We have to find matching time
733 * We always try to find space in the low speed schedule first, then in dwc2_uframe_schedule_split()
734 * try to find high speed time that matches. If we don't, we'll bump in dwc2_uframe_schedule_split()
735 * up the place we start searching in the low speed schedule and try in dwc2_uframe_schedule_split()
736 * again. To start we'll look right at the beginning of the low speed in dwc2_uframe_schedule_split()
740 * We may eventually want to try to avoid this by either considering in dwc2_uframe_schedule_split()
761 * If we got an error here there's no other magic we in dwc2_uframe_schedule_split()
763 * helpful to redo things if we got a low speed slot in dwc2_uframe_schedule_split()
784 * If we were going to start in uframe 7 then we would need to in dwc2_uframe_schedule_split()
812 * For ISOC out we might need to do: in dwc2_uframe_schedule_split()
818 * For INTERRUPT in we might need to do: in dwc2_uframe_schedule_split()
824 * For INTERRUPT out we might need to do: in dwc2_uframe_schedule_split()
861 * the above cases. Until it's fixed we just won't be able in dwc2_uframe_schedule_split()
970 /* If we scheduled all w/out breaking out then we're all good */ in dwc2_uframe_schedule_split()
1006 /* We'll have one transfer; init start to 0 before calling scheduler */ in dwc2_uframe_schedule_hs()
1083 * Takes a qh that has already been scheduled (which means we know we have the
1088 * running. It just picks the next frame that we can fit into without any
1110 * We wouldn't want to start any earlier than the next frame just in in dwc2_pick_first_frame()
1111 * case the frame number ticks as we're doing this calculation. in dwc2_pick_first_frame()
1113 * NOTE: if we could quantify how long till we actually get scheduled in dwc2_pick_first_frame()
1114 * we might be able to avoid the "+ 1" by looking at the upper part of in dwc2_pick_first_frame()
1115 * HFNUM (the FRREM field). For now we'll just use the + 1 though. in dwc2_pick_first_frame()
1130 * We're either at high speed or we're doing a split (which in dwc2_pick_first_frame()
1131 * means we're talking high speed to a hub). In any case in dwc2_pick_first_frame()
1160 * We know interval must divide (HFNUM_MAX_FRNUM + 1) now that we've in dwc2_pick_first_frame()
1164 * After this we might be before earliest_frame, but don't worry, in dwc2_pick_first_frame()
1165 * we'll fix it... in dwc2_pick_first_frame()
1170 * Actually choose to start at the frame number we've been in dwc2_pick_first_frame()
1177 * We actually need 1 frame before since the next_active_frame is in dwc2_pick_first_frame()
1178 * the frame number we'll be put on the ready list and we won't be on in dwc2_pick_first_frame()
1184 * By now we might actually be before the earliest_frame. Let's move in dwc2_pick_first_frame()
1185 * up intervals until we're not. in dwc2_pick_first_frame()
1262 /* No more unreserve pending--we're doing it */ in dwc2_do_unreserve()
1283 * "Reserved Bandwidth Transfers"), we need to keep a reservation active as
1284 * long as a device driver keeps submitting. Since we're using HCD_BH to give
1285 * back the URB we need to give the driver a little bit of time before we
1298 * Wait for the lock, or for us to be scheduled again. We in dwc2_unreserve_timer_fn()
1300 * - We started executing but didn't get the lock yet. in dwc2_unreserve_timer_fn()
1302 * because we already started executing. in dwc2_unreserve_timer_fn()
1313 * - We started executing but didn't get the lock yet. in dwc2_unreserve_timer_fn()
1315 * because we already started executing. in dwc2_unreserve_timer_fn()
1317 * We can't put this in the loop above because unreserve_pending needs in dwc2_unreserve_timer_fn()
1318 * to be accessed under lock, so we can only check it once we got the in dwc2_unreserve_timer_fn()
1386 * valid. Unreserve might still be pending even if we didn't cancel if in dwc2_schedule_periodic()
1397 * is still good. Note: we could also try to use the similar in dwc2_schedule_periodic()
1399 * tightly and we might need to hurry and queue things up. in dwc2_schedule_periodic()
1438 * We should never already be scheduled since dwc2_schedule_periodic() in dwc2_deschedule_periodic()
1442 * We add + 1 to the timer to guarantee that at least 1 jiffy has in dwc2_deschedule_periodic()
1443 * passed (otherwise if the jiffy counter might tick right after we in dwc2_deschedule_periodic()
1444 * read it and we'll get no delay). in dwc2_deschedule_periodic()
1459 * That means that when we encounter a NAK we're supposed to retry.
1461 * ...but if we retry right away (from the interrupt handler that saw the NAK)
1462 * then we can end up with an interrupt storm (if the other side keeps NAKing
1467 * ...so instead of retrying right away in the case of a NAK we'll set a timer
1484 * We'll set wait_timer_cancel to true if we want to cancel this in dwc2_wait_timer_fn()
1569 * Schedule low speed if we're running the host in low or in dwc2_qh_init()
1570 * full speed OR if we've got a "TT" to deal with to access this in dwc2_qh_init()
1577 /* We won't know num transfers until we schedule */ in dwc2_qh_init()
1585 /* We'll schedule later when we have something to do */ in dwc2_qh_init()
1700 * We don't have the lock so we can safely wait until the wait timer in dwc2_hcd_qh_free()
1701 * finishes. Of course, at this point in time we'd better have set in dwc2_hcd_qh_free()
1703 * won't do anything anyway, but we want it to finish before we free in dwc2_hcd_qh_free()
1818 * Periodic splits are single low/full speed transfers that we end up splitting
1820 * frame but might be split over several microframes (125 us each). We to put
1829 * Return: number missed by (or 0 if we didn't miss).
1856 * be 1 frame _before_ when we want to be scheduled. If we're 1 frame in dwc2_next_for_periodic_split()
1859 * It's _not_ OK, however, if we're more than one frame past. in dwc2_next_for_periodic_split()
1863 * OOPS, we missed. That's actually pretty bad since in dwc2_next_for_periodic_split()
1881 * Since we _always_ keep start_active_frame as the start of the previous
1882 * transfer this is normally pretty easy: we just add our interval to
1883 * start_active_frame and we've got our answer.
1885 * The tricks come into play if we miss. In that case we'll look for the next
1886 * slot we can fit into.
1892 * Return: number missed by (or 0 if we didn't miss).
1906 * with if we just incremented by a really large intervals since the in dwc2_next_periodic_start()
1907 * frame counter only goes to 0x3fff. It's terribly unlikely that we in dwc2_next_periodic_start()
1908 * will have missed in this case anyway. Just go to exit. If we want in dwc2_next_periodic_start()
1909 * to try to do better we'll need to keep track of a bigger counter in dwc2_next_periodic_start()
1919 * - We compare against prev_frame_number since start_active_frame in dwc2_next_periodic_start()
1920 * and next_active_frame are always 1 frame before we want things in dwc2_next_periodic_start()
1921 * to be active and we assume we can still get scheduled in the in dwc2_next_periodic_start()
1924 * next_active_frame if we got an EO MISS (even_odd miss) which in dwc2_next_periodic_start()
1925 * basically means that we detected there wasn't enough time for in dwc2_next_periodic_start()
1927 * at the last second. We want to make sure we don't schedule in dwc2_next_periodic_start()
1930 * we do two transfers in the same frame. in dwc2_next_periodic_start()
1937 * time. We can help with the dwc2 parts of this, but it's hard to in dwc2_next_periodic_start()
1939 * we have to be robust to some misses. in dwc2_next_periodic_start()
2008 * means we don't actually know if we've already handled the SOF in dwc2_hcd_qh_deactivate()
2034 * Note: we purposely use the frame_number from the "hsotg" structure in dwc2_hcd_qh_deactivate()
2035 * since we know SOF interrupt will handle future frames. in dwc2_hcd_qh_deactivate()