diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2010-12-31 03:22:22 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-12-31 10:53:09 -0500 |
commit | bfcf72e4426da2fd8f8081a641385ffc3ccc2282 (patch) | |
tree | b471c73b7e31ef6a0be649ecab96ad2a8798cbe2 /drivers/scsi | |
parent | f41d472179a0d7c8e8160c85180ab1124947068e (diff) |
[SCSI] libiscsi: use bh locking instead of irq with session lock
The session lock is taken in threads, timers, and bottom halves
like softirqs and tasklets. All the code but
iscsi_conn/session_failure take the session lock with the spin_lock_bh
call. This was done because I thought some offload drivers
would be calling these functions from a irq. They never did,
so this patch has iscsi_conn/session_failure use the bh
locking.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/libiscsi.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 1def8e101249..da8b61543ee4 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -1338,17 +1338,16 @@ void iscsi_session_failure(struct iscsi_session *session, | |||
1338 | { | 1338 | { |
1339 | struct iscsi_conn *conn; | 1339 | struct iscsi_conn *conn; |
1340 | struct device *dev; | 1340 | struct device *dev; |
1341 | unsigned long flags; | ||
1342 | 1341 | ||
1343 | spin_lock_irqsave(&session->lock, flags); | 1342 | spin_lock_bh(&session->lock); |
1344 | conn = session->leadconn; | 1343 | conn = session->leadconn; |
1345 | if (session->state == ISCSI_STATE_TERMINATE || !conn) { | 1344 | if (session->state == ISCSI_STATE_TERMINATE || !conn) { |
1346 | spin_unlock_irqrestore(&session->lock, flags); | 1345 | spin_unlock_bh(&session->lock); |
1347 | return; | 1346 | return; |
1348 | } | 1347 | } |
1349 | 1348 | ||
1350 | dev = get_device(&conn->cls_conn->dev); | 1349 | dev = get_device(&conn->cls_conn->dev); |
1351 | spin_unlock_irqrestore(&session->lock, flags); | 1350 | spin_unlock_bh(&session->lock); |
1352 | if (!dev) | 1351 | if (!dev) |
1353 | return; | 1352 | return; |
1354 | /* | 1353 | /* |
@@ -1367,17 +1366,16 @@ EXPORT_SYMBOL_GPL(iscsi_session_failure); | |||
1367 | void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err) | 1366 | void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err) |
1368 | { | 1367 | { |
1369 | struct iscsi_session *session = conn->session; | 1368 | struct iscsi_session *session = conn->session; |
1370 | unsigned long flags; | ||
1371 | 1369 | ||
1372 | spin_lock_irqsave(&session->lock, flags); | 1370 | spin_lock_bh(&session->lock); |
1373 | if (session->state == ISCSI_STATE_FAILED) { | 1371 | if (session->state == ISCSI_STATE_FAILED) { |
1374 | spin_unlock_irqrestore(&session->lock, flags); | 1372 | spin_unlock_bh(&session->lock); |
1375 | return; | 1373 | return; |
1376 | } | 1374 | } |
1377 | 1375 | ||
1378 | if (conn->stop_stage == 0) | 1376 | if (conn->stop_stage == 0) |
1379 | session->state = ISCSI_STATE_FAILED; | 1377 | session->state = ISCSI_STATE_FAILED; |
1380 | spin_unlock_irqrestore(&session->lock, flags); | 1378 | spin_unlock_bh(&session->lock); |
1381 | 1379 | ||
1382 | set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx); | 1380 | set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx); |
1383 | set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx); | 1381 | set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx); |