From patchwork Sun May 7 13:34:15 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: 9715431 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 64AE0602BD for ; Sun, 7 May 2017 21:46:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 565D726530 for ; Sun, 7 May 2017 21:46:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49947267EC; Sun, 7 May 2017 21:46: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=-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 DC7A126530 for ; Sun, 7 May 2017 21:46:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752910AbdEGVpn (ORCPT ); Sun, 7 May 2017 17:45:43 -0400 Received: from mail-bl2nam02on0060.outbound.protection.outlook.com ([104.47.38.60]:56655 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752471AbdEGVpj (ORCPT ); Sun, 7 May 2017 17:45:39 -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=qqWeXdKb449LiBFB/m6pn9OwLAnpiCosoWMbZlL8NuE=; b=JHO773iNS2MW8wTH4QUBOkAo9YvDwn1v5hoV7El4+qeLiJdXYmXryDsJJLJn42FeceotrNscqMiTYGZZhjzGGF57wbGPCz5Yo0/n4nF2QcgvkfYUMqq8uUJfhHhrdEcPrVk9OxrdE8OHqManxbC/pZaqGNz2B1TVa6ifxLHEXYU= Received: from BY2PR02CA0088.namprd02.prod.outlook.com (10.242.32.46) by DM2PR0201MB0733.namprd02.prod.outlook.com (10.160.94.21) 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:51 +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:51 +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:50 +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:35 -0700 From: Raghava Aditya Renukunta To: , , CC: , , , Subject: [PATCH 10/19] aacraid: Rework IOP reset Date: Sun, 7 May 2017 06:34:15 -0700 Message-ID: <1494164064-17715-11-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)(39410400002)(39400400002)(39850400002)(39450400003)(39840400002)(39860400002)(2980300002)(189002)(199003)(9170700003)(53936002)(305945005)(76176999)(104016004)(5660300001)(50986999)(38730400002)(107886003)(478600001)(54906002)(5003940100001)(47776003)(36756003)(4326008)(77096006)(189998001)(2906002)(76506005)(57986006)(106466001)(105586002)(575784001)(86362001)(356003)(6666003)(2950100002)(8936002)(8676002)(50226002)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0201MB0733; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Neutral; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD056; 1:76UKNvv4kgDn+VCunAnh7bzYL9Pg5zejTRBpV4qj8uKa5M77R8YKIGRhuMgREUJKrakuosHgRdFduvgXLqdhxaPWsQzuEA9ACeTCnFdw9ROkHkOPt8+6s3hbgyF8GYsqAXVlMgbbQkOUouK5soJj4OzuJgmdg37PZXP96cux4EvDLiPVBMkcnRr0RwlzoAH1LCOf5H13jCQG+5IJ0E2am4bRUOfUsCCE+b0rZJOMstrajZLZK/WnBsU0L5EqjPaDuQ4VkRQW9VYvHiaeCVoHfrWZjt83+eXllu1YZjQ2b5Ui0tpOAmytfG24hElikHy3HUU0nh7AbowKRb2xALur0SG1AkdmP6GBYfzrClYqy2sclG2+uXtJONYyu1YmeixNnxz6B2Kkk1bExaVb3niTaojUHwCKeIhESAZjPtwgHtHDFBoJeGkVEFQ6sq7/01YReTVElt/vvtvN1jL2EBEISq9MqM1mbT8XiAg4iW78nMaL8M8aO8I8t/XF4u9pYvP0x7oY177dGDiKu6L2jtU2DWPbCY9ILseGn13L454zNF8/aBiz7hLNPG+g2gSUfKdiUinsrsi9jF8Y4Oq76PE1tg== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b6093b1a-0e58-41c4-e7df-08d494f7c8bd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:DM2PR0201MB0733; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0733; 3:AjvbN4cjbBQdXh4KLhbK1GVAlupTPBN2jvp6vRAxtArJ7CEjvVHd6XKxEopcp5zLIDTLAsN9o1xNSQ9WIIOAXujFaQoZgbB5SBK81rCwc0IgQwplZzez6I+/l01ulQjSpoIBNd8tOG/QMK01qUFgMe2uHjtbOLb+6EtKqu2GKEwWkdI6jaKCElraCKUMNQPr7NPR3ijUPCgj6hF7w2u0j3ogWj40HWCjOwkCARdSh4N4BVP4UBDf3EOl3kv6q9X0qlduVqPXPRtLtATVJnQJiuY/V/nBOF+YVODqS5rEHCrgiFzrj7vnJhcbUlpuJ+PLMWaz/xT6KuK99y3KIxj8dOrcvJd87doWexbfZTNWM+xtatfLwh/AB2F4tRwxXjMGqoO2wNHIKtYXlkUlhhqfMPg1huP2LPOm3YGj20DDw5COrxcWlJLMC52k/Fl4PU1gnIayCisjEABgsmpWFEYC6Q== X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0733; 25:RGxH7OhXmOHwuwiulaBfZcigvKiARbTA3QgHx3m3ByyQUXYN1BFEzgJVZAsgpeTkGZU51rgJ1Gaq5zT4T0HL1QKSu/KoIOMjrYhuJOBouQ3uFHqpnI8qrRi5Qyjzw3SdcrvMAOeCWA0+K+1Tymh4htOrouW55M/sQGQO0Vj4cGHbfc4NTvrJW+b7+QB0HXJ3pE80uVW3zB3FgLXMeiA0FxGIq2ZMw9hV2S1u7j9wz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ca0g9sHnwJ8eiCwE+s83UzE9p67zFZ81xa7GRo2MDhntX 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)(5005006)(13017025)(8121501046)(13015025)(13024025)(13023025)(13018025)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148); SRVR:DM2PR0201MB0733; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0201MB0733; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0733; 4:xxjcNJjVqZA1eSW1vcgGJ2srZbkhEnWIsSqCmhAcMP6hQG33O/0yx0gLhk8GuIYYUjJnvGbkzR3go6+JvJF9Rg/ZU8ZzuCfImwxcYtTuYPy/YHFLzLi/Kkqs9vzuAO7gVNzXrKFMiyy8yBrOpPsySjBeuc+9dP1eIRawzEEMBqlFI+L2RzYkWLYl/HAcEmdKAj/8aLTGjCZ9hPQHugfcEa+1nkhy5pXVXYLndl1LZ3fAZR49VEBeI7H2Bgc6NWQW29zsyuLDi4mAUQPljBEsIQoO4X7j+QTnE2Kv3EHoDmZnVjIfRd1K2J1+6RQ9fXrDv3V79JIIAXgzNTFIrPTyWva7Z2erpjGDGxkRhIc37KLiWS/r4n8g0Kr7/vHoxLPryp43NT6eXWluIp95qoL0savsFbcRDFrn1YFhg77efjDnEj9lwrTFijGVbO9QbXTRY9x6nsQSjd5YPGztsWT3OJ4TOIhQginxGpAf52Xe9DJB38tM66qCBmqjzbAtEet/M2ZrJScFQHd5ZHojXCXUWAMJ4bz7KKA8dKSGkP+4TIrZRhAmihLNPlpgsaAS+MmHGQJIcWy05o/yZnhfmFASvpeJe7unSzKobMYsHXeuBmPD61gjIWCZ9dOgRPNUZectHEO5oX1utsLjSMBrNSdRv1d2/tHl4FVKR0SXS0Qi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1V1WHYXejKY4Q89uQobWIa4gFMOThPtATKYztbOdS2Sa/6rZyvq4cYTEeDDT8IkaB2yhWwiv7AVXVvM911CO/66hqCFdw/iAYBhdUzxecKQLVXxebz3PUHuqpjb8=; 5:FLCYETkGuAxtK4memNir1GS74R4D4aDGAJODLZ4LJ5b50slRmFjpkOgBzWPrU+6ecISu98wNdyKAmANjCUPXPm/UNTJrr1JTAbKpskn0SAbgp8k66ZLpw/F0jAqoDgUv/MGPPdkwRwb2Zsf9XfBuKg==; 24:c52scDZPhoDKxPdIExfJ35QfRC8o4MozddYWYSuCJsFi0luoO0QT7lJNXYsKnAcjHs6MEEYJje5MWlbkQcSqZYYTQj+47+Fph3D54FkFv3k= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0733; 7:9ETpGpXjrEPgzBn7KiPCC/tRgXh0hrAsff27YqkIHF9Nr8FkrWExBq4/rjeqOYjmGvbo91FXUSu5k+h0WXvJemXZu7YfCIy1orw6rYkYDtrwjVdVqgXLiODIHG/nXlPlMu6Z/YmKZchrSMz+UvS4VkS3U3a76VdbkkB6a4ibRyo3V1FvTSY+VTJE7QLi+rDza++KVk+bpm/ok/Fia0+XgZLDjZlKlogxeskp20ZL0XLc61WY0G51dw61XAuJ0RGqLxHykFXRb+bDHP+paQZhEV9GXhNXpTu2UzMH+D4LEIOXOi0Wx7GlIG6Ddmil64fyIcXE9RKEHMoTDzxCBTT3Mw== X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2017 03:18:50.8528 (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: DM2PR0201MB0733 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 Reworked IOP reset to remove unneeded variable and created a helper function to notify fw of an imminent IOP reset. Signed-off-by: Raghava Aditya Renukunta --- drivers/scsi/aacraid/src.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c index c0e5242..e8e9178 100644 --- a/drivers/scsi/aacraid/src.c +++ b/drivers/scsi/aacraid/src.c @@ -694,15 +694,17 @@ static void aac_dump_fw_fib_iop_reset(struct aac_dev *dev) 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL); } -static void aac_send_iop_reset(struct aac_dev *dev, int bled) +static void aac_notify_fw_of_iop_reset(struct aac_dev *dev) { - u32 var, reset_mask; + aac_adapter_sync_cmd(dev, IOP_RESET_ALWAYS, 0, 0, 0, 0, 0, 0, NULL, + NULL, NULL, NULL, NULL); +} +static void aac_send_iop_reset(struct aac_dev *dev) +{ aac_dump_fw_fib_iop_reset(dev); - bled = aac_adapter_sync_cmd(dev, IOP_RESET_ALWAYS, - 0, 0, 0, 0, 0, 0, &var, - &reset_mask, NULL, NULL, NULL); + aac_notify_fw_of_iop_reset(dev); aac_set_intx_mode(dev); @@ -742,7 +744,7 @@ static int aac_src_restart_adapter(struct aac_dev *dev, int bled, u8 reset_type) switch (reset_type) { case IOP_HWSOFT_RESET: - aac_send_iop_reset(dev, bled); + aac_send_iop_reset(dev); /* * Check to see if KERNEL_UP_AND_RUNNING * Wait for the adapter to be up and running. @@ -769,7 +771,7 @@ static int aac_src_restart_adapter(struct aac_dev *dev, int bled, u8 reset_type) } break; default: - aac_send_iop_reset(dev, bled); + aac_send_iop_reset(dev); break; }