diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/enic/vnic_dev.c | 9 | ||||
-rw-r--r-- | drivers/net/enic/vnic_rq.c | 13 | ||||
-rw-r--r-- | drivers/net/enic/vnic_wq.c | 2 |
3 files changed, 20 insertions, 4 deletions
diff --git a/drivers/net/enic/vnic_dev.c b/drivers/net/enic/vnic_dev.c index 180912f48007..662123c9581e 100644 --- a/drivers/net/enic/vnic_dev.c +++ b/drivers/net/enic/vnic_dev.c | |||
@@ -275,6 +275,11 @@ static int _vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, | |||
275 | int err; | 275 | int err; |
276 | 276 | ||
277 | status = ioread32(&devcmd->status); | 277 | status = ioread32(&devcmd->status); |
278 | if (status == 0xFFFFFFFF) { | ||
279 | /* PCI-e target device is gone */ | ||
280 | return -ENODEV; | ||
281 | } | ||
282 | |||
278 | if (status & STAT_BUSY) { | 283 | if (status & STAT_BUSY) { |
279 | pr_err("Busy devcmd %d\n", _CMD_N(cmd)); | 284 | pr_err("Busy devcmd %d\n", _CMD_N(cmd)); |
280 | return -EBUSY; | 285 | return -EBUSY; |
@@ -296,6 +301,10 @@ static int _vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, | |||
296 | udelay(100); | 301 | udelay(100); |
297 | 302 | ||
298 | status = ioread32(&devcmd->status); | 303 | status = ioread32(&devcmd->status); |
304 | if (status == 0xFFFFFFFF) { | ||
305 | /* PCI-e target device is gone */ | ||
306 | return -ENODEV; | ||
307 | } | ||
299 | 308 | ||
300 | if (!(status & STAT_BUSY)) { | 309 | if (!(status & STAT_BUSY)) { |
301 | 310 | ||
diff --git a/drivers/net/enic/vnic_rq.c b/drivers/net/enic/vnic_rq.c index 45cfc79f9f98..061a26fbbbfb 100644 --- a/drivers/net/enic/vnic_rq.c +++ b/drivers/net/enic/vnic_rq.c | |||
@@ -146,6 +146,11 @@ void vnic_rq_init(struct vnic_rq *rq, unsigned int cq_index, | |||
146 | /* Use current fetch_index as the ring starting point */ | 146 | /* Use current fetch_index as the ring starting point */ |
147 | fetch_index = ioread32(&rq->ctrl->fetch_index); | 147 | fetch_index = ioread32(&rq->ctrl->fetch_index); |
148 | 148 | ||
149 | if (fetch_index == 0xFFFFFFFF) { /* check for hardware gone */ | ||
150 | /* Hardware surprise removal: reset fetch_index */ | ||
151 | fetch_index = 0; | ||
152 | } | ||
153 | |||
149 | vnic_rq_init_start(rq, cq_index, | 154 | vnic_rq_init_start(rq, cq_index, |
150 | fetch_index, fetch_index, | 155 | fetch_index, fetch_index, |
151 | error_interrupt_enable, | 156 | error_interrupt_enable, |
@@ -187,8 +192,6 @@ void vnic_rq_clean(struct vnic_rq *rq, | |||
187 | u32 fetch_index; | 192 | u32 fetch_index; |
188 | unsigned int count = rq->ring.desc_count; | 193 | unsigned int count = rq->ring.desc_count; |
189 | 194 | ||
190 | BUG_ON(ioread32(&rq->ctrl->enable)); | ||
191 | |||
192 | buf = rq->to_clean; | 195 | buf = rq->to_clean; |
193 | 196 | ||
194 | while (vnic_rq_desc_used(rq) > 0) { | 197 | while (vnic_rq_desc_used(rq) > 0) { |
@@ -201,6 +204,12 @@ void vnic_rq_clean(struct vnic_rq *rq, | |||
201 | 204 | ||
202 | /* Use current fetch_index as the ring starting point */ | 205 | /* Use current fetch_index as the ring starting point */ |
203 | fetch_index = ioread32(&rq->ctrl->fetch_index); | 206 | fetch_index = ioread32(&rq->ctrl->fetch_index); |
207 | |||
208 | if (fetch_index == 0xFFFFFFFF) { /* check for hardware gone */ | ||
209 | /* Hardware surprise removal: reset fetch_index */ | ||
210 | fetch_index = 0; | ||
211 | } | ||
212 | |||
204 | rq->to_use = rq->to_clean = | 213 | rq->to_use = rq->to_clean = |
205 | &rq->bufs[fetch_index / VNIC_RQ_BUF_BLK_ENTRIES(count)] | 214 | &rq->bufs[fetch_index / VNIC_RQ_BUF_BLK_ENTRIES(count)] |
206 | [fetch_index % VNIC_RQ_BUF_BLK_ENTRIES(count)]; | 215 | [fetch_index % VNIC_RQ_BUF_BLK_ENTRIES(count)]; |
diff --git a/drivers/net/enic/vnic_wq.c b/drivers/net/enic/vnic_wq.c index 6c4d4f7f100f..3ab7fa5501cd 100644 --- a/drivers/net/enic/vnic_wq.c +++ b/drivers/net/enic/vnic_wq.c | |||
@@ -178,8 +178,6 @@ void vnic_wq_clean(struct vnic_wq *wq, | |||
178 | { | 178 | { |
179 | struct vnic_wq_buf *buf; | 179 | struct vnic_wq_buf *buf; |
180 | 180 | ||
181 | BUG_ON(ioread32(&wq->ctrl->enable)); | ||
182 | |||
183 | buf = wq->to_clean; | 181 | buf = wq->to_clean; |
184 | 182 | ||
185 | while (vnic_wq_desc_used(wq) > 0) { | 183 | while (vnic_wq_desc_used(wq) > 0) { |