[PATCH] USB: Simplify locking in UHCI
This patch is an amalgam of 9 contributions from Stephen Hemminger. It begins the process of straightening out the use of semaphores and locking in the UHCI driver by removing unneeded irqsaves and irqrestores. It also removes an unnecessary list node and makes a couple of other small changes. clear_next_interrupt only called in IRQ context don't need irqsave/restore Since uhci_finish_completion is only called from IRQ routine, the irqsave/irqrestore is redundant and unnecessary. UHCI transfer_result is only called from IRQ context so irqsave/restore is unnecessary here. uhci_finish_urb is always called from irq so no need for irqsave/irqrestore. uhci_add_complete only called from IRQ context The complete_list element in the urb private data is redundant, since it is only used when the urb is on the complete list. And given the state transitions, an urb can't be on the complete list and any other list (remove, or urb_list). Therefore just use urb_list to link the complete_list Use list_move_tail to move between remove (or urb_list) and the complete_list. Save irq state in uhci_stop so that the irqsave/irqrestore's in all the free_pending and remove_pending code can be eliminated. Since uhci_stop now saves IRQ state, the free/remove pending routines no longer need irqsave/irqrestore.
Showing
Please register or sign in to comment