diff options
author | Bhanu Gollapudi <bprakash@broadcom.com> | 2011-03-17 20:13:26 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-03-23 12:36:59 -0400 |
commit | 839900c69d5b8a07a4df8e9bd9d1e59a5c556811 (patch) | |
tree | 067b746caab1ba5ee6d38c73a56df9f7bb953c9c /drivers/scsi | |
parent | 70c7c88a1a65ca683eb7f3fe3ce79c72f29d845e (diff) |
[SCSI] bnx2fc: Avoid holding cq_lock when iounmap() is called
With kernel debugging enabled, holding cq_lock when calling
bnx2fc_free_session_resc() which calls iounmap() leads to a warning
stack trace [INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected].
iounmap() grabs a HARDIRQ-unsafe vmlist lock, so holding
spin_lock_bh(cq_lock) when calling iounmap() will trigger the LOCKDEP
warning. Since cq_lock is required only to guard against deletion, hold
the lock just before freeing the cq.
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_tgt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_tgt.c b/drivers/scsi/bnx2fc/bnx2fc_tgt.c index 7ea93af60260..7cc05e4e82d5 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_tgt.c +++ b/drivers/scsi/bnx2fc/bnx2fc_tgt.c | |||
@@ -304,10 +304,8 @@ static void bnx2fc_upload_session(struct fcoe_port *port, | |||
304 | " not sent to FW\n"); | 304 | " not sent to FW\n"); |
305 | 305 | ||
306 | /* Free session resources */ | 306 | /* Free session resources */ |
307 | spin_lock_bh(&tgt->cq_lock); | ||
308 | bnx2fc_free_session_resc(hba, tgt); | 307 | bnx2fc_free_session_resc(hba, tgt); |
309 | bnx2fc_free_conn_id(hba, tgt->fcoe_conn_id); | 308 | bnx2fc_free_conn_id(hba, tgt->fcoe_conn_id); |
310 | spin_unlock_bh(&tgt->cq_lock); | ||
311 | } | 309 | } |
312 | 310 | ||
313 | static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt, | 311 | static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt, |
@@ -830,11 +828,13 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba, | |||
830 | tgt->rq = NULL; | 828 | tgt->rq = NULL; |
831 | } | 829 | } |
832 | /* Free CQ */ | 830 | /* Free CQ */ |
831 | spin_lock_bh(&tgt->cq_lock); | ||
833 | if (tgt->cq) { | 832 | if (tgt->cq) { |
834 | dma_free_coherent(&hba->pcidev->dev, tgt->cq_mem_size, | 833 | dma_free_coherent(&hba->pcidev->dev, tgt->cq_mem_size, |
835 | tgt->cq, tgt->cq_dma); | 834 | tgt->cq, tgt->cq_dma); |
836 | tgt->cq = NULL; | 835 | tgt->cq = NULL; |
837 | } | 836 | } |
837 | spin_unlock_bh(&tgt->cq_lock); | ||
838 | /* Free SQ */ | 838 | /* Free SQ */ |
839 | if (tgt->sq) { | 839 | if (tgt->sq) { |
840 | dma_free_coherent(&hba->pcidev->dev, tgt->sq_mem_size, | 840 | dma_free_coherent(&hba->pcidev->dev, tgt->sq_mem_size, |