aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-03-31 18:08:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-03-31 18:08:51 -0400
commit9d919e8d5b04e987b0378cfd73df6cdd2b19e9db (patch)
tree7b82adaf62c7b8523715937b714419e68628bfc2
parentcf6fafcf0588093fadf0c8cd69bebe3b5df136c7 (diff)
parent59ff3eb6d6f75c6c1c3ea8b46ac2cc64eb216547 (diff)
Merge branch 'for-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
Pull workqueue changes from Tejun Heo: "PREPARE_[DELAYED_]WORK() were used to change the work function of work items without fully reinitializing it; however, this makes workqueue consider the work item as a different one from before and allows the work item to start executing before the previous instance is finished which can lead to extremely subtle issues which are painful to debug. The interface has never been popular. This pull request contains patches to remove existing usages and kill the interface. As one of the changes was routed during the last devel cycle and another depended on a pending change in nvme, for-3.15 contains a couple merge commits. In addition, interfaces which were deprecated quite a while ago - __cancel_delayed_work() and WQ_NON_REENTRANT - are removed too" * 'for-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: remove deprecated WQ_NON_REENTRANT workqueue: Spelling s/instensive/intensive/ workqueue: remove PREPARE_[DELAYED_]WORK() staging/fwserial: don't use PREPARE_WORK afs: don't use PREPARE_WORK nvme: don't use PREPARE_WORK usb: don't use PREPARE_DELAYED_WORK floppy: don't use PREPARE_[DELAYED_]WORK ps3-vuart: don't use PREPARE_WORK wireless/rt2x00: don't use PREPARE_WORK in rt2800usb.c workqueue: Remove deprecated __cancel_delayed_work()
-rw-r--r--drivers/block/floppy.c42
-rw-r--r--drivers/block/nvme-core.c18
-rw-r--r--drivers/mmc/host/dw_mmc.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c2
-rw-r--r--drivers/ps3/ps3-vuart.c4
-rw-r--r--drivers/staging/fwserial/fwserial.c13
-rw-r--r--drivers/staging/fwserial/fwserial.h1
-rw-r--r--drivers/usb/core/hub.c4
-rw-r--r--fs/afs/internal.h1
-rw-r--r--fs/afs/rxrpc.c12
-rw-r--r--include/linux/nvme.h1
-rw-r--r--include/linux/workqueue.h38
-rw-r--r--net/l2tp/l2tp_core.c2
13 files changed, 72 insertions, 68 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 2023043ce7c0..8f5565bf34cd 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -961,17 +961,31 @@ static void empty(void)
961{ 961{
962} 962}
963 963
964static DECLARE_WORK(floppy_work, NULL); 964static void (*floppy_work_fn)(void);
965
966static void floppy_work_workfn(struct work_struct *work)
967{
968 floppy_work_fn();
969}
970
971static DECLARE_WORK(floppy_work, floppy_work_workfn);
965 972
966static void schedule_bh(void (*handler)(void)) 973static void schedule_bh(void (*handler)(void))
967{ 974{
968 WARN_ON(work_pending(&floppy_work)); 975 WARN_ON(work_pending(&floppy_work));
969 976
970 PREPARE_WORK(&floppy_work, (work_func_t)handler); 977 floppy_work_fn = handler;
971 queue_work(floppy_wq, &floppy_work); 978 queue_work(floppy_wq, &floppy_work);
972} 979}
973 980
974static DECLARE_DELAYED_WORK(fd_timer, NULL); 981static void (*fd_timer_fn)(void) = NULL;
982
983static void fd_timer_workfn(struct work_struct *work)
984{
985 fd_timer_fn();
986}
987
988static DECLARE_DELAYED_WORK(fd_timer, fd_timer_workfn);
975 989
976static void cancel_activity(void) 990static void cancel_activity(void)
977{ 991{
@@ -982,7 +996,7 @@ static void cancel_activity(void)
982 996
983/* this function makes sure that the disk stays in the drive during the 997/* this function makes sure that the disk stays in the drive during the
984 * transfer */ 998 * transfer */
985static void fd_watchdog(struct work_struct *arg) 999static void fd_watchdog(void)
986{ 1000{
987 debug_dcl(DP->flags, "calling disk change from watchdog\n"); 1001 debug_dcl(DP->flags, "calling disk change from watchdog\n");
988 1002
@@ -993,7 +1007,7 @@ static void fd_watchdog(struct work_struct *arg)
993 reset_fdc(); 1007 reset_fdc();
994 } else { 1008 } else {
995 cancel_delayed_work(&fd_timer); 1009 cancel_delayed_work(&fd_timer);
996 PREPARE_DELAYED_WORK(&fd_timer, fd_watchdog); 1010 fd_timer_fn = fd_watchdog;
997 queue_delayed_work(floppy_wq, &fd_timer, HZ / 10); 1011 queue_delayed_work(floppy_wq, &fd_timer, HZ / 10);
998 } 1012 }
999} 1013}
@@ -1005,7 +1019,8 @@ static void main_command_interrupt(void)
1005} 1019}
1006 1020
1007/* waits for a delay (spinup or select) to pass */ 1021/* waits for a delay (spinup or select) to pass */
1008static int fd_wait_for_completion(unsigned long expires, work_func_t function) 1022static int fd_wait_for_completion(unsigned long expires,
1023 void (*function)(void))
1009{ 1024{
1010 if (FDCS->reset) { 1025 if (FDCS->reset) {
1011 reset_fdc(); /* do the reset during sleep to win time 1026 reset_fdc(); /* do the reset during sleep to win time
@@ -1016,7 +1031,7 @@ static int fd_wait_for_completion(unsigned long expires, work_func_t function)
1016 1031
1017 if (time_before(jiffies, expires)) { 1032 if (time_before(jiffies, expires)) {
1018 cancel_delayed_work(&fd_timer); 1033 cancel_delayed_work(&fd_timer);
1019 PREPARE_DELAYED_WORK(&fd_timer, function); 1034 fd_timer_fn = function;
1020 queue_delayed_work(floppy_wq, &fd_timer, expires - jiffies); 1035 queue_delayed_work(floppy_wq, &fd_timer, expires - jiffies);
1021 return 1; 1036 return 1;
1022 } 1037 }
@@ -1334,8 +1349,7 @@ static int fdc_dtr(void)
1334 * Pause 5 msec to avoid trouble. (Needs to be 2 jiffies) 1349 * Pause 5 msec to avoid trouble. (Needs to be 2 jiffies)
1335 */ 1350 */
1336 FDCS->dtr = raw_cmd->rate & 3; 1351 FDCS->dtr = raw_cmd->rate & 3;
1337 return fd_wait_for_completion(jiffies + 2UL * HZ / 100, 1352 return fd_wait_for_completion(jiffies + 2UL * HZ / 100, floppy_ready);
1338 (work_func_t)floppy_ready);
1339} /* fdc_dtr */ 1353} /* fdc_dtr */
1340 1354
1341static void tell_sector(void) 1355static void tell_sector(void)
@@ -1440,7 +1454,7 @@ static void setup_rw_floppy(void)
1440 int flags; 1454 int flags;
1441 int dflags; 1455 int dflags;
1442 unsigned long ready_date; 1456 unsigned long ready_date;
1443 work_func_t function; 1457 void (*function)(void);
1444 1458
1445 flags = raw_cmd->flags; 1459 flags = raw_cmd->flags;
1446 if (flags & (FD_RAW_READ | FD_RAW_WRITE)) 1460 if (flags & (FD_RAW_READ | FD_RAW_WRITE))
@@ -1454,9 +1468,9 @@ static void setup_rw_floppy(void)
1454 */ 1468 */
1455 if (time_after(ready_date, jiffies + DP->select_delay)) { 1469 if (time_after(ready_date, jiffies + DP->select_delay)) {
1456 ready_date -= DP->select_delay; 1470 ready_date -= DP->select_delay;
1457 function = (work_func_t)floppy_start; 1471 function = floppy_start;
1458 } else 1472 } else
1459 function = (work_func_t)setup_rw_floppy; 1473 function = setup_rw_floppy;
1460 1474
1461 /* wait until the floppy is spinning fast enough */ 1475 /* wait until the floppy is spinning fast enough */
1462 if (fd_wait_for_completion(ready_date, function)) 1476 if (fd_wait_for_completion(ready_date, function))
@@ -1486,7 +1500,7 @@ static void setup_rw_floppy(void)
1486 inr = result(); 1500 inr = result();
1487 cont->interrupt(); 1501 cont->interrupt();
1488 } else if (flags & FD_RAW_NEED_DISK) 1502 } else if (flags & FD_RAW_NEED_DISK)
1489 fd_watchdog(NULL); 1503 fd_watchdog();
1490} 1504}
1491 1505
1492static int blind_seek; 1506static int blind_seek;
@@ -1863,7 +1877,7 @@ static int start_motor(void (*function)(void))
1863 1877
1864 /* wait_for_completion also schedules reset if needed. */ 1878 /* wait_for_completion also schedules reset if needed. */
1865 return fd_wait_for_completion(DRS->select_date + DP->select_delay, 1879 return fd_wait_for_completion(DRS->select_date + DP->select_delay,
1866 (work_func_t)function); 1880 function);
1867} 1881}
1868 1882
1869static void floppy_ready(void) 1883static void floppy_ready(void)
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index 51824d1f23ea..8459e4e7c719 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -993,7 +993,7 @@ static void nvme_abort_cmd(int cmdid, struct nvme_queue *nvmeq)
993 dev_warn(&dev->pci_dev->dev, 993 dev_warn(&dev->pci_dev->dev,
994 "I/O %d QID %d timeout, reset controller\n", cmdid, 994 "I/O %d QID %d timeout, reset controller\n", cmdid,
995 nvmeq->qid); 995 nvmeq->qid);
996 PREPARE_WORK(&dev->reset_work, nvme_reset_failed_dev); 996 dev->reset_workfn = nvme_reset_failed_dev;
997 queue_work(nvme_workq, &dev->reset_work); 997 queue_work(nvme_workq, &dev->reset_work);
998 return; 998 return;
999 } 999 }
@@ -1696,8 +1696,7 @@ static int nvme_kthread(void *data)
1696 list_del_init(&dev->node); 1696 list_del_init(&dev->node);
1697 dev_warn(&dev->pci_dev->dev, 1697 dev_warn(&dev->pci_dev->dev,
1698 "Failed status, reset controller\n"); 1698 "Failed status, reset controller\n");
1699 PREPARE_WORK(&dev->reset_work, 1699 dev->reset_workfn = nvme_reset_failed_dev;
1700 nvme_reset_failed_dev);
1701 queue_work(nvme_workq, &dev->reset_work); 1700 queue_work(nvme_workq, &dev->reset_work);
1702 continue; 1701 continue;
1703 } 1702 }
@@ -2406,7 +2405,7 @@ static int nvme_dev_resume(struct nvme_dev *dev)
2406 return ret; 2405 return ret;
2407 if (ret == -EBUSY) { 2406 if (ret == -EBUSY) {
2408 spin_lock(&dev_list_lock); 2407 spin_lock(&dev_list_lock);
2409 PREPARE_WORK(&dev->reset_work, nvme_remove_disks); 2408 dev->reset_workfn = nvme_remove_disks;
2410 queue_work(nvme_workq, &dev->reset_work); 2409 queue_work(nvme_workq, &dev->reset_work);
2411 spin_unlock(&dev_list_lock); 2410 spin_unlock(&dev_list_lock);
2412 } 2411 }
@@ -2435,6 +2434,12 @@ static void nvme_reset_failed_dev(struct work_struct *ws)
2435 nvme_dev_reset(dev); 2434 nvme_dev_reset(dev);
2436} 2435}
2437 2436
2437static void nvme_reset_workfn(struct work_struct *work)
2438{
2439 struct nvme_dev *dev = container_of(work, struct nvme_dev, reset_work);
2440 dev->reset_workfn(work);
2441}
2442
2438static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) 2443static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
2439{ 2444{
2440 int result = -ENOMEM; 2445 int result = -ENOMEM;
@@ -2453,7 +2458,8 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
2453 goto free; 2458 goto free;
2454 2459
2455 INIT_LIST_HEAD(&dev->namespaces); 2460 INIT_LIST_HEAD(&dev->namespaces);
2456 INIT_WORK(&dev->reset_work, nvme_reset_failed_dev); 2461 dev->reset_workfn = nvme_reset_failed_dev;
2462 INIT_WORK(&dev->reset_work, nvme_reset_workfn);
2457 dev->pci_dev = pdev; 2463 dev->pci_dev = pdev;
2458 pci_set_drvdata(pdev, dev); 2464 pci_set_drvdata(pdev, dev);
2459 result = nvme_set_instance(dev); 2465 result = nvme_set_instance(dev);
@@ -2553,7 +2559,7 @@ static int nvme_resume(struct device *dev)
2553 struct nvme_dev *ndev = pci_get_drvdata(pdev); 2559 struct nvme_dev *ndev = pci_get_drvdata(pdev);
2554 2560
2555 if (nvme_dev_resume(ndev) && !work_busy(&ndev->reset_work)) { 2561 if (nvme_dev_resume(ndev) && !work_busy(&ndev->reset_work)) {
2556 PREPARE_WORK(&ndev->reset_work, nvme_reset_failed_dev); 2562 ndev->reset_workfn = nvme_reset_failed_dev;
2557 queue_work(nvme_workq, &ndev->reset_work); 2563 queue_work(nvme_workq, &ndev->reset_work);
2558 } 2564 }
2559 return 0; 2565 return 0;
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 55cd110a49c4..c204b7d1532c 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2607,7 +2607,7 @@ int dw_mci_probe(struct dw_mci *host)
2607 2607
2608 tasklet_init(&host->tasklet, dw_mci_tasklet_func, (unsigned long)host); 2608 tasklet_init(&host->tasklet, dw_mci_tasklet_func, (unsigned long)host);
2609 host->card_workqueue = alloc_workqueue("dw-mci-card", 2609 host->card_workqueue = alloc_workqueue("dw-mci-card",
2610 WQ_MEM_RECLAIM | WQ_NON_REENTRANT, 1); 2610 WQ_MEM_RECLAIM, 1);
2611 if (!host->card_workqueue) { 2611 if (!host->card_workqueue) {
2612 ret = -ENOMEM; 2612 ret = -ENOMEM;
2613 goto err_dmaunmap; 2613 goto err_dmaunmap;
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index caddc1b427a9..42a2e06512f2 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -764,7 +764,7 @@ static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev)
764 /* 764 /*
765 * Overwrite TX done handler 765 * Overwrite TX done handler
766 */ 766 */
767 PREPARE_WORK(&rt2x00dev->txdone_work, rt2800usb_work_txdone); 767 INIT_WORK(&rt2x00dev->txdone_work, rt2800usb_work_txdone);
768 768
769 return 0; 769 return 0;
770} 770}
diff --git a/drivers/ps3/ps3-vuart.c b/drivers/ps3/ps3-vuart.c
index fb7300837fee..bc1e5139ba29 100644
--- a/drivers/ps3/ps3-vuart.c
+++ b/drivers/ps3/ps3-vuart.c
@@ -699,8 +699,6 @@ int ps3_vuart_read_async(struct ps3_system_bus_device *dev, unsigned int bytes)
699 699
700 BUG_ON(!bytes); 700 BUG_ON(!bytes);
701 701
702 PREPARE_WORK(&priv->rx_list.work.work, ps3_vuart_work);
703
704 spin_lock_irqsave(&priv->rx_list.lock, flags); 702 spin_lock_irqsave(&priv->rx_list.lock, flags);
705 if (priv->rx_list.bytes_held >= bytes) { 703 if (priv->rx_list.bytes_held >= bytes) {
706 dev_dbg(&dev->core, "%s:%d: schedule_work %xh bytes\n", 704 dev_dbg(&dev->core, "%s:%d: schedule_work %xh bytes\n",
@@ -1052,7 +1050,7 @@ static int ps3_vuart_probe(struct ps3_system_bus_device *dev)
1052 INIT_LIST_HEAD(&priv->rx_list.head); 1050 INIT_LIST_HEAD(&priv->rx_list.head);
1053 spin_lock_init(&priv->rx_list.lock); 1051 spin_lock_init(&priv->rx_list.lock);
1054 1052
1055 INIT_WORK(&priv->rx_list.work.work, NULL); 1053 INIT_WORK(&priv->rx_list.work.work, ps3_vuart_work);
1056 priv->rx_list.work.trigger = 0; 1054 priv->rx_list.work.trigger = 0;
1057 priv->rx_list.work.dev = dev; 1055 priv->rx_list.work.dev = dev;
1058 1056
diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index 8af136e9c9dc..b22142ee5262 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -2036,6 +2036,13 @@ static void fwserial_auto_connect(struct work_struct *work)
2036 schedule_delayed_work(&peer->connect, CONNECT_RETRY_DELAY); 2036 schedule_delayed_work(&peer->connect, CONNECT_RETRY_DELAY);
2037} 2037}
2038 2038
2039static void fwserial_peer_workfn(struct work_struct *work)
2040{
2041 struct fwtty_peer *peer = to_peer(work, work);
2042
2043 peer->workfn(work);
2044}
2045
2039/** 2046/**
2040 * fwserial_add_peer - add a newly probed 'serial' unit device as a 'peer' 2047 * fwserial_add_peer - add a newly probed 'serial' unit device as a 'peer'
2041 * @serial: aggregate representing the specific fw_card to add the peer to 2048 * @serial: aggregate representing the specific fw_card to add the peer to
@@ -2100,7 +2107,7 @@ static int fwserial_add_peer(struct fw_serial *serial, struct fw_unit *unit)
2100 peer->port = NULL; 2107 peer->port = NULL;
2101 2108
2102 init_timer(&peer->timer); 2109 init_timer(&peer->timer);
2103 INIT_WORK(&peer->work, NULL); 2110 INIT_WORK(&peer->work, fwserial_peer_workfn);
2104 INIT_DELAYED_WORK(&peer->connect, fwserial_auto_connect); 2111 INIT_DELAYED_WORK(&peer->connect, fwserial_auto_connect);
2105 2112
2106 /* associate peer with specific fw_card */ 2113 /* associate peer with specific fw_card */
@@ -2702,7 +2709,7 @@ static int fwserial_parse_mgmt_write(struct fwtty_peer *peer,
2702 2709
2703 } else { 2710 } else {
2704 peer->work_params.plug_req = pkt->plug_req; 2711 peer->work_params.plug_req = pkt->plug_req;
2705 PREPARE_WORK(&peer->work, fwserial_handle_plug_req); 2712 peer->workfn = fwserial_handle_plug_req;
2706 queue_work(system_unbound_wq, &peer->work); 2713 queue_work(system_unbound_wq, &peer->work);
2707 } 2714 }
2708 break; 2715 break;
@@ -2731,7 +2738,7 @@ static int fwserial_parse_mgmt_write(struct fwtty_peer *peer,
2731 fwtty_err(&peer->unit, "unplug req: busy\n"); 2738 fwtty_err(&peer->unit, "unplug req: busy\n");
2732 rcode = RCODE_CONFLICT_ERROR; 2739 rcode = RCODE_CONFLICT_ERROR;
2733 } else { 2740 } else {
2734 PREPARE_WORK(&peer->work, fwserial_handle_unplug_req); 2741 peer->workfn = fwserial_handle_unplug_req;
2735 queue_work(system_unbound_wq, &peer->work); 2742 queue_work(system_unbound_wq, &peer->work);
2736 } 2743 }
2737 break; 2744 break;
diff --git a/drivers/staging/fwserial/fwserial.h b/drivers/staging/fwserial/fwserial.h
index 54f7f9b9b212..98b853d4acbc 100644
--- a/drivers/staging/fwserial/fwserial.h
+++ b/drivers/staging/fwserial/fwserial.h
@@ -91,6 +91,7 @@ struct fwtty_peer {
91 struct rcu_head rcu; 91 struct rcu_head rcu;
92 92
93 spinlock_t lock; 93 spinlock_t lock;
94 work_func_t workfn;
94 struct work_struct work; 95 struct work_struct work;
95 struct peer_work_params work_params; 96 struct peer_work_params work_params;
96 struct timer_list timer; 97 struct timer_list timer;
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 64ea21971be2..5cbf78d0be25 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1040,7 +1040,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
1040 */ 1040 */
1041 if (type == HUB_INIT) { 1041 if (type == HUB_INIT) {
1042 delay = hub_power_on(hub, false); 1042 delay = hub_power_on(hub, false);
1043 PREPARE_DELAYED_WORK(&hub->init_work, hub_init_func2); 1043 INIT_DELAYED_WORK(&hub->init_work, hub_init_func2);
1044 schedule_delayed_work(&hub->init_work, 1044 schedule_delayed_work(&hub->init_work,
1045 msecs_to_jiffies(delay)); 1045 msecs_to_jiffies(delay));
1046 1046
@@ -1194,7 +1194,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
1194 1194
1195 /* Don't do a long sleep inside a workqueue routine */ 1195 /* Don't do a long sleep inside a workqueue routine */
1196 if (type == HUB_INIT2) { 1196 if (type == HUB_INIT2) {
1197 PREPARE_DELAYED_WORK(&hub->init_work, hub_init_func3); 1197 INIT_DELAYED_WORK(&hub->init_work, hub_init_func3);
1198 schedule_delayed_work(&hub->init_work, 1198 schedule_delayed_work(&hub->init_work,
1199 msecs_to_jiffies(delay)); 1199 msecs_to_jiffies(delay));
1200 return; /* Continues at init3: below */ 1200 return; /* Continues at init3: below */
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index 6621f8008122..be75b500005d 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -75,6 +75,7 @@ struct afs_call {
75 const struct afs_call_type *type; /* type of call */ 75 const struct afs_call_type *type; /* type of call */
76 const struct afs_wait_mode *wait_mode; /* completion wait mode */ 76 const struct afs_wait_mode *wait_mode; /* completion wait mode */
77 wait_queue_head_t waitq; /* processes awaiting completion */ 77 wait_queue_head_t waitq; /* processes awaiting completion */
78 work_func_t async_workfn;
78 struct work_struct async_work; /* asynchronous work processor */ 79 struct work_struct async_work; /* asynchronous work processor */
79 struct work_struct work; /* actual work processor */ 80 struct work_struct work; /* actual work processor */
80 struct sk_buff_head rx_queue; /* received packets */ 81 struct sk_buff_head rx_queue; /* received packets */
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
index 8ad8c2a0703a..ef943df73b8c 100644
--- a/fs/afs/rxrpc.c
+++ b/fs/afs/rxrpc.c
@@ -644,7 +644,7 @@ static void afs_process_async_call(struct work_struct *work)
644 644
645 /* we can't just delete the call because the work item may be 645 /* we can't just delete the call because the work item may be
646 * queued */ 646 * queued */
647 PREPARE_WORK(&call->async_work, afs_delete_async_call); 647 call->async_workfn = afs_delete_async_call;
648 queue_work(afs_async_calls, &call->async_work); 648 queue_work(afs_async_calls, &call->async_work);
649 } 649 }
650 650
@@ -663,6 +663,13 @@ void afs_transfer_reply(struct afs_call *call, struct sk_buff *skb)
663 call->reply_size += len; 663 call->reply_size += len;
664} 664}
665 665
666static void afs_async_workfn(struct work_struct *work)
667{
668 struct afs_call *call = container_of(work, struct afs_call, async_work);
669
670 call->async_workfn(work);
671}
672
666/* 673/*
667 * accept the backlog of incoming calls 674 * accept the backlog of incoming calls
668 */ 675 */
@@ -685,7 +692,8 @@ static void afs_collect_incoming_call(struct work_struct *work)
685 return; 692 return;
686 } 693 }
687 694
688 INIT_WORK(&call->async_work, afs_process_async_call); 695 call->async_workfn = afs_process_async_call;
696 INIT_WORK(&call->async_work, afs_async_workfn);
689 call->wait_mode = &afs_async_incoming_call; 697 call->wait_mode = &afs_async_incoming_call;
690 call->type = &afs_RXCMxxxx; 698 call->type = &afs_RXCMxxxx;
691 init_waitqueue_head(&call->waitq); 699 init_waitqueue_head(&call->waitq);
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index 69ae03f6eb15..6b9aafed225f 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -87,6 +87,7 @@ struct nvme_dev {
87 struct list_head namespaces; 87 struct list_head namespaces;
88 struct kref kref; 88 struct kref kref;
89 struct miscdevice miscdev; 89 struct miscdevice miscdev;
90 work_func_t reset_workfn;
90 struct work_struct reset_work; 91 struct work_struct reset_work;
91 char name[12]; 92 char name[12];
92 char serial[20]; 93 char serial[20];
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 704f4f652d0a..532994651684 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -177,17 +177,6 @@ struct execute_work {
177#define DECLARE_DEFERRABLE_WORK(n, f) \ 177#define DECLARE_DEFERRABLE_WORK(n, f) \
178 struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f, TIMER_DEFERRABLE) 178 struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f, TIMER_DEFERRABLE)
179 179
180/*
181 * initialize a work item's function pointer
182 */
183#define PREPARE_WORK(_work, _func) \
184 do { \
185 (_work)->func = (_func); \
186 } while (0)
187
188#define PREPARE_DELAYED_WORK(_work, _func) \
189 PREPARE_WORK(&(_work)->work, (_func))
190
191#ifdef CONFIG_DEBUG_OBJECTS_WORK 180#ifdef CONFIG_DEBUG_OBJECTS_WORK
192extern void __init_work(struct work_struct *work, int onstack); 181extern void __init_work(struct work_struct *work, int onstack);
193extern void destroy_work_on_stack(struct work_struct *work); 182extern void destroy_work_on_stack(struct work_struct *work);
@@ -217,7 +206,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
217 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ 206 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \
218 lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0); \ 207 lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0); \
219 INIT_LIST_HEAD(&(_work)->entry); \ 208 INIT_LIST_HEAD(&(_work)->entry); \
220 PREPARE_WORK((_work), (_func)); \ 209 (_work)->func = (_func); \
221 } while (0) 210 } while (0)
222#else 211#else
223#define __INIT_WORK(_work, _func, _onstack) \ 212#define __INIT_WORK(_work, _func, _onstack) \
@@ -225,7 +214,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
225 __init_work((_work), _onstack); \ 214 __init_work((_work), _onstack); \
226 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ 215 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \
227 INIT_LIST_HEAD(&(_work)->entry); \ 216 INIT_LIST_HEAD(&(_work)->entry); \
228 PREPARE_WORK((_work), (_func)); \ 217 (_work)->func = (_func); \
229 } while (0) 218 } while (0)
230#endif 219#endif
231 220
@@ -295,17 +284,11 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
295 * Documentation/workqueue.txt. 284 * Documentation/workqueue.txt.
296 */ 285 */
297enum { 286enum {
298 /*
299 * All wqs are now non-reentrant making the following flag
300 * meaningless. Will be removed.
301 */
302 WQ_NON_REENTRANT = 1 << 0, /* DEPRECATED */
303
304 WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ 287 WQ_UNBOUND = 1 << 1, /* not bound to any cpu */
305 WQ_FREEZABLE = 1 << 2, /* freeze during suspend */ 288 WQ_FREEZABLE = 1 << 2, /* freeze during suspend */
306 WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */ 289 WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */
307 WQ_HIGHPRI = 1 << 4, /* high priority */ 290 WQ_HIGHPRI = 1 << 4, /* high priority */
308 WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ 291 WQ_CPU_INTENSIVE = 1 << 5, /* cpu intensive workqueue */
309 WQ_SYSFS = 1 << 6, /* visible in sysfs, see wq_sysfs_register() */ 292 WQ_SYSFS = 1 << 6, /* visible in sysfs, see wq_sysfs_register() */
310 293
311 /* 294 /*
@@ -602,21 +585,6 @@ static inline bool keventd_up(void)
602 return system_wq != NULL; 585 return system_wq != NULL;
603} 586}
604 587
605/*
606 * Like above, but uses del_timer() instead of del_timer_sync(). This means,
607 * if it returns 0 the timer function may be running and the queueing is in
608 * progress.
609 */
610static inline bool __deprecated __cancel_delayed_work(struct delayed_work *work)
611{
612 bool ret;
613
614 ret = del_timer(&work->timer);
615 if (ret)
616 work_clear_pending(&work->work);
617 return ret;
618}
619
620/* used to be different but now identical to flush_work(), deprecated */ 588/* used to be different but now identical to flush_work(), deprecated */
621static inline bool __deprecated flush_work_sync(struct work_struct *work) 589static inline bool __deprecated flush_work_sync(struct work_struct *work)
622{ 590{
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 85d9d94c0a3c..c83827e7c324 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -2016,7 +2016,7 @@ static int __init l2tp_init(void)
2016 if (rc) 2016 if (rc)
2017 goto out; 2017 goto out;
2018 2018
2019 l2tp_wq = alloc_workqueue("l2tp", WQ_NON_REENTRANT | WQ_UNBOUND, 0); 2019 l2tp_wq = alloc_workqueue("l2tp", WQ_UNBOUND, 0);
2020 if (!l2tp_wq) { 2020 if (!l2tp_wq) {
2021 pr_err("alloc_workqueue failed\n"); 2021 pr_err("alloc_workqueue failed\n");
2022 rc = -ENOMEM; 2022 rc = -ENOMEM;