Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181326
b: refs/heads/master
c: a104c99
h: refs/heads/master
v: v3
  • Loading branch information
Stephen M. Cameron authored and James Bottomley committed Feb 17, 2010
1 parent d9624f9 commit 525de4e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6df1e95496f8dfe08a520756187be59f7896f589
refs/heads/master: a104c99f386191706a11d39be81b8f03cd4f2719
26 changes: 22 additions & 4 deletions trunk/drivers/scsi/hpsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -2723,6 +2723,24 @@ static inline void finish_cmd(struct CommandList *c, u32 raw_tag)
complete(c->waiting);
}

static inline u32 hpsa_tag_contains_index(u32 tag)
{
#define DIRECT_LOOKUP_BIT 0x04
return tag & DIRECT_LOOKUP_BIT;
}

static inline u32 hpsa_tag_to_index(u32 tag)
{
#define DIRECT_LOOKUP_SHIFT 3
return tag >> DIRECT_LOOKUP_SHIFT;
}

static inline u32 hpsa_tag_discard_error_bits(u32 tag)
{
#define HPSA_ERROR_BITS 0x03
return tag & ~HPSA_ERROR_BITS;
}

static irqreturn_t do_hpsa_intr(int irq, void *dev_id)
{
struct ctlr_info *h = dev_id;
Expand All @@ -2736,15 +2754,15 @@ static irqreturn_t do_hpsa_intr(int irq, void *dev_id)
spin_lock_irqsave(&h->lock, flags);
while (interrupt_pending(h)) {
while ((raw_tag = get_next_completion(h)) != FIFO_EMPTY) {
if (likely(HPSA_TAG_CONTAINS_INDEX(raw_tag))) {
tag_index = HPSA_TAG_TO_INDEX(raw_tag);
if (likely(hpsa_tag_contains_index(raw_tag))) {
tag_index = hpsa_tag_to_index(raw_tag);
if (bad_tag(h, tag_index, raw_tag))
return IRQ_HANDLED;
c = h->cmd_pool + tag_index;
finish_cmd(c, raw_tag);
continue;
}
tag = HPSA_TAG_DISCARD_ERROR_BITS(raw_tag);
tag = hpsa_tag_discard_error_bits(raw_tag);
c = NULL;
hlist_for_each_entry(c, tmp, &h->cmpQ, list) {
if (c->busaddr == tag) {
Expand Down Expand Up @@ -2824,7 +2842,7 @@ static __devinit int hpsa_message(struct pci_dev *pdev, unsigned char opcode,

for (i = 0; i < HPSA_MSG_SEND_RETRY_LIMIT; i++) {
tag = readl(vaddr + SA5_REPLY_PORT_OFFSET);
if (HPSA_TAG_DISCARD_ERROR_BITS(tag) == paddr32)
if (hpsa_tag_discard_error_bits(tag) == paddr32)
break;
msleep(HPSA_MSG_SEND_RETRY_INTERVAL_MSECS);
}
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/scsi/hpsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ struct ctlr_info {
#define HPSA_FIRMWARE_READY 0xffff0000 /* value in scratchpad register */

#define HPSA_ERROR_BIT 0x02
#define HPSA_TAG_CONTAINS_INDEX(tag) ((tag) & 0x04)
#define HPSA_TAG_TO_INDEX(tag) ((tag) >> 3)
#define HPSA_TAG_DISCARD_ERROR_BITS(tag) ((tag) & ~3)

#define HPSA_INTR_ON 1
#define HPSA_INTR_OFF 0
Expand Down

0 comments on commit 525de4e

Please sign in to comment.