Commit 1a51042b authored by Harish Patil's avatar Harish Patil Committed by David S. Miller

qlcnic: Enhance semaphore lock access failure error message

Signed-off-by: default avatarHarish Patil <harish.patil@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cecd59d8
...@@ -317,9 +317,7 @@ static void qlcnic_write_window_reg(u32 addr, void __iomem *bar0, u32 data) ...@@ -317,9 +317,7 @@ static void qlcnic_write_window_reg(u32 addr, void __iomem *bar0, u32 data)
int int
qlcnic_pcie_sem_lock(struct qlcnic_adapter *adapter, int sem, u32 id_reg) qlcnic_pcie_sem_lock(struct qlcnic_adapter *adapter, int sem, u32 id_reg)
{ {
int timeout = 0; int timeout = 0, err = 0, done = 0;
int err = 0;
u32 done = 0;
while (!done) { while (!done) {
done = QLCRD32(adapter, QLCNIC_PCIE_REG(PCIE_SEM_LOCK(sem)), 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,10 +325,20 @@ qlcnic_pcie_sem_lock(struct qlcnic_adapter *adapter, int sem, u32 id_reg)
if (done == 1) if (done == 1)
break; break;
if (++timeout >= QLCNIC_PCIE_SEM_TIMEOUT) { if (++timeout >= QLCNIC_PCIE_SEM_TIMEOUT) {
if (id_reg) {
done = QLCRD32(adapter, id_reg, &err);
if (done != -1)
dev_err(&adapter->pdev->dev,
"Failed to acquire sem=%d lock held by=%d\n",
sem, done);
else
dev_err(&adapter->pdev->dev, dev_err(&adapter->pdev->dev,
"Failed to acquire sem=%d lock; holdby=%d\n", "Failed to acquire sem=%d lock",
sem, sem);
id_reg ? QLCRD32(adapter, id_reg, &err) : -1); } else {
dev_err(&adapter->pdev->dev,
"Failed to acquire sem=%d lock", sem);
}
return -EIO; return -EIO;
} }
msleep(1); msleep(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment