FROMGIT: usb: host: ehci-sched: try to turn on io watchdog as long as periodic_count > 0

If initially isoc_count = 0, periodic_count > 0 and the io watchdog is
not started (e.g. just timed out), then the io watchdog may not run after
submitting isoc urbs and enable_periodic(). The isoc urbs may not complete
forever if the controller had already stopped periodic schedule.

This will try to call turn_on_io_watchdog() for each enable_periodic() to
ensure the io watchdog functions properly.

Bug: 295046582
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20230809065327.952368-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c272dabf2d43c3523af1a40be3127e7a1f84540a
    https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Change-Id: I0f10ec8bcf0e14269b2a9693617dd83327c26a20
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
This commit is contained in:
Xu Yang 2023-08-09 14:53:27 +08:00 committed by Todd Kjos
parent 2d3351bd5e
commit 3378cbd264

View File

@ -490,13 +490,14 @@ static int tt_no_collision(
static void enable_periodic(struct ehci_hcd *ehci)
{
if (ehci->periodic_count++)
return;
goto out;
/* Stop waiting to turn off the periodic schedule */
ehci->enabled_hrtimer_events &= ~BIT(EHCI_HRTIMER_DISABLE_PERIODIC);
/* Don't start the schedule until PSS is 0 */
ehci_poll_PSS(ehci);
out:
turn_on_io_watchdog(ehci);
}