diff options
author | Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com> | 2015-03-26 10:41:30 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-04-09 19:55:21 -0400 |
commit | ef6162333a6910007c0ae2237e750ffd5bf25811 (patch) | |
tree | 4c98934c82f74a61ff394aed1f16041129748e62 /drivers/scsi/aacraid/rx.c | |
parent | f9c4259678cbde854a4e94398d66ef379178fd7c (diff) |
aacraid: performance improvement changes
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/aacraid/rx.c')
-rw-r--r-- | drivers/scsi/aacraid/rx.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c index 5c6a8703f535..9570612b80ce 100644 --- a/drivers/scsi/aacraid/rx.c +++ b/drivers/scsi/aacraid/rx.c | |||
@@ -400,16 +400,13 @@ int aac_rx_deliver_producer(struct fib * fib) | |||
400 | { | 400 | { |
401 | struct aac_dev *dev = fib->dev; | 401 | struct aac_dev *dev = fib->dev; |
402 | struct aac_queue *q = &dev->queues->queue[AdapNormCmdQueue]; | 402 | struct aac_queue *q = &dev->queues->queue[AdapNormCmdQueue]; |
403 | unsigned long qflags; | ||
404 | u32 Index; | 403 | u32 Index; |
405 | unsigned long nointr = 0; | 404 | unsigned long nointr = 0; |
406 | 405 | ||
407 | spin_lock_irqsave(q->lock, qflags); | ||
408 | aac_queue_get( dev, &Index, AdapNormCmdQueue, fib->hw_fib_va, 1, fib, &nointr); | 406 | aac_queue_get( dev, &Index, AdapNormCmdQueue, fib->hw_fib_va, 1, fib, &nointr); |
409 | 407 | ||
410 | q->numpending++; | 408 | atomic_inc(&q->numpending); |
411 | *(q->headers.producer) = cpu_to_le32(Index + 1); | 409 | *(q->headers.producer) = cpu_to_le32(Index + 1); |
412 | spin_unlock_irqrestore(q->lock, qflags); | ||
413 | if (!(nointr & aac_config.irq_mod)) | 410 | if (!(nointr & aac_config.irq_mod)) |
414 | aac_adapter_notify(dev, AdapNormCmdQueue); | 411 | aac_adapter_notify(dev, AdapNormCmdQueue); |
415 | 412 | ||
@@ -426,15 +423,12 @@ static int aac_rx_deliver_message(struct fib * fib) | |||
426 | { | 423 | { |
427 | struct aac_dev *dev = fib->dev; | 424 | struct aac_dev *dev = fib->dev; |
428 | struct aac_queue *q = &dev->queues->queue[AdapNormCmdQueue]; | 425 | struct aac_queue *q = &dev->queues->queue[AdapNormCmdQueue]; |
429 | unsigned long qflags; | ||
430 | u32 Index; | 426 | u32 Index; |
431 | u64 addr; | 427 | u64 addr; |
432 | volatile void __iomem *device; | 428 | volatile void __iomem *device; |
433 | 429 | ||
434 | unsigned long count = 10000000L; /* 50 seconds */ | 430 | unsigned long count = 10000000L; /* 50 seconds */ |
435 | spin_lock_irqsave(q->lock, qflags); | 431 | atomic_inc(&q->numpending); |
436 | q->numpending++; | ||
437 | spin_unlock_irqrestore(q->lock, qflags); | ||
438 | for(;;) { | 432 | for(;;) { |
439 | Index = rx_readl(dev, MUnit.InboundQueue); | 433 | Index = rx_readl(dev, MUnit.InboundQueue); |
440 | if (unlikely(Index == 0xFFFFFFFFL)) | 434 | if (unlikely(Index == 0xFFFFFFFFL)) |
@@ -442,9 +436,7 @@ static int aac_rx_deliver_message(struct fib * fib) | |||
442 | if (likely(Index != 0xFFFFFFFFL)) | 436 | if (likely(Index != 0xFFFFFFFFL)) |
443 | break; | 437 | break; |
444 | if (--count == 0) { | 438 | if (--count == 0) { |
445 | spin_lock_irqsave(q->lock, qflags); | 439 | atomic_dec(&q->numpending); |
446 | q->numpending--; | ||
447 | spin_unlock_irqrestore(q->lock, qflags); | ||
448 | return -ETIMEDOUT; | 440 | return -ETIMEDOUT; |
449 | } | 441 | } |
450 | udelay(5); | 442 | udelay(5); |