From patchwork Tue Jan 15 01:09:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Satish Kharat X-Patchwork-Id: 10763687 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5FAA191E for ; Tue, 15 Jan 2019 01:25:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C6CB2BAD1 for ; Tue, 15 Jan 2019 01:25:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D4CD2BAC8; Tue, 15 Jan 2019 01:25:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBEF82BAC8 for ; Tue, 15 Jan 2019 01:25:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727775AbfAOBZ0 (ORCPT ); Mon, 14 Jan 2019 20:25:26 -0500 Received: from rcdn-iport-7.cisco.com ([173.37.86.78]:52732 "EHLO rcdn-iport-7.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727307AbfAOBZZ (ORCPT ); Mon, 14 Jan 2019 20:25:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1555; q=dns/txt; s=iport; t=1547515525; x=1548725125; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=YTOPnDaqcIHZxnLYqO0V9vYH7Z+CnjkwW76SJH3fPQQ=; b=jXBmwWpxwexPupG6laEgnL7SY8MiZd8rHOIAJvssLefwzGwnvD5E7iil kQzIdDD4wbNDc4rZMKhihdcj9qTVJ3pvyGB15QfbN8VlB1rt9/mvkKroN 9VicwShxmlC1nuB0FUBZyN6hIPPWkI8xNes3JiZDxqtIOfOwDXfdKIkXL w=; X-IronPort-AV: E=Sophos;i="5.56,479,1539648000"; d="scan'208";a="502338806" Received: from alln-core-11.cisco.com ([173.36.13.133]) by rcdn-iport-7.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2019 01:16:06 +0000 Received: from satish-ini-cisco-com.cisco.com (satish-ini.cisco.com [10.193.101.67]) by alln-core-11.cisco.com (8.15.2/8.15.2) with ESMTP id x0F1G2Br016303; Tue, 15 Jan 2019 01:16:05 GMT From: Satish Kharat To: satishkh@cisco.com, martin.petersen@oracle.com, jejb@linux.vnet.ibm.com Cc: linux-scsi@vger.kernel.org Subject: [PATCH v2 07/10] scsi: fnic: Warn when calling io done for IO not issued to fw Date: Mon, 14 Jan 2019 17:09:26 -0800 Message-Id: <20190115010929.15347-8-satishkh@cisco.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190115010929.15347-1-satishkh@cisco.com> References: <20190115010929.15347-1-satishkh@cisco.com> X-Outbound-SMTP-Client: 10.193.101.67, satish-ini.cisco.com X-Outbound-Node: alln-core-11.cisco.com Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The change is to print warning when scsi done is called for an IO that has not yet been issued to the fw. Also adding sc and tag to debug print when IO is cleaned up. Signed-off-by: Satish Kharat --- drivers/scsi/fnic/fnic_scsi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index 61606fd675d0..1aeee899c411 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c @@ -1415,8 +1415,9 @@ static void fnic_cleanup_io(struct fnic *fnic, int exclude_id) cleanup_scsi_cmd: sc->result = DID_TRANSPORT_DISRUPTED << 16; FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, - "%s: sc duration = %lu DID_TRANSPORT_DISRUPTED\n", - __func__, (jiffies - start_time)); + "%s: tag:0x%x : sc:0x%p duration = %lu DID_TRANSPORT_DISRUPTED\n", + __func__, sc->request->tag, sc, + (jiffies - start_time)); if (atomic64_read(&fnic->io_cmpl_skip)) atomic64_dec(&fnic->io_cmpl_skip); @@ -1425,6 +1426,11 @@ static void fnic_cleanup_io(struct fnic *fnic, int exclude_id) /* Complete the command to SCSI */ if (sc->scsi_done) { + if (!(CMD_FLAGS(sc) & FNIC_IO_ISSUED)) + shost_printk(KERN_ERR, fnic->lport->host, + "Calling done for IO not issued to fw: tag:0x%x sc:0x%p\n", + sc->request->tag, sc); + FNIC_TRACE(fnic_cleanup_io, sc->device->host->host_no, i, sc, jiffies_to_msecs(jiffies - start_time),