Skip to content

Commit

Permalink
Merge branch 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/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.
  • Loading branch information
torvalds committed Jan 8, 2011
2 parents e744070 + 569ff2d commit 23d69b0
Show file tree
Hide file tree
Showing 80 changed files with 289 additions and 156 deletions.
10 changes: 10 additions & 0 deletions Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -566,3 +566,13 @@ Why: This field is deprecated. I2C device drivers shouldn't change their
Who: Jean Delvare <khali@linux-fr.org>

----------------------------

What: cancel_rearming_delayed_work[queue]()
When: 2.6.39

Why: The functions have been superceded by cancel_delayed_work_sync()
quite some time ago. The conversion is trivial and there is no
in-kernel user left.
Who: Tejun Heo <tj@kernel.org>

----------------------------
3 changes: 2 additions & 1 deletion arch/arm/mach-pxa/sharpsl_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,8 @@ static int sharpsl_ac_check(void)
static int sharpsl_pm_suspend(struct platform_device *pdev, pm_message_t state)
{
sharpsl_pm.flags |= SHARPSL_SUSPENDED;
flush_scheduled_work();
flush_delayed_work_sync(&toggle_charger);
flush_delayed_work_sync(&sharpsl_bat);

if (sharpsl_pm.charge_mode == CHRG_ON)
sharpsl_pm.flags |= SHARPSL_DO_OFFLINE_CHRG;
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/drivers/push-switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static int switch_drv_remove(struct platform_device *pdev)
device_remove_file(&pdev->dev, &dev_attr_switch);

platform_set_drvdata(pdev, NULL);
flush_scheduled_work();
flush_work_sync(&psw->work);
del_timer_sync(&psw->debounce);
free_irq(irq, pdev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -6128,7 +6128,7 @@ static void ata_port_detach(struct ata_port *ap)
/* it better be dead now */
WARN_ON(!(ap->pflags & ATA_PFLAG_UNLOADED));

cancel_rearming_delayed_work(&ap->hotplug_task);
cancel_delayed_work_sync(&ap->hotplug_task);

skip_eh:
if (ap->pmp_link) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/libata-sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@ void ata_sff_flush_pio_task(struct ata_port *ap)
{
DPRINTK("ENTER\n");

cancel_rearming_delayed_work(&ap->sff_pio_task);
cancel_delayed_work_sync(&ap->sff_pio_task);
ap->hsm_task_state = HSM_ST_IDLE;

if (ata_msg_ctl(ap))
Expand Down
4 changes: 2 additions & 2 deletions drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -4352,7 +4352,7 @@ static int __init floppy_init(void)
out_unreg_platform_dev:
platform_device_unregister(&floppy_device[drive]);
out_flush_work:
flush_scheduled_work();
flush_work_sync(&floppy_work);
if (atomic_read(&usage_count))
floppy_release_irq_and_dma();
out_unreg_region:
Expand Down Expand Up @@ -4422,7 +4422,7 @@ static int floppy_grab_irq_and_dma(void)
* We might have scheduled a free_irq(), wait it to
* drain first:
*/
flush_scheduled_work();
flush_work_sync(&floppy_work);

if (fd_request_irq()) {
DPRINT("Unable to grab IRQ%d for the floppy driver\n",
Expand Down
4 changes: 2 additions & 2 deletions drivers/block/xen-blkfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ static void xlvbd_release_gendisk(struct blkfront_info *info)
spin_unlock_irqrestore(&blkif_io_lock, flags);

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

del_gendisk(info->gd);

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

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

/* Free resources associated with old device channel. */
if (info->ring_ref != GRANT_INVALID_REF) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/cdrom/gdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ static int __devinit probe_gdrom(struct platform_device *devptr)

static int __devexit remove_gdrom(struct platform_device *devptr)
{
flush_scheduled_work();
flush_work_sync(&work);
blk_cleanup_queue(gd.gdrom_rq);
free_irq(HW_EVENT_GDROM_CMD, &gd);
free_irq(HW_EVENT_GDROM_DMA, &gd);
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/hvsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,8 @@ static void hvsi_flush_output(struct hvsi_struct *hp)
wait_event_timeout(hp->emptyq, (hp->n_outbuf <= 0), HVSI_TIMEOUT);

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

/*
* it's also possible that our timeout expired and hvsi_write_worker
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/pcmcia/ipwireless/hardware.c
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ void ipwireless_hardware_free(struct ipw_hardware *hw)

ipwireless_stop_interrupts(hw);

flush_scheduled_work();
flush_work_sync(&hw->work_rx);

for (i = 0; i < NL_NUM_OF_ADDRESSES; i++)
if (hw->packet_assembler[i] != NULL)
Expand Down
3 changes: 2 additions & 1 deletion drivers/char/pcmcia/ipwireless/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,8 @@ void ipwireless_network_free(struct ipw_network *network)
network->shutting_down = 1;

ipwireless_ppp_close(network);
flush_scheduled_work();
flush_work_sync(&network->work_go_online);
flush_work_sync(&network->work_go_offline);

ipwireless_stop_interrupts(network->hardware);
ipwireless_associate_network(network->hardware, NULL);
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/pcmcia/ipwireless/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ void ipwireless_tty_free(struct ipw_tty *tty)
mutex_unlock(&ttyj->ipw_tty_mutex);
tty_hangup(ttyj->linux_tty);
/* Wait till the tty_hangup has completed */
flush_scheduled_work();
flush_work_sync(&ttyj->linux_tty->hangup_work);
/* FIXME: Exactly how is the tty object locked here
against a parallel ioctl etc */
mutex_lock(&ttyj->ipw_tty_mutex);
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/sonypi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ static int __devexit sonypi_remove(struct platform_device *dev)
sonypi_disable();

synchronize_irq(sonypi_device.irq);
flush_scheduled_work();
flush_work_sync(&sonypi_device.input_work);

if (useinput) {
input_unregister_device(sonypi_device.input_key_dev);
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ int tpm_release(struct inode *inode, struct file *file)
struct tpm_chip *chip = file->private_data;

del_singleshot_timer_sync(&chip->user_read_timer);
flush_scheduled_work();
flush_work_sync(&chip->work);
file->private_data = NULL;
atomic_set(&chip->data_pending, 0);
kfree(chip->data_buffer);
Expand Down Expand Up @@ -1038,7 +1038,7 @@ ssize_t tpm_read(struct file *file, char __user *buf,
ssize_t ret_size;

del_singleshot_timer_sync(&chip->user_read_timer);
flush_scheduled_work();
flush_work_sync(&chip->work);
ret_size = atomic_read(&chip->data_pending);
atomic_set(&chip->data_pending, 0);
if (ret_size > 0) { /* relay data */
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1472,8 +1472,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev)
list_del(&bdev->device_list);
mutex_unlock(&glob->device_list_mutex);

if (!cancel_delayed_work(&bdev->wq))
flush_scheduled_work();
cancel_delayed_work_sync(&bdev->wq);

while (ttm_bo_delayed_delete(bdev, true))
;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ int vmw_fb_off(struct vmw_private *vmw_priv)
par->dirty.active = false;
spin_unlock_irqrestore(&par->dirty.lock, flags);

flush_scheduled_work();
flush_delayed_work_sync(&info->deferred_work);

par->bo_ptr = NULL;
ttm_bo_kunmap(&par->map);
Expand Down
1 change: 1 addition & 0 deletions drivers/isdn/capi/capidrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2297,6 +2297,7 @@ static int __init capidrv_init(void)

errcode = capi20_get_profile(0, &profile);
if (errcode != CAPI_NOERROR) {
unregister_capictr_notifier(&capictr_nb);
capi20_release(&global.ap);
return -EIO;
}
Expand Down
26 changes: 18 additions & 8 deletions drivers/isdn/capi/kcapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <linux/rcupdate.h>

static int showcapimsgs = 0;
static struct workqueue_struct *kcapi_wq;

MODULE_DESCRIPTION("CAPI4Linux: kernel CAPI layer");
MODULE_AUTHOR("Carsten Paeth");
Expand Down Expand Up @@ -291,7 +292,7 @@ static int notify_push(unsigned int event_type, u32 controller)
event->type = event_type;
event->controller = controller;

schedule_work(&event->work);
queue_work(kcapi_wq, &event->work);
return 0;
}

Expand Down Expand Up @@ -408,7 +409,7 @@ void capi_ctr_handle_message(struct capi_ctr *ctr, u16 appl,
goto error;
}
skb_queue_tail(&ap->recv_queue, skb);
schedule_work(&ap->recv_work);
queue_work(kcapi_wq, &ap->recv_work);
rcu_read_unlock();

return;
Expand Down Expand Up @@ -743,7 +744,7 @@ u16 capi20_release(struct capi20_appl *ap)

mutex_unlock(&capi_controller_lock);

flush_scheduled_work();
flush_workqueue(kcapi_wq);
skb_queue_purge(&ap->recv_queue);

if (showcapimsgs & 1) {
Expand Down Expand Up @@ -1285,21 +1286,30 @@ static int __init kcapi_init(void)
{
int err;

kcapi_wq = alloc_workqueue("kcapi", 0, 0);
if (!kcapi_wq)
return -ENOMEM;

register_capictr_notifier(&capictr_nb);

err = cdebug_init();
if (!err)
kcapi_proc_init();
return err;
if (err) {
unregister_capictr_notifier(&capictr_nb);
destroy_workqueue(kcapi_wq);
return err;
}

kcapi_proc_init();
return 0;
}

static void __exit kcapi_exit(void)
{
kcapi_proc_exit();

/* make sure all notifiers are finished */
flush_scheduled_work();
unregister_capictr_notifier(&capictr_nb);
cdebug_exit();
destroy_workqueue(kcapi_wq);
}

module_init(kcapi_init);
Expand Down
4 changes: 2 additions & 2 deletions drivers/isdn/mISDN/hwchannel.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ mISDN_freedchannel(struct dchannel *ch)
}
skb_queue_purge(&ch->squeue);
skb_queue_purge(&ch->rqueue);
flush_scheduled_work();
flush_work_sync(&ch->workq);
return 0;
}
EXPORT_SYMBOL(mISDN_freedchannel);
Expand Down Expand Up @@ -143,7 +143,7 @@ mISDN_freebchannel(struct bchannel *ch)
mISDN_clear_bchannel(ch);
skb_queue_purge(&ch->rqueue);
ch->rcount = 0;
flush_scheduled_work();
flush_work_sync(&ch->workq);
return 0;
}
EXPORT_SYMBOL(mISDN_freebchannel);
Expand Down
2 changes: 2 additions & 0 deletions drivers/isdn/mISDN/l1oip_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,8 @@ release_card(struct l1oip *hc)
if (timer_pending(&hc->timeout_tl))
del_timer(&hc->timeout_tl);

cancel_work_sync(&hc->workq);

if (hc->socket_thread)
l1oip_socket_close(hc);

Expand Down
2 changes: 1 addition & 1 deletion drivers/leds/leds-wm8350.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ static int wm8350_led_remove(struct platform_device *pdev)
struct wm8350_led *led = platform_get_drvdata(pdev);

led_classdev_unregister(&led->cdev);
flush_scheduled_work();
flush_work_sync(&led->work);
wm8350_led_disable(led);
regulator_put(led->dcdc);
regulator_put(led->isink);
Expand Down
2 changes: 1 addition & 1 deletion drivers/macintosh/ams/ams-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void ams_sensor_detach(void)
* We do this after ams_info.exit(), because an interrupt might
* have arrived before disabling them.
*/
flush_scheduled_work();
flush_work_sync(&ams_info.worker);

/* Remove device */
of_device_unregister(ams_info.of_dev);
Expand Down
4 changes: 2 additions & 2 deletions drivers/macintosh/rack-meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ static void __devinit rackmeter_init_cpu_sniffer(struct rackmeter *rm)

static void __devexit rackmeter_stop_cpu_sniffer(struct rackmeter *rm)
{
cancel_rearming_delayed_work(&rm->cpu[0].sniffer);
cancel_rearming_delayed_work(&rm->cpu[1].sniffer);
cancel_delayed_work_sync(&rm->cpu[0].sniffer);
cancel_delayed_work_sync(&rm->cpu[1].sniffer);
}

static int __devinit rackmeter_setup(struct rackmeter *rm)
Expand Down
3 changes: 2 additions & 1 deletion drivers/media/dvb/dvb-core/dvb_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,8 @@ static int dvb_net_remove_if(struct dvb_net *dvbnet, unsigned long num)
return -EBUSY;

dvb_net_stop(net);
flush_scheduled_work();
flush_work_sync(&priv->set_multicast_list_wq);
flush_work_sync(&priv->restart_net_feed_wq);
printk("dvb_net: removed network interface %s\n", net->name);
unregister_netdev(net);
dvbnet->state[num]=0;
Expand Down
3 changes: 1 addition & 2 deletions drivers/media/dvb/dvb-usb/dvb-usb-remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,7 @@ int dvb_usb_remote_init(struct dvb_usb_device *d)
int dvb_usb_remote_exit(struct dvb_usb_device *d)
{
if (d->state & DVB_USB_STATE_REMOTE) {
cancel_rearming_delayed_work(&d->rc_query_work);
flush_scheduled_work();
cancel_delayed_work_sync(&d->rc_query_work);
if (d->props.rc.mode == DVB_RC_LEGACY)
input_unregister_device(d->input_dev);
else
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/mantis/mantis_evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void mantis_evmgr_exit(struct mantis_ca *ca)
struct mantis_pci *mantis = ca->ca_priv;

dprintk(MANTIS_DEBUG, 1, "Mantis Host I/F Event manager exiting");
flush_scheduled_work();
flush_work_sync(&ca->hif_evm_work);
mantis_hif_exit(ca);
mantis_pcmcia_exit(ca);
}
1 change: 1 addition & 0 deletions drivers/media/dvb/mantis/mantis_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,6 @@ void mantis_uart_exit(struct mantis_pci *mantis)
{
/* disable interrupt */
mmwrite(mmread(MANTIS_UART_CTL) & 0xffef, MANTIS_UART_CTL);
flush_work_sync(&mantis->uart_work);
}
EXPORT_SYMBOL_GPL(mantis_uart_exit);
9 changes: 9 additions & 0 deletions drivers/media/video/bt8xx/bttv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,14 @@ static void request_modules(struct bttv *dev)
INIT_WORK(&dev->request_module_wk, request_module_async);
schedule_work(&dev->request_module_wk);
}

static void flush_request_modules(struct bttv *dev)
{
flush_work_sync(&dev->request_module_wk);
}
#else
#define request_modules(dev)
#define flush_request_modules(dev)
#endif /* CONFIG_MODULES */


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

if (bttv_tvcards[btv->c.type].has_dvb)
flush_request_modules(btv);

/* shutdown everything (DMA+IRQs) */
btand(~15, BT848_GPIO_DMA_CTL);
btwrite(0, BT848_INT_MASK);
Expand Down
5 changes: 1 addition & 4 deletions drivers/media/video/bt8xx/bttv-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,16 +319,13 @@ static void bttv_ir_start(struct bttv *btv, struct bttv_ir *ir)

static void bttv_ir_stop(struct bttv *btv)
{
if (btv->remote->polling) {
if (btv->remote->polling)
del_timer_sync(&btv->remote->timer);
flush_scheduled_work();
}

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

del_timer_sync(&btv->remote->timer);
flush_scheduled_work();

gpio = bttv_gpio_read(&btv->c);
bttv_gpio_write(&btv->c, gpio & ~(1 << 4));
Expand Down
Loading

0 comments on commit 23d69b0

Please sign in to comment.