]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - drivers/usb/core/hcd.c
Merge tag 'usb-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
[thirdparty/linux.git] / drivers / usb / core / hcd.c
index 14fc28c4cf485aef970f9595e15706440539d4a8..c0e005670d67d1b9cf0b8cdb03d12635148772d6 100644 (file)
@@ -1662,9 +1662,10 @@ static void __usb_hcd_giveback_urb(struct urb *urb)
        usb_put_urb(urb);
 }
 
-static void usb_giveback_urb_bh(struct tasklet_struct *t)
+static void usb_giveback_urb_bh(struct work_struct *work)
 {
-       struct giveback_urb_bh *bh = from_tasklet(bh, t, bh);
+       struct giveback_urb_bh *bh =
+               container_of(work, struct giveback_urb_bh, bh);
        struct list_head local_list;
 
        spin_lock_irq(&bh->lock);
@@ -1689,9 +1690,9 @@ static void usb_giveback_urb_bh(struct tasklet_struct *t)
        spin_lock_irq(&bh->lock);
        if (!list_empty(&bh->head)) {
                if (bh->high_prio)
-                       tasklet_hi_schedule(&bh->bh);
+                       queue_work(system_bh_highpri_wq, &bh->bh);
                else
-                       tasklet_schedule(&bh->bh);
+                       queue_work(system_bh_wq, &bh->bh);
        }
        bh->running = false;
        spin_unlock_irq(&bh->lock);
@@ -1704,7 +1705,7 @@ static void usb_giveback_urb_bh(struct tasklet_struct *t)
  * @status: completion status code for the URB.
  *
  * Context: atomic. The completion callback is invoked in caller's context.
- * For HCDs with HCD_BH flag set, the completion callback is invoked in tasklet
+ * For HCDs with HCD_BH flag set, the completion callback is invoked in BH
  * context (except for URBs submitted to the root hub which always complete in
  * caller's context).
  *
@@ -1723,7 +1724,7 @@ void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb, int status)
        struct giveback_urb_bh *bh;
        bool running;
 
-       /* pass status to tasklet via unlinked */
+       /* pass status to BH via unlinked */
        if (likely(!urb->unlinked))
                urb->unlinked = status;
 
@@ -1745,9 +1746,9 @@ void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb, int status)
        if (running)
                ;
        else if (bh->high_prio)
-               tasklet_hi_schedule(&bh->bh);
+               queue_work(system_bh_highpri_wq, &bh->bh);
        else
-               tasklet_schedule(&bh->bh);
+               queue_work(system_bh_wq, &bh->bh);
 }
 EXPORT_SYMBOL_GPL(usb_hcd_giveback_urb);
 
@@ -2538,7 +2539,7 @@ static void init_giveback_urb_bh(struct giveback_urb_bh *bh)
 
        spin_lock_init(&bh->lock);
        INIT_LIST_HEAD(&bh->head);
-       tasklet_setup(&bh->bh, usb_giveback_urb_bh);
+       INIT_WORK(&bh->bh, usb_giveback_urb_bh);
 }
 
 struct usb_hcd *__usb_create_hcd(const struct hc_driver *driver,
@@ -2930,7 +2931,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
                        && device_can_wakeup(&hcd->self.root_hub->dev))
                dev_dbg(hcd->self.controller, "supports USB remote wakeup\n");
 
-       /* initialize tasklets */
+       /* initialize BHs */
        init_giveback_urb_bh(&hcd->high_prio_bh);
        hcd->high_prio_bh.high_prio = true;
        init_giveback_urb_bh(&hcd->low_prio_bh);
@@ -3040,7 +3041,7 @@ void usb_remove_hcd(struct usb_hcd *hcd)
        mutex_unlock(&usb_bus_idr_lock);
 
        /*
-        * tasklet_kill() isn't needed here because:
+        * flush_work() isn't needed here because:
         * - driver's disconnect() called from usb_disconnect() should
         *   make sure its URBs are completed during the disconnect()
         *   callback