Commit 1c10bbee authored by Thomas Gleixner's avatar Thomas Gleixner

Merge tag 'timers-conversion-next4' of...

Merge tag 'timers-conversion-next4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux into timers/core

Pull the 4th timer conversion batch from Kees Cook

 - A couple fixes for less common build configurations

 - More stragglers that have either been reviewed or gone
   long enough on list
parents c7c2f3d9 5ea22086
...@@ -141,7 +141,7 @@ static void dc21285_enable_error(struct timer_list *timer) ...@@ -141,7 +141,7 @@ static void dc21285_enable_error(struct timer_list *timer)
del_timer(timer); del_timer(timer);
if (timer == &serr_timer) if (timer == &serr_timer)
enable_irq(IRQ_PCI_SERR) enable_irq(IRQ_PCI_SERR);
else if (timer == &perr_timer) else if (timer == &perr_timer)
enable_irq(IRQ_PCI_PERR); enable_irq(IRQ_PCI_PERR);
} }
......
...@@ -15,49 +15,19 @@ MODULE_AUTHOR("Sam Hopkins <sah@coraid.com>"); ...@@ -15,49 +15,19 @@ MODULE_AUTHOR("Sam Hopkins <sah@coraid.com>");
MODULE_DESCRIPTION("AoE block/char driver for 2.6.2 and newer 2.6 kernels"); MODULE_DESCRIPTION("AoE block/char driver for 2.6.2 and newer 2.6 kernels");
MODULE_VERSION(VERSION); MODULE_VERSION(VERSION);
enum { TINIT, TRUN, TKILL }; static struct timer_list timer;
static void static void discover_timer(struct timer_list *t)
discover_timer(ulong vp)
{ {
static struct timer_list t; mod_timer(t, jiffies + HZ * 60); /* one minute */
static volatile ulong die;
static spinlock_t lock;
ulong flags;
enum { DTIMERTICK = HZ * 60 }; /* one minute */
switch (vp) {
case TINIT:
init_timer(&t);
spin_lock_init(&lock);
t.data = TRUN;
t.function = discover_timer;
die = 0;
case TRUN:
spin_lock_irqsave(&lock, flags);
if (!die) {
t.expires = jiffies + DTIMERTICK;
add_timer(&t);
}
spin_unlock_irqrestore(&lock, flags);
aoecmd_cfg(0xffff, 0xff);
return;
case TKILL:
spin_lock_irqsave(&lock, flags);
die = 1;
spin_unlock_irqrestore(&lock, flags);
del_timer_sync(&t); aoecmd_cfg(0xffff, 0xff);
default:
return;
}
} }
static void static void
aoe_exit(void) aoe_exit(void)
{ {
discover_timer(TKILL); del_timer_sync(&timer);
aoenet_exit(); aoenet_exit();
unregister_blkdev(AOE_MAJOR, DEVICE_NAME); unregister_blkdev(AOE_MAJOR, DEVICE_NAME);
...@@ -93,7 +63,9 @@ aoe_init(void) ...@@ -93,7 +63,9 @@ aoe_init(void)
goto blkreg_fail; goto blkreg_fail;
} }
printk(KERN_INFO "aoe: AoE v%s initialised.\n", VERSION); printk(KERN_INFO "aoe: AoE v%s initialised.\n", VERSION);
discover_timer(TINIT);
timer_setup(&timer, discover_timer, 0);
discover_timer(&timer);
return 0; return 0;
blkreg_fail: blkreg_fail:
aoecmd_exit(); aoecmd_exit();
......
...@@ -1551,8 +1551,8 @@ extern int w_restart_disk_io(struct drbd_work *, int); ...@@ -1551,8 +1551,8 @@ extern int w_restart_disk_io(struct drbd_work *, int);
extern int w_send_out_of_sync(struct drbd_work *, int); extern int w_send_out_of_sync(struct drbd_work *, int);
extern int w_start_resync(struct drbd_work *, int); extern int w_start_resync(struct drbd_work *, int);
extern void resync_timer_fn(unsigned long data); extern void resync_timer_fn(struct timer_list *t);
extern void start_resync_timer_fn(unsigned long data); extern void start_resync_timer_fn(struct timer_list *t);
extern void drbd_endio_write_sec_final(struct drbd_peer_request *peer_req); extern void drbd_endio_write_sec_final(struct drbd_peer_request *peer_req);
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
static DEFINE_MUTEX(drbd_main_mutex); static DEFINE_MUTEX(drbd_main_mutex);
static int drbd_open(struct block_device *bdev, fmode_t mode); static int drbd_open(struct block_device *bdev, fmode_t mode);
static void drbd_release(struct gendisk *gd, fmode_t mode); static void drbd_release(struct gendisk *gd, fmode_t mode);
static void md_sync_timer_fn(unsigned long data); static void md_sync_timer_fn(struct timer_list *t);
static int w_bitmap_io(struct drbd_work *w, int unused); static int w_bitmap_io(struct drbd_work *w, int unused);
MODULE_AUTHOR("Philipp Reisner <phil@linbit.com>, " MODULE_AUTHOR("Philipp Reisner <phil@linbit.com>, "
...@@ -2023,14 +2023,10 @@ void drbd_init_set_defaults(struct drbd_device *device) ...@@ -2023,14 +2023,10 @@ void drbd_init_set_defaults(struct drbd_device *device)
device->unplug_work.cb = w_send_write_hint; device->unplug_work.cb = w_send_write_hint;
device->bm_io_work.w.cb = w_bitmap_io; device->bm_io_work.w.cb = w_bitmap_io;
setup_timer(&device->resync_timer, resync_timer_fn, timer_setup(&device->resync_timer, resync_timer_fn, 0);
(unsigned long)device); timer_setup(&device->md_sync_timer, md_sync_timer_fn, 0);
setup_timer(&device->md_sync_timer, md_sync_timer_fn, timer_setup(&device->start_resync_timer, start_resync_timer_fn, 0);
(unsigned long)device); timer_setup(&device->request_timer, request_timer_fn, 0);
setup_timer(&device->start_resync_timer, start_resync_timer_fn,
(unsigned long)device);
setup_timer(&device->request_timer, request_timer_fn,
(unsigned long)device);
init_waitqueue_head(&device->misc_wait); init_waitqueue_head(&device->misc_wait);
init_waitqueue_head(&device->state_wait); init_waitqueue_head(&device->state_wait);
...@@ -3721,9 +3717,9 @@ int drbd_md_test_flag(struct drbd_backing_dev *bdev, int flag) ...@@ -3721,9 +3717,9 @@ int drbd_md_test_flag(struct drbd_backing_dev *bdev, int flag)
return (bdev->md.flags & flag) != 0; return (bdev->md.flags & flag) != 0;
} }
static void md_sync_timer_fn(unsigned long data) static void md_sync_timer_fn(struct timer_list *t)
{ {
struct drbd_device *device = (struct drbd_device *) data; struct drbd_device *device = from_timer(device, t, md_sync_timer);
drbd_device_post_work(device, MD_SYNC); drbd_device_post_work(device, MD_SYNC);
} }
......
...@@ -5056,7 +5056,7 @@ static int drbd_disconnected(struct drbd_peer_device *peer_device) ...@@ -5056,7 +5056,7 @@ static int drbd_disconnected(struct drbd_peer_device *peer_device)
wake_up(&device->misc_wait); wake_up(&device->misc_wait);
del_timer_sync(&device->resync_timer); del_timer_sync(&device->resync_timer);
resync_timer_fn((unsigned long)device); resync_timer_fn(&device->resync_timer);
/* wait for all w_e_end_data_req, w_e_end_rsdata_req, w_send_barrier, /* wait for all w_e_end_data_req, w_e_end_rsdata_req, w_send_barrier,
* w_make_resync_request etc. which may still be on the worker queue * w_make_resync_request etc. which may still be on the worker queue
......
...@@ -1714,9 +1714,9 @@ static bool net_timeout_reached(struct drbd_request *net_req, ...@@ -1714,9 +1714,9 @@ static bool net_timeout_reached(struct drbd_request *net_req,
* to expire twice (worst case) to become effective. Good enough. * to expire twice (worst case) to become effective. Good enough.
*/ */
void request_timer_fn(unsigned long data) void request_timer_fn(struct timer_list *t)
{ {
struct drbd_device *device = (struct drbd_device *) data; struct drbd_device *device = from_timer(device, t, request_timer);
struct drbd_connection *connection = first_peer_device(device)->connection; struct drbd_connection *connection = first_peer_device(device)->connection;
struct drbd_request *req_read, *req_write, *req_peer; /* oldest request */ struct drbd_request *req_read, *req_write, *req_peer; /* oldest request */
struct net_conf *nc; struct net_conf *nc;
......
...@@ -294,7 +294,7 @@ extern int __req_mod(struct drbd_request *req, enum drbd_req_event what, ...@@ -294,7 +294,7 @@ extern int __req_mod(struct drbd_request *req, enum drbd_req_event what,
struct bio_and_error *m); struct bio_and_error *m);
extern void complete_master_bio(struct drbd_device *device, extern void complete_master_bio(struct drbd_device *device,
struct bio_and_error *m); struct bio_and_error *m);
extern void request_timer_fn(unsigned long data); extern void request_timer_fn(struct timer_list *t);
extern void tl_restart(struct drbd_connection *connection, enum drbd_req_event what); extern void tl_restart(struct drbd_connection *connection, enum drbd_req_event what);
extern void _tl_restart(struct drbd_connection *connection, enum drbd_req_event what); extern void _tl_restart(struct drbd_connection *connection, enum drbd_req_event what);
extern void tl_abort_disk_io(struct drbd_device *device); extern void tl_abort_disk_io(struct drbd_device *device);
......
...@@ -457,9 +457,9 @@ int w_resync_timer(struct drbd_work *w, int cancel) ...@@ -457,9 +457,9 @@ int w_resync_timer(struct drbd_work *w, int cancel)
return 0; return 0;
} }
void resync_timer_fn(unsigned long data) void resync_timer_fn(struct timer_list *t)
{ {
struct drbd_device *device = (struct drbd_device *) data; struct drbd_device *device = from_timer(device, t, resync_timer);
drbd_queue_work_if_unqueued( drbd_queue_work_if_unqueued(
&first_peer_device(device)->connection->sender_work, &first_peer_device(device)->connection->sender_work,
...@@ -1705,9 +1705,9 @@ void drbd_rs_controller_reset(struct drbd_device *device) ...@@ -1705,9 +1705,9 @@ void drbd_rs_controller_reset(struct drbd_device *device)
rcu_read_unlock(); rcu_read_unlock();
} }
void start_resync_timer_fn(unsigned long data) void start_resync_timer_fn(struct timer_list *t)
{ {
struct drbd_device *device = (struct drbd_device *) data; struct drbd_device *device = from_timer(device, t, start_resync_timer);
drbd_device_post_work(device, RS_START); drbd_device_post_work(device, RS_START);
} }
......
...@@ -2074,9 +2074,9 @@ static void artpec6_crypto_process_queue(struct artpec6_crypto *ac) ...@@ -2074,9 +2074,9 @@ static void artpec6_crypto_process_queue(struct artpec6_crypto *ac)
del_timer(&ac->timer); del_timer(&ac->timer);
} }
static void artpec6_crypto_timeout(unsigned long data) static void artpec6_crypto_timeout(struct timer_list *t)
{ {
struct artpec6_crypto *ac = (struct artpec6_crypto *) data; struct artpec6_crypto *ac = from_timer(ac, t, timer);
dev_info_ratelimited(artpec6_crypto_dev, "timeout\n"); dev_info_ratelimited(artpec6_crypto_dev, "timeout\n");
...@@ -3063,7 +3063,7 @@ static int artpec6_crypto_probe(struct platform_device *pdev) ...@@ -3063,7 +3063,7 @@ static int artpec6_crypto_probe(struct platform_device *pdev)
spin_lock_init(&ac->queue_lock); spin_lock_init(&ac->queue_lock);
INIT_LIST_HEAD(&ac->queue); INIT_LIST_HEAD(&ac->queue);
INIT_LIST_HEAD(&ac->pending); INIT_LIST_HEAD(&ac->pending);
setup_timer(&ac->timer, artpec6_crypto_timeout, (unsigned long) ac); timer_setup(&ac->timer, artpec6_crypto_timeout, 0);
ac->base = base; ac->base = base;
......
...@@ -149,7 +149,7 @@ struct mv_req_hash_ctx { ...@@ -149,7 +149,7 @@ struct mv_req_hash_ctx {
int count_add; int count_add;
}; };
static void mv_completion_timer_callback(unsigned long unused) static void mv_completion_timer_callback(struct timer_list *unused)
{ {
int active = readl(cpg->reg + SEC_ACCEL_CMD) & SEC_CMD_EN_SEC_ACCL0; int active = readl(cpg->reg + SEC_ACCEL_CMD) & SEC_CMD_EN_SEC_ACCL0;
...@@ -167,7 +167,7 @@ static void mv_completion_timer_callback(unsigned long unused) ...@@ -167,7 +167,7 @@ static void mv_completion_timer_callback(unsigned long unused)
static void mv_setup_timer(void) static void mv_setup_timer(void)
{ {
setup_timer(&cpg->completion_timer, &mv_completion_timer_callback, 0); timer_setup(&cpg->completion_timer, mv_completion_timer_callback, 0);
mod_timer(&cpg->completion_timer, mod_timer(&cpg->completion_timer,
jiffies + msecs_to_jiffies(MV_CESA_EXPIRE)); jiffies + msecs_to_jiffies(MV_CESA_EXPIRE));
} }
......
...@@ -1125,9 +1125,9 @@ static irqreturn_t spacc_spacc_irq(int irq, void *dev) ...@@ -1125,9 +1125,9 @@ static irqreturn_t spacc_spacc_irq(int irq, void *dev)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static void spacc_packet_timeout(unsigned long data) static void spacc_packet_timeout(struct timer_list *t)
{ {
struct spacc_engine *engine = (struct spacc_engine *)data; struct spacc_engine *engine = from_timer(engine, t, packet_timeout);
spacc_process_done(engine); spacc_process_done(engine);
} }
...@@ -1714,8 +1714,7 @@ static int spacc_probe(struct platform_device *pdev) ...@@ -1714,8 +1714,7 @@ static int spacc_probe(struct platform_device *pdev)
writel(SPA_IRQ_EN_STAT_EN | SPA_IRQ_EN_GLBL_EN, writel(SPA_IRQ_EN_STAT_EN | SPA_IRQ_EN_GLBL_EN,
engine->regs + SPA_IRQ_EN_REG_OFFSET); engine->regs + SPA_IRQ_EN_REG_OFFSET);
setup_timer(&engine->packet_timeout, spacc_packet_timeout, timer_setup(&engine->packet_timeout, spacc_packet_timeout, 0);
(unsigned long)engine);
INIT_LIST_HEAD(&engine->pending); INIT_LIST_HEAD(&engine->pending);
INIT_LIST_HEAD(&engine->completed); INIT_LIST_HEAD(&engine->completed);
......
...@@ -611,9 +611,9 @@ static int drive_is_ready(ide_drive_t *drive) ...@@ -611,9 +611,9 @@ static int drive_is_ready(ide_drive_t *drive)
* logic that wants cleaning up. * logic that wants cleaning up.
*/ */
void ide_timer_expiry (unsigned long data) void ide_timer_expiry (struct timer_list *t)
{ {
ide_hwif_t *hwif = (ide_hwif_t *)data; ide_hwif_t *hwif = from_timer(hwif, t, timer);
ide_drive_t *uninitialized_var(drive); ide_drive_t *uninitialized_var(drive);
ide_handler_t *handler; ide_handler_t *handler;
unsigned long flags; unsigned long flags;
......
...@@ -1184,7 +1184,7 @@ static void ide_init_port_data(ide_hwif_t *hwif, unsigned int index) ...@@ -1184,7 +1184,7 @@ static void ide_init_port_data(ide_hwif_t *hwif, unsigned int index)
spin_lock_init(&hwif->lock); spin_lock_init(&hwif->lock);
setup_timer(&hwif->timer, &ide_timer_expiry, (unsigned long)hwif); timer_setup(&hwif->timer, ide_timer_expiry, 0);
init_completion(&hwif->gendev_rel_comp); init_completion(&hwif->gendev_rel_comp);
......
...@@ -57,6 +57,7 @@ struct altera_mbox { ...@@ -57,6 +57,7 @@ struct altera_mbox {
/* If the controller supports only RX polling mode */ /* If the controller supports only RX polling mode */
struct timer_list rxpoll_timer; struct timer_list rxpoll_timer;
struct mbox_chan *chan;
}; };
static struct altera_mbox *mbox_chan_to_altera_mbox(struct mbox_chan *chan) static struct altera_mbox *mbox_chan_to_altera_mbox(struct mbox_chan *chan)
...@@ -138,12 +139,11 @@ static void altera_mbox_rx_data(struct mbox_chan *chan) ...@@ -138,12 +139,11 @@ static void altera_mbox_rx_data(struct mbox_chan *chan)
} }
} }
static void altera_mbox_poll_rx(unsigned long data) static void altera_mbox_poll_rx(struct timer_list *t)
{ {
struct mbox_chan *chan = (struct mbox_chan *)data; struct altera_mbox *mbox = from_timer(mbox, t, rxpoll_timer);
struct altera_mbox *mbox = mbox_chan_to_altera_mbox(chan);
altera_mbox_rx_data(chan); altera_mbox_rx_data(mbox->chan);
mod_timer(&mbox->rxpoll_timer, mod_timer(&mbox->rxpoll_timer,
jiffies + msecs_to_jiffies(MBOX_POLLING_MS)); jiffies + msecs_to_jiffies(MBOX_POLLING_MS));
...@@ -206,8 +206,8 @@ static int altera_mbox_startup_receiver(struct mbox_chan *chan) ...@@ -206,8 +206,8 @@ static int altera_mbox_startup_receiver(struct mbox_chan *chan)
polling: polling:
/* Setup polling timer */ /* Setup polling timer */
setup_timer(&mbox->rxpoll_timer, altera_mbox_poll_rx, mbox->chan = chan;
(unsigned long)chan); timer_setup(&mbox->rxpoll_timer, altera_mbox_poll_rx, 0);
mod_timer(&mbox->rxpoll_timer, mod_timer(&mbox->rxpoll_timer,
jiffies + msecs_to_jiffies(MBOX_POLLING_MS)); jiffies + msecs_to_jiffies(MBOX_POLLING_MS));
......
...@@ -102,7 +102,9 @@ static void omap_cf_timer(struct timer_list *t) ...@@ -102,7 +102,9 @@ static void omap_cf_timer(struct timer_list *t)
*/ */
static irqreturn_t omap_cf_irq(int irq, void *_cf) static irqreturn_t omap_cf_irq(int irq, void *_cf)
{ {
omap_cf_timer(&_cf->timer); struct omap_cf_socket *cf = (struct omap_cf_socket *)_cf;
omap_cf_timer(&cf->timer);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
...@@ -1211,7 +1211,7 @@ extern int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout); ...@@ -1211,7 +1211,7 @@ extern int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout);
extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout); extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout);
extern void ide_timer_expiry(unsigned long); extern void ide_timer_expiry(struct timer_list *t);
extern irqreturn_t ide_intr(int irq, void *dev_id); extern irqreturn_t ide_intr(int irq, void *dev_id);
extern void do_ide_request(struct request_queue *); extern void do_ide_request(struct request_queue *);
extern void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq); extern void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment