From patchwork Fri Oct 20 21:51:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10021003 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 4680C60234 for ; Fri, 20 Oct 2017 21:51:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34F6B28F67 for ; Fri, 20 Oct 2017 21:51:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2966828F6C; Fri, 20 Oct 2017 21:51: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=-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 530EB28F67 for ; Fri, 20 Oct 2017 21:51:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753461AbdJTVvR (ORCPT ); Fri, 20 Oct 2017 17:51:17 -0400 Received: from mail-sn1nam02on0065.outbound.protection.outlook.com ([104.47.36.65]:43328 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753448AbdJTVvN (ORCPT ); Fri, 20 Oct 2017 17:51: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=A4/dlz1WWiG5lq5kfkLyS5AwuoNo5DIo7KoCQBOyjEw=; b=RPR/fvWJA4y7QsH4vdT/oN3pI1F0nLEVVXrsSC9x4Rt70tQJUoEFbu+i0L1Nh3zwYra2mQHE0AeSuT+pN0SazDr0ICKusgt8fbx6473nsZwXvR4V+MS7+PTfVtqiH9i2lfaUJ81esMRsg4gvbjh8PahedlPovQSBuEp/JL/KrRo= Received: from BLUPR0201CA0025.namprd02.prod.outlook.com (10.163.116.35) by CY1PR0201MB1835.namprd02.prod.outlook.com (10.163.55.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Fri, 20 Oct 2017 21:51:10 +0000 Received: from BY2FFO11FD023.protection.gbl (2a01:111:f400:7c0c::186) by BLUPR0201CA0025.outlook.office365.com (2a01:111:e400:52e7::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.156.4 via Frontend Transport; Fri, 20 Oct 2017 21:51:10 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; suse.com; dkim=none (message not signed) header.d=none;suse.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 BY2FFO11FD023.mail.protection.outlook.com (10.1.15.212) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.77.10 via Frontend Transport; Fri, 20 Oct 2017 21:51:10 +0000 Received: from [127.0.1.1] (10.238.32.34) by avsrvexchhts1.microsemi.net (10.100.34.105) with Microsoft SMTP Server id 14.3.361.1; Fri, 20 Oct 2017 14:51:09 -0700 Subject: [PATCH 01/12] hpsa: destroy sas transport properties before scsi_host From: Don Brace To: , , , , , , , , , , CC: Date: Fri, 20 Oct 2017 16:51:08 -0500 Message-ID: <150853626812.28275.3467395264226426125.stgit@brunhilda> In-Reply-To: <150853443786.28275.17878578984391668998.stgit@brunhilda> References: <150853443786.28275.17878578984391668998.stgit@brunhilda> User-Agent: StGit/0.17.1-dirty 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)(7916004)(39860400002)(346002)(376002)(2980300002)(438002)(189002)(199003)(106466001)(53936002)(2950100002)(76176999)(5660300001)(356003)(81166006)(54356999)(50986999)(81156014)(68736007)(103116003)(8676002)(97736004)(33716001)(83506002)(47776003)(478600001)(230700001)(966005)(23676002)(58126008)(2906002)(104016004)(86362001)(110136005)(50466002)(33646002)(69596002)(4326008)(6306002)(106002)(77096006)(189998001)(9686003)(2201001)(8936002)(316002)(305945005)(16576012)(921003)(2101003)(83996005)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB1835; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD023; 1:G6PHl0j2tNzTBAa7aE4ZG7MYiIEV7F3+vUkBBs/DJJnCt5KSIAqwx4gpu5RE95XUEeDf1E5rfSob76AlPJxtsggIXsxhEDsKw6+PQ4EEKUqeXZO2OcAHmgwA6cu39KIe X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fff853c2-984e-4847-e9e2-08d51804acf6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199); SRVR:CY1PR0201MB1835; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1835; 3:cognPvyCogqwnRWxXVxYroayCE3IYcanxEsG5cIKzziF6FVW2UfHmR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WIR6gbyUmJUTSlzth6DR4+5E0usrwc+pxjp9JwE9hnwUh1jm0U5Y8Y97ruOkfGVF9GBRSUks/bnQBGSc12k/3xRfmG39uD7EBNGduAH8exM8TeKMwaumsB7hCR6Xxp3U/0Mc2c49xm1nlqCIdCmjjyiEuuk6oMHqeZtwMrwnRpi4e9I2KTo7djXIdkdOvm3W9friOMCSHbrKDmN/vYBYs++d4P414eOGnlnSxA4mNFkWCukN9DYS6Q6AZfTmJHAdwhzvxYj2OHbyJsZiKLHYFUgUdEMqRMFY5LGb4CAk5LZigL0VUWwDy9HeiyoaKVpdLnpMfEnZMl63SpE1QqnaLr397LbeoBgjBAeqr18zeajOcERyxOUD5eY/G2FfKIX1Zh6gPK X-Exchange-Antispam-Report-Test: UriScan:(72170198267865); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(93006095)(93004095)(10201501046)(3231020)(100000703101)(100105400095)(6055026)(6041248)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR0201MB1835; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR0201MB1835; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1835; 4:1onHibb9disBsYt0/faoLHmbshClbBtrdBqLdTG7mCzlspak0bmVjc2O+/QzsnBEVH19+yc0Koifsw0BUSYTuGwEG65N/KwhUVPby52SnSBTi0U2e1bK4yp/M20wnsD3GgqgbLRcEIgI4ZFJePO9LyqnjeNySkhKwfN6R07A98acOLhMzP4Ss9xdjEniIlgRvui9CRaaXbhjUATYWL3MBKosRyu+IZ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-Diagnostics: 1; CY1PR0201MB1835; 6:QQ4uMJ5Xx+7hCzyRS+0ALeFpNBFOFiRA6K134Yu6NC+2xsITjVp0uL+I9bk9YP2UmSUd1j291XKuNvzBJRF//CO5nPPfSf/2DuHWZX5V9o+dbbU49topNoRmh7dAbKFbBIFdDhtFISPCfVBZzxh05pUUMfswVsd+amKw9IV1rgbjCJliZC9wwgEpAao1tAmzDJZghKlo3On8GzruG2eOB0dMdeKeAecFk5l0AkiJ4q3e1Cv2ACMWPRfEmUeKxMKB7P3zZ3iHdud4MfTwA8oiTLpuzq4+pvGazAd5mIVBAoz9iR9BTAf1WAZEB++aPxRebnDFnCKQ3cQdxA0InXWu1w==; 5:C6qVjtVkmLFvmI995xq9URA5kBb1rpVELHrAnJp9ZGWKjVdKHz2qL4UKxMs7zbx4g3eMLD8i4Qea89EyLGUTvUgSybFLLJRqDla74/GOymSkWceKeBqRmfKQa7XuIsHyX08/DYv4tMBF/e/tAklF6w==; 24:PE0H/VBrvWeTUu2C5QVoKwdCLwgjhXivQi6HxYdtyMx7gmT5hIZiyySBc3qsN1FeAs90FrQGIO68oYWc4agUvzNjhKGPWenFiH7+qK/3pIM=; 7:LegrqCFMeVSniK03ML1u4kTmE6ezpSscWaVgJtFtyFy0gYjiEGqrwVHCzmSFUVhqNS01BWRnZW07D9GMMPSWkUm4lzSZlJp9Vp9cnVL5iJqTd04mjQaVMUbMrc2yhvKbpyghbo8NrUeipw1WQ6guNeUPixtkgEoOvLn/jyKfxOD4fF7MrEKI6aykqsJ78qr3vCNl2nrYYxImsd3T4dIrFa/Uqa4yQar/8KIoS5z+lMQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2017 21:51:10.1407 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fff853c2-984e-4847-e9e2-08d51804acf6 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: CY1PR0201MB1835 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 From: Martin Wilck This patch cleans up a lot of warnings when unloading the driver. A current example of the stack trace starts with: [ 142.570715] sysfs group 'power' not found for kobject 'port-5:0' There can be hundreds of these messages during a driver unload. I am resubmitting this patch on behalf of Martin Wilck with his permission. His original patch can be found here: https://www.spinics.net/lists/linux-scsi/msg102085.html This patch did not help until Hannes's commit 9441284fbc39 ("scsi-fixup-kernel-warning-during-rmmod") was applied to the kernel. --------------------------- Original patch description: --------------------------- Unloading the hpsa driver causes warnings [ 1063.793652] WARNING: CPU: 1 PID: 4850 at ../fs/sysfs/group.c:237 device_del+0x54/0x240() [ 1063.793659] sysfs group ffffffff81cf21a0 not found for kobject 'port-2:0' with two different stacks: 1) [ 1063.793774] [] device_del+0x54/0x240 [ 1063.793780] [] transport_remove_classdev+0x4a/0x60 [ 1063.793784] [] attribute_container_device_trigger+0xa6/0xb0 [ 1063.793802] [] sas_port_delete+0x126/0x160 [scsi_transport_sas] [ 1063.793819] [] hpsa_free_sas_port+0x3c/0x70 [hpsa] 2) [ 1063.797103] [] device_del+0x54/0x240 [ 1063.797118] [] sas_port_delete+0x12e/0x160 [scsi_transport_sas] [ 1063.797134] [] hpsa_free_sas_port+0x3c/0x70 [hpsa] This is caused by the fact that host device hostX is deleted before the SAS transport devices hostX/port-a:b. This patch fixes this by reverting the order of device deletions. Tested-by: Don Brace Reviewed-by: Don Brace Signed-off-by: Martin Wilck Signed-off-by: Don Brace --- drivers/scsi/hpsa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 9abe810..aff4a4f 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -8684,6 +8684,8 @@ static void hpsa_remove_one(struct pci_dev *pdev) destroy_workqueue(h->rescan_ctlr_wq); destroy_workqueue(h->resubmit_wq); + hpsa_delete_sas_host(h); + /* * Call before disabling interrupts. * scsi_remove_host can trigger I/O operations especially @@ -8718,8 +8720,6 @@ static void hpsa_remove_one(struct pci_dev *pdev) h->lockup_detected = NULL; /* init_one 2 */ /* (void) pci_disable_pcie_error_reporting(pdev); */ /* init_one 1 */ - hpsa_delete_sas_host(h); - kfree(h); /* init_one 1 */ }