From patchwork Sun May 7 13:34:16 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: 9715413 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 7603E602BD for ; Sun, 7 May 2017 21:45:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66BC826785 for ; Sun, 7 May 2017 21:45:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B655269A3; Sun, 7 May 2017 21:45:44 +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 BA41E26785 for ; Sun, 7 May 2017 21:45:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754167AbdEGVpl (ORCPT ); Sun, 7 May 2017 17:45:41 -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 S1751693AbdEGVpf (ORCPT ); Sun, 7 May 2017 17:45:35 -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=XeWwln7xwRtMpOw9hXuYKBTi20uMsOr/d78ohSdpY7k=; b=dljjOhSivZvy5Efl8MIwfmBXiikihc6tkNhHgOzLd13lMUlD/nNlZtcI6Lo/GUFJ+vTi5m1VdtrLP9zELv77+30pIMZmHZB2HhUdX7s8vpaMvhShd4VCYzrLkVCNjRIRiNBU/rn76q1aiMHja1tLutBEBEtyja/S0fGh/+F+qYU= 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:53 +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:52 +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:52 +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:36 -0700 From: Raghava Aditya Renukunta To: , , CC: , , , Subject: [PATCH 11/19] aacraid: Add periodic checks to see IOP reset status Date: Sun, 7 May 2017 06:34:16 -0700 Message-ID: <1494164064-17715-12-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)(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:0uwTuF8hulOpKaVM+PyV8zzx8PFIPCqNHjX8EqszFfd1P6EoQQq5etRwRFeSxNYQkjWUavZrGcqStOPsNMPsdft6+6LS/c1hx5XTXReHS/hL2Fr7r1zyUndEnpoEW6VVk/6GkXggcAjkxVD36zBlc35s4X2zLAGzo3oObcHisVO/q44HAVC4lbdtR4gfrDyEVs5IqDoSjFBuc91SVK2vU7+xgAZP0aQeM6AlmKErXvnmHu9Bj/tUBp/kdYzZ7rMlaYxJ6R3MXQ/BSh62MkQWT7UZYBbg5jPGkrmjEQZ9Ni7h5S0OWTgadcJiOHC6ZXS2jS4j+uuk+baFclJTDn2bKQYg2eWz7tN6vToRA55P9ZbLncxPoHY/4dfoEZTsVMmKrOtzhPd3eKtfWsEmqwVtrWeLA6CRhRTqpJhk0R0UXrG27JWX0lGgiDxLfFlYJRqTtenKvzDkGEL0VjPKnJHhwTh/Bng4GNQh2BDgl6+2xWQLfwkU6gSmoDkcGRgsNG3Skcekv9s8z6EvmDtla0Nms8oqJS3uxMVqfgMG1huaMjXdTSjHEX0b3hAYAU00C8p5LUnDMIpCVTbWKOGe0fF1SA== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 972a6b7c-5503-4daa-c134-08d494f7c991 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:DM2PR0201MB0733; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0733; 3:2qthFl+lJiAqNZ9hlQG63vfPGUcLbdl/eyQa71A2a7EXlItBPd6CzhoP5jKIhfoZ8k8t51/QB8gnuGxSsMBQ72nVBLiUytkdZBSMBZ2x940fd2+ryEUrGO3+ElgT/6jR1W/jlJlDOfnpKejVVa446jz7qL8bqGMUZR8Yayaflw4QzGWPksVksu4/uc9XQPOLqpY8hOhM9JUL4yBTAATP72/tKqyADthwOajQaTdUWsBPtewrhZjmUmJmkd6tnYTqJCawTX1tVyd27S0O7L0tgOwkqTy1SQ+B2TVlaKsPolwmn9Fozpn8tCePmQ4XoSzWTzYcrlEeZ4tktZrf252xTlTLG1OHn2NNtv0HNdtdGQ8LoPip5sLtiNTh465wtLu94HbRTthD3+XaD4p2sLeVxRwvvX0ObqmTPoe9dFs6om68qjfLHL1VEaJIFnNrZDykd7BiGCD1vHzgylmxJoZIaA== X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0733; 25:8uE9CsNpNSvsOcz3nfR9xbNK3tG6jAN+07LkJt/TjwxcqdTw2sJWWH2Pg3paipO/WIsn3Hc0VIUx5KqLVdnQpPKdrxyqr1sfbzLlMD7Y6bxBCRzKYlOBB+ve2KPyst2a54Dyl9v5VXtsGbQwOLTX84ErdHzsH3Pd9klc7yHo2HtDAbbeyTvjUPbIQfNPL9kg1eXKHHa7RIYIISGgDaej0xtvCkSzHKA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X0JohBgpI7mNzP3f6 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:ajtWW8X9lPbmO1oQbo5MW1eW2UHr71as/rfyf8Tfl6hc4PdM1gxl58GmFXZRRqEvZzwRt+JjPbUGEZSz4gh2dV2c0epMpDPmmh1uPQiljRTF6ouF/8r+wL//2xoCMWGFdsQNtUonadsi60hUjtMOJTkUtOwcK7DiWFvtQJbifMUw/KD2CXwwuuGrPllJE/ALbuw1Mp9Nrh6GVaFEZz6BvdjhMOT9wKwDPgiVo32BCH1CHfXOBszT2KIUd6vS9BL/73SVJs5shmohPvxW+YAbXPirT2pZEQPQwoK0IiUJKtczagwRv4t6VMK6tKbmJkfcPsGV0ypB+jJPTEuuS/Cjb3PIWcTpSXWeJdSiRZcgpH9mzO8a29gk87ga37vEQy5PpOasNjzTSDo0sbPkbkKk/SLTWVz4s1ZcgWp3FngjQeKNjtyn+0PmJcOwRl9FRitLM46MT/xnv6Vl6mem4aMqCpjTbSTS7KUytuzBQllquoqMafvT3N8drrBEyTr5W1jMMGfBs6Hp6W+lFcS8y5YZ9xceCREAbtpb5x37GPO8lDOLCtHRpO57jm9qF6j9RaEEEU4tPG/Z7zZEy0UqRZQahuvlbMOpqyQfKPAYeGXUNOmi80HEb8OEl0aHCOKlpslocJuZDnULRzpwJKQN48f7g5A/JpTqKLkqCaDVDb9DE3mCZTszSz0lRgdkwowRWAw3IvYDb3lIYlnw6OZWiIy5n3GHaYg4BRGkfq6J4aE0pQR72A9Hr9QKLWsV/tPYxCySuLcg1Jhk2TGSCbRzNezwhp8id5GAUVRYOlYJ5J78ZFhFqJgFI8olclPxDucLVp0DvDbR39vJ7pIRc37jLqsC+AvGPgKe6TAjG9uJokSPaSsi5uuPIOkyIqgAGYksBHbeIX3kWg4cQiGkcBJrbu0Suh3N5zFbwqrKDdCi8SrB LGhfud+rbH9zY/DHQTlwuW6w X-Forefront-PRVS: 03008837BD X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0201MB0733; 23:hIuvb+iqSRypWkOR683rsCbJ4OtwDzJvfGucMxA?= =?us-ascii?Q?AMwxxd123A6ctnWUIEsSXYSo1t1tcR3ZtM0hMdcmEoSIH2OjBPD4Z5CZ0x1d?= =?us-ascii?Q?iuVnqJo3dDMY6T2jpyETfGLhxpNvidLXj3buAQky+61Rta5wr8hgtEDb4LMY?= =?us-ascii?Q?o6EGiDY/7KNhArEs8TSX1/mMvCQ0OioH+qILOhCqmB8HSnDuvWZrygU7WPJn?= =?us-ascii?Q?QzAuaGtabmtxes3VfNR4HzZiPtzOapPG/cXy8AvBl1eQL2B41szuve2LfqaR?= =?us-ascii?Q?DaIklkli1kG4c0+YnhVvA5zIe0rtzRUua6O3bXGKbscbaIkxc2vCh0tKbjVU?= =?us-ascii?Q?nVAEWMlv1st1CfUTM/Z0TEXhKt9OCUzvaEtw+gauQdmfhGXfunf/0OoL6X/o?= =?us-ascii?Q?S5UIVrhyrAAYhRhMx9b2me9W47nqBA71m5fAkQNniZHPFblEK4U0fMTal6hb?= =?us-ascii?Q?qtiIEuzVkmbZQoZrRAI4KFTdg9cQ2tfbiivfl1UKv881AAmema5eka3CPstH?= =?us-ascii?Q?NJkcnnU26H/9aPZ4DajsqpQko0fRcQ8DqEwmVx85JOhJN3zXfel0MeTBMpC1?= =?us-ascii?Q?pU5hsX9s6TAexZ/htTf182ahBO4hzKG2HxxOCxEfKKSHn9yxZJj2L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Aedxkk0zlr2spCXNFc5CnljqEVENcSlGIlaYoWpU=; 5:MI7UKPfrMtAW0rCdjxuBGKySX0Kt+0lbUylZw0qoMMNUSUDBBNP7agGfxXaRxUfCaC2+7CJbH377UAPTQQRDe1xXkiu4RSjShHTayAnLsmtGBEZU+vlSYnKvK24TK3zpFywVi7rTCwbYssDUxQmsew==; 24:WfcXYoSxdYHVTsTdzg3oEU1dlfg+RfGu0jZNItd6WHPa+e+AjLPA9HN9fer7Q7OHjzbpNXm6botVOtd+4R8LAURtdAxjQjoYI26y8xP3K5Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0733; 7:r0vD2uF8/vYOVe/4aowzAw/X9dsMjrc1cXtGyenL4s0/QztLtMdXgCvGe7LW1EqDjupYdB92elNESgfxgWEY1SCRDIdo5WhaBp55LrIzgzxxEf1jsDYONegQhGTw8Q1jK91x/dlfsJcH8QKbFjrHWGTpox5/4/k0shSO78pJs5otpG8rMiiCEawfaatcudLO+WVuKRmsGdD1Mon0QBdXFVvqwtCM07FT3mims5ke1WfJEbX21GbubK8v7pcmg1VeNKAx0pMQgKSLwb3UD3ziZAOZBFBFG+9sH3Qu7jCI+n5F8+u56DZ7zqax0vtW8MN1/+HZ+2wcn8nBAc386mSZTw== X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2017 03:18:52.2256 (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 Added function that waits with a timeout for the ctrl to be up and running after triggering an IOP reset. Also removed 30 sec sleep as it is not needed. Signed-off-by: Raghava Aditya Renukunta --- drivers/scsi/aacraid/aacraid.h | 1 + drivers/scsi/aacraid/src.c | 45 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index 993f134..829f3d8 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -2519,6 +2519,7 @@ struct aac_hba_info { #define SELF_TEST_FAILED 0x00000004 #define MONITOR_PANIC 0x00000020 +#define KERNEL_BOOTING 0x00000040 #define KERNEL_UP_AND_RUNNING 0x00000080 #define KERNEL_PANIC 0x00000100 #define FLASH_UPD_PENDING 0x00002000 diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c index e8e9178..67185eb 100644 --- a/drivers/scsi/aacraid/src.c +++ b/drivers/scsi/aacraid/src.c @@ -694,6 +694,37 @@ static void aac_dump_fw_fib_iop_reset(struct aac_dev *dev) 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL); } +static bool aac_is_ctrl_up_and_running(struct aac_dev *dev) +{ + bool ctrl_up = true; + unsigned long status, start; + bool is_up = false; + + start = jiffies; + do { + schedule(); + status = src_readl(dev, MUnit.OMR); + + if (status == 0xffffffff) + status = 0; + + if (status & KERNEL_BOOTING) { + start = jiffies; + continue; + } + + if (time_after(jiffies, start+HZ*SOFT_RESET_TIME)) { + ctrl_up = false; + break; + } + + is_up = status & KERNEL_UP_AND_RUNNING; + + } while (!is_up); + + return ctrl_up; +} + static void aac_notify_fw_of_iop_reset(struct aac_dev *dev) { aac_adapter_sync_cmd(dev, IOP_RESET_ALWAYS, 0, 0, 0, 0, 0, 0, NULL, @@ -709,8 +740,6 @@ static void aac_send_iop_reset(struct aac_dev *dev) aac_set_intx_mode(dev); src_writel(dev, MUnit.IDR, IOP_SRC_RESET_MASK); - - msleep(30000); } static void aac_send_hardware_soft_reset(struct aac_dev *dev) @@ -726,6 +755,7 @@ static void aac_send_hardware_soft_reset(struct aac_dev *dev) static int aac_src_restart_adapter(struct aac_dev *dev, int bled, u8 reset_type) { unsigned long status, start; + bool is_ctrl_up; if (bled < 0) goto invalid_out; @@ -745,6 +775,16 @@ 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); + + /* + * Creates a delay or wait till up and running comes thru + */ + is_ctrl_up = aac_is_ctrl_up_and_running(dev); + if (!is_ctrl_up) + dev_err(&dev->pdev->dev, "IOP reset failed\n"); + else + goto set_startup; + /* * Check to see if KERNEL_UP_AND_RUNNING * Wait for the adapter to be up and running. @@ -780,6 +820,7 @@ static int aac_src_restart_adapter(struct aac_dev *dev, int bled, u8 reset_type) if (src_readl(dev, MUnit.OMR) & KERNEL_PANIC) return -ENODEV; +set_startup: if (startup_timeout < 300) startup_timeout = 300;