Commit 94bef5e4 authored by Dan Carpenter's avatar Dan Carpenter Committed by Kleber Sacilotto de Souza

scsi: csiostor: Don't enable IRQs too early

BugLink: https://bugs.launchpad.net/bugs/1858462

[ Upstream commit d6c9b31a ]

These are called with IRQs disabled from csio_mgmt_tmo_handler() so we
can't call spin_unlock_irq() or it will enable IRQs prematurely.

Fixes: a3667aae ("[SCSI] csiostor: Chelsio FCoE offload driver")
Link: https://lore.kernel.org/r/20191019085913.GA14245@mwandaSigned-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 675432dd
...@@ -301,6 +301,7 @@ csio_ln_fdmi_rhba_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req) ...@@ -301,6 +301,7 @@ csio_ln_fdmi_rhba_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req)
struct fc_fdmi_port_name *port_name; struct fc_fdmi_port_name *port_name;
uint8_t buf[64]; uint8_t buf[64];
uint8_t *fc4_type; uint8_t *fc4_type;
unsigned long flags;
if (fdmi_req->wr_status != FW_SUCCESS) { if (fdmi_req->wr_status != FW_SUCCESS) {
csio_ln_dbg(ln, "WR error:%x in processing fdmi rhba cmd\n", csio_ln_dbg(ln, "WR error:%x in processing fdmi rhba cmd\n",
...@@ -377,13 +378,13 @@ csio_ln_fdmi_rhba_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req) ...@@ -377,13 +378,13 @@ csio_ln_fdmi_rhba_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req)
len = (uint32_t)(pld - (uint8_t *)cmd); len = (uint32_t)(pld - (uint8_t *)cmd);
/* Submit FDMI RPA request */ /* Submit FDMI RPA request */
spin_lock_irq(&hw->lock); spin_lock_irqsave(&hw->lock, flags);
if (csio_ln_mgmt_submit_req(fdmi_req, csio_ln_fdmi_done, if (csio_ln_mgmt_submit_req(fdmi_req, csio_ln_fdmi_done,
FCOE_CT, &fdmi_req->dma_buf, len)) { FCOE_CT, &fdmi_req->dma_buf, len)) {
CSIO_INC_STATS(ln, n_fdmi_err); CSIO_INC_STATS(ln, n_fdmi_err);
csio_ln_dbg(ln, "Failed to issue fdmi rpa req\n"); csio_ln_dbg(ln, "Failed to issue fdmi rpa req\n");
} }
spin_unlock_irq(&hw->lock); spin_unlock_irqrestore(&hw->lock, flags);
} }
/* /*
...@@ -404,6 +405,7 @@ csio_ln_fdmi_dprt_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req) ...@@ -404,6 +405,7 @@ csio_ln_fdmi_dprt_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req)
struct fc_fdmi_rpl *reg_pl; struct fc_fdmi_rpl *reg_pl;
struct fs_fdmi_attrs *attrib_blk; struct fs_fdmi_attrs *attrib_blk;
uint8_t buf[64]; uint8_t buf[64];
unsigned long flags;
if (fdmi_req->wr_status != FW_SUCCESS) { if (fdmi_req->wr_status != FW_SUCCESS) {
csio_ln_dbg(ln, "WR error:%x in processing fdmi dprt cmd\n", csio_ln_dbg(ln, "WR error:%x in processing fdmi dprt cmd\n",
...@@ -483,13 +485,13 @@ csio_ln_fdmi_dprt_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req) ...@@ -483,13 +485,13 @@ csio_ln_fdmi_dprt_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req)
attrib_blk->numattrs = htonl(numattrs); attrib_blk->numattrs = htonl(numattrs);
/* Submit FDMI RHBA request */ /* Submit FDMI RHBA request */
spin_lock_irq(&hw->lock); spin_lock_irqsave(&hw->lock, flags);
if (csio_ln_mgmt_submit_req(fdmi_req, csio_ln_fdmi_rhba_cbfn, if (csio_ln_mgmt_submit_req(fdmi_req, csio_ln_fdmi_rhba_cbfn,
FCOE_CT, &fdmi_req->dma_buf, len)) { FCOE_CT, &fdmi_req->dma_buf, len)) {
CSIO_INC_STATS(ln, n_fdmi_err); CSIO_INC_STATS(ln, n_fdmi_err);
csio_ln_dbg(ln, "Failed to issue fdmi rhba req\n"); csio_ln_dbg(ln, "Failed to issue fdmi rhba req\n");
} }
spin_unlock_irq(&hw->lock); spin_unlock_irqrestore(&hw->lock, flags);
} }
/* /*
...@@ -504,6 +506,7 @@ csio_ln_fdmi_dhba_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req) ...@@ -504,6 +506,7 @@ csio_ln_fdmi_dhba_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req)
void *cmd; void *cmd;
struct fc_fdmi_port_name *port_name; struct fc_fdmi_port_name *port_name;
uint32_t len; uint32_t len;
unsigned long flags;
if (fdmi_req->wr_status != FW_SUCCESS) { if (fdmi_req->wr_status != FW_SUCCESS) {
csio_ln_dbg(ln, "WR error:%x in processing fdmi dhba cmd\n", csio_ln_dbg(ln, "WR error:%x in processing fdmi dhba cmd\n",
...@@ -534,13 +537,13 @@ csio_ln_fdmi_dhba_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req) ...@@ -534,13 +537,13 @@ csio_ln_fdmi_dhba_cbfn(struct csio_hw *hw, struct csio_ioreq *fdmi_req)
len += sizeof(*port_name); len += sizeof(*port_name);
/* Submit FDMI request */ /* Submit FDMI request */
spin_lock_irq(&hw->lock); spin_lock_irqsave(&hw->lock, flags);
if (csio_ln_mgmt_submit_req(fdmi_req, csio_ln_fdmi_dprt_cbfn, if (csio_ln_mgmt_submit_req(fdmi_req, csio_ln_fdmi_dprt_cbfn,
FCOE_CT, &fdmi_req->dma_buf, len)) { FCOE_CT, &fdmi_req->dma_buf, len)) {
CSIO_INC_STATS(ln, n_fdmi_err); CSIO_INC_STATS(ln, n_fdmi_err);
csio_ln_dbg(ln, "Failed to issue fdmi dprt req\n"); csio_ln_dbg(ln, "Failed to issue fdmi dprt req\n");
} }
spin_unlock_irq(&hw->lock); spin_unlock_irqrestore(&hw->lock, flags);
} }
/** /**
......
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