[SCSI] qla2xxx: Change from irq to irqsave with host_lock

Make the driver safer by using irqsave/irqrestore with host_lock.

Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
Madhuranath Iyengar 2011-01-28 15:17:56 -08:00 committed by James Bottomley
parent 563585ec4b
commit 044d78e1ac
3 changed files with 12 additions and 8 deletions

View File

@ -1561,6 +1561,7 @@ qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport)
{ {
struct Scsi_Host *host = rport_to_shost(rport); struct Scsi_Host *host = rport_to_shost(rport);
fc_port_t *fcport = *(fc_port_t **)rport->dd_data; fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
unsigned long flags;
if (!fcport) if (!fcport)
return; return;
@ -1573,10 +1574,10 @@ qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport)
* Transport has effectively 'deleted' the rport, clear * Transport has effectively 'deleted' the rport, clear
* all local references. * all local references.
*/ */
spin_lock_irq(host->host_lock); spin_lock_irqsave(host->host_lock, flags);
fcport->rport = fcport->drport = NULL; fcport->rport = fcport->drport = NULL;
*((fc_port_t **)rport->dd_data) = NULL; *((fc_port_t **)rport->dd_data) = NULL;
spin_unlock_irq(host->host_lock); spin_unlock_irqrestore(host->host_lock, flags);
if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags)) if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags))
return; return;

View File

@ -2505,11 +2505,12 @@ qla2x00_rport_del(void *data)
{ {
fc_port_t *fcport = data; fc_port_t *fcport = data;
struct fc_rport *rport; struct fc_rport *rport;
unsigned long flags;
spin_lock_irq(fcport->vha->host->host_lock); spin_lock_irqsave(fcport->vha->host->host_lock, flags);
rport = fcport->drport ? fcport->drport: fcport->rport; rport = fcport->drport ? fcport->drport: fcport->rport;
fcport->drport = NULL; fcport->drport = NULL;
spin_unlock_irq(fcport->vha->host->host_lock); spin_unlock_irqrestore(fcport->vha->host->host_lock, flags);
if (rport) if (rport)
fc_remote_port_delete(rport); fc_remote_port_delete(rport);
} }
@ -2879,6 +2880,7 @@ qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport)
struct fc_rport_identifiers rport_ids; struct fc_rport_identifiers rport_ids;
struct fc_rport *rport; struct fc_rport *rport;
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
unsigned long flags;
qla2x00_rport_del(fcport); qla2x00_rport_del(fcport);
@ -2893,9 +2895,9 @@ qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport)
"Unable to allocate fc remote port!\n"); "Unable to allocate fc remote port!\n");
return; return;
} }
spin_lock_irq(fcport->vha->host->host_lock); spin_lock_irqsave(fcport->vha->host->host_lock, flags);
*((fc_port_t **)rport->dd_data) = fcport; *((fc_port_t **)rport->dd_data) = fcport;
spin_unlock_irq(fcport->vha->host->host_lock); spin_unlock_irqrestore(fcport->vha->host->host_lock, flags);
rport->supported_classes = fcport->supported_classes; rport->supported_classes = fcport->supported_classes;

View File

@ -2513,6 +2513,7 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *vha, fc_port_t *fcport,
{ {
struct fc_rport *rport; struct fc_rport *rport;
scsi_qla_host_t *base_vha; scsi_qla_host_t *base_vha;
unsigned long flags;
if (!fcport->rport) if (!fcport->rport)
return; return;
@ -2520,9 +2521,9 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *vha, fc_port_t *fcport,
rport = fcport->rport; rport = fcport->rport;
if (defer) { if (defer) {
base_vha = pci_get_drvdata(vha->hw->pdev); base_vha = pci_get_drvdata(vha->hw->pdev);
spin_lock_irq(vha->host->host_lock); spin_lock_irqsave(vha->host->host_lock, flags);
fcport->drport = rport; fcport->drport = rport;
spin_unlock_irq(vha->host->host_lock); spin_unlock_irqrestore(vha->host->host_lock, flags);
set_bit(FCPORT_UPDATE_NEEDED, &base_vha->dpc_flags); set_bit(FCPORT_UPDATE_NEEDED, &base_vha->dpc_flags);
qla2xxx_wake_dpc(base_vha); qla2xxx_wake_dpc(base_vha);
} else } else