aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c25
-rw-r--r--drivers/ata/libata-eh.c2
-rw-r--r--drivers/ata/libata-scsi.c14
-rw-r--r--drivers/ata/libata.h4
4 files changed, 23 insertions, 22 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 915a55a6cc14..b5f2da6ac80e 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -914,7 +914,7 @@ static unsigned int ata_id_xfermask(const u16 *id)
914 * ata_port_queue_task - Queue port_task 914 * ata_port_queue_task - Queue port_task
915 * @ap: The ata_port to queue port_task for 915 * @ap: The ata_port to queue port_task for
916 * @fn: workqueue function to be scheduled 916 * @fn: workqueue function to be scheduled
917 * @data: data value to pass to workqueue function 917 * @data: data for @fn to use
918 * @delay: delay time for workqueue function 918 * @delay: delay time for workqueue function
919 * 919 *
920 * Schedule @fn(@data) for execution after @delay jiffies using 920 * Schedule @fn(@data) for execution after @delay jiffies using
@@ -929,7 +929,7 @@ static unsigned int ata_id_xfermask(const u16 *id)
929 * LOCKING: 929 * LOCKING:
930 * Inherited from caller. 930 * Inherited from caller.
931 */ 931 */
932void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), void *data, 932void ata_port_queue_task(struct ata_port *ap, work_func_t fn, void *data,
933 unsigned long delay) 933 unsigned long delay)
934{ 934{
935 int rc; 935 int rc;
@@ -937,12 +937,10 @@ void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), void *data,
937 if (ap->pflags & ATA_PFLAG_FLUSH_PORT_TASK) 937 if (ap->pflags & ATA_PFLAG_FLUSH_PORT_TASK)
938 return; 938 return;
939 939
940 PREPARE_WORK(&ap->port_task, fn, data); 940 PREPARE_DELAYED_WORK(&ap->port_task, fn);
941 ap->port_task_data = data;
941 942
942 if (!delay) 943 rc = queue_delayed_work(ata_wq, &ap->port_task, delay);
943 rc = queue_work(ata_wq, &ap->port_task);
944 else
945 rc = queue_delayed_work(ata_wq, &ap->port_task, delay);
946 944
947 /* rc == 0 means that another user is using port task */ 945 /* rc == 0 means that another user is using port task */
948 WARN_ON(rc == 0); 946 WARN_ON(rc == 0);
@@ -4295,10 +4293,11 @@ fsm_start:
4295 return poll_next; 4293 return poll_next;
4296} 4294}
4297 4295
4298static void ata_pio_task(void *_data) 4296static void ata_pio_task(struct work_struct *work)
4299{ 4297{
4300 struct ata_queued_cmd *qc = _data; 4298 struct ata_port *ap =
4301 struct ata_port *ap = qc->ap; 4299 container_of(work, struct ata_port, port_task.work);
4300 struct ata_queued_cmd *qc = ap->port_task_data;
4302 u8 status; 4301 u8 status;
4303 int poll_next; 4302 int poll_next;
4304 4303
@@ -5320,9 +5319,9 @@ void ata_port_init(struct ata_port *ap, struct ata_host *host,
5320 ap->msg_enable = ATA_MSG_DRV | ATA_MSG_ERR | ATA_MSG_WARN; 5319 ap->msg_enable = ATA_MSG_DRV | ATA_MSG_ERR | ATA_MSG_WARN;
5321#endif 5320#endif
5322 5321
5323 INIT_WORK(&ap->port_task, NULL, NULL); 5322 INIT_DELAYED_WORK(&ap->port_task, NULL);
5324 INIT_WORK(&ap->hotplug_task, ata_scsi_hotplug, ap); 5323 INIT_DELAYED_WORK(&ap->hotplug_task, ata_scsi_hotplug);
5325 INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan, ap); 5324 INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan);
5326 INIT_LIST_HEAD(&ap->eh_done_q); 5325 INIT_LIST_HEAD(&ap->eh_done_q);
5327 init_waitqueue_head(&ap->eh_wait_q); 5326 init_waitqueue_head(&ap->eh_wait_q);
5328 5327
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 02b2b2787d9b..9f6b7cc74fd9 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -332,7 +332,7 @@ void ata_scsi_error(struct Scsi_Host *host)
332 if (ap->pflags & ATA_PFLAG_LOADING) 332 if (ap->pflags & ATA_PFLAG_LOADING)
333 ap->pflags &= ~ATA_PFLAG_LOADING; 333 ap->pflags &= ~ATA_PFLAG_LOADING;
334 else if (ap->pflags & ATA_PFLAG_SCSI_HOTPLUG) 334 else if (ap->pflags & ATA_PFLAG_SCSI_HOTPLUG)
335 queue_work(ata_aux_wq, &ap->hotplug_task); 335 queue_delayed_work(ata_aux_wq, &ap->hotplug_task, 0);
336 336
337 if (ap->pflags & ATA_PFLAG_RECOVERED) 337 if (ap->pflags & ATA_PFLAG_RECOVERED)
338 ata_port_printk(ap, KERN_INFO, "EH complete\n"); 338 ata_port_printk(ap, KERN_INFO, "EH complete\n");
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 47ea111d5ace..4c32d93d44b1 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3081,7 +3081,7 @@ static void ata_scsi_remove_dev(struct ata_device *dev)
3081 3081
3082/** 3082/**
3083 * ata_scsi_hotplug - SCSI part of hotplug 3083 * ata_scsi_hotplug - SCSI part of hotplug
3084 * @data: Pointer to ATA port to perform SCSI hotplug on 3084 * @work: Pointer to ATA port to perform SCSI hotplug on
3085 * 3085 *
3086 * Perform SCSI part of hotplug. It's executed from a separate 3086 * Perform SCSI part of hotplug. It's executed from a separate
3087 * workqueue after EH completes. This is necessary because SCSI 3087 * workqueue after EH completes. This is necessary because SCSI
@@ -3091,9 +3091,10 @@ static void ata_scsi_remove_dev(struct ata_device *dev)
3091 * LOCKING: 3091 * LOCKING:
3092 * Kernel thread context (may sleep). 3092 * Kernel thread context (may sleep).
3093 */ 3093 */
3094void ata_scsi_hotplug(void *data) 3094void ata_scsi_hotplug(struct work_struct *work)
3095{ 3095{
3096 struct ata_port *ap = data; 3096 struct ata_port *ap =
3097 container_of(work, struct ata_port, hotplug_task.work);
3097 int i; 3098 int i;
3098 3099
3099 if (ap->pflags & ATA_PFLAG_UNLOADING) { 3100 if (ap->pflags & ATA_PFLAG_UNLOADING) {
@@ -3192,7 +3193,7 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
3192 3193
3193/** 3194/**
3194 * ata_scsi_dev_rescan - initiate scsi_rescan_device() 3195 * ata_scsi_dev_rescan - initiate scsi_rescan_device()
3195 * @data: Pointer to ATA port to perform scsi_rescan_device() 3196 * @work: Pointer to ATA port to perform scsi_rescan_device()
3196 * 3197 *
3197 * After ATA pass thru (SAT) commands are executed successfully, 3198 * After ATA pass thru (SAT) commands are executed successfully,
3198 * libata need to propagate the changes to SCSI layer. This 3199 * libata need to propagate the changes to SCSI layer. This
@@ -3202,9 +3203,10 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
3202 * LOCKING: 3203 * LOCKING:
3203 * Kernel thread context (may sleep). 3204 * Kernel thread context (may sleep).
3204 */ 3205 */
3205void ata_scsi_dev_rescan(void *data) 3206void ata_scsi_dev_rescan(struct work_struct *work)
3206{ 3207{
3207 struct ata_port *ap = data; 3208 struct ata_port *ap =
3209 container_of(work, struct ata_port, scsi_rescan_task);
3208 struct ata_device *dev; 3210 struct ata_device *dev;
3209 unsigned int i; 3211 unsigned int i;
3210 3212
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index 0ed263be652a..7e0f3aff873d 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -81,7 +81,7 @@ extern struct scsi_transport_template ata_scsi_transport_template;
81 81
82extern void ata_scsi_scan_host(struct ata_port *ap); 82extern void ata_scsi_scan_host(struct ata_port *ap);
83extern int ata_scsi_offline_dev(struct ata_device *dev); 83extern int ata_scsi_offline_dev(struct ata_device *dev);
84extern void ata_scsi_hotplug(void *data); 84extern void ata_scsi_hotplug(struct work_struct *work);
85extern unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf, 85extern unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf,
86 unsigned int buflen); 86 unsigned int buflen);
87 87
@@ -111,7 +111,7 @@ extern void ata_scsi_rbuf_fill(struct ata_scsi_args *args,
111 unsigned int (*actor) (struct ata_scsi_args *args, 111 unsigned int (*actor) (struct ata_scsi_args *args,
112 u8 *rbuf, unsigned int buflen)); 112 u8 *rbuf, unsigned int buflen));
113extern void ata_schedule_scsi_eh(struct Scsi_Host *shost); 113extern void ata_schedule_scsi_eh(struct Scsi_Host *shost);
114extern void ata_scsi_dev_rescan(void *data); 114extern void ata_scsi_dev_rescan(struct work_struct *work);
115extern int ata_bus_probe(struct ata_port *ap); 115extern int ata_bus_probe(struct ata_port *ap);
116 116
117/* libata-eh.c */ 117/* libata-eh.c */