From cdb4dd15e62eb984d9461b520d15d00ff2b88d9d Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Fri, 18 Jul 2014 16:26:07 -0400 Subject: USB: OHCI: make URB completions single-threaded URBs for a particular endpoint should complete sequentially. That is, we shouldn't call the completion handler for one URB until the handler for the previous URB has returned. When the OHCI watchdog routine is added, there will be two paths for completing URBs: interrupt handler and watchdog routine. Their activities have to be synchronized so that completions don't occur in multiple threads concurrently. For that purpose, this patch creates an ohci_work() routine which will be responsible for calling process_done_list() and finish_unlinks(), the two routines that detect when an URB is complete. Everything will funnel through ohci_work(), and it will be careful not to run in more than one thread at a time. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/ohci.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/usb/host/ohci.h') diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h index a8259bc6fd8b..ef348c2e1e4b 100644 --- a/drivers/usb/host/ohci.h +++ b/drivers/usb/host/ohci.h @@ -393,6 +393,8 @@ struct ohci_hcd { unsigned long next_statechange; /* suspend/resume */ u32 fminterval; /* saved register */ unsigned autostop:1; /* rh auto stopping/stopped */ + unsigned working:1; + unsigned restart_work:1; unsigned long flags; /* for HC bugs */ #define OHCI_QUIRK_AMD756 0x01 /* erratum #4 */ -- cgit v1.2.3