From patchwork Thu Dec 21 17:34:01 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: 10128107 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 2AC7C60390 for ; Thu, 21 Dec 2017 17:35:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1787329CE3 for ; Thu, 21 Dec 2017 17:35:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A4A929D1B; Thu, 21 Dec 2017 17:35:07 +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 4B2D629CE3 for ; Thu, 21 Dec 2017 17:35:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754760AbdLURfE (ORCPT ); Thu, 21 Dec 2017 12:35:04 -0500 Received: from mail-co1nam03on0069.outbound.protection.outlook.com ([104.47.40.69]:36640 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753954AbdLURek (ORCPT ); Thu, 21 Dec 2017 12:34:40 -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=+65ED7fCYrhhwnj617FVy3iFRc4EWLawYXxtqc/dOOI=; b=mYPsScomScB5Zxl2GhuCymyRPmLrpuvruAQOtOQopheqSbZ6bBIf4DEQMXQfWHPgsFsYb3jQrl1FZbbZlFCsbHB8rTBCxUsqoMrbkCf/lrzEVlyRYrMEVOKE8cy5yD5469262YVYXnxpSDQZ/OfAlKd6eFOO9xOuhtkLOlb1UGI= Received: from MWHPR02CA0045.namprd02.prod.outlook.com (10.164.133.34) by BY2PR0201MB1829.namprd02.prod.outlook.com (10.163.75.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Thu, 21 Dec 2017 17:34:37 +0000 Received: from BN1BFFO11FD036.protection.gbl (2a01:111:f400:7c10::1:195) by MWHPR02CA0045.outlook.office365.com (2603:10b6:301:60::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.323.15 via Frontend Transport; Thu, 21 Dec 2017 17:34:36 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; linux.vnet.ibm.com; dkim=none (message not signed) header.d=none; linux.vnet.ibm.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 BN1BFFO11FD036.mail.protection.outlook.com (10.58.144.99) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.302.6 via Frontend Transport; Thu, 21 Dec 2017 17:34:22 +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; Thu, 21 Dec 2017 09:34:23 -0800 From: Raghava Aditya Renukunta To: , , CC: , , , "Guilherme G . Piccoli" Subject: [PATCH 10/29] scsi: aacraid: Change phy luns function to use common bmic function Date: Thu, 21 Dec 2017 09:34:01 -0800 Message-ID: <20171221173420.8213-11-RaghavaAditya.Renukunta@microsemi.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20171221173420.8213-1-RaghavaAditya.Renukunta@microsemi.com> References: <20171221173420.8213-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)(396003)(346002)(39860400002)(376002)(39380400002)(2980300002)(438002)(199004)(189003)(36756003)(76506005)(305945005)(68736007)(1076002)(4326008)(106002)(356003)(5660300001)(59450400001)(53936002)(69596002)(8676002)(57986006)(97736004)(81166006)(575784001)(104016004)(81156014)(2201001)(77096006)(316002)(16586007)(47776003)(110136005)(54906003)(478600001)(72206003)(86362001)(50226002)(2906002)(106466001)(6666003)(8936002)(50466002)(2950100002)(76176011)(48376002)(51416003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0201MB1829; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD036; 1:PFPLn/+D0B0cMCkGKEqBk69MwROGjwaH7UYjAMXgj5c/5H6ACTqdQGkPZXtrBnbKLRN2gs5plsiV72mCVUCma2B1pA4nmB4B4XUTxj5K98BfB9zn+vkDZ8mCk4mxGs1f X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d22170ee-d5e1-4f60-944e-08d5489912d5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4608076)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307)(7153060); SRVR:BY2PR0201MB1829; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1829; 3:0wOGyz4dpYb6k0S5DYTsmCc2RsysxmvS427pocOg48N827VR49PaDAbq+y+1BMB7in+CI+jIxRDQAyqX6hj+2chtfWqnOf5EvsA8lvL57dY8fc17DnkBEb8DxBZOuJ8t64U6C7YVZ5ePdzN7RpLIJw0ydXyIeYDEeJT+2XdPYQyr2FEo421zEzPIXTWQSlDv4atVC9T/GxWdPOJNf0BnsJ0NjDIIGS6plLR5mfMOTr9OMM4hZBML3JfVW6l6F7BshFjvwcDW5KrPs42O8eQu/FQ8EdWxn4WJlAT4Zkvn2EiGAdNwJYa0L0aOKP+pqJwTu+yYWg+mbXyOM4MDVV55OqA3AHnEZmpZyPuqsIMIwuA=; 25:Jl0SVVQNfGvWezV5GEn4lIRk7Z+4S7J2dncs4IFaZVLSjMaefKJuvX0Bp/riGlIyKnIMAXjvGf6WXgaHOfP5bXpynYVxDmZUoqJ02cjoOyLvop2UvD/GUwPjrxU8fhjK8aujWE9egrxODdwuHqz4g61SL9Hw/6eWTzZfr85niOCBG0bC4/vWiemqSYvPFLhwqs6WYRgeFDPsTLmFZ6QwJpjAxnf7uGKJn/v6ue1cl676rehU5NU62+NC3dnaakuU0xvIFVAFCCZkSXVFDVwOCHIWcaTnGG16GP0kei9P1WTM3HDdAR/saNo8SOfAwdSVMdk5OQU0nDfxs3DHxdUdxQ== X-MS-TrafficTypeDiagnostic: BY2PR0201MB1829: X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1829; 31:S7/r6Zn2STMVtzhKuE6VNpaYOQQBa48ag+jqTvTnaSRboYzXSW7+vw7gGS6UK62f+MBs82NbFbXzQsNYtd1rrWrgkJWxqwSh/41ExTe2ZcElXFEIw/Z7XHxXpC09+IwOw2DZQM7/VeSZSGtMgf95KObK/V/BrnZAmsjgZ8fUFI42UkK7H7Iexlt6i8we5Ak8KOycXo5Gs8n1TdRd0EjK01bfz0A3IGURoOadhU539l4=; 20:ezrupR4v9a0Z69tmMoe/OhuadzN0v4SbGC9DuSXcLwbuVCiiuu2zdNqn/SmbjiDt23QJpvSVqF/Nda+UADiKrgeB8aakb28GtUOyxVsw0Mm6S7TcRO8TuSuuHEYTEyxHr0TwFk+J3IE+IW7bEqCHG1TxyuOGMXz4r/MA0rX/fn9gv0m3Ip3U+zNNgwJw8GIvCFQjKEnBVWXRP1uoVCgqbe/pbsds+7yH+tuFMnfPM0pZ08GiWYVYL103ddyDTAVDQvQ0INZgdKCzf9YRLJlqi1K7HpGuZRj/3BJLEcQLhqNcqXNEO1HqMLX8I0JuOGJsxNCUudbsWnf9T1LiAm/hXwm8HkMxMTPFagezkN7g3q7wYEZkaYAq4+3QOkTw8hTXWNv5YCreQ6iD6rVpc4pFJBVk/wpGZ9sVGtc1iMdyOYzpuqz+q31QYvxeUjxC6czPg3ePysl9auFG4yBz/dCBnSCu5aAf5ni12ZXNH5cNFF7ySOmH1rHvU05Vdomj4uBrMDqygznR74DVCUYt3rP4qBz4dJ1Fdet0nGukFfPjKRt36EY4KuikUtrznphgy1egMKI2FYIGiysOsTkdAkYbaQXdzsnjRO4yYDDZ3byYwUQ= 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)(3002001)(3231023)(93006095)(93004095)(10201501046)(6055026)(6041268)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:BY2PR0201MB1829; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BY2PR0201MB1829; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1829; 4:VqwyOR+N10slVSecXtf2+4JXlf/FqxS5YnHKJjz7kj+pzJlO+sUBP7DhTW7EGGnKHv5lj4GPLDpRjppUCWihWCn+3sAkfREpSzVb49IVxrwAZWjOMuKNQnQQMWaaZyyX1v1aHQLczlDIsMT+DLyt0/VipbNBqxZAgsKvyoSX+BaA/3tnrp2mpGbnM9EdyBaj/iGCXpusCbaJRTE25GvF2bgb7gj/yivvRAVcfOUFY4gD/yXLiG5xIZNguk5vauiQaKXr1fWkKdzMa3P25FupH+i+v1AwZemvK7GBKODeEoQmuP8d5Vzfn/0B7tsl+hgKNNn8bjYAs96hJqcFYIm2xPiw0/p8VJgro4vuksk69pw= X-Forefront-PRVS: 0528942FD8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0201MB1829; 23:nBivM9C4Az8xcK1eKzPPMywFEj504LsX0yvBpWL?= =?us-ascii?Q?goq4SLvSryLuJbdsMdqI+3sQJyCiRmpyDsyYAUVPrffk3pVZEk0dGbDiTFa+?= =?us-ascii?Q?wbVcAvweSyBTvmP+XtU3gj+cuI2VfWnt4pZibb0uMWfR7mi3v14P8U666uZJ?= =?us-ascii?Q?bc9ZyhtPCcq8Md26J84r2tdXxhDrvyLeDlK3QZVgTnk/nfZKxZF9SqE8M7tG?= =?us-ascii?Q?XwAwn+IWJ+8Rq+Zf3MtZ9ze3su6hOTuSlflhyab8lalOpiz7+gpnoOgvozuh?= =?us-ascii?Q?Gahyt1c2CpQQ3eNWiiac4PEejlqT1qlt5IBNn5qY6qNjjKsVERN06HTOy8D9?= =?us-ascii?Q?lucSI04M8yhJ2blDmiT6ot73IKy77QONdqL3Wr1UwSZI87wkCVJrZ11r3kZp?= =?us-ascii?Q?gy3ctc3qkzW/XUozXFX5cB7U27UcygfVJSzWpq9aIhYDcO9pVVWNPE1/PIcn?= =?us-ascii?Q?HK6H3WokTwXONjn9V9Gcf7tusQIt4kc+cfO96MFndo8+8Rh5vR0n01HqTG+g?= =?us-ascii?Q?QQhEYYsbLjrPDDWr0eavZ+Muz0ghusHJSuyTYx9BzxkACN2b/VtxzT4HUUKe?= =?us-ascii?Q?LUWMWSJKMcOB89s+lr4pQxPGfJbQl0yJkyaNAhn5SgMJjg3+Bn5TjKftr1uM?= =?us-ascii?Q?SqY2EKVye2ZBMCVq+RMcYg3wwRs5mVmI+NSoJDM3orBuJaHTUOxhQIR443p+?= =?us-ascii?Q?odu1PUsVF55CWRrRFt9CW8HfO5q6gogCCTwN/EFUONr6j/txK211214Wit4S?= =?us-ascii?Q?GnCyApU3EUjAf2JbTIzSZpgIwtjoajr75b95894aYkNuFKxKpqXZezTAruGL?= =?us-ascii?Q?D1kjQ8WA8jxelRxlcon9kdesijkVAp3RFUOzy0lBs2OANr30k8BfU7WFOUxh?= =?us-ascii?Q?cSIQy6PTaJF5hD9WXGW/yay3YpwMQeSjXo9Hf+p+kzAMgmbv0GeNkklO72/5?= =?us-ascii?Q?bzDi9UzH34M+8h12kTUI/peFitkeoXpYDhVdf1ScmSlMy9yfdxUgC0is8bXB?= =?us-ascii?Q?xLasL3/yGIa3jNgU0wMf0WE7aL3ZU1XdLLLgrI0QsSPIquWACeQb60p6Yjp8?= =?us-ascii?Q?/VFprBVDpJp/la1ggK3dmlVqFQnSS7VH1hD4eZXUxt+TnPTY1yvqfG6LfCC4?= =?us-ascii?Q?cv2Z6RWvmLbw36KbV8efJPysu80p5bs6wS0sQrFIlf1bL0g8eY8cTnngJevo?= =?us-ascii?Q?IVx8Qx5voZ2bXKqQdNEOBmCHcSj7ADTBl9S1dS6I+GiGYVALaZhzMaMsztQ?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1829; 6:C2u1MvEOhD7E7WVKkcC654gIP5Hablhq7C5eD1W/Up+tD6ihy+3e+fAjyUjsTDVtoXtW1AzuwKsXFwH+2KX0KWziHMEXF37A7h6unGDgiMOlPZEfpSqHyxfiywoTbH9Sar1EVNqSBschLM7lfshlHpdx8pKZaktq6JM9knI+AM8X4T9/rvLiewoc+r5BHjougCDgqTWfr/CWfdLdN22XCoLJgWe65GcGDc9BRS7azGyr6iT9yQopELdSYgol62b9begUAVdu9UVXzF/ScYsUdlufzPs00I5wKdmjSpYRKP7wjoTtT/69YRJjDeNtGYFjS9/x+4XcWV0kXT2Kb79IGrvyAXiBHYAqg4JaX5S3FoM=; 5:vjjG84/MCgFq0bQdan2ScdWqhZlGcewvj1LgV1hjs2A2K7JfyGyeqf49Jl7DFmjrvqqlZalHhXd1GpiC4Tf3Cs3a2vOZa6kfDJc/zKrP635U7z/8XLxgxBi+v1MS0MT1tHKobc1ObNN1US9I+waqiajUHwvGCj3cwfbhQ33M3GA=; 24:fcXl4AaVAmtWg3eqqHYM3ETczzEzjGN8JFhGRYLmm5mlgQNFRPK7b8xqGuUQp+KxEvCBJJJLHC8ZA716NBJnI2+rl/2VcvCsss70hMaL97Y=; 7:YS0BH6YVJMBchO3YTX+W1zAuSZh34LXNDBRzVGZQ+9G8WL+v/8a2y7aBYh+7adV6/zK4JpqBZL7RG4RR8M3eKF2iwvUtUMjvcYmXP1roZH56eIE94Ah05MbNCfVwc/q3KovB+fjwVyIEL04VBUqrfKqKVNewttg/ARVDOHok2oOuiL9gsb3IEoQzZgJA3zfyPdJaLqHvHRbJVM9zxqhDK448UoR+YO84DRM/FQAW74rLEQ9iunx730Wg8GKlcX8S SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2017 17:34:22.2700 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d22170ee-d5e1-4f60-944e-08d5489912d5 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: BY2PR0201MB1829 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 --- 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 8d119e1..8fb0da7 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -1856,66 +1856,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) { @@ -1923,7 +1894,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; } @@ -2033,7 +2004,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);