aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRon Mercer <ron.mercer@qlogic.com>2009-07-02 02:06:06 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-03 22:10:18 -0400
commit4322c5bee85ed58042ec04235ec7086065ad5074 (patch)
treeefe4347f866ffb5bd7dbd0694d94c7b0110144d9 /drivers
parenta1ed05263b74921742b454ef52c30b609ec6940f (diff)
qlge: Expand coverage of hw lock for config register.
The hardware semaphore covers the configuration register as well as the ICB registers. The ICB high and low regs contain the address of the initialization control block and the config register is used to signal the hardware that a block is ready to be downloaded. Currently we were only protecting the ICB regs. This changes expands to cover the config register as well. Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/qlge/qlge_main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 90d1f76c0e8b..7f372672ac4e 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -214,6 +214,10 @@ int ql_write_cfg(struct ql_adapter *qdev, void *ptr, int size, u32 bit,
214 return -ENOMEM; 214 return -ENOMEM;
215 } 215 }
216 216
217 status = ql_sem_spinlock(qdev, SEM_ICB_MASK);
218 if (status)
219 return status;
220
217 status = ql_wait_cfg(qdev, bit); 221 status = ql_wait_cfg(qdev, bit);
218 if (status) { 222 if (status) {
219 QPRINTK(qdev, IFUP, ERR, 223 QPRINTK(qdev, IFUP, ERR,
@@ -221,12 +225,8 @@ int ql_write_cfg(struct ql_adapter *qdev, void *ptr, int size, u32 bit,
221 goto exit; 225 goto exit;
222 } 226 }
223 227
224 status = ql_sem_spinlock(qdev, SEM_ICB_MASK);
225 if (status)
226 goto exit;
227 ql_write32(qdev, ICB_L, (u32) map); 228 ql_write32(qdev, ICB_L, (u32) map);
228 ql_write32(qdev, ICB_H, (u32) (map >> 32)); 229 ql_write32(qdev, ICB_H, (u32) (map >> 32));
229 ql_sem_unlock(qdev, SEM_ICB_MASK); /* does flush too */
230 230
231 mask = CFG_Q_MASK | (bit << 16); 231 mask = CFG_Q_MASK | (bit << 16);
232 value = bit | (q_id << CFG_Q_SHIFT); 232 value = bit | (q_id << CFG_Q_SHIFT);
@@ -237,6 +237,7 @@ int ql_write_cfg(struct ql_adapter *qdev, void *ptr, int size, u32 bit,
237 */ 237 */
238 status = ql_wait_cfg(qdev, bit); 238 status = ql_wait_cfg(qdev, bit);
239exit: 239exit:
240 ql_sem_unlock(qdev, SEM_ICB_MASK); /* does flush too */
240 pci_unmap_single(qdev->pdev, map, size, direction); 241 pci_unmap_single(qdev->pdev, map, size, direction);
241 return status; 242 return status;
242} 243}