Message ID | 20210415203554.27890-1-d.bogdanov@yadro.com |
---|---|
State | New |
Headers | show |
Series | scsi: qla2xx: wait for stop_phase1 at wwn removal | expand |
On Thu, 15 Apr 2021 23:35:54 +0300, Dmitry Bogdanov wrote: > Target de-configuration panics at high CPU load. > TPGT and WWPN can be removed on separate threads. > TPGT removal requests a reset HBA on a separate thread and waits for > reset complete (qlt_stop_phase1). Due to high CPU load that HBA reset > can be delayed for some time. > WWPN removal does qlt_stop_phase2 where it is thinked that phase1 > has been already finished and zeroed tgt.tgt_ops that is used by > incoming traffic and causes several panics: > > [...] Applied to 5.13/scsi-fixes, thanks! [1/1] scsi: qla2xx: wait for stop_phase1 at wwn removal https://git.kernel.org/mkp/scsi/c/2ef7665dfd88 -- Martin K. Petersen Oracle Linux Engineering
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 480e7d2dcf3e..745d6d98c02e 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -1558,10 +1558,12 @@ void qlt_stop_phase2(struct qla_tgt *tgt) return; } + mutex_lock(&tgt->ha->optrom_mutex); mutex_lock(&vha->vha_tgt.tgt_mutex); tgt->tgt_stop = 0; tgt->tgt_stopped = 1; mutex_unlock(&vha->vha_tgt.tgt_mutex); + mutex_unlock(&tgt->ha->optrom_mutex); ql_dbg(ql_dbg_tgt_mgt, vha, 0xf00c, "Stop of tgt %p finished\n", tgt);