diff options
Diffstat (limited to 'drivers/scsi/ibmvscsi')
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvfc.c | 11 | ||||
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvfc.h | 1 | ||||
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.c | 29 |
3 files changed, 12 insertions, 29 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 60cd4ec51eae..fef49521cbc3 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c | |||
@@ -2245,7 +2245,7 @@ static int ibmvfc_wait_for_ops(struct ibmvfc_host *vhost, void *device, | |||
2245 | DECLARE_COMPLETION_ONSTACK(comp); | 2245 | DECLARE_COMPLETION_ONSTACK(comp); |
2246 | int wait; | 2246 | int wait; |
2247 | unsigned long flags; | 2247 | unsigned long flags; |
2248 | signed long timeout = init_timeout * HZ; | 2248 | signed long timeout = IBMVFC_ABORT_WAIT_TIMEOUT * HZ; |
2249 | 2249 | ||
2250 | ENTER; | 2250 | ENTER; |
2251 | do { | 2251 | do { |
@@ -2919,6 +2919,7 @@ static DEVICE_ATTR(log_level, S_IRUGO | S_IWUSR, | |||
2919 | #ifdef CONFIG_SCSI_IBMVFC_TRACE | 2919 | #ifdef CONFIG_SCSI_IBMVFC_TRACE |
2920 | /** | 2920 | /** |
2921 | * ibmvfc_read_trace - Dump the adapter trace | 2921 | * ibmvfc_read_trace - Dump the adapter trace |
2922 | * @filp: open sysfs file | ||
2922 | * @kobj: kobject struct | 2923 | * @kobj: kobject struct |
2923 | * @bin_attr: bin_attribute struct | 2924 | * @bin_attr: bin_attribute struct |
2924 | * @buf: buffer | 2925 | * @buf: buffer |
@@ -2928,7 +2929,7 @@ static DEVICE_ATTR(log_level, S_IRUGO | S_IWUSR, | |||
2928 | * Return value: | 2929 | * Return value: |
2929 | * number of bytes printed to buffer | 2930 | * number of bytes printed to buffer |
2930 | **/ | 2931 | **/ |
2931 | static ssize_t ibmvfc_read_trace(struct kobject *kobj, | 2932 | static ssize_t ibmvfc_read_trace(struct file *filp, struct kobject *kobj, |
2932 | struct bin_attribute *bin_attr, | 2933 | struct bin_attribute *bin_attr, |
2933 | char *buf, loff_t off, size_t count) | 2934 | char *buf, loff_t off, size_t count) |
2934 | { | 2935 | { |
@@ -3013,6 +3014,7 @@ static struct ibmvfc_async_crq *ibmvfc_next_async_crq(struct ibmvfc_host *vhost) | |||
3013 | if (crq->valid & 0x80) { | 3014 | if (crq->valid & 0x80) { |
3014 | if (++async_crq->cur == async_crq->size) | 3015 | if (++async_crq->cur == async_crq->size) |
3015 | async_crq->cur = 0; | 3016 | async_crq->cur = 0; |
3017 | rmb(); | ||
3016 | } else | 3018 | } else |
3017 | crq = NULL; | 3019 | crq = NULL; |
3018 | 3020 | ||
@@ -3035,6 +3037,7 @@ static struct ibmvfc_crq *ibmvfc_next_crq(struct ibmvfc_host *vhost) | |||
3035 | if (crq->valid & 0x80) { | 3037 | if (crq->valid & 0x80) { |
3036 | if (++queue->cur == queue->size) | 3038 | if (++queue->cur == queue->size) |
3037 | queue->cur = 0; | 3039 | queue->cur = 0; |
3040 | rmb(); | ||
3038 | } else | 3041 | } else |
3039 | crq = NULL; | 3042 | crq = NULL; |
3040 | 3043 | ||
@@ -3083,12 +3086,14 @@ static void ibmvfc_tasklet(void *data) | |||
3083 | while ((async = ibmvfc_next_async_crq(vhost)) != NULL) { | 3086 | while ((async = ibmvfc_next_async_crq(vhost)) != NULL) { |
3084 | ibmvfc_handle_async(async, vhost); | 3087 | ibmvfc_handle_async(async, vhost); |
3085 | async->valid = 0; | 3088 | async->valid = 0; |
3089 | wmb(); | ||
3086 | } | 3090 | } |
3087 | 3091 | ||
3088 | /* Pull all the valid messages off the CRQ */ | 3092 | /* Pull all the valid messages off the CRQ */ |
3089 | while ((crq = ibmvfc_next_crq(vhost)) != NULL) { | 3093 | while ((crq = ibmvfc_next_crq(vhost)) != NULL) { |
3090 | ibmvfc_handle_crq(crq, vhost); | 3094 | ibmvfc_handle_crq(crq, vhost); |
3091 | crq->valid = 0; | 3095 | crq->valid = 0; |
3096 | wmb(); | ||
3092 | } | 3097 | } |
3093 | 3098 | ||
3094 | vio_enable_interrupts(vdev); | 3099 | vio_enable_interrupts(vdev); |
@@ -3096,10 +3101,12 @@ static void ibmvfc_tasklet(void *data) | |||
3096 | vio_disable_interrupts(vdev); | 3101 | vio_disable_interrupts(vdev); |
3097 | ibmvfc_handle_async(async, vhost); | 3102 | ibmvfc_handle_async(async, vhost); |
3098 | async->valid = 0; | 3103 | async->valid = 0; |
3104 | wmb(); | ||
3099 | } else if ((crq = ibmvfc_next_crq(vhost)) != NULL) { | 3105 | } else if ((crq = ibmvfc_next_crq(vhost)) != NULL) { |
3100 | vio_disable_interrupts(vdev); | 3106 | vio_disable_interrupts(vdev); |
3101 | ibmvfc_handle_crq(crq, vhost); | 3107 | ibmvfc_handle_crq(crq, vhost); |
3102 | crq->valid = 0; | 3108 | crq->valid = 0; |
3109 | wmb(); | ||
3103 | } else | 3110 | } else |
3104 | done = 1; | 3111 | done = 1; |
3105 | } | 3112 | } |
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.h b/drivers/scsi/ibmvscsi/ibmvfc.h index d25106a958d7..7e9742764e4b 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.h +++ b/drivers/scsi/ibmvscsi/ibmvfc.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #define IBMVFC_ADISC_PLUS_CANCEL_TIMEOUT \ | 38 | #define IBMVFC_ADISC_PLUS_CANCEL_TIMEOUT \ |
39 | (IBMVFC_ADISC_TIMEOUT + IBMVFC_ADISC_CANCEL_TIMEOUT) | 39 | (IBMVFC_ADISC_TIMEOUT + IBMVFC_ADISC_CANCEL_TIMEOUT) |
40 | #define IBMVFC_INIT_TIMEOUT 120 | 40 | #define IBMVFC_INIT_TIMEOUT 120 |
41 | #define IBMVFC_ABORT_WAIT_TIMEOUT 40 | ||
41 | #define IBMVFC_MAX_REQUESTS_DEFAULT 100 | 42 | #define IBMVFC_MAX_REQUESTS_DEFAULT 100 |
42 | 43 | ||
43 | #define IBMVFC_DEBUG 0 | 44 | #define IBMVFC_DEBUG 0 |
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index cc38fefc2612..aad35cc41e49 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
@@ -323,16 +323,6 @@ static void set_srp_direction(struct scsi_cmnd *cmd, | |||
323 | srp_cmd->buf_fmt = fmt; | 323 | srp_cmd->buf_fmt = fmt; |
324 | } | 324 | } |
325 | 325 | ||
326 | static void unmap_sg_list(int num_entries, | ||
327 | struct device *dev, | ||
328 | struct srp_direct_buf *md) | ||
329 | { | ||
330 | int i; | ||
331 | |||
332 | for (i = 0; i < num_entries; ++i) | ||
333 | dma_unmap_single(dev, md[i].va, md[i].len, DMA_BIDIRECTIONAL); | ||
334 | } | ||
335 | |||
336 | /** | 326 | /** |
337 | * unmap_cmd_data: - Unmap data pointed in srp_cmd based on the format | 327 | * unmap_cmd_data: - Unmap data pointed in srp_cmd based on the format |
338 | * @cmd: srp_cmd whose additional_data member will be unmapped | 328 | * @cmd: srp_cmd whose additional_data member will be unmapped |
@@ -350,24 +340,9 @@ static void unmap_cmd_data(struct srp_cmd *cmd, | |||
350 | 340 | ||
351 | if (out_fmt == SRP_NO_DATA_DESC && in_fmt == SRP_NO_DATA_DESC) | 341 | if (out_fmt == SRP_NO_DATA_DESC && in_fmt == SRP_NO_DATA_DESC) |
352 | return; | 342 | return; |
353 | else if (out_fmt == SRP_DATA_DESC_DIRECT || | ||
354 | in_fmt == SRP_DATA_DESC_DIRECT) { | ||
355 | struct srp_direct_buf *data = | ||
356 | (struct srp_direct_buf *) cmd->add_data; | ||
357 | dma_unmap_single(dev, data->va, data->len, DMA_BIDIRECTIONAL); | ||
358 | } else { | ||
359 | struct srp_indirect_buf *indirect = | ||
360 | (struct srp_indirect_buf *) cmd->add_data; | ||
361 | int num_mapped = indirect->table_desc.len / | ||
362 | sizeof(struct srp_direct_buf); | ||
363 | 343 | ||
364 | if (num_mapped <= MAX_INDIRECT_BUFS) { | 344 | if (evt_struct->cmnd) |
365 | unmap_sg_list(num_mapped, dev, &indirect->desc_list[0]); | 345 | scsi_dma_unmap(evt_struct->cmnd); |
366 | return; | ||
367 | } | ||
368 | |||
369 | unmap_sg_list(num_mapped, dev, evt_struct->ext_list); | ||
370 | } | ||
371 | } | 346 | } |
372 | 347 | ||
373 | static int map_sg_list(struct scsi_cmnd *cmd, int nseg, | 348 | static int map_sg_list(struct scsi_cmnd *cmd, int nseg, |