Skip to contentSkip to conversation

qla2xxx: locking problem in qla2x00_init_rings()

PATCH In review Dan Carpenter 2 participants 2 messages Sep 12, 2010 – Sep 14, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qla2xxx: locking problem in qla2x00_init_rings()

IRQs are already disabled here so we don't need to disable them again. But more importantly, the spin_lock_irqsave() overwrites "flags" and that breaks things when we want to re-enable the IRQs when we call spin_unlock_irqrestore(&ha->hardware_lock, flags);

---
This seems like an important bug. I don't have this hardware but could someone from QLogic test this out and maybe queue it up for 2.6.36?

drivers/scsi/qla2xxx/qla_init.c +2 -2
index 9c383ba..9f4ba28 100644
@@ -1787,14 +1787,14 @@ qla2x00_init_rings(scsi_qla_host_t *vha)
 		qla2x00_init_response_q_entries(rsp);
 	}
 
-	spin_lock_irqsave(&ha->vport_slock, flags);
+	spin_lock(&ha->vport_slock);
 	/* Clear RSCN queue. */
 	list_for_each_entry(vp, &ha->vp_list, list) {
 		vp->rscn_in_ptr = 0;
 		vp->rscn_out_ptr = 0;
 	}
 
-	spin_unlock_irqrestore(&ha->vport_slock, flags);
+	spin_unlock(&ha->vport_slock);
 
 	ha->isp_ops->config_rings(vha);
 
Acked-by on v1 1/1
#1 lore raw

Dan,

Thanks. We'll test this patch.

Cheers,
Madhu

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Dan Carpenter
Sent: Sunday, September 12, 2010 2:41 PM
To: Andrew Vasquez
Cc: Linux Driver; James E.J. Bottomley; Giridhar Malavali; Lalit Chandivade; Grant Likely; [email protected]; [email protected]; [email protected]; Arun Easi
Subject: [patch] qla2xxx: locking problem in qla2x00_init_rings()

IRQs are already disabled here so we don't need to disable them again. But more importantly, the spin_lock_irqsave() overwrites "flags" and that breaks things when we want to re-enable the IRQs when we call spin_unlock_irqrestore(&ha->hardware_lock, flags);

---
This seems like an important bug. I don't have this hardware but could someone from QLogic test this out and maybe queue it up for 2.6.36?

drivers/scsi/qla2xxx/qla_init.c +2 -2
index 9c383ba..9f4ba28 100644
@@ -1787,14 +1787,14 @@ qla2x00_init_rings(scsi_qla_host_t *vha)
 		qla2x00_init_response_q_entries(rsp);
 	}
 
-	spin_lock_irqsave(&ha->vport_slock, flags);
+	spin_lock(&ha->vport_slock);
 	/* Clear RSCN queue. */
 	list_for_each_entry(vp, &ha->vp_list, list) {
 		vp->rscn_in_ptr = 0;
 		vp->rscn_out_ptr = 0;
 	}
 
-	spin_unlock_irqrestore(&ha->vport_slock, flags);
+	spin_unlock(&ha->vport_slock);
 
 	ha->isp_ops->config_rings(vha);
 

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html