|
46 | 46 | #include "dwc_otg_hcd.h"
|
47 | 47 | #include "dwc_otg_regs.h"
|
48 | 48 |
|
49 |
| -extern bool microframe_schedule; |
| 49 | +extern bool microframe_schedule, nak_holdoff_enable; |
50 | 50 |
|
51 | 51 | //#define DEBUG_HOST_CHANNELS
|
52 | 52 | #ifdef DEBUG_HOST_CHANNELS
|
@@ -1349,18 +1349,26 @@ dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t * hcd)
|
1349 | 1349 |
|
1350 | 1350 | /*
|
1351 | 1351 | * Check to see if this is a NAK'd retransmit, in which case ignore for retransmission
|
1352 |
| - * we hold off on bulk retransmissions to reduce NAK interrupt overhead for |
| 1352 | + * we hold off on bulk retransmissions to reduce NAK interrupt overhead for full-speed |
1353 | 1353 | * cheeky devices that just hold off using NAKs
|
1354 | 1354 | */
|
1355 |
| - if (dwc_full_frame_num(qh->nak_frame) == dwc_full_frame_num(dwc_otg_hcd_get_frame_number(hcd))) { |
1356 |
| - // Make fiq interrupt run on next frame (i.e. 8 uframes) |
1357 |
| - g_next_sched_frame = ((qh->nak_frame + 8) & ~7) & DWC_HFNUM_MAX_FRNUM; |
1358 |
| - qh_ptr = DWC_LIST_NEXT(qh_ptr); |
1359 |
| - continue; |
| 1355 | + if (nak_holdoff_enable && qh->do_split) { |
| 1356 | + if (qh->nak_frame != 0xffff && |
| 1357 | + dwc_full_frame_num(qh->nak_frame) == |
| 1358 | + dwc_full_frame_num(dwc_otg_hcd_get_frame_number(hcd))) { |
| 1359 | + /* |
| 1360 | + * Revisit: Need to avoid trampling on periodic scheduling. |
| 1361 | + * Currently we are safe because g_np_count != g_np_sent whenever we hit this, |
| 1362 | + * but if this behaviour is changed then periodic endpoints will get a slower |
| 1363 | + * polling rate. |
| 1364 | + */ |
| 1365 | + g_next_sched_frame = ((qh->nak_frame + 8) & ~7) & DWC_HFNUM_MAX_FRNUM; |
| 1366 | + qh_ptr = DWC_LIST_NEXT(qh_ptr); |
| 1367 | + continue; |
| 1368 | + } else { |
| 1369 | + qh->nak_frame = 0xffff; |
| 1370 | + } |
1360 | 1371 | }
|
1361 |
| - else |
1362 |
| - qh->nak_frame = 0xffff; |
1363 |
| - |
1364 | 1372 | if (microframe_schedule) {
|
1365 | 1373 | DWC_SPINLOCK_IRQSAVE(channel_lock, &flags);
|
1366 | 1374 | if (hcd->available_host_channels < 1) {
|
|
0 commit comments