From patchwork Sun May 7 13:34:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghava Aditya Renukunta X-Patchwork-Id: 9715391 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 5BA2060385 for ; Sun, 7 May 2017 21:44:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CD9426530 for ; Sun, 7 May 2017 21:44:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 418B126785; Sun, 7 May 2017 21:44:08 +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=-5.4 required=2.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_HI 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 B45D8267EC for ; Sun, 7 May 2017 21:44:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753454AbdEGVoE (ORCPT ); Sun, 7 May 2017 17:44:04 -0400 Received: from mail-dm3nam03on0082.outbound.protection.outlook.com ([104.47.41.82]:29700 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752906AbdEGVoB (ORCPT ); Sun, 7 May 2017 17:44:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mscc365.onmicrosoft.com; s=selector1-microsemi-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=xd3mxJCl4Kh/eFFFgujigfzs/GverfkCFDpusBoTgOc=; b=givAY5dhmK7UT5tYRrzxZ6xYHpvcyoGSm3cPFZ6qKZcXI+zqN1NeLlfK36zZBoFFRdLMuE60Dupm8xgyroaL0Ma5jmzubW/opxY45CXBjSd8cGEGg2ODDuu8Bh8e+XLdfyIkQiQ2zd97wWGCcxNpa6Pd6c66AOcMz/TpEAvWrqg= Received: from BY2PR02CA0088.namprd02.prod.outlook.com (10.242.32.46) by BY2PR02MB091.namprd02.prod.outlook.com (10.242.43.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11; Sun, 7 May 2017 03:18:59 +0000 Received: from BL2FFO11FD056.protection.gbl (2a01:111:f400:7c09::115) by BY2PR02CA0088.outlook.office365.com (2a01:111:e400:2c2a::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11 via Frontend Transport; Sun, 7 May 2017 03:18:58 +0000 Authentication-Results: spf=neutral (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=microsemi.com; Received-SPF: Neutral (protection.outlook.com: 208.19.100.21 is neither permitted nor denied by domain of microsemi.com) Received: from avsrvexchhts1.microsemi.net (208.19.100.21) by BL2FFO11FD056.mail.protection.outlook.com (10.173.161.184) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.1047.9 via Frontend Transport; Sun, 7 May 2017 03:18:57 +0000 Received: from localhost (10.181.72.194) by avsrvexchhts1.microsemi.net (10.100.34.105) with Microsoft SMTP Server (TLS) id 14.3.339.0; Sat, 6 May 2017 20:18:37 -0700 From: Raghava Aditya Renukunta To: , , CC: , , , Subject: [PATCH 15/19] aacraid: Make sure ioctl returns on controller reset Date: Sun, 7 May 2017 06:34:20 -0700 Message-ID: <1494164064-17715-16-git-send-email-RaghavaAditya.Renukunta@microsemi.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1494164064-17715-1-git-send-email-RaghavaAditya.Renukunta@microsemi.com> References: <1494164064-17715-1-git-send-email-RaghavaAditya.Renukunta@microsemi.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:208.19.100.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39400400002)(39850400002)(39860400002)(39840400002)(39450400003)(39410400002)(2980300002)(189002)(199003)(9170700003)(189998001)(53936002)(6666003)(8676002)(107886003)(5003940100001)(2950100002)(38730400002)(2906002)(104016004)(76506005)(478600001)(8936002)(105586002)(86362001)(77096006)(4326008)(356003)(81166006)(5660300001)(50986999)(50226002)(76176999)(47776003)(36756003)(106466001)(57986006)(305945005)(54906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB091; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Neutral; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD056; 1:6IBSbxxIRXA6vg5Hby4IF+zkSUZHieohQQ4yiTVClJG3Zxc1g5C/z+19AXc2PNJ87xo8z4+Ngb2z/HOZdMI/sMPC3IkWFoyND1REXTPPRjxPe1l573NZ/vIb8PaCZLGvJPT7ukdkCRm59MMWg3ti+C8LLrwYhq+6Kes/lCg06d0Ndr3ZARoXVHYFqPDmzjnfV8Uo31J1z3CwESH9cW6kwu9oM9io3w+TtlpLfH2Mqq4KWJFj4DcDqJE3Nz3/lQ1fAKqkkr9d5XT6B5XcP5inExfAgISenjbdVaP0xdaYKCubhGmrGPEiCCkrDfXMvWErwbTVAkJby1+imPWOiakhZqop9H4bhq2haBjOxjeK6cCvnaLILqfL+utK59POy7cfh+RAHCgH6b91S8RbMLs349dQsrkmlC6Xbmh/yJlL72FfXT++zMH9leFO6w/xOxFbE9irfJq50sIymTN10ZbsJV8kfsEhVuhvqGCUWx1c07QnCdwiz921vscmpQ6+gvaX0SftJyqSyZcYHeD/vvm7b3BWnNL+f7TIBnEstffX2buNJqK2fO9VDNq4IC/0Diz57pXWui2U4Ff/ZKGl8G7E0AkPTNMxV7AweuyU+Oico94= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f0f74691-488d-45f9-6eb6-08d494f7ccef X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:BY2PR02MB091; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB091; 3:cmeAPDxUhQswydopojHY4QeJ/cd0Pj4DPFz70gqLRnQ+w1kjfrDqnE5EcXKS3xfvHYw2rcyfg1XJ6jvC6ua+GtjAG6WyDbSGHB+5ZibSOGEWXEP/lKjVxpf26oq8AgZso1kXTcrLE4rVyPMP4HQ/2+6DJVsRt0/Skgf15xnXtRDQL1Chc2OLhnPeG1Kol9SqHmq+6VjKUnlS7y8WfbcxGPJOfRXMJasGGvD8uxW+baGxsaqA+Dqc9T9aDiJrPZ+67S4pud6tNYQkXaooEYCS2GiHwC5pDIvz1uOUdnpmOR+26RdXE7qUvh3jKwidHEOTnk26m7UNtV7B2MV/BW6tFwTyj3GhzrAV2pMK3++EMg0eIFG2PT8tbXn+kEDSOoJmXrWlX9jkCSmtkxycD91OOy0jD35bkbPeBjBkyGtBjD6llDWWnm5Py7X9DsUAsCl2vEp//rpb6epziydZzB6Gt91HEhJmwvEH7MBhccgTaYVCEcYM0J9CkLQog+c1VArg X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB091; 25:+wQAkHKGfPmP/UdDbtafM4ZoI0Fw3Fvq1rB0oatLUonFhTdVnSgvyWzjfe24q0e/hGhpn+NF7ex/u42Cf3gcCimO+eM9A1P7o+RFYMQxjQrM2/CBS6lNSO7Z0CQWQksyxYL+FoLVoMXUmZwNXcKjVuB4iHm+Dawan+KilFV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fbyW6Q1nhSni6OXWOUiVQ3qc93Wiy4/ha12TYaDL2OFJ0zrQCCdT5GZZHM808IcKnu1D39naeDUOZCcPaSlIrSO9YC8xesS X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(72170198267865); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13023025)(8121501046)(13015025)(13018025)(13024025)(13017025)(5005006)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123555025)(6072148); SRVR:BY2PR02MB091; BCL:0; PCL:0; RULEID:; SRVR:BY2PR02MB091; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB091; 4:X1dwSWKnFxIll0T12TgWoGxq1F0qa3efyD0RJGKRG7oNIT7HTDmW1AimWMwwpLwsHmR1T78sjxcMOdyvktPokyD9rGTxwfze7ewZeOJ/eNjxx+0eK0xeJu72FAdfQAwA5mNwfUD/UvLm49avGDTFYDLFByZ4SEAfi4/Znzq3h+pZPKL18KmW4rdRh4XdE/KqaR77yEJGJAlYXjlJ5cHfy+q69R215NdLLJuFfZJQqWE4PBNa8dfIDmaZmkyBmLgi7GOsJkrbhjXH1UThum6Rt+3XLjk6QAkpjUZ++Wul/5PZIsD6JJiqlsXhZYn6NOX/Orj13mSGP2FsKICIysl49B2NUXsCMLTUz03TYEQoVOCHQx6T/vzIHQxpLWFSJnV5EuR2D5ZdSg2zrTTpxmrXCsRcIS4b6y7h1XCfrCPErh9WCKMtpc44tBtPGHSUFyzH2qi+mCp5c4iM3W77XKfIGKJ8fO6HyjWGXKNBAApKMUJArpSxPpZc/5JKsXz0SgEFie1LE+hN6tOpK2efMTTqTOYRbS3Kp4lSBKi2vvuWBFZSh6O3KCUe7opB5keuHTM+EMij3hfIxTh4Idtw/shO0zRxlPvpFkPu38AsHU3dEOtr+zNECrPuBdumB2TjTzJjmY0L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XC4vQoV5JlxSW4eGp5r2Qys/K7iF8BiyIDISTMUgRvAR//RvEVqvFAEJ9c4HZs4VpCH8a8ivFfXJraa2AqRxOmtQStJxNTvRcg0Htwvep30VKFruIH391kzN16k3hpaicwPa2xwpjg=; 5:tEibFCWXmyyj8MjX8deYUtW4FlUfV9hZy9ySFb9rd6Q3d57iUKmVQY7OD32YxRtXYbFoDWdIADL2x0K8F2Cqa5+DWAgxBuCfeG69ve63EmbKaW2EcVf/BW/23kgEn9ZEcOdsBlTW14leQXgPu/xHzg==; 24:CXl3fnf1Xu63l7C2B42hi9wbIIIkRlMhBBgK7rJCyI7jWvg0/SUTkx8ciEPCiHFvZwx8H/SmhajqTJ+KgqLT3GZkKRgxkkSelAVKVyjItLY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB091; 7:gk74UveO+ZWOsUf+AuaKuKiHToEvtJXyDMGxWK/KlHsRCbu/QAyKXRe6uK7o1xKlL0bsInVlNmCZ3CGFx9zbOeBl/HX8EfK3QEBVhq7WOKs9oiuZtTXiHJT0JD+Ep8E0ydsih5klizYfWdsfkq5n8tXwCZsXqCZqDUr3J+upg4u1rfFMdhyXfBRWb3/fjz3k3XnUSorfPia5T8PQ0TFNVt8mXZkQ7ob0hpkrhEdqW/uwVOYQuxtwsM0a1L5R96DE6BmTK2XABpjODiIK8QTzXeMTE88vtBzM5N8VPBVxVl9Vqhn3KaDyEA2HFnxJd7yKjSXQy2uHcoi6q9pD8fphDQ==; 23:lLPeTajH0yzSmz1b/JItllcrjYKbgLMhMAd9rL2uJcK1Xdcwr++qMHGomXggr6xCfHYrTHGH4eKbSbSevHkZLL1JEH90+7aCmpFL4oEMmHspPqvSg4iQrrx2mibD6JJ/O/PjM28jfweoBeoHfkJYNQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2017 03:18:57.8883 (UTC) X-MS-Exchange-CrossTenant-Id: f267a5c8-86d8-4cc9-af71-1fd2c67c8fad X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f267a5c8-86d8-4cc9-af71-1fd2c67c8fad; Ip=[208.19.100.21]; Helo=[avsrvexchhts1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB091 X-OriginatorOrg: microsemi.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 Made sure that ioctl commands return in case of a controller reset. Signed-off-by: Raghava Aditya Renukunta --- drivers/scsi/aacraid/commsup.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index f26543a..a026790 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -804,10 +804,13 @@ int aac_hba_send(u8 command, struct fib *fibptr, fib_callback callback, return -EFAULT; /* Only set for first known interruptable command */ + fibptr->flags |= FIB_CONTEXT_FLAG_WAIT; + fibptr->flags &= ~(FIB_CONTEXT_FLAG_WAIT); if (down_interruptible(&fibptr->event_wait)) { fibptr->done = 2; up(&fibptr->event_wait); } + spin_lock_irqsave(&fibptr->event_lock, flags); if ((fibptr->done == 0) || (fibptr->done == 2)) { fibptr->done = 2; /* Tell interrupt we aborted */ @@ -1514,6 +1517,7 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type) int jafo = 0; int bled; u64 dmamask; + int num_of_fibs = 0; /* * Assumptions: @@ -1547,10 +1551,20 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type) /* * Loop through the fibs, close the synchronous FIBS */ - for (retval = 1, index = 0; index < (aac->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB); index++) { + retval = 1; + num_of_fibs = aac->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB; + for (index = 0; index < num_of_fibs; index++) { + struct fib *fib = &aac->fibs[index]; - if (!(fib->hw_fib_va->header.XferState & cpu_to_le32(NoResponseExpected | Async)) && - (fib->hw_fib_va->header.XferState & cpu_to_le32(ResponseExpected))) { + __le32 XferState = fib->hw_fib_va->header.XferState; + bool is_response_expected = false; + + if (!(XferState & cpu_to_le32(NoResponseExpected | Async)) && + (XferState & cpu_to_le32(ResponseExpected))) + is_response_expected = true; + + if (is_response_expected + || fib->flags & FIB_CONTEXT_FLAG_WAIT) { unsigned long flagv; spin_lock_irqsave(&fib->event_lock, flagv); up(&fib->event_wait);