@@ -1664,9 +1664,10 @@ static void __usb_hcd_giveback_urb(struct urb *urb)
1664
1664
usb_put_urb (urb );
1665
1665
}
1666
1666
1667
- static void usb_giveback_urb_bh (struct tasklet_struct * t )
1667
+ static void usb_giveback_urb_bh (struct work_struct * work )
1668
1668
{
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 );
1670
1671
struct list_head local_list ;
1671
1672
1672
1673
spin_lock_irq (& bh -> lock );
@@ -1691,9 +1692,9 @@ static void usb_giveback_urb_bh(struct tasklet_struct *t)
1691
1692
spin_lock_irq (& bh -> lock );
1692
1693
if (!list_empty (& bh -> head )) {
1693
1694
if (bh -> high_prio )
1694
- tasklet_hi_schedule ( & bh -> bh );
1695
+ queue_work ( system_bh_highpri_wq , & bh -> bh );
1695
1696
else
1696
- tasklet_schedule ( & bh -> bh );
1697
+ queue_work ( system_bh_wq , & bh -> bh );
1697
1698
}
1698
1699
bh -> running = false;
1699
1700
spin_unlock_irq (& bh -> lock );
@@ -1706,7 +1707,7 @@ static void usb_giveback_urb_bh(struct tasklet_struct *t)
1706
1707
* @status: completion status code for the URB.
1707
1708
*
1708
1709
* 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
1710
1711
* context (except for URBs submitted to the root hub which always complete in
1711
1712
* caller's context).
1712
1713
*
@@ -1725,7 +1726,7 @@ void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb, int status)
1725
1726
struct giveback_urb_bh * bh ;
1726
1727
bool running ;
1727
1728
1728
- /* pass status to tasklet via unlinked */
1729
+ /* pass status to BH via unlinked */
1729
1730
if (likely (!urb -> unlinked ))
1730
1731
urb -> unlinked = status ;
1731
1732
@@ -1747,9 +1748,9 @@ void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb, int status)
1747
1748
if (running )
1748
1749
;
1749
1750
else if (bh -> high_prio )
1750
- tasklet_hi_schedule ( & bh -> bh );
1751
+ queue_work ( system_bh_highpri_wq , & bh -> bh );
1751
1752
else
1752
- tasklet_schedule ( & bh -> bh );
1753
+ queue_work ( system_bh_wq , & bh -> bh );
1753
1754
}
1754
1755
EXPORT_SYMBOL_GPL (usb_hcd_giveback_urb );
1755
1756
@@ -2540,7 +2541,7 @@ static void init_giveback_urb_bh(struct giveback_urb_bh *bh)
2540
2541
2541
2542
spin_lock_init (& bh -> lock );
2542
2543
INIT_LIST_HEAD (& bh -> head );
2543
- tasklet_setup (& bh -> bh , usb_giveback_urb_bh );
2544
+ INIT_WORK (& bh -> bh , usb_giveback_urb_bh );
2544
2545
}
2545
2546
2546
2547
struct usb_hcd * __usb_create_hcd (const struct hc_driver * driver ,
@@ -2926,7 +2927,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
2926
2927
&& device_can_wakeup (& hcd -> self .root_hub -> dev ))
2927
2928
dev_dbg (hcd -> self .controller , "supports USB remote wakeup\n" );
2928
2929
2929
- /* initialize tasklets */
2930
+ /* initialize BHs */
2930
2931
init_giveback_urb_bh (& hcd -> high_prio_bh );
2931
2932
hcd -> high_prio_bh .high_prio = true;
2932
2933
init_giveback_urb_bh (& hcd -> low_prio_bh );
@@ -3036,7 +3037,7 @@ void usb_remove_hcd(struct usb_hcd *hcd)
3036
3037
mutex_unlock (& usb_bus_idr_lock );
3037
3038
3038
3039
/*
3039
- * tasklet_kill () isn't needed here because:
3040
+ * flush_work () isn't needed here because:
3040
3041
* - driver's disconnect() called from usb_disconnect() should
3041
3042
* make sure its URBs are completed during the disconnect()
3042
3043
* callback
0 commit comments