From patchwork Tue Oct 10 13:11:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 9996107 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 093BB603B5 for ; Tue, 10 Oct 2017 13:14:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDDF51FF82 for ; Tue, 10 Oct 2017 13:14:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2A692097A; Tue, 10 Oct 2017 13:14:35 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable 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 99FE61FF82 for ; Tue, 10 Oct 2017 13:14:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756313AbdJJNMV (ORCPT ); Tue, 10 Oct 2017 09:12:21 -0400 Received: from mail-qt0-f172.google.com ([209.85.216.172]:55405 "EHLO mail-qt0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756303AbdJJNMS (ORCPT ); Tue, 10 Oct 2017 09:12:18 -0400 Received: by mail-qt0-f172.google.com with SMTP id x54so50877718qth.12 for ; Tue, 10 Oct 2017 06:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GtLHO9dao/DXnhQqbdTexDihvrBxqeoGAyVbWiYBgVg=; b=UzwYHRhgBBIOP/4AOMYrBLttg0LbUsijRyqOuot6SUo0Ror+3qDqPf9r8HSPcf+TQN UXorcBzM/PK/eUUbuCdfhjLblun4jlYWBHwAUkQ2974FDvI/8SKX1jF0iO3SNjIdqEHu SWh1PHTQowXZW0Cr5XBxKlbmPmH3teOkL1ZV4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GtLHO9dao/DXnhQqbdTexDihvrBxqeoGAyVbWiYBgVg=; b=O2/KjGBLEGul5F17D/WROlIwRaYyc/ekwGf1BakJkJlBzikMKXSKhskwbdjQdv+OSI vWzm5O6p5m+BKLLwzaTsF1meTlaeAnFu7Ne8uo21ge1o9FGFzj4sSLEL4cSQxhpkJJW5 wiRdYOfhuoUU3g6aJeGWKyayyolMBLYyNLsZI/9vDFaJ41tfc9POd+53+9WjAzcNAa/u KZJVELxGpq1Z0pEG9NdBnozcL8g3lNmQnPq9XIZzTHjbgXoQYfcKM+ZQtEvvX0s+q1Pm /R5oNUtBm+ZtgYoz2EJZOJtHNHeTmUxiw+QRCnWNnZcsL3pqXqrCrUl5I8PCCXaOXLyI 5CCQ== X-Gm-Message-State: AMCzsaXpYq66yPmSIKJQHodeU8ee2NCmnI+gsAJ67s3dKJU5LKEdqSea 14FIzqJ9PPnLCxPKQDt4y9HlWugZ X-Google-Smtp-Source: AOwi7QA99ZuqBD/25c7rlmu5yaCaYQ7YRhhsiE7hu7hS9opYVAtHtxFYh5DBytFIijcKgR/DTzCSXg== X-Received: by 10.55.96.134 with SMTP id u128mr5407408qkb.290.1507641137954; Tue, 10 Oct 2017 06:12:17 -0700 (PDT) Received: from host1.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id h135sm634004qke.5.2017.10.10.06.12.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Oct 2017 06:12:17 -0700 (PDT) From: Sreekanth Reddy X-Google-Original-From: Sreekanth Reddy To: linux-scsi@vger.kernel.org, hch@infradead.org Cc: martin.petersen@oracle.com, JBottomley@Parallels.com, Sathya.Prakash@broadcom.com, linux-kernel@vger.kernel.org, Sreekanth Reddy Subject: [PATCH 05/10] mpt3sas: Fix IO error occurs on pulling out a drive from RAID1 volume created on two SATA drive Date: Tue, 10 Oct 2017 18:41:18 +0530 Message-Id: <1507641083-20207-6-git-send-email-Sreekanth.Reddy@broadcom.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1507641083-20207-1-git-send-email-Sreekanth.Reddy@broadcom.com> References: <1507641083-20207-1-git-send-email-Sreekanth.Reddy@broadcom.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 Whenever IO for raid volume fails with IOCStatus "MPI2_IOCSTATUS_SCSI_IOC_TERMINATED"and SCSIStatus equal to "(MPI2_SCSI_STATE_TERMINATED | MPI2_SCSI_STATE_NO_SCSI_STATUS)" then return the IO to SML with "DID_RESET" (i.e. retry the IO infinite times) host bytes. Earlier driver is returning the IO with "DID_SOFT_ERROR" that reties the IO quickly for five times but still firmware needed some more time and hence IOs were failing. Signed-off-by: Sreekanth Reddy Signed-off-by: Tomas Henzl --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index cc78ce4..fa948ab 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -4807,6 +4807,11 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) } else if (log_info == VIRTUAL_IO_FAILED_RETRY) { scmd->result = DID_RESET << 16; break; + } else if ((scmd->device->channel == RAID_CHANNEL) && + (scsi_state == (MPI2_SCSI_STATE_TERMINATED | + MPI2_SCSI_STATE_NO_SCSI_STATUS))) { + scmd->result = DID_RESET << 16; + break; } scmd->result = DID_SOFT_ERROR << 16; break;