From patchwork Wed Mar 1 00:15:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Satish Kharat X-Patchwork-Id: 9597243 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 72FDA60429 for ; Wed, 1 Mar 2017 00:49:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63435284AD for ; Wed, 1 Mar 2017 00:49:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54A1F284D0; Wed, 1 Mar 2017 00:49:05 +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=-14.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 EDD0D284AD for ; Wed, 1 Mar 2017 00:49:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751620AbdCAAtE (ORCPT ); Tue, 28 Feb 2017 19:49:04 -0500 Received: from rcdn-iport-1.cisco.com ([173.37.86.72]:28832 "EHLO rcdn-iport-1.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751547AbdCAAtC (ORCPT ); Tue, 28 Feb 2017 19:49:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2322; q=dns/txt; s=iport; t=1488329342; x=1489538942; h=from:to:cc:subject:date:message-id; bh=4oqHSUkBOPqPlmSKa8zegt069kp46qS0N89uYp8kWjQ=; b=aJFEH9xgyre5IaEMhEyAxgin9DeEUhLNdyxoP4i6HolzeNHRK7EcIpcU gX1RwX0/yaLNwU8pNEvWDjppR2sulPFuzketep+G/uzpGpqjejrQa/h4Y 7qJJJmSdUT5Rx0/ndibVowPPf0AYU1DIDNMRQgrnbAxKv9JphesnhLumC 0=; X-IronPort-AV: E=Sophos;i="5.35,222,1484006400"; d="scan'208";a="217971703" Received: from alln-core-3.cisco.com ([173.36.13.136]) by rcdn-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 01 Mar 2017 00:15:14 +0000 Received: from satishkh.cisco.com ([10.157.132.70]) by alln-core-3.cisco.com (8.14.5/8.14.5) with ESMTP id v210FE42013951; Wed, 1 Mar 2017 00:15:14 GMT From: Satish Kharat To: linux-scsi@vger.kernel.org Cc: satishkh@cisco.com, sebaddel@cisco.com Subject: [PATCH 1/1] fnic: Avoid false out-of-order detection for aborted command Date: Tue, 28 Feb 2017 16:15:12 -0800 Message-Id: <1488327312-8750-1-git-send-email-satishkh@cisco.com> X-Mailer: git-send-email 2.5.5 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 If SCSI-ML has already issued abort on a command i.e FNIC_IOREQ_ABTS_PENDING is set and we get a IO completion avoid this being flagged as out-of-order completion by setting the FNIC_IO_DONE flag in fnic_fcpio_icmnd_cmpl_handler Signed-off-by: Satish Kharat Signed-off-by: Sesidhar Baddela --- drivers/scsi/fnic/fnic_scsi.c | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index 2544a37..d851d89 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c @@ -876,32 +876,28 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic, /* * if SCSI-ML has already issued abort on this command, - * ignore completion of the IO. The abts path will clean it up + * set completion of the IO. The abts path will clean it up */ if (CMD_STATE(sc) == FNIC_IOREQ_ABTS_PENDING) { - spin_unlock_irqrestore(io_lock, flags); + + /* + * set the FNIC_IO_DONE so that this doesn't get + * flagged as 'out of order' if it was not aborted + */ + CMD_FLAGS(sc) |= FNIC_IO_DONE; CMD_FLAGS(sc) |= FNIC_IO_ABTS_PENDING; - switch (hdr_status) { - case FCPIO_SUCCESS: - CMD_FLAGS(sc) |= FNIC_IO_DONE; - FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, - "icmnd_cmpl ABTS pending hdr status = %s " - "sc 0x%p scsi_status %x residual %d\n", - fnic_fcpio_status_to_str(hdr_status), sc, - icmnd_cmpl->scsi_status, - icmnd_cmpl->residual); - break; - case FCPIO_ABORTED: + spin_unlock_irqrestore(io_lock, flags); + if(FCPIO_ABORTED == hdr_status) CMD_FLAGS(sc) |= FNIC_IO_ABORTED; - break; - default: - FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, - "icmnd_cmpl abts pending " - "hdr status = %s tag = 0x%x sc = 0x%p\n", - fnic_fcpio_status_to_str(hdr_status), - id, sc); - break; - } + + FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, + "icmnd_cmpl abts pending " + "hdr status = %s tag = 0x%x sc = 0x%p" + "scsi_status = %x residual = %d\n", + fnic_fcpio_status_to_str(hdr_status), + id, sc, + icmnd_cmpl->scsi_status, + icmnd_cmpl->residual); return; }