mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
SCSI: qla2xxx: Obtain proper host structure during response-queue processing.
commit a67093d46e upstream.
Original code incorrectly assumed only status-type-0
IOCBs would be queued to the response-queue, and thus all
entries would safely reference a VHA from the IOCB
'handle.'
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9c69f804cf
commit
154d9b4d57
@@ -453,6 +453,5 @@ extern void qla24xx_wrt_req_reg(struct qla_hw_data *, uint16_t, uint16_t);
|
||||
extern void qla25xx_wrt_req_reg(struct qla_hw_data *, uint16_t, uint16_t);
|
||||
extern void qla25xx_wrt_rsp_reg(struct qla_hw_data *, uint16_t, uint16_t);
|
||||
extern void qla24xx_wrt_rsp_reg(struct qla_hw_data *, uint16_t, uint16_t);
|
||||
extern struct scsi_qla_host * qla25xx_get_host(struct rsp_que *);
|
||||
|
||||
#endif /* _QLA_GBL_H */
|
||||
|
||||
@@ -2018,7 +2018,7 @@ qla24xx_msix_rsp_q(int irq, void *dev_id)
|
||||
|
||||
spin_lock_irq(&ha->hardware_lock);
|
||||
|
||||
vha = qla25xx_get_host(rsp);
|
||||
vha = pci_get_drvdata(ha->pdev);
|
||||
qla24xx_process_response_queue(vha, rsp);
|
||||
if (!ha->mqenable) {
|
||||
WRT_REG_DWORD(®->hccr, HCCRX_CLR_RISC_INT);
|
||||
@@ -2357,30 +2357,3 @@ int qla25xx_request_irq(struct rsp_que *rsp)
|
||||
msix->rsp = rsp;
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct scsi_qla_host *
|
||||
qla25xx_get_host(struct rsp_que *rsp)
|
||||
{
|
||||
srb_t *sp;
|
||||
struct qla_hw_data *ha = rsp->hw;
|
||||
struct scsi_qla_host *vha = NULL;
|
||||
struct sts_entry_24xx *pkt;
|
||||
struct req_que *req;
|
||||
uint16_t que;
|
||||
uint32_t handle;
|
||||
|
||||
pkt = (struct sts_entry_24xx *) rsp->ring_ptr;
|
||||
que = MSW(pkt->handle);
|
||||
handle = (uint32_t) LSW(pkt->handle);
|
||||
req = ha->req_q_map[que];
|
||||
if (handle < MAX_OUTSTANDING_COMMANDS) {
|
||||
sp = req->outstanding_cmds[handle];
|
||||
if (sp)
|
||||
return sp->fcport->vha;
|
||||
else
|
||||
goto base_que;
|
||||
}
|
||||
base_que:
|
||||
vha = pci_get_drvdata(ha->pdev);
|
||||
return vha;
|
||||
}
|
||||
|
||||
@@ -638,11 +638,15 @@ failed:
|
||||
|
||||
static void qla_do_work(struct work_struct *work)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct rsp_que *rsp = container_of(work, struct rsp_que, q_work);
|
||||
struct scsi_qla_host *vha;
|
||||
struct qla_hw_data *ha = rsp->hw;
|
||||
|
||||
vha = qla25xx_get_host(rsp);
|
||||
spin_lock_irqsave(&rsp->hw->hardware_lock, flags);
|
||||
vha = pci_get_drvdata(ha->pdev);
|
||||
qla24xx_process_response_queue(vha, rsp);
|
||||
spin_unlock_irqrestore(&rsp->hw->hardware_lock, flags);
|
||||
}
|
||||
|
||||
/* create response queue */
|
||||
|
||||
Reference in New Issue
Block a user