* fiq_fsm: Use correct states when starting isoc OUT transfers
In fiq_fsm_start_next_periodic() if an isochronous OUT transfer
was selected, no regard was given as to whether this was a single-packet
transfer or a multi-packet staged transfer.
For single-packet transfers, this had the effect of repeatedly sending
OUT packets with bogus data and lengths.
Eventually if the channel was repeatedly enabled enough times, this
would lock up the OTG core and no further bus transfers would happen.
Set the FSM state up properly if we select a single-packet transfer.
Fixes https://github.com/raspberrypi/linux/issues/1842
if (st->channel[n].fsm == FIQ_PER_ISO_OUT_PENDING) {
if (!fiq_fsm_tt_in_use(st, num_channels, n)) {
fiq_print(FIQDBG_INT, st, "NEXTISO ");
- st->channel[n].fsm = FIQ_PER_ISO_OUT_ACTIVE;
+ if (st->channel[n].nrpackets == 1)
+ st->channel[n].fsm = FIQ_PER_ISO_OUT_LAST;
+ else
+ st->channel[n].fsm = FIQ_PER_ISO_OUT_ACTIVE;
fiq_fsm_restart_channel(st, n, 0);
break;
}