From: P33M Date: Thu, 4 May 2017 13:56:08 +0000 (+0100) Subject: fiq_fsm: Use correct states when starting isoc OUT transfers (#1991) X-Git-Tag: archive/raspbian/4.9.82-1+deb9u3+rpi1_jessie~5^2~242 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9c32f95eb6a8421e08a68988fca3cb613200320b;p=linux-4.9.git fiq_fsm: Use correct states when starting isoc OUT transfers (#1991) * 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 --- diff --git a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c index 9304279592cb..208252645c09 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c +++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c @@ -491,7 +491,10 @@ static void notrace noinline fiq_fsm_start_next_periodic(struct fiq_state *st, i 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; }