static unsigned long ata_dev_blacklisted(const struct ata_device *dev);
unsigned int ata_print_id = 1;
-static struct workqueue_struct *ata_wq;
struct workqueue_struct *ata_aux_wq;
ap->port_task_data = data;
/* may fail if ata_port_flush_task() in progress */
- queue_delayed_work(ata_wq, &ap->port_task, msecs_to_jiffies(delay));
+ delayed_slow_work_enqueue(&ap->port_task, msecs_to_jiffies(delay));
}
/**
{
DPRINTK("ENTER\n");
- cancel_rearming_delayed_work(&ap->port_task);
+ cancel_delayed_slow_work(&ap->port_task);
if (ata_msg_ctl(ap))
ata_port_printk(ap, KERN_DEBUG, "%s: EXIT\n", __func__);
return 0;
}
+static const struct slow_work_ops ata_work_ops_sff = {
+ .execute = ata_pio_task,
+};
+
+static const struct slow_work_ops ata_work_ops = {
+ .execute = NULL, /* what's the point of this?! */
+};
+
/**
* ata_port_alloc - allocate and initialize basic ATA port resources
* @host: ATA host this allocated port belongs to
#endif
#ifdef CONFIG_ATA_SFF
- INIT_DELAYED_WORK(&ap->port_task, ata_pio_task);
+ delayed_slow_work_init(&ap->port_task, &ata_work_ops_sff);
#else
- INIT_DELAYED_WORK(&ap->port_task, NULL);
+ delayed_slow_work_init(&ap->port_task, &ata_work_ops);
#endif
INIT_DELAYED_WORK(&ap->hotplug_task, ata_scsi_hotplug);
INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan);
{
ata_parse_force_param();
- ata_wq = create_workqueue("ata");
- if (!ata_wq)
- goto free_force_tbl;
-
ata_aux_wq = create_singlethread_workqueue("ata_aux");
if (!ata_aux_wq)
- goto free_wq;
+ goto free_force_tbl;
+
+ slow_work_register_user(THIS_MODULE);
printk(KERN_DEBUG "libata version " DRV_VERSION " loaded.\n");
return 0;
-free_wq:
- destroy_workqueue(ata_wq);
free_force_tbl:
kfree(ata_force_tbl);
return -ENOMEM;
static void __exit ata_exit(void)
{
kfree(ata_force_tbl);
- destroy_workqueue(ata_wq);
destroy_workqueue(ata_aux_wq);
+ slow_work_unregister_user(THIS_MODULE);
}
subsys_initcall(ata_init);
extern void ata_dev_select(struct ata_port *ap, unsigned int device,
unsigned int wait, unsigned int can_sleep);
extern u8 ata_irq_on(struct ata_port *ap);
-extern void ata_pio_task(struct work_struct *work);
+extern void ata_pio_task(struct slow_work *work);
#endif /* CONFIG_ATA_SFF */
#endif /* __LIBATA_H__ */