scsi: qla2xxx: Verify locking assumptions at runtime
authorBart Van Assche <bvanassche@acm.org>
Fri, 9 Aug 2019 03:01:34 +0000 (20:01 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 13 Aug 2019 01:34:05 +0000 (21:34 -0400)
Make sure that locking assumptions are verified at runtime if kernel
debugging is enabled.

Cc: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_target.c

index b8241d7b1f8a41613976c28a37300e729497af1d..ded5f13372af888afecf4cd7a8950e6d76bfc7f7 100644 (file)
@@ -789,6 +789,8 @@ qlt_plogi_ack_find_add(struct scsi_qla_host *vha, port_id_t *id,
 {
        struct qlt_plogi_ack_t *pla;
 
+       lockdep_assert_held(&vha->hw->hardware_lock);
+
        list_for_each_entry(pla, &vha->plogi_ack_list, list) {
                if (pla->id.b24 == id->b24) {
                        ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0x210d,
@@ -4713,6 +4715,8 @@ static int qlt_handle_login(struct scsi_qla_host *vha,
        struct qlt_plogi_ack_t *pla;
        unsigned long flags;
 
+       lockdep_assert_held(&vha->hw->hardware_lock);
+
        wwn = wwn_to_u64(iocb->u.isp24.port_name);
 
        port_id.b.domain = iocb->u.isp24.port_id[2];
@@ -4886,6 +4890,8 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha,
        int res = 0;
        unsigned long flags;
 
+       lockdep_assert_held(&ha->hardware_lock);
+
        wwn = wwn_to_u64(iocb->u.isp24.port_name);
 
        port_id.b.domain = iocb->u.isp24.port_id[2];
@@ -5162,6 +5168,8 @@ static void qlt_handle_imm_notify(struct scsi_qla_host *vha,
        int send_notify_ack = 1;
        uint16_t status;
 
+       lockdep_assert_held(&ha->hardware_lock);
+
        status = le16_to_cpu(iocb->u.isp2x.status);
        switch (status) {
        case IMM_NTFY_LIP_RESET: