Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203170
b: refs/heads/master
c: 506e119
h: refs/heads/master
v: v3
  • Loading branch information
Vasanthy Kolluri authored and David S. Miller committed Jun 26, 2010
1 parent a6a0e9f commit d9fd4f0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 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: 1825aca667196f75b193e2d509ea96ffdc8db0ca
refs/heads/master: 506e1198413d28446f9a98792b2b38b6bf5f8295
9 changes: 9 additions & 0 deletions trunk/drivers/net/enic/vnic_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ static int _vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd,
int err;

status = ioread32(&devcmd->status);
if (status == 0xFFFFFFFF) {
/* PCI-e target device is gone */
return -ENODEV;
}

if (status & STAT_BUSY) {
pr_err("Busy devcmd %d\n", _CMD_N(cmd));
return -EBUSY;
Expand All @@ -296,6 +301,10 @@ static int _vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd,
udelay(100);

status = ioread32(&devcmd->status);
if (status == 0xFFFFFFFF) {
/* PCI-e target device is gone */
return -ENODEV;
}

if (!(status & STAT_BUSY)) {

Expand Down
13 changes: 11 additions & 2 deletions trunk/drivers/net/enic/vnic_rq.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ void vnic_rq_init(struct vnic_rq *rq, unsigned int cq_index,
/* Use current fetch_index as the ring starting point */
fetch_index = ioread32(&rq->ctrl->fetch_index);

if (fetch_index == 0xFFFFFFFF) { /* check for hardware gone */
/* Hardware surprise removal: reset fetch_index */
fetch_index = 0;
}

vnic_rq_init_start(rq, cq_index,
fetch_index, fetch_index,
error_interrupt_enable,
Expand Down Expand Up @@ -187,8 +192,6 @@ void vnic_rq_clean(struct vnic_rq *rq,
u32 fetch_index;
unsigned int count = rq->ring.desc_count;

BUG_ON(ioread32(&rq->ctrl->enable));

buf = rq->to_clean;

while (vnic_rq_desc_used(rq) > 0) {
Expand All @@ -201,6 +204,12 @@ void vnic_rq_clean(struct vnic_rq *rq,

/* Use current fetch_index as the ring starting point */
fetch_index = ioread32(&rq->ctrl->fetch_index);

if (fetch_index == 0xFFFFFFFF) { /* check for hardware gone */
/* Hardware surprise removal: reset fetch_index */
fetch_index = 0;
}

rq->to_use = rq->to_clean =
&rq->bufs[fetch_index / VNIC_RQ_BUF_BLK_ENTRIES(count)]
[fetch_index % VNIC_RQ_BUF_BLK_ENTRIES(count)];
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/net/enic/vnic_wq.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ void vnic_wq_clean(struct vnic_wq *wq,
{
struct vnic_wq_buf *buf;

BUG_ON(ioread32(&wq->ctrl->enable));

buf = wq->to_clean;

while (vnic_wq_desc_used(wq) > 0) {
Expand Down

0 comments on commit d9fd4f0

Please sign in to comment.