Message ID | 20180207164058.29598-4-RaghavaAditya.Renukunta@microsemi.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show
Return-Path: <linux-scsi-owner@kernel.org> 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 E2AA8602D8 for <patchwork-linux-scsi@patchwork.kernel.org>; Wed, 7 Feb 2018 16:42:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EADF204BA for <patchwork-linux-scsi@patchwork.kernel.org>; Wed, 7 Feb 2018 16:42:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D22928639; Wed, 7 Feb 2018 16:42:25 +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.9 required=2.0 tests=BAYES_00,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 909E22909F for <patchwork-linux-scsi@patchwork.kernel.org>; Wed, 7 Feb 2018 16:41:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754403AbeBGQlU (ORCPT <rfc822;patchwork-linux-scsi@patchwork.kernel.org>); Wed, 7 Feb 2018 11:41:20 -0500 Received: from mail-cys01nam02on0053.outbound.protection.outlook.com ([104.47.37.53]:50906 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754546AbeBGQlR (ORCPT <rfc822;linux-scsi@vger.kernel.org>); Wed, 7 Feb 2018 11:41:17 -0500 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=HtjpRt1zlkmgKz2gmJrbZ8Yc0NRsdfT1PJtFPXsmOlQ=; b=RkeIGTxMQxfuSZybO5zUKYRxEFIWAQknIqEpeUuRg+gwJ1yOPi81o0h/LUl+MROC84ekh/wAI47UaPEbub8+5Csljj9R2UWTOgCQVrto/22ZOCUE/kGKNMoHqwqIJwGbkkUkk17QHSae4yNcWyZTqHLs/upjFfnHuB7JR6DeqJE= Received: from MWHPR0201CA0083.namprd02.prod.outlook.com (10.167.161.24) by CY1PR0201MB1836.namprd02.prod.outlook.com (10.163.55.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Wed, 7 Feb 2018 16:41:15 +0000 Received: from BN1AFFO11FD018.protection.gbl (2a01:111:f400:7c10::160) by MWHPR0201CA0083.outlook.office365.com (2603:10b6:301:75::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.485.10 via Frontend Transport; Wed, 7 Feb 2018 16:41:15 +0000 Authentication-Results: spf=pass (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=bestguesspass action=none header.from=microsemi.com; Received-SPF: Pass (protection.outlook.com: domain of microsemi.com designates 208.19.100.21 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.21; helo=avsrvexchhts1.microsemi.net; Received: from avsrvexchhts1.microsemi.net (208.19.100.21) by BN1AFFO11FD018.mail.protection.outlook.com (10.58.52.78) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.464.8 via Frontend Transport; Wed, 7 Feb 2018 16:41:14 +0000 Received: from localhost (10.181.117.15) by avsrvexchhts1.microsemi.net (10.100.34.105) with Microsoft SMTP Server id 14.3.361.1; Wed, 7 Feb 2018 08:40:59 -0800 From: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> To: <jejb@linux.vnet.ibm.com>, <martin.petersen@oracle.com>, <linux-scsi@vger.kernel.org> CC: <Scott.Benesh@microsemi.com>, <esc-teamarcdriversvl@microsemi.com> Subject: [PATCH v2 3/3] scsi: aacraid: Auto detect INTx or MSIx mode during sync cmd processing Date: Wed, 7 Feb 2018 08:40:58 -0800 Message-ID: <20180207164058.29598-4-RaghavaAditya.Renukunta@microsemi.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20180207164058.29598-1-RaghavaAditya.Renukunta@microsemi.com> References: <20180207164058.29598-1-RaghavaAditya.Renukunta@microsemi.com> MIME-Version: 1.0 Content-Type: text/plain 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)(39380400002)(39860400002)(376002)(396003)(346002)(2980300002)(438002)(199004)(189003)(68736007)(50466002)(48376002)(4326008)(104016004)(69596002)(478600001)(47776003)(76176011)(316002)(76506005)(57986006)(2201001)(110136005)(16586007)(107886003)(106002)(8676002)(356003)(97736004)(51416003)(305945005)(54906003)(5660300001)(86362001)(106466001)(2950100002)(336011)(26005)(77096007)(186003)(50226002)(36756003)(8936002)(2906002)(81156014)(81166006)(59450400001)(53936002)(1076002)(72206003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB1836; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD018; 1:bbjI3EXPT4vD+jDBqAY6VBujqjcmgFdFOKzgH1oehV4MMoZ53lZjFZuKPfSuOEgPnZxYePF0wKA51QWMyi392kaEzk0WO/2bsNVthwg4kqZUgtOvDuTdEMmV0kyifre/ X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4b5cdf3b-fc70-4e24-a82f-08d56e499ac8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(4608076)(2017052603307)(7153060); SRVR:CY1PR0201MB1836; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1836; 3:r17GQrqI8iBAtf5TguW+lalMzReO0Hai20XRvnBnfMJf7/XcAe6WiK2ulb5KeGz/t3+Hn9CKx7pgaZmSYm3kMOFFhKQ4LHkdvpJWl7gFAiGJ1eWH2CgXnEKVbhFx5jFy+T77GpdLDYd+4AA5F+MzOxrz4no6Dm70j6M8KRDzKIfKVjXux9CGg8kiIae8zRSDVn55LvdvqPp0jyEcVSb+pa8aOpjybga4k5h2w//JEg5fbAg/tA2o/yeO6a8U3AO1Z1qAdwE1utH12WwfyUTL4xUCvw8WktmwP6PSIy1bbS21D1tjhAi5sWfZR26OFxJBQ+VfcePyXi42J/VYQwtJ79KSr3Mm1YHFz5sg0swbfYY=; 25:+BZyFriMlv73NUTRqlN/Hz+R8pv4d6zACybGDK9zbDMRSexUWQ8JiBV2mhc3ZcRskpUMqTpOyAh7yZYHT+IZdJjAkVKIvuv2SIezmFtjyGgFPixKA/fXx/l7IjPiSwVXg73/owcCCOV36h+05D0JzStCyPmmqsuOsN4hyIxRRDbZe4Wy69oTTjXy04MbpzJ9V6XGXg7Bn74LwCsIA71VdpWi5UoqZikBiO+Jb/PSIuU0zsoHhVBfvUhdPRkxJ/GjS9SJn87FOkhSuYrrIVJaOc6R3IyIwobA3+i1Xhy/hvu3TKUHn7r2f+YBk3QCkXGfGECvEmBihC08nse40UspOg== X-MS-TrafficTypeDiagnostic: CY1PR0201MB1836: X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1836; 31:i0E8YQRdVyeTpd0f0H83rThgexoNQeTm93GjnmAyZa0jgtkdrkzPV2n8VZuefbeUeMpVyKbJN8x5hJSqhEHtNBaCYA+c0sLAo3hiY1RW95GVWn4Idp0pGWmW7ws0FCISPEn39MvXojsmgpc7Tf7rt69aNgoUv+On20Ec2e1d87btiV4LQkJoSSAY6OGdAVRB4WzCg2tePUmDZLdDIj8Uc1KqeI/WMoW0tRqcBOiCs+A=; 20:PAmsrbrBkmwhr6Z03aVTOV3obQNSFNJF5gMeNBnHKiIKmJlGvu/UNFvZmcCRbtTj0cudXN/gLnU9IZrzGoe2xDTP2GUMnDXMz0TCOTuV09WNpn1V3C0bajgXHfTpXPg85JRoAyeBm5aVPah8JW3GNMoYPX2TRytSFN9M7xkZHO+WHXtOGz1gwblHvnprqsUL+hHr8bsbJ1PmQRwhVSZywKuRJVX3OtTzWzCyioOA1bwDWvf9VdAXjoZuCkVxL+fdeqaAm3Yny387wtKypE4CzkgvNlLX+1GUTDWk0mBMCI+8BYSfJnIyQ5jntTipnckjHOnkYd9U9mkdnwDPd4QPmbiPPVpM6R2RjxHGSFexsaVuLMv3/XUT9B/ckfYk8cDQMJMdEsJBTWqShqZnDbMa6+m15ZohTnKAo1vt1rD4pMFG3fVZg8CJcMgvAOvRyPznKjt9LqtVq6ij4yCW2FNTBPujBqJF/SsOTxhXeOaQJBAlzybW6lLCDxFpU3zOXSDm+jz5dUaK5ouj1j/2pR5IV6v9x2oOZF/Kx5ZeXGIGkLZrXXQn5Z30KHbiiu0S6X7usXnXL1kyE6MuCsUMylvp7HGGSBELAPoa59qUlQUM2ro= X-Microsoft-Antispam-PRVS: <CY1PR0201MB18366A42161B375B27B263A2F0FC0@CY1PR0201MB1836.namprd02.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(72170198267865); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(10201501046)(3231101)(2400082)(944501161)(3002001)(93006095)(93004095)(6055026)(6041288)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:CY1PR0201MB1836; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB1836; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1836; 4:8VQLMqWHFVmrKMI8znoru0os18iLXoUIqLYV2Ln6R9pEnH7ltoIrcjUietyLdJiPGAxMdOwoyzOw4oRk0ulbbKl0GEooJQiov9Atr6ohuIa29Q6DD4nxFa35riLmAEOfvKH5K1CKVAWRGmbM5nku1yHplrV+WzH4ljlykN2Y2o8nrugJ8t4lV36vBZ61hVEx0WeiNddeUAe4gkf127w2PNzrP36EVw1FA6OFLFe0auTPE6a9kS30vYtOoXi1LOqqCPdOkERBDDDeLKIPe3WP3oruq5Fvk0856xmcLVYljRcYnIN0eQ3pqcVRk+nJIdJC X-Forefront-PRVS: 0576145E86 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0201MB1836; 23:djrc0eIM9rCq26Dy8bSXujdZW7vLXx+AgHN24KS?= =?us-ascii?Q?UmEqo0QGqMkHIjvjVw104lq9tj8aTgbPmnCs8Ud6O4YT1y5vflj//fpbtiYz?= =?us-ascii?Q?Antj2nw2AjSpq4bcao/vUubT6BTXb5wSX+nqwZgMCtX7GB13Y0BV1IqC5wMa?= =?us-ascii?Q?onwOF+qyPYho/MLRFNhCIvqgJxzKgOuYjIHqWjvu6SOocffDi5Thwqajy9x2?= =?us-ascii?Q?ecp0HP1s7Tcao9xCwGmsAgYnWjirxNm9k3T1Q0ZoKkaFdycK0kvx1/0WZLfP?= =?us-ascii?Q?+PC5JQxxM3sYp4s50zOjQZBW5dQ4oH+y9koTAFmvmmLum7GWb9IwJTfRxZh7?= =?us-ascii?Q?3SBJKaHcv2Wpp72oax75eeKixVy9oZvcmpjy7prCG28bqzn9YRa+UjeZd6tH?= =?us-ascii?Q?poeoPyayQbkQmViYQozgO+swUA/MfCyD3aoB1s/tYZKPGsVDlBQfz12USSkA?= =?us-ascii?Q?I6FulTVS4r84w1MY2HM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BGb3i2H7iVnWQwiFJtgpB5FYXDQ1cwHGNYDeESU1Y+VpyMSO5W51TUuWg4fXqqvGFP+5KMPYJ3kG0BXdnuNYkXm2d4QfRE1Eg0uxTu/9Hc9369B1mIEtn3738Lrh6N8rUE/oiGgj6laxqSfRgsG8Kp7DegOXRFGnTDhqrd/qz8REicyMfCBODLoQ5VyRPl0XIY=; 5:8pz1DzhqhHoVASAsokiNMBrElqdkkuy/6U/pDsvdhIw5wWcOJ/L/vRTkHU5AZxv92RlPnD61irV4wqOpRW38WfDOpHGEExH39KrYvUGrMu7QVEEipX++r6uQ/3TDHzn4gf2xLmq2tzK6qRm7/Tk+HFY7PAhgru3QFeTnpxVitEg=; 24:SRBdDT8MorjRJ+3PQEVQ6Xy1KmoZxiZaFbJ5uJaKPUpHAbFogoiWuCeej+GjyGYXJIBQN6LdFMqVNpEluRxlMNNQuuJP2+U1XArnlJg9tfU=; 7:/uF+i/y0XCEA8lCE1tF4MVgsBpO3P8KyaFQb44jiboMFzQhO4hDlFpxUg6D5jKw/YiwNBTm2Dzi5YEaTbBLZNLlP0DKIsaWAQckp8ReynUaPgJ6XbPVr9w9QkfNcvO9ymtKO9gLw5vaYrFNLQU0f9G0mpLGjUJiChs9dQhpV248fTjjBZGKR4kX3oIu/oAFfNOX94ArmUBj8esnqchUEeb6Gky+pen8LzYWV1SiX6xmBd0DH2rsJQdYUN1O9n9xm SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2018 16:41:14.7870 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4b5cdf3b-fc70-4e24-a82f-08d56e499ac8 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: CY1PR0201MB1836 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: <linux-scsi.vger.kernel.org> X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index c3fdec9..29bf1e6 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -1231,6 +1231,7 @@ struct src_registers { #define SRC_ODR_SHIFT 12 #define SRC_IDR_SHIFT 9 +#define SRC_MSI_READ_MASK 0x1000 typedef void (*fib_callback)(void *ctxt, struct fib *fibctx); diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c index 09b82d3..3122389f 100644 --- a/drivers/scsi/aacraid/src.c +++ b/drivers/scsi/aacraid/src.c @@ -1405,13 +1405,23 @@ void aac_src_access_devreg(struct aac_dev *dev, int mode) static int aac_src_get_sync_status(struct aac_dev *dev) { + int msix_val = 0; + int legacy_val = 0; - int val; + msix_val = src_readl(dev, MUnit.ODR_MSI) & SRC_MSI_READ_MASK ? 1 : 0; - if (dev->msi_enabled) - val = src_readl(dev, MUnit.ODR_MSI) & 0x1000 ? 1 : 0; - else - val = src_readl(dev, MUnit.ODR_R) >> SRC_ODR_SHIFT; + if (!dev->msi_enabled) { + /* + * if Legacy int status indicates cmd is not complete + * sample MSIx register to see if it indiactes cmd complete, + * if yes set the controller in MSIx mode and consider cmd + * completed + */ + legacy_val = src_readl(dev, MUnit.ODR_R) >> SRC_ODR_SHIFT; + if (!(legacy_val & 1) && msix_val) + dev->msi_enabled = 1; + return legacy_val; + } - return val; + return msix_val; }