From patchwork Wed Dec 27 04:34:31 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: 10133401 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 873B16037D for ; Wed, 27 Dec 2017 04:35:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F23E2D864 for ; Wed, 27 Dec 2017 04:35:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63AB32DA5E; Wed, 27 Dec 2017 04:35:21 +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 C218C2D864 for ; Wed, 27 Dec 2017 04:35:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751816AbdL0EfT (ORCPT ); Tue, 26 Dec 2017 23:35:19 -0500 Received: from mail-by2nam03on0054.outbound.protection.outlook.com ([104.47.42.54]:7488 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751814AbdL0EfM (ORCPT ); Tue, 26 Dec 2017 23:35:12 -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=HnRtp5Onh5KIyZrY3jm/38YrUHUMR2u8ThNNq4GiNUU=; b=SI/OEUGL3xKS++TG35lBuxv270yNDh45YGT/Uq5XvkFij4oYpR2eyUCq371kEd3k0iAG4LfOKQc65rDDayXknsMmDyuj4IDZeUGRPe2MrWDu4HROomNfRah/fKG9uO/OUFkoa504nHuijXwB8Db2rjO0M0jce4r8VLjFfD59LQs= Received: from MWHPR0201CA0047.namprd02.prod.outlook.com (2603:10b6:301:73::24) by DM2PR0201MB0750.namprd02.prod.outlook.com (2a01:111:e400:3c06::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Wed, 27 Dec 2017 04:35:08 +0000 Received: from BL2FFO11FD050.protection.gbl (2a01:111:f400:7c09::115) by MWHPR0201CA0047.outlook.office365.com (2603:10b6:301:73::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.366.8 via Frontend Transport; Wed, 27 Dec 2017 04:35:08 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; wdc.com; dkim=none (message not signed) header.d=none;wdc.com; 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 BL2FFO11FD050.mail.protection.outlook.com (10.173.161.212) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.345.12 via Frontend Transport; Wed, 27 Dec 2017 04:34:48 +0000 Received: from localhost (10.181.72.13) by avsrvexchhts1.microsemi.net (10.100.34.105) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 26 Dec 2017 20:34:55 -0800 From: Raghava Aditya Renukunta To: , , CC: , , , "Guilherme G . Piccoli" , Bart Van Assche Subject: [PATCH v2 10/30] scsi: aacraid: Change phy luns function to use common bmic function Date: Tue, 26 Dec 2017 20:34:31 -0800 Message-ID: <20171227043451.27813-11-RaghavaAditya.Renukunta@microsemi.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20171227043451.27813-1-RaghavaAditya.Renukunta@microsemi.com> References: <20171227043451.27813-1-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)(979002)(376002)(39850400004)(346002)(39380400002)(396003)(2980300002)(438002)(199004)(189003)(57986006)(8936002)(48376002)(50226002)(97736004)(68736007)(104016004)(76176011)(356003)(6666003)(1076002)(50466002)(51416003)(106002)(4326008)(76506005)(2201001)(575784001)(86362001)(77096006)(53936002)(81166006)(106466001)(16586007)(316002)(110136005)(72206003)(69596002)(305945005)(2950100002)(54906003)(2906002)(47776003)(59450400001)(81156014)(478600001)(8676002)(36756003)(5660300001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0201MB0750; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD050; 1:Opz7ivPDlKpXzmV6eQCnx9+YUWATWn7hzlkVNSRYD4epanOvI+4mDBek7spfOQaPqh1NzzdiZM0gdbwpna2BlOocq8WX2D77z5FnDukkHpwssxbavqMfRAx9jlhoTzU9 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cce0e57b-8e02-4b8b-59b4-08d54ce32a2c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(4608076)(2017052603307)(7153060); SRVR:DM2PR0201MB0750; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0750; 3:qFPrpDWt4/NPG8LMu4AMr/uujmKzgU385Aag1Du1GrGCWcR/OYAxeeVbZDGwNhAnz8i/rMCs2xjYTXLRs/HKeFs3bLfEa8YgdDM8OXqlsj6A6GGf8ycRYz2wj/UZOV7XnnWc/WgoIjcmIQa5YZl0JtYhInarkYnaS1rM2QoMrjxf5nVpqAC0/jHE/Q85LS68jKx4lBWE1hl7QpmEDTH5jm/pbRFETYwxtoNxMWR1qY9tuP26fYJQ2b9A9sdUOxIPL6L9kL5GgKQHfKm3gokR+rZKjiynBBDOQPKm95mZNzn41oE7BdxzxEt0sy5H2D3mzLWVHka4j3uY7xwhA3SLZnrKYLWwh0Fr70XaCkKohEs=; 25:hqaPYnTCcRwuKSJktm+I2m/Mq92dSTGdReyvd0E3Kk4FKMOrjrUnpRBtvVAd2vILrkyyq1Bbo9r1V2DP4iCZNF3W3Bmxk5IGHdBDCg9Ma0tgublA/7CmLq4lL+2IMypabifg6cwTNy4PZFb9raB3s6FDcASrY6hZ+op5IVlEJd8ObK8XkQPGhGQEsTKcQXN5XyjxS1sWK8PBYZMF0XCNMEx4V5iv4ZlxkX19/NaYNIcelRfuz1vN/sM3HVjXt/nZCPSvjaI9cJDC/zBFazyu37im5LNKXj15bnDIKfkxxLm8F1g0XV4zvShAU20eCyRLR3PlDznZIB0ApjG/eoe+Ng== X-MS-TrafficTypeDiagnostic: DM2PR0201MB0750: X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0750; 31:tJg5wmG6qsDcJvPUo86ndsJeBF3G+B3xOVhbapvbQHKz18hUWlHmiePPH4P+0aLqdT3LJ0uG2cmk7nh6On2zab2SNV+hhYHoU3bWtL9kiY9KxP9bKOorA/8kGPHTEUM42w5Jq9b7/FGLbfiuC0G9CXnVXH5tjsPfHRgNVk8UCQgzKcbtS+HRRE3x9SzDoNlTzzhg8gNvyNJfw67Jxgvwryx7D+T3HD6UwqSuKjo5si8=; 20:JcEvmcB1OwirZQvab9wmJmpsI6iOpAMHofdN0FvQsdW569f+3BJ5TccwpnFgF8ARC4puH2kLdZaqRzrZowk1A7ZH3bysWfgUOQH4Mm8cX4/biaQnVcKlMpcmH+M+JTnh2ykaXwiExoYivF1WE0RCIBtmIjpppipPMaVWpU/xsTcmqkjNjCe/HTxLz7ZQHJpFQF5903hOsyJqzzlHIX1+4RsK4djZ/vAD84pDZo3/au8rkJI4TcLTGtpNkN5X0u+h95DlLsIXBPrSe8Y7ap+ORNwNUeVsf0/CR8rN2gXr0sa9jG6lzmYxwjMGBl3sjjkZ5M0X6bN3NRLEG3XCUbX/MqLq3AfJ/uciVxi7Qo+W+57aYSyesHe8DG2O6JD4AT0po7/rTewy16b216y1Z7DLemtmBdb40wg2kFqyNb2mV4lsQiKpp6UiWrgYJ3jVyJg33yb1koTYybZXkArN24V+Ohv3TCnxkVXapr4lkDdM4vY6+KKeymeNuHuLy8dEXsxfYprjgLL9NXZ5BjvaRemJSPFnNxD5SxxPsR2A2VfGmeZqC76y79PE9RFCj5dsr+9pDos+rhjz17dxeyt04pA9XNN6pK865jO35Fk0T5CGVrU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(72170198267865)(211171220733660); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3231023)(944501075)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041268)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM2PR0201MB0750; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM2PR0201MB0750; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0750; 4:Zc0J8F4t8sX7pUbfiS71c4fgXtTaqy27Uc8VlpPGkeD1H5K/9B6AuCqkU4DjkKXPuROEZ/JuxKhUqClcATGH28qVa9qlBkBepyChuCZLuLOKR3VsDIU9e+v2/nLaziKQOnEZhZnhd/XXYJghnQawkPhwEhTjhhMOsyt1qP/zE0sGRTfDvwOYIg9XuvPJJfhOyh/MSraji/uyVqf4OgiHxp5TS56cx8gRfldkMzgxQJ6OPBrmWgEIgyvrZ1iusirwQk4PbsyHq7KDxEZUZkc5nBiTQsaNy0XS9pQVrNDNzx+UQECdbRXK3H6Wz32UElM61OqliXww6xSXnbXNXHCdtqKO6nDUH7G1kFgugPNjR3Y= X-Forefront-PRVS: 0534947130 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0201MB0750; 23:8kW6kXpw3X/jO31eSRCa+8Vo1GgFAAsARVEsZoY?= =?us-ascii?Q?Bd7Sm0e4itBdfDap05UB/SJK6xHNHr2Tqta0YobJqZbCm9z91OckWaYHLhhC?= =?us-ascii?Q?51BTXGpTV3xi8J8ozJr1u70wzBsXSpKWevow0s3ft28biOGtV7NG/SLDujhB?= =?us-ascii?Q?wRq8wV5N71cw38zRq/mmFnPadwHRye87K1fQQQ4A3RrrMoe/zD0vjKeltXjz?= =?us-ascii?Q?5iOjPPoKAFZXN50X400XGw1ldQmB35RSEVjS9Dq0CEt+zcB5I4D7IBXPzN7h?= =?us-ascii?Q?G3cPv7vUZop5pqYUFdTpcW47pOsfrAl8kTwqrNobrZzxSR39qNxz/8VfzQ9c?= =?us-ascii?Q?eLbb3F+S2gAiM/qWpvA0ESRdLRSwz6pXYpfNNoDKkEgoEFtC7JpZYiv7fWcw?= =?us-ascii?Q?uVgD3ZNhOmvQl7spGT83R9DUUO6bKHa/GmsrpOPxjFjHLTbEMZWnh0NpGtZ3?= =?us-ascii?Q?uUIWNbIG4n8xnEBdfQQ75dIuFWqjhPjgiv22VHk7AeZ8bo9njwSlXPEzZCvh?= =?us-ascii?Q?JNHKhJj0aLDeZGreViYlEl1ndD62FJMlq5aIdWslMGLGmMxHFN+YoE6ny/VP?= =?us-ascii?Q?BI/2NYgFcmNnSIkvTWUmrbY/bLgZh/hsnoHPK4D0zNIencgPbUgMUHuvvWc8?= =?us-ascii?Q?NRl6uEaIGeKKQMaHaQMy/WyzY5bgut67Pi+P5EtVzjKfD3/dahxmhi3goFQm?= =?us-ascii?Q?AEOj3yqQOMIp7f88GWC2Lgn6fWuPlE3CLUzGfmpaLAnVkuiSxd81CcmVzV/t?= =?us-ascii?Q?2sJueOsiPeLjbI471/+eXXRi6GuvUHCnFxhyFFOBQwim6w70BZWZEKmABL2m?= =?us-ascii?Q?3S79uyo+FcWg1YVQ/JST4nFSc5RaK2nqQcrl+GZkqf8Bntw3T+etjhS/8frt?= =?us-ascii?Q?Nsn1W99w2xDn8QQnFR1WefGnXbl6e+8kBJvcPsL89OFtWXPfqHEzeUFuZSW0?= =?us-ascii?Q?QnpkozaX1TeP/QBGNVQ/dod+N3suW28BxyvkuTmyUTBqkEKZibabJyltT1f4?= =?us-ascii?Q?l6tZIbI4OVdMI4208rurOAUrVdi4nX9xOUwKmeATkUw7RzjGWkj1duhCmqkb?= =?us-ascii?Q?pbCh/48ahFYsBz9AUbQAj5ZiET8t62sF7/0mUPcXMZ3y2068fXEP9YoTZKYl?= =?us-ascii?Q?N/bnY2ll1sn29qTu8/PFcyr05TMoe7eObU27ifa6cP0wsXh+Mb4ru3pLf8q4?= =?us-ascii?Q?PWDcIhm7fmf55Hr6uvsdxlmurTfZh3mT7fzl36LZ7ZHJ24acOLtvBO4k0hw?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0750; 6:r6sutA1bFA99ypTppTxn2653jkrq7+u6y4JF1L4wSarc3SXi5hZ0WwB5Aab4l3X8KgEQ2PM3bsvI13IFQDpdQdTjfB3eA8ozYPbAHrGGKsnveFaI64Sqaw6KbA/wNJfomRm03N3yhlY6WR37yzK7eyCtLKMx4DvtninZOF7sLCM4jow/3Myupmm+NVLMOLEj8aerM1I1EBNHAbgzW1EkzFBbozqjMMx9eo1+rzcGbPFdxukZ/D/8VDovi1GlnFSB10ZaQDXWOCjPPmA6612+sppFylsXigouq22ZLefZehQ6ma+zcsWzpjnoL2MeDTPUUqQk9KyDovey43Q9+ZZARduUUC4N7h4C2Z2Ifnq7Pag=; 5:SAQGCg3YPHQcG7ohMMe5v7P6FVi6NFVsqmXVpYRdtBpEYxDV8E43zE6qS9BnkivCsllI0OIJIlSONICiWBNngyVt+1A48z4uQv73E006yUDXDVzrPI3hqa998+ZNNW9tCrZyWJZJWPUAg//yqqluByYe6kaJ1zgjtjw74/ufLaY=; 24:glmfBvBnPrGCKOqMt8u9Hcr3PYkUiGiLl03glSNV2JpHvTpCz6rSLNYLglfGXragGXaddrCIsESopSrHOHW/s5fZTsVcA3Qe0oajvwMWDA8=; 7:AHRqCJ9jJk2qWMH4oh8W9LxFtNEfxPRd7/gtb4+oJ/UjiiepRgbKAQhneJw4yVNNZh+fW7aHeOXITKkOQ+X0k1wYoOExy3DNwpzz69RnPySg9m6qudgW4lWyoq0kG2bkNRnGpqoU7pzEjTQfBHyfrpfsCyhz1R3xJ0AtYhg4aI6lNOGB238w+i1vAvkNiB4lD/UQYgteoPc2BfOnJNIt1M5imqEU/7d3vcuQtCek4dMdiHhZDo3AO7zRHCfBlWnd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2017 04:34:48.8354 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cce0e57b-8e02-4b8b-59b4-08d54ce32a2c 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: DM2PR0201MB0750 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 Edit function that retrieves phy lun information to use common bmic function Signed-off-by: Raghava Aditya Renukunta --- Changes in V2: Added missing colon to match kernel coding style drivers/scsi/aacraid/aachba.c | 75 +++++++++++++----------------------------- drivers/scsi/aacraid/aacraid.h | 2 +- drivers/scsi/aacraid/commsup.c | 11 +------ 3 files changed, 25 insertions(+), 63 deletions(-) diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index e02158d..1853bd2 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -1853,66 +1853,37 @@ void aac_update_hba_map(struct aac_dev *dev, /** * aac_report_phys_luns() Process topology change * @dev: aac_dev structure - * @fibptr: fib pointer + * @rescan: Indicates rescan * * Execute a CISS REPORT PHYS LUNS and process the results into * the current hba_map. */ -int aac_report_phys_luns(struct aac_dev *dev, struct fib *fibptr, int rescan) +int aac_report_phys_luns(struct aac_dev *dev, int rescan) { - int fibsize, datasize; - struct aac_ciss_phys_luns_resp *phys_luns; + int rcode = -ENOMEM; + int datasize; struct aac_srb *srbcmd; - struct sgmap64 *sg64; - dma_addr_t addr; - u32 vbus, vid; - int rcode = 0; - - /* Thor SA Firmware -> CISS_REPORT_PHYSICAL_LUNS */ - fibsize = sizeof(struct aac_srb) - sizeof(struct sgentry) - + sizeof(struct sgentry64); - datasize = sizeof(struct aac_ciss_phys_luns_resp) - + (AAC_MAX_TARGETS - 1) * sizeof(struct _ciss_lun); - - phys_luns = dma_alloc_coherent(&dev->pdev->dev, datasize, &addr, - GFP_KERNEL); - if (phys_luns == NULL) { - rcode = -ENOMEM; - goto err_out; - } - - vbus = (u32) le16_to_cpu( - dev->supplement_adapter_info.virt_device_bus); - vid = (u32) le16_to_cpu( - dev->supplement_adapter_info.virt_device_target); - - aac_fib_init(fibptr); + struct aac_srb_unit srbu; + struct aac_ciss_phys_luns_resp *phys_luns; - srbcmd = (struct aac_srb *) fib_data(fibptr); - srbcmd->function = cpu_to_le32(SRBF_ExecuteScsi); - srbcmd->channel = cpu_to_le32(vbus); - srbcmd->id = cpu_to_le32(vid); - srbcmd->lun = 0; - srbcmd->flags = cpu_to_le32(SRB_DataIn); - srbcmd->timeout = cpu_to_le32(10); - srbcmd->retry_limit = 0; - srbcmd->cdb_size = cpu_to_le32(12); - srbcmd->count = cpu_to_le32(datasize); + datasize = sizeof(struct aac_ciss_phys_luns_resp) + + (AAC_MAX_TARGETS - 1) * sizeof(struct _ciss_lun); + phys_luns = kmalloc(datasize, GFP_KERNEL); + if (phys_luns == NULL) + goto err_out; - memset(srbcmd->cdb, 0, sizeof(srbcmd->cdb)); - srbcmd->cdb[0] = CISS_REPORT_PHYSICAL_LUNS; - srbcmd->cdb[1] = 2; /* extended reporting */ - srbcmd->cdb[8] = (u8)(datasize >> 8); - srbcmd->cdb[9] = (u8)(datasize); + memset(&srbu, 0, sizeof(struct aac_srb_unit)); - sg64 = (struct sgmap64 *) &srbcmd->sg; - sg64->count = cpu_to_le32(1); - sg64->sg[0].addr[1] = cpu_to_le32(upper_32_bits(addr)); - sg64->sg[0].addr[0] = cpu_to_le32(lower_32_bits(addr)); - sg64->sg[0].count = cpu_to_le32(datasize); + srbcmd = &srbu.srb; + srbcmd->flags = cpu_to_le32(SRB_DataIn); + srbcmd->cdb[0] = CISS_REPORT_PHYSICAL_LUNS; + srbcmd->cdb[1] = 2; /* extended reporting */ + srbcmd->cdb[8] = (u8)(datasize >> 8); + srbcmd->cdb[9] = (u8)(datasize); - rcode = aac_fib_send(ScsiPortCommand64, fibptr, fibsize, - FsaNormal, 1, 1, NULL, NULL); + rcode = aac_send_safw_bmic_cmd(dev, &srbu, phys_luns, datasize); + if (unlikely(rcode < 0)) + goto err_out; /* analyse data */ if (rcode >= 0 && phys_luns->resp_flag == 2) { @@ -1920,7 +1891,7 @@ int aac_report_phys_luns(struct aac_dev *dev, struct fib *fibptr, int rescan) aac_update_hba_map(dev, phys_luns, rescan); } - dma_free_coherent(&dev->pdev->dev, datasize, phys_luns, addr); + kfree(phys_luns); err_out: return rcode; } @@ -2030,7 +2001,7 @@ int aac_get_adapter_info(struct aac_dev* dev) if (!dev->sync_mode && dev->sa_firmware && dev->supplement_adapter_info.virt_device_bus != 0xffff) { /* Thor SA Firmware -> CISS_REPORT_PHYSICAL_LUNS */ - rcode = aac_report_phys_luns(dev, fibptr, AAC_INIT); + rcode = aac_report_phys_luns(dev, AAC_INIT); } if (!dev->in_reset) { diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index bc2a0bc..3a20168 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -2639,7 +2639,7 @@ static inline int aac_adapter_check_health(struct aac_dev *dev) int aac_acquire_irq(struct aac_dev *dev); void aac_free_irq(struct aac_dev *dev); -int aac_report_phys_luns(struct aac_dev *dev, struct fib *fibptr, int rescan); +int aac_report_phys_luns(struct aac_dev *dev, int rescan); const char *aac_driverinfo(struct Scsi_Host *); void aac_fib_vector_assign(struct aac_dev *dev); struct fib *aac_fib_alloc(struct aac_dev *dev); diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 9840bd3..f70f112 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -1919,7 +1919,6 @@ static void aac_handle_sa_aif(struct aac_dev *dev, struct fib *fibptr) { int i, bus, target, container, rcode = 0; u32 events = 0; - struct fib *fib; struct scsi_device *sdev; if (fibptr->hbacmd_size & SA_AIF_HOTPLUG) @@ -1942,19 +1941,11 @@ static void aac_handle_sa_aif(struct aac_dev *dev, struct fib *fibptr) case SA_AIF_LDEV_CHANGE: case SA_AIF_BPCFG_CHANGE: - fib = aac_fib_alloc(dev); - if (!fib) { - pr_err("aac_handle_sa_aif: out of memory\n"); - return; - } for (bus = 0; bus < AAC_MAX_BUSES; bus++) for (target = 0; target < AAC_MAX_TARGETS; target++) dev->hba_map[bus][target].new_devtype = 0; - rcode = aac_report_phys_luns(dev, fib, AAC_RESCAN); - - if (rcode != -ERESTARTSYS) - aac_fib_free(fib); + rcode = aac_report_phys_luns(dev, AAC_RESCAN); aac_resolve_luns(dev);