Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3319187imu; Sun, 11 Nov 2018 12:16:20 -0800 (PST) X-Google-Smtp-Source: AJdET5fuQOYut9ZjwFhfhHWGj1n8/i+Wnh3rTlu8GLQnIGb37OQ3n4W8ahmyLMv/wboSIhrWvY2a X-Received: by 2002:a17:902:f83:: with SMTP id 3-v6mr17617437plz.254.1541967380204; Sun, 11 Nov 2018 12:16:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541967380; cv=none; d=google.com; s=arc-20160816; b=zKPhGsdPLa9q1lvmj5e6pU6ZbvcLTO5ffQN/ET8duqbCa+nKGUXqeUVyXHf21l8Z+T NT809rFEIHBJoBlfmnTqhLWRp5/PvGGJs8aiXFKrpr0JFkCZtGuSml/N/KghadclK5W5 8EOuhEbCxhZySY2z0RoHVp7zu/cOl+Vw+FuLF5uuma/bVZUi09bSk2LSLNpHAUXy3maF BxySlrihEXKpe2kk4+WxY2agfmAbdK41UHytNcbYpJEOsD33poAtfdChhYSTmtsT2map iJMwrAAf+tVs+l7yNzHbSzmADcjEc7IbBd0WlREEsRBBE+3vBK0eMys/Q7sHSb79kYPc 4+rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=/7grTYOux93DIU2RRH8qbQpBtF8aqrK/6wi6E0gMvqE=; b=yk0r/CZqRvV+noI8hOp7h2fSKBjS0VlTSJ1JIbI2FGgpNbLQntTcNdDF7T5eujtcQN pb3SJz4jlavs2zJnM4lbdkXYdXgg4wYxYUQomeWOemiTztMpp0qWfgIc4zX/FruC9HcS 1t1UvuxnVwb0PPa3ewtyUexnij4MyjO4VJOGqMgwmAowDd8BxOyjOiC76ed0JoGTgstN D2k4pHZHuhCOOkoc+Al52cgyEB1jIaX/jV8H03e8JGNLPR3E2FAQAOHNAsKvbt6xIRke vna4i0m3xKUc3QZSRYcfqeC1WsKnmXYwd5R752A7OVY8zVofcXDS1tBaWChgyM3yT/79 w3WQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 65-v6si13767741pgj.173.2018.11.11.12.16.05; Sun, 11 Nov 2018 12:16:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731481AbeKLGEB (ORCPT + 99 others); Mon, 12 Nov 2018 01:04:01 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:52866 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726816AbeKLGEB (ORCPT ); Mon, 12 Nov 2018 01:04:01 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvt9-0000oN-8c; Sun, 11 Nov 2018 19:59:19 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsP-0001RB-Fc; Sun, 11 Nov 2018 19:58:33 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Martin K. Petersen" , "Steffen Maier" , "Benjamin Block" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 064/366] scsi: zfcp: fix missing REC trigger trace on terminate_rport_io for ERP_FAILED In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Steffen Maier commit d70aab55924b44f213fec2b900b095430b33eec6 upstream. For problem determination we always want to see when we were invoked on the terminate_rport_io callback whether we perform something or not. Temporal event sequence of interest with a long fast_io_fail_tmo of 27 sec: loose remote port t workqueue [s] zfcp_q_ IRQ zfcperp === ================== =================== ============================ 0 recv RSCN q p.test_link_work block rport start fast_io_fail_tmo send ADISC ELS 4 recv ADISC fail block zfcp_port port forced reopen send open port 12 recv open port fail q p.gid_pn_work zfcp_erp_wakeup (zfcp_erp_wait would return) GID_PN fail Before this point, we got a SCSI trace with tag "sctrpi1" on fast_io_fail, e.g. with the typical 5 sec setting. port.status |= ERP_FAILED If fast_io_fail_tmo triggers after this point, we missed a SCSI trace. workqueue fc_dl_ ================== 27 fc_timeout_fail_rport_io fc_terminate_rport_io zfcp_scsi_terminate_rport_io zfcp_erp_port_forced_reopen _zfcp_erp_port_forced_reopen if (port.status & ERP_FAILED) return; Therefore, write a trace before above early return. Example trace record formatted with zfcpdbf from s390-tools: Timestamp : ... Area : REC Subarea : 00 Level : 1 Exception : - CPU ID : .. Caller : 0x... Record ID : 1 ZFCP_DBF_REC_TRIG Tag : sctrpi1 SCSI terminate rport I/O LUN : 0xffffffffffffffff none (invalid) WWPN : 0x D_ID : 0x Adapter status : 0x... Port status : 0x... LUN status : 0x00000000 none (invalid) Ready count : 0x... Running count : 0x... ERP want : 0x03 ZFCP_ERP_ACTION_REOPEN_PORT_FORCED ERP need : 0xe0 ZFCP_ERP_ACTION_FAILED Signed-off-by: Steffen Maier Reviewed-by: Benjamin Block Signed-off-by: Martin K. Petersen Signed-off-by: Ben Hutchings --- drivers/s390/scsi/zfcp_erp.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -41,9 +41,13 @@ enum zfcp_erp_steps { * @ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: Forced port recovery. * @ZFCP_ERP_ACTION_REOPEN_ADAPTER: Adapter recovery. * @ZFCP_ERP_ACTION_NONE: Eyecatcher pseudo flag to bitwise or-combine with - * either of the other enum values. + * either of the first four enum values. * Used to indicate that an ERP action could not be * set up despite a detected need for some recovery. + * @ZFCP_ERP_ACTION_FAILED: Eyecatcher pseudo flag to bitwise or-combine with + * either of the first four enum values. + * Used to indicate that ERP not needed because + * the object has ZFCP_STATUS_COMMON_ERP_FAILED. */ enum zfcp_erp_act_type { ZFCP_ERP_ACTION_REOPEN_LUN = 1, @@ -51,6 +55,7 @@ enum zfcp_erp_act_type { ZFCP_ERP_ACTION_REOPEN_PORT_FORCED = 3, ZFCP_ERP_ACTION_REOPEN_ADAPTER = 4, ZFCP_ERP_ACTION_NONE = 0xc0, + ZFCP_ERP_ACTION_FAILED = 0xe0, }; enum zfcp_erp_act_state { @@ -378,8 +383,12 @@ static void _zfcp_erp_port_forced_reopen zfcp_erp_port_block(port, clear); zfcp_scsi_schedule_rport_block(port); - if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED) + if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED) { + zfcp_dbf_rec_trig(id, port->adapter, port, NULL, + ZFCP_ERP_ACTION_REOPEN_PORT_FORCED, + ZFCP_ERP_ACTION_FAILED); return; + } zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_PORT_FORCED, port->adapter, port, NULL, id, 0);