* [PATCH 2/3] scsi: qla2xxx: Fix failure message in qlt_disable_vha()
@ 2020-04-24 12:10 Viacheslav Dubeyko
0 siblings, 0 replies; 2+ messages in thread
From: Viacheslav Dubeyko @ 2020-04-24 12:10 UTC (permalink / raw)
To: linux-scsi; +Cc: hmadhani, jejb, martin.petersen, linux, r.bolshakov, slava
From: Viacheslav Dubeyko <v.dubeiko@yadro.com>
Date: Wed, 22 Apr 2020 13:51:51 +0300
Subject: [PATCH 2/3] scsi: qla2xxx: Fix failure message in qlt_disable_vha()
The sequence of commands is able to reveal the incorrect
failure message:
echo 0x7fffffff > /sys/module/qla2xxx/parameters/logging
modprobe target_core_mod
modprobe tcm_qla2xxx
mkdir /sys/kernel/config/target/qla2xxx
mkdir /sys/kernel/config/target/qla2xxx/<port-name>
mkdir /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1
echo 1 > /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1/enable
echo 0 > /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1/enable
qla2xxx [0001:00:02.0]-e881:1: qla2x00_wait_for_hba_online() failed
The reason of this message is the QLA_FUNCTION_FAILED code
that qla2x00_wait_for_hba_online() returns. However,
qlt_disable_vha() expects that adapter is offlined and
QLA_FUNCTION_FAILED informs namely about the offline
state of the adapter.
The qla2x00_abort_isp() function finishes the execution
at the point of checking the adapter's mode (for example,
qla_tgt_mode_enabled()) because of the qlt_disable_vha()
calls qlt_clear_mode() method. It means that qla2x00_abort_isp()
keeps vha->flags.online is equal to zero. Finally,
qla2x00_wait_for_hba_online() checks the state of this flag
and returns QLA_FUNCTION_FAILED error code.
This patch change the failure message on the message
that informs about adapter's offline state.
Signed-off-by: Viacheslav Dubeyko <v.dubeiko@yadro.com>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index 622e7337affc..f3255aa70dcc 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -6661,9 +6661,14 @@ static void qlt_disable_vha(struct scsi_qla_host *vha)
set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
qla2xxx_wake_dpc(vha);
+
+ /*
+ * We are expecting the offline state.
+ * QLA_FUNCTION_FAILED means that adapter is offline.
+ */
if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS)
ql_dbg(ql_dbg_tgt, vha, 0xe081,
- "qla2x00_wait_for_hba_online() failed\n");
+ "adapter is offline\n");
}
/*
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/3] scsi: qla2xxx: Fix failure message in qlt_disable_vha()
@ 2020-05-06 13:46 Himanshu Madhani
0 siblings, 0 replies; 2+ messages in thread
From: Himanshu Madhani @ 2020-05-06 13:46 UTC (permalink / raw)
To: v.dubeiko
Cc: linux-scsi, r.bolshakov, slava, linux, hmadhani, jejb,
martin.petersen
----- Original Message -----
From: v.dubeiko@yadro.com
To: linux-scsi@vger.kernel.org
Cc: hmadhani@marvell.com, jejb@linux.ibm.com, martin.petersen@oracle.com, linux@yadro.com, r.bolshakov@yadro.com, slava@dubeyko.com
Sent: Friday, April 24, 2020 7:10:39 AM GMT -06:00 US/Canada Central
Subject: [PATCH 2/3] scsi: qla2xxx: Fix failure message in qlt_disable_vha()
From: Viacheslav Dubeyko <v.dubeiko@yadro.com>
Date: Wed, 22 Apr 2020 13:51:51 +0300
Subject: [PATCH 2/3] scsi: qla2xxx: Fix failure message in qlt_disable_vha()
The sequence of commands is able to reveal the incorrect
failure message:
echo 0x7fffffff > /sys/module/qla2xxx/parameters/logging
modprobe target_core_mod
modprobe tcm_qla2xxx
mkdir /sys/kernel/config/target/qla2xxx
mkdir /sys/kernel/config/target/qla2xxx/<port-name>
mkdir /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1
echo 1 > /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1/enable
echo 0 > /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1/enable
qla2xxx [0001:00:02.0]-e881:1: qla2x00_wait_for_hba_online() failed
The reason of this message is the QLA_FUNCTION_FAILED code
that qla2x00_wait_for_hba_online() returns. However,
qlt_disable_vha() expects that adapter is offlined and
QLA_FUNCTION_FAILED informs namely about the offline
state of the adapter.
The qla2x00_abort_isp() function finishes the execution
at the point of checking the adapter's mode (for example,
qla_tgt_mode_enabled()) because of the qlt_disable_vha()
calls qlt_clear_mode() method. It means that qla2x00_abort_isp()
keeps vha->flags.online is equal to zero. Finally,
qla2x00_wait_for_hba_online() checks the state of this flag
and returns QLA_FUNCTION_FAILED error code.
This patch change the failure message on the message
that informs about adapter's offline state.
Signed-off-by: Viacheslav Dubeyko <v.dubeiko@yadro.com>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index 622e7337affc..f3255aa70dcc 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -6661,9 +6661,14 @@ static void qlt_disable_vha(struct scsi_qla_host *vha)
set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
qla2xxx_wake_dpc(vha);
+
+ /*
+ * We are expecting the offline state.
+ * QLA_FUNCTION_FAILED means that adapter is offline.
+ */
if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS)
ql_dbg(ql_dbg_tgt, vha, 0xe081,
- "qla2x00_wait_for_hba_online() failed\n");
+ "adapter is offline\n");
}
/*
--
2.17.1
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
--
Himanshu Madhani
Oracle Linux Engineering
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-06 13:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-06 13:46 [PATCH 2/3] scsi: qla2xxx: Fix failure message in qlt_disable_vha() Himanshu Madhani
-- strict thread matches above, loose matches on Subject: below --
2020-04-24 12:10 Viacheslav Dubeyko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox