aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ibmvscsi/ibmvfc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/ibmvscsi/ibmvfc.c')
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c11
1 files changed, 9 insertions, 2 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 **/
2931static ssize_t ibmvfc_read_trace(struct kobject *kobj, 2932static 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 }