From patchwork Tue Jun 16 05:35:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 6613141 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A19B99F8B6 for ; Tue, 16 Jun 2015 05:35:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4F09207AA for ; Tue, 16 Jun 2015 05:35:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B4D1C207B1 for ; Tue, 16 Jun 2015 05:35:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751207AbbFPFfv (ORCPT ); Tue, 16 Jun 2015 01:35:51 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:35083 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752145AbbFPFfl (ORCPT ); Tue, 16 Jun 2015 01:35:41 -0400 Received: by pdbnf5 with SMTP id nf5so6325128pdb.2 for ; Mon, 15 Jun 2015 22:35:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avagotech.com; s=google; h=from:to:cc:subject:date:message-id; bh=wCS1R1Stf12RIgUZLvwYdEmYSCucwjK6RD8VeBOq33E=; b=RnoI3Ldjp2FbqBvWUuJUmh0ZaPPwchF4LFsY5adau7qePAuRfmL2T1PbdRPBf9NWlb 8EDPG+ka7yMjXBHfxqYEwfq2HOa3aSi7TG9KDeMfI1/WcGDWvplyZo6eg4ZkZ31S6+3d 3swA0xYdT9qESezdiNwSY48rYgg/ESvKES40w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=wCS1R1Stf12RIgUZLvwYdEmYSCucwjK6RD8VeBOq33E=; b=PoKegwR+j1y1JmJBs555LjLw2QdK1bUD4GFHVYisN6ThOC7Hnv5EQcdKjK0KkE0wNu 8syt3AALV4InWO9s/4IG0+JTYNguF05C6HuL+SpxzM4HT5T44wY/9fh/i3399NlNADNU maOthv00oXCDKPG2gYsSyIah543cYlnjdD54qv4sSJOTLoWXDN23cDYRAeKXFYTxApwX BHNpYw/xCu/jdUmS/qpaJQ0HAQFD2kjrkkGie1OFRsDnIPnmcw4YYslf0T/V8ChiwRi1 GRuYyTHFdh7b5K1d1dfSMyesFvF7kPFfPIw3BHgVSOk8BuOG9NgtBFIJbRGGX6EoqF4y Kyvw== X-Gm-Message-State: ALoCoQmjxxsd/0m+hErJ9ufRt0jsuKfzQfeO9jocziKOBcqXOGcpzwR8UpvrnBl4BDU3LvMqUXug X-Received: by 10.66.63.70 with SMTP id e6mr37518875pas.62.1434432940874; Mon, 15 Jun 2015 22:35:40 -0700 (PDT) Received: from host1.lsi.com ([192.19.239.250]) by mx.google.com with ESMTPSA id ia3sm13978627pbc.31.2015.06.15.22.35.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Jun 2015 22:35:39 -0700 (PDT) From: Sreekanth Reddy X-Google-Original-From: Sreekanth Reddy To: jejb@kernel.org, hch@infradead.org, jthumshirn@suse.de Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, JBottomley@Parallels.com, Sathya.Prakash@avagotech.com, linux-kernel@vger.kernel.org, Sreekanth Reddy Subject: [PATCH 14/20 v1] [SCSI] mpt3sas: Complete the SCSI command with DID_RESET status for log_info value 0x0x32010081 Date: Tue, 16 Jun 2015 11:05:24 +0530 Message-Id: <1434432924-40632-1-git-send-email-Sreekanth.Reddy@avagotech.com> X-Mailer: git-send-email 2.0.2 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For any SCSI command, if the driver receives IOC status = SCSI_IOC_TERMINATED and log info = 0x32010081 then that command will be completed with DID_RESET host status. The definition of this log info value is "Virtual IO has failed and has to be retried". Firmware will provide this log info value with IOC Status "SCSI_IOC_TERMINATED", whenever a drive (with is a part of a volume) is pulled and pushed back within some minimal delay. With this log info value, firmware informs the driver to retry the failed IO command infinite times, so to provide some time for the firmware to discover the reinserted drive successfully instated of just retrying failed command for five times(doesn't giving enough time for firmware to complete the drive discovery) and failing the IO permanently even though drive came back successfully. Changes in v1: Defined macro VIRTUAL_IO_FAILED_RETRY for magic a value 0x32010081 Signed-off-by: Sreekanth Reddy Reviewed-by: Johannes Thumshirn Reviewed-by: Martin K. Petersen --- drivers/scsi/mpt3sas/mpt3sas_base.h | 2 ++ drivers/scsi/mpt3sas/mpt3sas_scsih.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h index 0ffe763..f3f79be 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.h +++ b/drivers/scsi/mpt3sas/mpt3sas_base.h @@ -203,6 +203,8 @@ #define MFG10_GF0_SSD_DATA_SCRUB_DISABLE (0x00000008) #define MFG10_GF0_SINGLE_DRIVE_R0 (0x00000010) +#define VIRTUAL_IO_FAILED_RETRY (0x32010081) + /* OEM Specific Flags will come from OEM specific header files */ struct Mpi2ManufacturingPage10_t { MPI2_CONFIG_PAGE_HEADER Header; /* 00h */ diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 7060c8b..7587f77 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -4302,6 +4302,9 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) scmd->device->expecting_cc_ua = 1; } break; + } else if (log_info == VIRTUAL_IO_FAILED_RETRY) { + scmd->result = DID_RESET << 16; + break; } scmd->result = DID_SOFT_ERROR << 16; break;