aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/dpcsup.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/aacraid/dpcsup.c')
-rw-r--r--drivers/scsi/aacraid/dpcsup.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/drivers/scsi/aacraid/dpcsup.c b/drivers/scsi/aacraid/dpcsup.c
index d38b628be1ad..42c7dcda6d9b 100644
--- a/drivers/scsi/aacraid/dpcsup.c
+++ b/drivers/scsi/aacraid/dpcsup.c
@@ -5,7 +5,7 @@
5 * based on the old aacraid driver that is.. 5 * based on the old aacraid driver that is..
6 * Adaptec aacraid device driver for Linux. 6 * Adaptec aacraid device driver for Linux.
7 * 7 *
8 * Copyright (c) 2000 Adaptec, Inc. (aacraid@adaptec.com) 8 * Copyright (c) 2000-2007 Adaptec, Inc. (aacraid@adaptec.com)
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
@@ -32,7 +32,6 @@
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/init.h> 33#include <linux/init.h>
34#include <linux/types.h> 34#include <linux/types.h>
35#include <linux/pci.h>
36#include <linux/spinlock.h> 35#include <linux/spinlock.h>
37#include <linux/slab.h> 36#include <linux/slab.h>
38#include <linux/completion.h> 37#include <linux/completion.h>
@@ -73,7 +72,7 @@ unsigned int aac_response_normal(struct aac_queue * q)
73 u32 index = le32_to_cpu(entry->addr); 72 u32 index = le32_to_cpu(entry->addr);
74 fast = index & 0x01; 73 fast = index & 0x01;
75 fib = &dev->fibs[index >> 2]; 74 fib = &dev->fibs[index >> 2];
76 hwfib = fib->hw_fib; 75 hwfib = fib->hw_fib_va;
77 76
78 aac_consumer_free(dev, q, HostNormRespQueue); 77 aac_consumer_free(dev, q, HostNormRespQueue);
79 /* 78 /*
@@ -84,11 +83,13 @@ unsigned int aac_response_normal(struct aac_queue * q)
84 * continue. The caller has already been notified that 83 * continue. The caller has already been notified that
85 * the fib timed out. 84 * the fib timed out.
86 */ 85 */
87 if (!(fib->flags & FIB_CONTEXT_FLAG_TIMED_OUT)) 86 dev->queues->queue[AdapNormCmdQueue].numpending--;
88 dev->queues->queue[AdapNormCmdQueue].numpending--; 87
89 else { 88 if (unlikely(fib->flags & FIB_CONTEXT_FLAG_TIMED_OUT)) {
90 printk(KERN_WARNING "aacraid: FIB timeout (%x).\n", fib->flags); 89 spin_unlock_irqrestore(q->lock, flags);
91 printk(KERN_DEBUG"aacraid: hwfib=%p fib index=%i fib=%p\n",hwfib, hwfib->header.SenderData,fib); 90 aac_fib_complete(fib);
91 aac_fib_free(fib);
92 spin_lock_irqsave(q->lock, flags);
92 continue; 93 continue;
93 } 94 }
94 spin_unlock_irqrestore(q->lock, flags); 95 spin_unlock_irqrestore(q->lock, flags);
@@ -193,7 +194,7 @@ unsigned int aac_command_normal(struct aac_queue *q)
193 INIT_LIST_HEAD(&fib->fiblink); 194 INIT_LIST_HEAD(&fib->fiblink);
194 fib->type = FSAFS_NTC_FIB_CONTEXT; 195 fib->type = FSAFS_NTC_FIB_CONTEXT;
195 fib->size = sizeof(struct fib); 196 fib->size = sizeof(struct fib);
196 fib->hw_fib = hw_fib; 197 fib->hw_fib_va = hw_fib;
197 fib->data = hw_fib->data; 198 fib->data = hw_fib->data;
198 fib->dev = dev; 199 fib->dev = dev;
199 200
@@ -254,12 +255,13 @@ unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index)
254 return 1; 255 return 1;
255 } 256 }
256 memset(hw_fib, 0, sizeof(struct hw_fib)); 257 memset(hw_fib, 0, sizeof(struct hw_fib));
257 memcpy(hw_fib, (struct hw_fib *)(((unsigned long)(dev->regs.sa)) + (index & ~0x00000002L)), sizeof(struct hw_fib)); 258 memcpy(hw_fib, (struct hw_fib *)(((ptrdiff_t)(dev->regs.sa)) +
259 (index & ~0x00000002L)), sizeof(struct hw_fib));
258 memset(fib, 0, sizeof(struct fib)); 260 memset(fib, 0, sizeof(struct fib));
259 INIT_LIST_HEAD(&fib->fiblink); 261 INIT_LIST_HEAD(&fib->fiblink);
260 fib->type = FSAFS_NTC_FIB_CONTEXT; 262 fib->type = FSAFS_NTC_FIB_CONTEXT;
261 fib->size = sizeof(struct fib); 263 fib->size = sizeof(struct fib);
262 fib->hw_fib = hw_fib; 264 fib->hw_fib_va = hw_fib;
263 fib->data = hw_fib->data; 265 fib->data = hw_fib->data;
264 fib->dev = dev; 266 fib->dev = dev;
265 267
@@ -271,7 +273,7 @@ unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index)
271 } else { 273 } else {
272 int fast = index & 0x01; 274 int fast = index & 0x01;
273 struct fib * fib = &dev->fibs[index >> 2]; 275 struct fib * fib = &dev->fibs[index >> 2];
274 struct hw_fib * hwfib = fib->hw_fib; 276 struct hw_fib * hwfib = fib->hw_fib_va;
275 277
276 /* 278 /*
277 * Remove this fib from the Outstanding I/O queue. 279 * Remove this fib from the Outstanding I/O queue.
@@ -281,14 +283,14 @@ unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index)
281 * continue. The caller has already been notified that 283 * continue. The caller has already been notified that
282 * the fib timed out. 284 * the fib timed out.
283 */ 285 */
284 if ((fib->flags & FIB_CONTEXT_FLAG_TIMED_OUT)) { 286 dev->queues->queue[AdapNormCmdQueue].numpending--;
285 printk(KERN_WARNING "aacraid: FIB timeout (%x).\n", fib->flags); 287
286 printk(KERN_DEBUG"aacraid: hwfib=%p index=%i fib=%p\n",hwfib, hwfib->header.SenderData,fib); 288 if (unlikely(fib->flags & FIB_CONTEXT_FLAG_TIMED_OUT)) {
289 aac_fib_complete(fib);
290 aac_fib_free(fib);
287 return 0; 291 return 0;
288 } 292 }
289 293
290 dev->queues->queue[AdapNormCmdQueue].numpending--;
291
292 if (fast) { 294 if (fast) {
293 /* 295 /*
294 * Doctor the fib 296 * Doctor the fib