Commit 8f09a3b9 authored by Jayamohan Kallickal's avatar Jayamohan Kallickal Committed by James Bottomley

[SCSI] be2iscsi: Fix locking mechanism in Unsol Path

The default pdu is a common resource and needs to be protected
while manipulating it.
Signed-off-by: default avatarMinh Tran <minhduc.tran@emulex.com>
Signed-off-by: default avatarJohn Soni Jose <sony.john-n@emulex.com>
Signed-off-by: default avatarJayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 7331613e
...@@ -2072,8 +2072,10 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq) ...@@ -2072,8 +2072,10 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
"BM_%d : Received %s[%d] on CID : %d\n", "BM_%d : Received %s[%d] on CID : %d\n",
cqe_desc[code], code, cid); cqe_desc[code], code, cid);
spin_lock_bh(&phba->async_pdu_lock);
hwi_process_default_pdu_ring(beiscsi_conn, phba, hwi_process_default_pdu_ring(beiscsi_conn, phba,
(struct i_t_dpdu_cqe *)sol); (struct i_t_dpdu_cqe *)sol);
spin_unlock_bh(&phba->async_pdu_lock);
break; break;
case UNSOL_DATA_NOTIFY: case UNSOL_DATA_NOTIFY:
beiscsi_log(phba, KERN_INFO, beiscsi_log(phba, KERN_INFO,
...@@ -2081,8 +2083,10 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq) ...@@ -2081,8 +2083,10 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
"BM_%d : Received %s[%d] on CID : %d\n", "BM_%d : Received %s[%d] on CID : %d\n",
cqe_desc[code], code, cid); cqe_desc[code], code, cid);
spin_lock_bh(&phba->async_pdu_lock);
hwi_process_default_pdu_ring(beiscsi_conn, phba, hwi_process_default_pdu_ring(beiscsi_conn, phba,
(struct i_t_dpdu_cqe *)sol); (struct i_t_dpdu_cqe *)sol);
spin_unlock_bh(&phba->async_pdu_lock);
break; break;
case CXN_INVALIDATE_INDEX_NOTIFY: case CXN_INVALIDATE_INDEX_NOTIFY:
case CMD_INVALIDATED_NOTIFY: case CMD_INVALIDATED_NOTIFY:
...@@ -2110,8 +2114,10 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq) ...@@ -2110,8 +2114,10 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG, BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG,
"BM_%d : Dropping %s[%d] on DPDU ring on CID : %d\n", "BM_%d : Dropping %s[%d] on DPDU ring on CID : %d\n",
cqe_desc[code], code, cid); cqe_desc[code], code, cid);
spin_lock_bh(&phba->async_pdu_lock);
hwi_flush_default_pdu_buffer(phba, beiscsi_conn, hwi_flush_default_pdu_buffer(phba, beiscsi_conn,
(struct i_t_dpdu_cqe *) sol); (struct i_t_dpdu_cqe *) sol);
spin_unlock_bh(&phba->async_pdu_lock);
break; break;
case CXN_KILLED_PDU_SIZE_EXCEEDS_DSL: case CXN_KILLED_PDU_SIZE_EXCEEDS_DSL:
case CXN_KILLED_BURST_LEN_MISMATCH: case CXN_KILLED_BURST_LEN_MISMATCH:
...@@ -5010,6 +5016,7 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev, ...@@ -5010,6 +5016,7 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
spin_lock_init(&phba->io_sgl_lock); spin_lock_init(&phba->io_sgl_lock);
spin_lock_init(&phba->mgmt_sgl_lock); spin_lock_init(&phba->mgmt_sgl_lock);
spin_lock_init(&phba->isr_lock); spin_lock_init(&phba->isr_lock);
spin_lock_init(&phba->async_pdu_lock);
ret = mgmt_get_fw_config(&phba->ctrl, phba); ret = mgmt_get_fw_config(&phba->ctrl, phba);
if (ret != 0) { if (ret != 0) {
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
......
...@@ -305,6 +305,7 @@ struct beiscsi_hba { ...@@ -305,6 +305,7 @@ struct beiscsi_hba {
spinlock_t io_sgl_lock; spinlock_t io_sgl_lock;
spinlock_t mgmt_sgl_lock; spinlock_t mgmt_sgl_lock;
spinlock_t isr_lock; spinlock_t isr_lock;
spinlock_t async_pdu_lock;
unsigned int age; unsigned int age;
unsigned short avlbl_cids; unsigned short avlbl_cids;
unsigned short cid_alloc; unsigned short cid_alloc;
......
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