From patchwork Wed May 10 16:39:41 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: 9719255 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 0A5C960236 for ; Wed, 10 May 2017 06:24:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFB4E284D5 for ; Wed, 10 May 2017 06:24:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E466528552; Wed, 10 May 2017 06:24:19 +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.0 required=2.0 tests=BAYES_00, DATE_IN_FUTURE_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 4F5B0284D5 for ; Wed, 10 May 2017 06:24:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751756AbdEJGYR (ORCPT ); Wed, 10 May 2017 02:24:17 -0400 Received: from mail-co1nam03on0042.outbound.protection.outlook.com ([104.47.40.42]:48335 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751645AbdEJGYN (ORCPT ); Wed, 10 May 2017 02:24:13 -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=gY+4nqp1LMhuXFnlA+zVqw3pw12wThqE7ctUZxCHqLY=; b=BfdN0xrFKkPHjd5QbEoJKG0J78wCt80N+1x+EoavR51JY4L1Vyx4f4kC6NQwCBJAeCQPp96AoxOCm/czyYqYoX5NhVyiQS38j8LuhDQkQZKF8jZ5mFzSywu1HuECAzLgjVzLLZOYzW96oGUp/nW08RrYq8b88eVvYcEIYHz+fSk= Received: from CY4PR02CA0034.namprd02.prod.outlook.com (10.175.57.148) by CY1PR0201MB0730.namprd02.prod.outlook.com (10.160.141.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11; Wed, 10 May 2017 06:24:11 +0000 Received: from BN1BFFO11FD011.protection.gbl (2a01:111:f400:7c10::1:131) by CY4PR02CA0034.outlook.office365.com (2603:10b6:903:117::20) 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; Wed, 10 May 2017 06:24:11 +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 BN1BFFO11FD011.mail.protection.outlook.com (10.58.144.74) 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; Wed, 10 May 2017 06:24:10 +0000 Received: from localhost (10.181.72.13) by avsrvexchhts1.microsemi.net (10.100.34.105) with Microsoft SMTP Server (TLS) id 14.3.339.0; Tue, 9 May 2017 23:24:03 -0700 From: Raghava Aditya Renukunta To: , , CC: , , , Subject: [PATCH V2 07/19] aacraid: Log count info of scsi cmds before reset Date: Wed, 10 May 2017 09:39:41 -0700 Message-ID: <1494434393-17261-8-git-send-email-RaghavaAditya.Renukunta@microsemi.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1494434393-17261-1-git-send-email-RaghavaAditya.Renukunta@microsemi.com> References: <1494434393-17261-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)(39840400002)(39450400003)(39860400002)(39850400002)(39400400002)(39410400002)(2980300002)(199003)(189002)(9170700003)(4326008)(105586002)(8936002)(53936002)(50466002)(38730400002)(47776003)(6666003)(2906002)(72206003)(8676002)(54906002)(50226002)(107886003)(81166006)(478600001)(2950100002)(106466001)(189998001)(104016004)(5003940100001)(305945005)(2201001)(5660300001)(77096006)(57986006)(76506005)(76176999)(86362001)(50986999)(36756003)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB0730; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Neutral; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD011; 1:gZNGhRRBlfHzfv1qtYghKxwbs4F+tvVBUUemVVjwguXFvH2e5wQyTblFAv9BPCI292pcTou/iKc/o5/OhMeU6AWkF5rgXWjr1N4HHhRI1qcOJsGxAO9eAsfz4Zal9kig5+tB04yB3X+K1qHC/94Wa5ng+APOvWBTjM0qLgP4KloHZtKSE+NF/ulPNRnHz3Y0e4I7oCBA+OIxi0A4ElbZrVfpVfD71zpoLPbEYM04jghjtibS1LW29URZz3a1aNcPq+T3GsuPl8aIM4Jh2UOLezB4oU0hpjXCOwztA4WRaVLX5uu5omUm6L9ydkj2Wa2yPkk8qu3urHSWpW5+41IQYEWD9zeIRK/4JLHu0mQpgcoJBjDMX/76Ua0AYgdz3jTc1ThQGbejuNuoXL8B45vieis3SdpMEreQleHOxOfWj6SgXhUdMG3+UYa0dJGu0BmgAThGol2TTyOMIvFdQiqU9ckRXneS+rjtOYysLUSd+zhgzV+H273h5DauqdVWkMtR93oAp1s/Ellbh6RYX0pZrsB43LSh96DrAuwHK1QBBa7DAZkvX6KenNDACsJKteOYuIa9EAaBGlgOEPj5OEByZg== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: df886aa5-5f1f-4d93-cacf-08d4976d2bd5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:CY1PR0201MB0730; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0730; 3:LggdyhHCwdTVZ1Tp77OfBQ6jfrnb2q6rYR2MVgPg3u+mzw9BdHEcgFXt8PmfSjJR4OqPETamiHPD9E1az4qXPST0g2IaxHF5CxVcOGe3qfp81bNvgmyWugFOTDVK2Af6jynYiQm4SWj8+bu7atYZuQLtjUHXECWRaJrQ12h39M4mB2I/ktV1nF2PyqDGOs/IV0fxijudrBV2g7VlrdO9T3edBz5iGf8Ph0oiTBweKq2DjcCtBec68n7IGcBt+N2a2EbXvv5Cp90+4XIkzEbmWXFtcQQe/1B/0EulCCY/vV2xixH3xUa5CAlGVXMWVcXsKlpH+VRhHkjv1iUJpTyZdyEAZ2sqZRDc5IVtKevJp4RloY6RroculZIF4U+uqgj256SNf8e3vnsEexL8DnDs6T9B6degV7WIe40QoYR2oPRIkCe6f4dzXxMI9RbfBKJloacqIngHIpNW29Kv03lyh9cTEgyjsh5s1p+7VEW+aDuxF5vkvW77UonEBBTzdI2h X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0730; 25:OzyDPtpZgNdqPb9VXVgzxO9F9PZNl4fZFbI8YeHVI5LnHbgOTMUMARHsRPICgwwUdL9WNiXjOA741jReIag5oY5H55tdIG+l8Woum0MsFYAn25DIwg9mm4mntyGk/+5PcptTxG2ISPC7pv6omgES3mnLZFh//be/hYkvGvmHkoMLylwlpfJhrA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+A3LPiMHNfkzzKRy7uUfah6HjBV3HvApShe8GQOWqvn15r8BBrk2dtlYxdZImkzDKm3mtf2LP7/ECX7Cp1G8 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)(8121501046)(13018025)(13015025)(13017025)(13024025)(13023025)(5005006)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041248)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148); SRVR:CY1PR0201MB0730; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB0730; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0730; 4:0r5SF/xHusu1ehbczaxsYIOw3H9M6i4ToCtK3dBvEn9zyPjPLFGmgWv9znLgkCM6XLzH6uqjCAOTblz1LjbyyNk5qfirBb0+RVK9dzQHgIAgqsikFEug9r2BzXb/BvPKO/FWGgb5VJogmu8rx4GuEAXYHrOG2++nwqIA4NdHXXV7OuSqjX58srcDGF8DRJoFluj9LwZy83OVd0zGpHyP7iAbbj0ITRsmlc9v1qZn35JFuH6wUEMsAshu81YrVAacyn52NkQg1xlMauWY3l5+mNAVeVHV8I8PGRDETmNW1NJhzaCHHVoarqvIRVqRcbdjxIERxXX/BdgQ+ADoCuCr0JnnXh1E8uNSDZ8IBnI7l3Z5A/Aw4lJ0glxJky+/IAvuTQD4gaBvISYdq1d3vQEuc0GuHmHSnyPyTleEIocbeHdw/LNpqE7Yzuwl987TKj8tZey830AJFqJrpa5ITxseNYOOX9fm10u5bc9MElw+QIYohzSv6VG0U565mbrmD55jrq58pbsOOnLoH+dqwk+pPj3nSAWRYKNm5ro+Aqq8vBFiWCeXqhIXw6tN4tQLIVxgGl1PPeegbXqOoD/NN503zbmswRDa0GQx0NxD96qDXDAwujVKqGP5WtEFRZt2ylCWrDum/hEn5i/TYbCCG+mU91Da02quJ6OFTWlNmHdD7d+c3Hx5gbwR9u2fCNc5Je8MtRCSBAYV+BNz1mZj6HtBf/bLYNSXuppSdh6l2RwMWRHN3PiDGiD/6XRxvg1xsJbY5ed8gJdkTkUw3gZyNpnTSSrIPEWdJfZwcLbF5CKbT26eBbs4Z2jjClXwGT6TSx0PULJ+hfNr+THYX0Zxo/iupMuv9hyUMxv8j7X+zuB+rW7vRVExE2zycfbV4y/ubQpsMNw7rDic81D5fSKdbJe+14sTknpJbWJnMF928Xo8 /CvOxoY2BqWChjOP80d9YhIs X-Forefront-PRVS: 03030B9493 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0201MB0730; 23:D8On7h82nQdN3AtpE7wKA9F1lOohxKuemkPd+Sl?= =?us-ascii?Q?GNxUhe7Y28kVO1rmtu13ItTOMxQg4YRDI4KJKtGit+qvomkHDY/z3spFAVJF?= =?us-ascii?Q?oX3vq+9MeMzaT8F+VQxnf6kPpL4RWouBmbeJD2R4Y7xNTneITtNobK/8bnsq?= =?us-ascii?Q?rOYa6Hm7U3iV/3Nn7zieK23PKPoUpdbp0mqh2qxDWpUm8IFlNTQxqAX3LTVV?= =?us-ascii?Q?smKSFUyJYOj+V3ZnZoyT3HsxdK2EwmeITho48zDv6JSI1xLPwzFDLXkNmPsJ?= =?us-ascii?Q?aFr/qcTf2vnHgADO2cUAgfByNUlTSoiy2+pZ8h2xj+9e7L4rHxXGnmmuxGqa?= =?us-ascii?Q?RTJQXshm2K+ead6SQQyld+uEtp3+mynTNXV8+RtrhYWacRCDUfv346vGUhOp?= =?us-ascii?Q?NnC0ZmNeCvoeR2J+K8msNCfTXDhChGeztsWueXTbYCx8FjIKJpkQ7TjzNx00?= =?us-ascii?Q?AX4Zzi/wA/sKpxSNac0Cffd1N4p1tYOibImUA9XqhN5eIq+wZFrSZ9EJtckz?= =?us-ascii?Q?2iNXRypgMGnwFHlGxZH5SZntxXoCu5hV/5BJBMHeOVHkakqrIJdJja5mHYah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QnqXWMVI26m3tWUo1+Iw7WsOJ5nyB/jhc0HmZ048RFQcn2UfJacQKT1oqMgSz/z9sitDvYi+K5Z7ASTLLL6EvcmSAfJTr6rtawajGruvFvlMzg/zT97Tfu4AIqOS/dp1zG3Abs96LtyfB20q03tMNNS3uv84lMEyzOUFf00UMr1ApmINBX75En4rg6392Q=; 5:3qAUUSfUgy20+FUIDzMI4CuP9DFMP9yKkW/Ld3Z8Mqz0zK+0jMDRzKmCxdxVILG1P2K3E6SMEwFKjt/7YuP9Z1tgRljhOrphtHBmEV2W9Kp0J4vWpFN7oEHGmPvYcjShxMhq7AcJ7wkdR4g4y/dh5g==; 24:4Oa488bAaO88t+xt5pCh71/ZrBA14bqhzd+lUn8YYrvIYvfxByHuiF9ejXUV46jQwFBldHwn8tdBt7l/06OZDBQ/PVNka2wQONagSPCTG+o= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0730; 7:/jL1bFIYTfBdUEnEmzuCK2rKwKSVgGm1vhMWoThNUlsbEB+B+mR8pKUFPC4c04bRBqqhIM8j1stUpLqHMAx78iykccOGR5BekSAhdDi5AboAOkv9+XxHmwMm5GcY+xv6SgKIvEUeTmIxcoYcuOuBu7qre0ja53yYIq1t2qxqE6jOejHnu44AzqVW3lhlmrPLU4t3NSqwFnW9G1zbfKLf5h0qVRmZk1y252aMyCAaOPSDHiYCDnCL+rmw5yNdQdJqj+5wDo3dzYUjp9dztwia8td2zw4YhdiOtaQVCBez1/frytEVmGIULLlbhMJJS3PhXmPgqznwuQxG1fzrGgcH/A== X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2017 06:24:10.5155 (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: CY1PR0201MB0730 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 Log the location of the scsi cmds before triggering a reset. This information is useful for debugging. Signed-off-by: Raghava Aditya Renukunta Reviewed-by: David Carroll --- Changes in V2: None drivers/scsi/aacraid/linit.c | 90 ++++++++++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 37 deletions(-) diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index f6a11af..0a8d303 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -624,6 +624,56 @@ static int aac_ioctl(struct scsi_device *sdev, int cmd, void __user * arg) return aac_do_ioctl(dev, cmd, arg); } +static int get_num_of_incomplete_fibs(struct aac_dev *aac) +{ + + unsigned long flags; + struct scsi_device *sdev = NULL; + struct Scsi_Host *shost = aac->scsi_host_ptr; + struct scsi_cmnd *scmnd = NULL; + struct device *ctrl_dev; + + int mlcnt = 0; + int llcnt = 0; + int ehcnt = 0; + int fwcnt = 0; + int krlcnt = 0; + + __shost_for_each_device(sdev, shost) { + spin_lock_irqsave(&sdev->list_lock, flags); + list_for_each_entry(scmnd, &sdev->cmd_list, list) { + switch (scmnd->SCp.phase) { + case AAC_OWNER_FIRMWARE: + fwcnt++; + break; + case AAC_OWNER_ERROR_HANDLER: + ehcnt++; + break; + case AAC_OWNER_LOWLEVEL: + llcnt++; + break; + case AAC_OWNER_MIDLEVEL: + mlcnt++; + break; + default: + krlcnt++; + break; + } + } + spin_unlock_irqrestore(&sdev->list_lock, flags); + } + + ctrl_dev = &aac->pdev->dev; + + dev_info(ctrl_dev, "outstanding cmd: midlevel-%d\n", mlcnt); + dev_info(ctrl_dev, "outstanding cmd: lowlevel-%d\n", llcnt); + dev_info(ctrl_dev, "outstanding cmd: error handler-%d\n", ehcnt); + dev_info(ctrl_dev, "outstanding cmd: firmware-%d\n", fwcnt); + dev_info(ctrl_dev, "outstanding cmd: kernel-%d\n", krlcnt); + + return mlcnt + llcnt + ehcnt + fwcnt; +} + static int aac_eh_abort(struct scsi_cmnd* cmd) { struct scsi_device * dev = cmd->device; @@ -853,8 +903,6 @@ static int aac_eh_reset(struct scsi_cmnd* cmd) pr_err("%s: Host adapter reset request timed out\n", AAC_DRIVERNAME); } else { - struct scsi_cmnd *command; - unsigned long flags; /* Mark the assoc. FIB to not complete, eh handler does this */ for (count = 0; @@ -873,41 +921,9 @@ static int aac_eh_reset(struct scsi_cmnd* cmd) pr_err("%s: Host adapter reset request. SCSI hang ?\n", AAC_DRIVERNAME); - count = aac_check_health(aac); - if (count) - return count; - /* - * Wait for all commands to complete to this specific - * target (block maximum 60 seconds). - */ - for (count = 60; count; --count) { - int active = aac->in_reset; - - if (active == 0) - __shost_for_each_device(dev, host) { - spin_lock_irqsave(&dev->list_lock, flags); - list_for_each_entry(command, &dev->cmd_list, - list) { - if ((command != cmd) && - (command->SCp.phase == - AAC_OWNER_FIRMWARE)) { - active++; - break; - } - } - spin_unlock_irqrestore(&dev->list_lock, flags); - if (active) - break; - - } - /* - * We can exit If all the commands are complete - */ - if (active == 0) - return SUCCESS; - ssleep(1); - } - pr_err("%s: SCSI bus appears hung\n", AAC_DRIVERNAME); + count = get_num_of_incomplete_fibs(aac); + if (count == 0) + return SUCCESS; /* * This adapter needs a blind reset, only do so for