Skip to content

Commit 23d69b0

Browse files
committed
Merge branch 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
* 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: (33 commits) usb: don't use flush_scheduled_work() speedtch: don't abuse struct delayed_work media/video: don't use flush_scheduled_work() media/video: explicitly flush request_module work ioc4: use static work_struct for ioc4_load_modules() init: don't call flush_scheduled_work() from do_initcalls() s390: don't use flush_scheduled_work() rtc: don't use flush_scheduled_work() mmc: update workqueue usages mfd: update workqueue usages dvb: don't use flush_scheduled_work() leds-wm8350: don't use flush_scheduled_work() mISDN: don't use flush_scheduled_work() macintosh/ams: don't use flush_scheduled_work() vmwgfx: don't use flush_scheduled_work() tpm: don't use flush_scheduled_work() sonypi: don't use flush_scheduled_work() hvsi: don't use flush_scheduled_work() xen: don't use flush_scheduled_work() gdrom: don't use flush_scheduled_work() ... Fixed up trivial conflict in drivers/media/video/bt8xx/bttv-input.c as per Tejun.
2 parents e744070 + 569ff2d commit 23d69b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+289
-156
lines changed

Documentation/feature-removal-schedule.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,3 +566,13 @@ Why: This field is deprecated. I2C device drivers shouldn't change their
566566
Who: Jean Delvare <[email protected]>
567567

568568
----------------------------
569+
570+
What: cancel_rearming_delayed_work[queue]()
571+
When: 2.6.39
572+
573+
Why: The functions have been superceded by cancel_delayed_work_sync()
574+
quite some time ago. The conversion is trivial and there is no
575+
in-kernel user left.
576+
Who: Tejun Heo <[email protected]>
577+
578+
----------------------------

arch/arm/mach-pxa/sharpsl_pm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,8 @@ static int sharpsl_ac_check(void)
579579
static int sharpsl_pm_suspend(struct platform_device *pdev, pm_message_t state)
580580
{
581581
sharpsl_pm.flags |= SHARPSL_SUSPENDED;
582-
flush_scheduled_work();
582+
flush_delayed_work_sync(&toggle_charger);
583+
flush_delayed_work_sync(&sharpsl_bat);
583584

584585
if (sharpsl_pm.charge_mode == CHRG_ON)
585586
sharpsl_pm.flags |= SHARPSL_DO_OFFLINE_CHRG;

arch/sh/drivers/push-switch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static int switch_drv_remove(struct platform_device *pdev)
107107
device_remove_file(&pdev->dev, &dev_attr_switch);
108108

109109
platform_set_drvdata(pdev, NULL);
110-
flush_scheduled_work();
110+
flush_work_sync(&psw->work);
111111
del_timer_sync(&psw->debounce);
112112
free_irq(irq, pdev);
113113

drivers/ata/libata-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6128,7 +6128,7 @@ static void ata_port_detach(struct ata_port *ap)
61286128
/* it better be dead now */
61296129
WARN_ON(!(ap->pflags & ATA_PFLAG_UNLOADED));
61306130

6131-
cancel_rearming_delayed_work(&ap->hotplug_task);
6131+
cancel_delayed_work_sync(&ap->hotplug_task);
61326132

61336133
skip_eh:
61346134
if (ap->pmp_link) {

drivers/ata/libata-sff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ void ata_sff_flush_pio_task(struct ata_port *ap)
13201320
{
13211321
DPRINTK("ENTER\n");
13221322

1323-
cancel_rearming_delayed_work(&ap->sff_pio_task);
1323+
cancel_delayed_work_sync(&ap->sff_pio_task);
13241324
ap->hsm_task_state = HSM_ST_IDLE;
13251325

13261326
if (ata_msg_ctl(ap))

drivers/block/floppy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4352,7 +4352,7 @@ static int __init floppy_init(void)
43524352
out_unreg_platform_dev:
43534353
platform_device_unregister(&floppy_device[drive]);
43544354
out_flush_work:
4355-
flush_scheduled_work();
4355+
flush_work_sync(&floppy_work);
43564356
if (atomic_read(&usage_count))
43574357
floppy_release_irq_and_dma();
43584358
out_unreg_region:
@@ -4422,7 +4422,7 @@ static int floppy_grab_irq_and_dma(void)
44224422
* We might have scheduled a free_irq(), wait it to
44234423
* drain first:
44244424
*/
4425-
flush_scheduled_work();
4425+
flush_work_sync(&floppy_work);
44264426

44274427
if (fd_request_irq()) {
44284428
DPRINT("Unable to grab IRQ%d for the floppy driver\n",

drivers/block/xen-blkfront.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ static void xlvbd_release_gendisk(struct blkfront_info *info)
547547
spin_unlock_irqrestore(&blkif_io_lock, flags);
548548

549549
/* Flush gnttab callback work. Must be done with no locks held. */
550-
flush_scheduled_work();
550+
flush_work_sync(&info->work);
551551

552552
del_gendisk(info->gd);
553553

@@ -596,7 +596,7 @@ static void blkif_free(struct blkfront_info *info, int suspend)
596596
spin_unlock_irq(&blkif_io_lock);
597597

598598
/* Flush gnttab callback work. Must be done with no locks held. */
599-
flush_scheduled_work();
599+
flush_work_sync(&info->work);
600600

601601
/* Free resources associated with old device channel. */
602602
if (info->ring_ref != GRANT_INVALID_REF) {

drivers/cdrom/gdrom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ static int __devinit probe_gdrom(struct platform_device *devptr)
837837

838838
static int __devexit remove_gdrom(struct platform_device *devptr)
839839
{
840-
flush_scheduled_work();
840+
flush_work_sync(&work);
841841
blk_cleanup_queue(gd.gdrom_rq);
842842
free_irq(HW_EVENT_GDROM_CMD, &gd);
843843
free_irq(HW_EVENT_GDROM_DMA, &gd);

drivers/char/hvsi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,8 +850,8 @@ static void hvsi_flush_output(struct hvsi_struct *hp)
850850
wait_event_timeout(hp->emptyq, (hp->n_outbuf <= 0), HVSI_TIMEOUT);
851851

852852
/* 'writer' could still be pending if it didn't see n_outbuf = 0 yet */
853-
cancel_delayed_work(&hp->writer);
854-
flush_scheduled_work();
853+
cancel_delayed_work_sync(&hp->writer);
854+
flush_work_sync(&hp->handshaker);
855855

856856
/*
857857
* it's also possible that our timeout expired and hvsi_write_worker

drivers/char/pcmcia/ipwireless/hardware.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,7 @@ void ipwireless_hardware_free(struct ipw_hardware *hw)
17291729

17301730
ipwireless_stop_interrupts(hw);
17311731

1732-
flush_scheduled_work();
1732+
flush_work_sync(&hw->work_rx);
17331733

17341734
for (i = 0; i < NL_NUM_OF_ADDRESSES; i++)
17351735
if (hw->packet_assembler[i] != NULL)

drivers/char/pcmcia/ipwireless/network.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,8 @@ void ipwireless_network_free(struct ipw_network *network)
430430
network->shutting_down = 1;
431431

432432
ipwireless_ppp_close(network);
433-
flush_scheduled_work();
433+
flush_work_sync(&network->work_go_online);
434+
flush_work_sync(&network->work_go_offline);
434435

435436
ipwireless_stop_interrupts(network->hardware);
436437
ipwireless_associate_network(network->hardware, NULL);

drivers/char/pcmcia/ipwireless/tty.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ void ipwireless_tty_free(struct ipw_tty *tty)
577577
mutex_unlock(&ttyj->ipw_tty_mutex);
578578
tty_hangup(ttyj->linux_tty);
579579
/* Wait till the tty_hangup has completed */
580-
flush_scheduled_work();
580+
flush_work_sync(&ttyj->linux_tty->hangup_work);
581581
/* FIXME: Exactly how is the tty object locked here
582582
against a parallel ioctl etc */
583583
mutex_lock(&ttyj->ipw_tty_mutex);

drivers/char/sonypi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ static int __devexit sonypi_remove(struct platform_device *dev)
14341434
sonypi_disable();
14351435

14361436
synchronize_irq(sonypi_device.irq);
1437-
flush_scheduled_work();
1437+
flush_work_sync(&sonypi_device.input_work);
14381438

14391439
if (useinput) {
14401440
input_unregister_device(sonypi_device.input_key_dev);

drivers/char/tpm/tpm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ int tpm_release(struct inode *inode, struct file *file)
986986
struct tpm_chip *chip = file->private_data;
987987

988988
del_singleshot_timer_sync(&chip->user_read_timer);
989-
flush_scheduled_work();
989+
flush_work_sync(&chip->work);
990990
file->private_data = NULL;
991991
atomic_set(&chip->data_pending, 0);
992992
kfree(chip->data_buffer);
@@ -1038,7 +1038,7 @@ ssize_t tpm_read(struct file *file, char __user *buf,
10381038
ssize_t ret_size;
10391039

10401040
del_singleshot_timer_sync(&chip->user_read_timer);
1041-
flush_scheduled_work();
1041+
flush_work_sync(&chip->work);
10421042
ret_size = atomic_read(&chip->data_pending);
10431043
atomic_set(&chip->data_pending, 0);
10441044
if (ret_size > 0) { /* relay data */

drivers/gpu/drm/ttm/ttm_bo.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,8 +1472,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev)
14721472
list_del(&bdev->device_list);
14731473
mutex_unlock(&glob->device_list_mutex);
14741474

1475-
if (!cancel_delayed_work(&bdev->wq))
1476-
flush_scheduled_work();
1475+
cancel_delayed_work_sync(&bdev->wq);
14771476

14781477
while (ttm_bo_delayed_delete(bdev, true))
14791478
;

drivers/gpu/drm/vmwgfx/vmwgfx_fb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ int vmw_fb_off(struct vmw_private *vmw_priv)
659659
par->dirty.active = false;
660660
spin_unlock_irqrestore(&par->dirty.lock, flags);
661661

662-
flush_scheduled_work();
662+
flush_delayed_work_sync(&info->deferred_work);
663663

664664
par->bo_ptr = NULL;
665665
ttm_bo_kunmap(&par->map);

drivers/isdn/capi/capidrv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2297,6 +2297,7 @@ static int __init capidrv_init(void)
22972297

22982298
errcode = capi20_get_profile(0, &profile);
22992299
if (errcode != CAPI_NOERROR) {
2300+
unregister_capictr_notifier(&capictr_nb);
23002301
capi20_release(&global.ap);
23012302
return -EIO;
23022303
}

drivers/isdn/capi/kcapi.c

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <linux/rcupdate.h>
3939

4040
static int showcapimsgs = 0;
41+
static struct workqueue_struct *kcapi_wq;
4142

4243
MODULE_DESCRIPTION("CAPI4Linux: kernel CAPI layer");
4344
MODULE_AUTHOR("Carsten Paeth");
@@ -291,7 +292,7 @@ static int notify_push(unsigned int event_type, u32 controller)
291292
event->type = event_type;
292293
event->controller = controller;
293294

294-
schedule_work(&event->work);
295+
queue_work(kcapi_wq, &event->work);
295296
return 0;
296297
}
297298

@@ -408,7 +409,7 @@ void capi_ctr_handle_message(struct capi_ctr *ctr, u16 appl,
408409
goto error;
409410
}
410411
skb_queue_tail(&ap->recv_queue, skb);
411-
schedule_work(&ap->recv_work);
412+
queue_work(kcapi_wq, &ap->recv_work);
412413
rcu_read_unlock();
413414

414415
return;
@@ -743,7 +744,7 @@ u16 capi20_release(struct capi20_appl *ap)
743744

744745
mutex_unlock(&capi_controller_lock);
745746

746-
flush_scheduled_work();
747+
flush_workqueue(kcapi_wq);
747748
skb_queue_purge(&ap->recv_queue);
748749

749750
if (showcapimsgs & 1) {
@@ -1285,21 +1286,30 @@ static int __init kcapi_init(void)
12851286
{
12861287
int err;
12871288

1289+
kcapi_wq = alloc_workqueue("kcapi", 0, 0);
1290+
if (!kcapi_wq)
1291+
return -ENOMEM;
1292+
12881293
register_capictr_notifier(&capictr_nb);
12891294

12901295
err = cdebug_init();
1291-
if (!err)
1292-
kcapi_proc_init();
1293-
return err;
1296+
if (err) {
1297+
unregister_capictr_notifier(&capictr_nb);
1298+
destroy_workqueue(kcapi_wq);
1299+
return err;
1300+
}
1301+
1302+
kcapi_proc_init();
1303+
return 0;
12941304
}
12951305

12961306
static void __exit kcapi_exit(void)
12971307
{
12981308
kcapi_proc_exit();
12991309

1300-
/* make sure all notifiers are finished */
1301-
flush_scheduled_work();
1310+
unregister_capictr_notifier(&capictr_nb);
13021311
cdebug_exit();
1312+
destroy_workqueue(kcapi_wq);
13031313
}
13041314

13051315
module_init(kcapi_init);

drivers/isdn/mISDN/hwchannel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ mISDN_freedchannel(struct dchannel *ch)
110110
}
111111
skb_queue_purge(&ch->squeue);
112112
skb_queue_purge(&ch->rqueue);
113-
flush_scheduled_work();
113+
flush_work_sync(&ch->workq);
114114
return 0;
115115
}
116116
EXPORT_SYMBOL(mISDN_freedchannel);
@@ -143,7 +143,7 @@ mISDN_freebchannel(struct bchannel *ch)
143143
mISDN_clear_bchannel(ch);
144144
skb_queue_purge(&ch->rqueue);
145145
ch->rcount = 0;
146-
flush_scheduled_work();
146+
flush_work_sync(&ch->workq);
147147
return 0;
148148
}
149149
EXPORT_SYMBOL(mISDN_freebchannel);

drivers/isdn/mISDN/l1oip_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,8 @@ release_card(struct l1oip *hc)
12691269
if (timer_pending(&hc->timeout_tl))
12701270
del_timer(&hc->timeout_tl);
12711271

1272+
cancel_work_sync(&hc->workq);
1273+
12721274
if (hc->socket_thread)
12731275
l1oip_socket_close(hc);
12741276

drivers/leds/leds-wm8350.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static int wm8350_led_remove(struct platform_device *pdev)
276276
struct wm8350_led *led = platform_get_drvdata(pdev);
277277

278278
led_classdev_unregister(&led->cdev);
279-
flush_scheduled_work();
279+
flush_work_sync(&led->work);
280280
wm8350_led_disable(led);
281281
regulator_put(led->dcdc);
282282
regulator_put(led->isink);

drivers/macintosh/ams/ams-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ void ams_sensor_detach(void)
226226
* We do this after ams_info.exit(), because an interrupt might
227227
* have arrived before disabling them.
228228
*/
229-
flush_scheduled_work();
229+
flush_work_sync(&ams_info.worker);
230230

231231
/* Remove device */
232232
of_device_unregister(ams_info.of_dev);

drivers/macintosh/rack-meter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ static void __devinit rackmeter_init_cpu_sniffer(struct rackmeter *rm)
285285

286286
static void __devexit rackmeter_stop_cpu_sniffer(struct rackmeter *rm)
287287
{
288-
cancel_rearming_delayed_work(&rm->cpu[0].sniffer);
289-
cancel_rearming_delayed_work(&rm->cpu[1].sniffer);
288+
cancel_delayed_work_sync(&rm->cpu[0].sniffer);
289+
cancel_delayed_work_sync(&rm->cpu[1].sniffer);
290290
}
291291

292292
static int __devinit rackmeter_setup(struct rackmeter *rm)

drivers/media/dvb/dvb-core/dvb_net.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,8 @@ static int dvb_net_remove_if(struct dvb_net *dvbnet, unsigned long num)
13291329
return -EBUSY;
13301330

13311331
dvb_net_stop(net);
1332-
flush_scheduled_work();
1332+
flush_work_sync(&priv->set_multicast_list_wq);
1333+
flush_work_sync(&priv->restart_net_feed_wq);
13331334
printk("dvb_net: removed network interface %s\n", net->name);
13341335
unregister_netdev(net);
13351336
dvbnet->state[num]=0;

drivers/media/dvb/dvb-usb/dvb-usb-remote.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,7 @@ int dvb_usb_remote_init(struct dvb_usb_device *d)
313313
int dvb_usb_remote_exit(struct dvb_usb_device *d)
314314
{
315315
if (d->state & DVB_USB_STATE_REMOTE) {
316-
cancel_rearming_delayed_work(&d->rc_query_work);
317-
flush_scheduled_work();
316+
cancel_delayed_work_sync(&d->rc_query_work);
318317
if (d->props.rc.mode == DVB_RC_LEGACY)
319318
input_unregister_device(d->input_dev);
320319
else

drivers/media/dvb/mantis/mantis_evm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void mantis_evmgr_exit(struct mantis_ca *ca)
111111
struct mantis_pci *mantis = ca->ca_priv;
112112

113113
dprintk(MANTIS_DEBUG, 1, "Mantis Host I/F Event manager exiting");
114-
flush_scheduled_work();
114+
flush_work_sync(&ca->hif_evm_work);
115115
mantis_hif_exit(ca);
116116
mantis_pcmcia_exit(ca);
117117
}

drivers/media/dvb/mantis/mantis_uart.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,6 @@ void mantis_uart_exit(struct mantis_pci *mantis)
182182
{
183183
/* disable interrupt */
184184
mmwrite(mmread(MANTIS_UART_CTL) & 0xffef, MANTIS_UART_CTL);
185+
flush_work_sync(&mantis->uart_work);
185186
}
186187
EXPORT_SYMBOL_GPL(mantis_uart_exit);

drivers/media/video/bt8xx/bttv-driver.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,14 @@ static void request_modules(struct bttv *dev)
189189
INIT_WORK(&dev->request_module_wk, request_module_async);
190190
schedule_work(&dev->request_module_wk);
191191
}
192+
193+
static void flush_request_modules(struct bttv *dev)
194+
{
195+
flush_work_sync(&dev->request_module_wk);
196+
}
192197
#else
193198
#define request_modules(dev)
199+
#define flush_request_modules(dev)
194200
#endif /* CONFIG_MODULES */
195201

196202

@@ -4429,6 +4435,9 @@ static void __devexit bttv_remove(struct pci_dev *pci_dev)
44294435
if (bttv_verbose)
44304436
printk("bttv%d: unloading\n",btv->c.nr);
44314437

4438+
if (bttv_tvcards[btv->c.type].has_dvb)
4439+
flush_request_modules(btv);
4440+
44324441
/* shutdown everything (DMA+IRQs) */
44334442
btand(~15, BT848_GPIO_DMA_CTL);
44344443
btwrite(0, BT848_INT_MASK);

drivers/media/video/bt8xx/bttv-input.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,16 +319,13 @@ static void bttv_ir_start(struct bttv *btv, struct bttv_ir *ir)
319319

320320
static void bttv_ir_stop(struct bttv *btv)
321321
{
322-
if (btv->remote->polling) {
322+
if (btv->remote->polling)
323323
del_timer_sync(&btv->remote->timer);
324-
flush_scheduled_work();
325-
}
326324

327325
if (btv->remote->rc5_gpio) {
328326
u32 gpio;
329327

330328
del_timer_sync(&btv->remote->timer);
331-
flush_scheduled_work();
332329

333330
gpio = bttv_gpio_read(&btv->c);
334331
bttv_gpio_write(&btv->c, gpio & ~(1 << 4));

0 commit comments

Comments
 (0)