From 06249d693bf1eda5a73125995a199a7dff7a8e3a Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 17 Feb 2011 20:40:49 +0000 Subject: [PATCH] Disable asking firmware for statistic if neither initiator, nor target modes enabled, because otherwise it can get crazy and be recovered only by a power reset. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3253 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla_mbx.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qla2x00t/qla_mbx.c b/qla2x00t/qla_mbx.c index c59d223ee..477669c98 100644 --- a/qla2x00t/qla_mbx.c +++ b/qla2x00t/qla_mbx.c @@ -2255,6 +2255,13 @@ qla24xx_get_isp_stats(scsi_qla_host_t *ha, struct link_statistics *stats, mbx_cmd_t *mcp = &mc; uint32_t *siter, *diter, dwords; + if (!qla_tgt_mode_enabled(ha) && !qla_ini_mode_enabled(ha)) { + DEBUG2_3_11(printk("%s(%ld): neither initiator, nor target " + "mode enabled, no stats returned\n", + __func__, ha->host_no)); + return QLA_FUNCTION_FAILED; + } + DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); mcp->mb[0] = MBC_GET_LINK_PRIV_STATS;