diff options
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/libata-core.c | 25 | ||||
-rw-r--r-- | drivers/ata/libata-eh.c | 2 | ||||
-rw-r--r-- | drivers/ata/libata-scsi.c | 14 | ||||
-rw-r--r-- | drivers/ata/libata.h | 4 |
4 files changed, 23 insertions, 22 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index f8ec3896b793..8816e30fb7a4 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -1081,7 +1081,7 @@ static unsigned int ata_id_xfermask(const u16 *id) | |||
1081 | * ata_port_queue_task - Queue port_task | 1081 | * ata_port_queue_task - Queue port_task |
1082 | * @ap: The ata_port to queue port_task for | 1082 | * @ap: The ata_port to queue port_task for |
1083 | * @fn: workqueue function to be scheduled | 1083 | * @fn: workqueue function to be scheduled |
1084 | * @data: data value to pass to workqueue function | 1084 | * @data: data for @fn to use |
1085 | * @delay: delay time for workqueue function | 1085 | * @delay: delay time for workqueue function |
1086 | * | 1086 | * |
1087 | * Schedule @fn(@data) for execution after @delay jiffies using | 1087 | * Schedule @fn(@data) for execution after @delay jiffies using |
@@ -1096,7 +1096,7 @@ static unsigned int ata_id_xfermask(const u16 *id) | |||
1096 | * LOCKING: | 1096 | * LOCKING: |
1097 | * Inherited from caller. | 1097 | * Inherited from caller. |
1098 | */ | 1098 | */ |
1099 | void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), void *data, | 1099 | void ata_port_queue_task(struct ata_port *ap, work_func_t fn, void *data, |
1100 | unsigned long delay) | 1100 | unsigned long delay) |
1101 | { | 1101 | { |
1102 | int rc; | 1102 | int rc; |
@@ -1104,12 +1104,10 @@ void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), void *data, | |||
1104 | if (ap->pflags & ATA_PFLAG_FLUSH_PORT_TASK) | 1104 | if (ap->pflags & ATA_PFLAG_FLUSH_PORT_TASK) |
1105 | return; | 1105 | return; |
1106 | 1106 | ||
1107 | PREPARE_WORK(&ap->port_task, fn, data); | 1107 | PREPARE_DELAYED_WORK(&ap->port_task, fn); |
1108 | ap->port_task_data = data; | ||
1108 | 1109 | ||
1109 | if (!delay) | 1110 | rc = queue_delayed_work(ata_wq, &ap->port_task, delay); |
1110 | rc = queue_work(ata_wq, &ap->port_task); | ||
1111 | else | ||
1112 | rc = queue_delayed_work(ata_wq, &ap->port_task, delay); | ||
1113 | 1111 | ||
1114 | /* rc == 0 means that another user is using port task */ | 1112 | /* rc == 0 means that another user is using port task */ |
1115 | WARN_ON(rc == 0); | 1113 | WARN_ON(rc == 0); |
@@ -4588,10 +4586,11 @@ fsm_start: | |||
4588 | return poll_next; | 4586 | return poll_next; |
4589 | } | 4587 | } |
4590 | 4588 | ||
4591 | static void ata_pio_task(void *_data) | 4589 | static void ata_pio_task(struct work_struct *work) |
4592 | { | 4590 | { |
4593 | struct ata_queued_cmd *qc = _data; | 4591 | struct ata_port *ap = |
4594 | struct ata_port *ap = qc->ap; | 4592 | container_of(work, struct ata_port, port_task.work); |
4593 | struct ata_queued_cmd *qc = ap->port_task_data; | ||
4595 | u8 status; | 4594 | u8 status; |
4596 | int poll_next; | 4595 | int poll_next; |
4597 | 4596 | ||
@@ -5635,9 +5634,9 @@ void ata_port_init(struct ata_port *ap, struct ata_host *host, | |||
5635 | ap->msg_enable = ATA_MSG_DRV | ATA_MSG_ERR | ATA_MSG_WARN; | 5634 | ap->msg_enable = ATA_MSG_DRV | ATA_MSG_ERR | ATA_MSG_WARN; |
5636 | #endif | 5635 | #endif |
5637 | 5636 | ||
5638 | INIT_WORK(&ap->port_task, NULL, NULL); | 5637 | INIT_DELAYED_WORK(&ap->port_task, NULL); |
5639 | INIT_WORK(&ap->hotplug_task, ata_scsi_hotplug, ap); | 5638 | INIT_DELAYED_WORK(&ap->hotplug_task, ata_scsi_hotplug); |
5640 | INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan, ap); | 5639 | INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan); |
5641 | INIT_LIST_HEAD(&ap->eh_done_q); | 5640 | INIT_LIST_HEAD(&ap->eh_done_q); |
5642 | init_waitqueue_head(&ap->eh_wait_q); | 5641 | init_waitqueue_head(&ap->eh_wait_q); |
5643 | 5642 | ||
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 76a85dfb7307..08ad44b3e48f 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 8eaace94d963..664e1377b54c 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -2963,7 +2963,7 @@ static void ata_scsi_remove_dev(struct ata_device *dev) | |||
2963 | 2963 | ||
2964 | /** | 2964 | /** |
2965 | * ata_scsi_hotplug - SCSI part of hotplug | 2965 | * ata_scsi_hotplug - SCSI part of hotplug |
2966 | * @data: Pointer to ATA port to perform SCSI hotplug on | 2966 | * @work: Pointer to ATA port to perform SCSI hotplug on |
2967 | * | 2967 | * |
2968 | * Perform SCSI part of hotplug. It's executed from a separate | 2968 | * Perform SCSI part of hotplug. It's executed from a separate |
2969 | * workqueue after EH completes. This is necessary because SCSI | 2969 | * workqueue after EH completes. This is necessary because SCSI |
@@ -2973,9 +2973,10 @@ static void ata_scsi_remove_dev(struct ata_device *dev) | |||
2973 | * LOCKING: | 2973 | * LOCKING: |
2974 | * Kernel thread context (may sleep). | 2974 | * Kernel thread context (may sleep). |
2975 | */ | 2975 | */ |
2976 | void ata_scsi_hotplug(void *data) | 2976 | void ata_scsi_hotplug(struct work_struct *work) |
2977 | { | 2977 | { |
2978 | struct ata_port *ap = data; | 2978 | struct ata_port *ap = |
2979 | container_of(work, struct ata_port, hotplug_task.work); | ||
2979 | int i; | 2980 | int i; |
2980 | 2981 | ||
2981 | if (ap->pflags & ATA_PFLAG_UNLOADING) { | 2982 | if (ap->pflags & ATA_PFLAG_UNLOADING) { |
@@ -3076,7 +3077,7 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, | |||
3076 | 3077 | ||
3077 | /** | 3078 | /** |
3078 | * ata_scsi_dev_rescan - initiate scsi_rescan_device() | 3079 | * ata_scsi_dev_rescan - initiate scsi_rescan_device() |
3079 | * @data: Pointer to ATA port to perform scsi_rescan_device() | 3080 | * @work: Pointer to ATA port to perform scsi_rescan_device() |
3080 | * | 3081 | * |
3081 | * After ATA pass thru (SAT) commands are executed successfully, | 3082 | * After ATA pass thru (SAT) commands are executed successfully, |
3082 | * libata need to propagate the changes to SCSI layer. This | 3083 | * libata need to propagate the changes to SCSI layer. This |
@@ -3086,9 +3087,10 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, | |||
3086 | * LOCKING: | 3087 | * LOCKING: |
3087 | * Kernel thread context (may sleep). | 3088 | * Kernel thread context (may sleep). |
3088 | */ | 3089 | */ |
3089 | void ata_scsi_dev_rescan(void *data) | 3090 | void ata_scsi_dev_rescan(struct work_struct *work) |
3090 | { | 3091 | { |
3091 | struct ata_port *ap = data; | 3092 | struct ata_port *ap = |
3093 | container_of(work, struct ata_port, scsi_rescan_task); | ||
3092 | unsigned long flags; | 3094 | unsigned long flags; |
3093 | unsigned int i; | 3095 | unsigned int i; |
3094 | 3096 | ||
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index 107b2b565229..81ae41d5f23f 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h | |||
@@ -94,7 +94,7 @@ extern struct scsi_transport_template ata_scsi_transport_template; | |||
94 | 94 | ||
95 | extern void ata_scsi_scan_host(struct ata_port *ap); | 95 | extern void ata_scsi_scan_host(struct ata_port *ap); |
96 | extern int ata_scsi_offline_dev(struct ata_device *dev); | 96 | extern int ata_scsi_offline_dev(struct ata_device *dev); |
97 | extern void ata_scsi_hotplug(void *data); | 97 | extern void ata_scsi_hotplug(struct work_struct *work); |
98 | extern unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf, | 98 | extern unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf, |
99 | unsigned int buflen); | 99 | unsigned int buflen); |
100 | 100 | ||
@@ -124,7 +124,7 @@ extern void ata_scsi_rbuf_fill(struct ata_scsi_args *args, | |||
124 | unsigned int (*actor) (struct ata_scsi_args *args, | 124 | unsigned int (*actor) (struct ata_scsi_args *args, |
125 | u8 *rbuf, unsigned int buflen)); | 125 | u8 *rbuf, unsigned int buflen)); |
126 | extern void ata_schedule_scsi_eh(struct Scsi_Host *shost); | 126 | extern void ata_schedule_scsi_eh(struct Scsi_Host *shost); |
127 | extern void ata_scsi_dev_rescan(void *data); | 127 | extern void ata_scsi_dev_rescan(struct work_struct *work); |
128 | extern int ata_bus_probe(struct ata_port *ap); | 128 | extern int ata_bus_probe(struct ata_port *ap); |
129 | 129 | ||
130 | /* libata-eh.c */ | 130 | /* libata-eh.c */ |