@@ -1664,9 +1664,10 @@ static void __usb_hcd_giveback_urb(struct urb *urb)
16641664 usb_put_urb (urb );
16651665}
16661666
1667- static void usb_giveback_urb_bh (struct tasklet_struct * t )
1667+ static void usb_giveback_urb_bh (struct work_struct * work )
16681668{
1669- struct giveback_urb_bh * bh = from_tasklet (bh , t , bh );
1669+ struct giveback_urb_bh * bh =
1670+ container_of (work , struct giveback_urb_bh , bh );
16701671 struct list_head local_list ;
16711672
16721673 spin_lock_irq (& bh -> lock );
@@ -1691,9 +1692,9 @@ static void usb_giveback_urb_bh(struct tasklet_struct *t)
16911692 spin_lock_irq (& bh -> lock );
16921693 if (!list_empty (& bh -> head )) {
16931694 if (bh -> high_prio )
1694- tasklet_hi_schedule ( & bh -> bh );
1695+ queue_work ( system_bh_highpri_wq , & bh -> bh );
16951696 else
1696- tasklet_schedule ( & bh -> bh );
1697+ queue_work ( system_bh_wq , & bh -> bh );
16971698 }
16981699 bh -> running = false;
16991700 spin_unlock_irq (& bh -> lock );
@@ -1706,7 +1707,7 @@ static void usb_giveback_urb_bh(struct tasklet_struct *t)
17061707 * @status: completion status code for the URB.
17071708 *
17081709 * Context: atomic. The completion callback is invoked in caller's context.
1709- * For HCDs with HCD_BH flag set, the completion callback is invoked in tasklet
1710+ * For HCDs with HCD_BH flag set, the completion callback is invoked in BH
17101711 * context (except for URBs submitted to the root hub which always complete in
17111712 * caller's context).
17121713 *
@@ -1725,7 +1726,7 @@ void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb, int status)
17251726 struct giveback_urb_bh * bh ;
17261727 bool running ;
17271728
1728- /* pass status to tasklet via unlinked */
1729+ /* pass status to BH via unlinked */
17291730 if (likely (!urb -> unlinked ))
17301731 urb -> unlinked = status ;
17311732
@@ -1747,9 +1748,9 @@ void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb, int status)
17471748 if (running )
17481749 ;
17491750 else if (bh -> high_prio )
1750- tasklet_hi_schedule ( & bh -> bh );
1751+ queue_work ( system_bh_highpri_wq , & bh -> bh );
17511752 else
1752- tasklet_schedule ( & bh -> bh );
1753+ queue_work ( system_bh_wq , & bh -> bh );
17531754}
17541755EXPORT_SYMBOL_GPL (usb_hcd_giveback_urb );
17551756
@@ -2540,7 +2541,7 @@ static void init_giveback_urb_bh(struct giveback_urb_bh *bh)
25402541
25412542 spin_lock_init (& bh -> lock );
25422543 INIT_LIST_HEAD (& bh -> head );
2543- tasklet_setup (& bh -> bh , usb_giveback_urb_bh );
2544+ INIT_WORK (& bh -> bh , usb_giveback_urb_bh );
25442545}
25452546
25462547struct usb_hcd * __usb_create_hcd (const struct hc_driver * driver ,
@@ -2926,7 +2927,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
29262927 && device_can_wakeup (& hcd -> self .root_hub -> dev ))
29272928 dev_dbg (hcd -> self .controller , "supports USB remote wakeup\n" );
29282929
2929- /* initialize tasklets */
2930+ /* initialize BHs */
29302931 init_giveback_urb_bh (& hcd -> high_prio_bh );
29312932 hcd -> high_prio_bh .high_prio = true;
29322933 init_giveback_urb_bh (& hcd -> low_prio_bh );
@@ -3036,7 +3037,7 @@ void usb_remove_hcd(struct usb_hcd *hcd)
30363037 mutex_unlock (& usb_bus_idr_lock );
30373038
30383039 /*
3039- * tasklet_kill () isn't needed here because:
3040+ * flush_work () isn't needed here because:
30403041 * - driver's disconnect() called from usb_disconnect() should
30413042 * make sure its URBs are completed during the disconnect()
30423043 * callback
0 commit comments