diff options
Diffstat (limited to 'drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c index 03d18a0be6ce..9f3adf4e70b5 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | |||
@@ -317,9 +317,7 @@ static void qlcnic_write_window_reg(u32 addr, void __iomem *bar0, u32 data) | |||
317 | int | 317 | int |
318 | qlcnic_pcie_sem_lock(struct qlcnic_adapter *adapter, int sem, u32 id_reg) | 318 | qlcnic_pcie_sem_lock(struct qlcnic_adapter *adapter, int sem, u32 id_reg) |
319 | { | 319 | { |
320 | int timeout = 0; | 320 | int timeout = 0, err = 0, done = 0; |
321 | int err = 0; | ||
322 | u32 done = 0; | ||
323 | 321 | ||
324 | while (!done) { | 322 | while (!done) { |
325 | done = QLCRD32(adapter, QLCNIC_PCIE_REG(PCIE_SEM_LOCK(sem)), | 323 | done = QLCRD32(adapter, QLCNIC_PCIE_REG(PCIE_SEM_LOCK(sem)), |
@@ -327,10 +325,20 @@ qlcnic_pcie_sem_lock(struct qlcnic_adapter *adapter, int sem, u32 id_reg) | |||
327 | if (done == 1) | 325 | if (done == 1) |
328 | break; | 326 | break; |
329 | if (++timeout >= QLCNIC_PCIE_SEM_TIMEOUT) { | 327 | if (++timeout >= QLCNIC_PCIE_SEM_TIMEOUT) { |
330 | dev_err(&adapter->pdev->dev, | 328 | if (id_reg) { |
331 | "Failed to acquire sem=%d lock; holdby=%d\n", | 329 | done = QLCRD32(adapter, id_reg, &err); |
332 | sem, | 330 | if (done != -1) |
333 | id_reg ? QLCRD32(adapter, id_reg, &err) : -1); | 331 | dev_err(&adapter->pdev->dev, |
332 | "Failed to acquire sem=%d lock held by=%d\n", | ||
333 | sem, done); | ||
334 | else | ||
335 | dev_err(&adapter->pdev->dev, | ||
336 | "Failed to acquire sem=%d lock", | ||
337 | sem); | ||
338 | } else { | ||
339 | dev_err(&adapter->pdev->dev, | ||
340 | "Failed to acquire sem=%d lock", sem); | ||
341 | } | ||
334 | return -EIO; | 342 | return -EIO; |
335 | } | 343 | } |
336 | msleep(1); | 344 | msleep(1); |