From patchwork Fri Oct 20 21:51:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10021011 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 3157F60234 for ; Fri, 20 Oct 2017 21:51:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22F7928F67 for ; Fri, 20 Oct 2017 21:51:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17BFA28F6C; Fri, 20 Oct 2017 21:51:28 +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 96EDC28F67 for ; Fri, 20 Oct 2017 21:51:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752612AbdJTVvW (ORCPT ); Fri, 20 Oct 2017 17:51:22 -0400 Received: from mail-bl2nam02on0061.outbound.protection.outlook.com ([104.47.38.61]:64704 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753448AbdJTVvS (ORCPT ); Fri, 20 Oct 2017 17:51:18 -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=l43LB7CXbFicGaLl4P2VHW5D+sXYlO7E9lHAHv89lUc=; b=Hxtql2bJmizeK8/g00ttn1Qjq/y18GRkeQXt591ARTji762OkCMsvMZZE/kbz0DGFuD8+tg9RvRmf6LjmrYHt4OHBPZGp7TWqjFzl2cUmawP01uPegQEQxKQw9W6Y9/2CPMzs1Y+Q1dyZj5SaIcPJZA6D504WCP2DpXqGSVg/LM= Received: from MWHPR02CA0010.namprd02.prod.outlook.com (10.168.209.148) by CY1PR0201MB0745.namprd02.prod.outlook.com (10.160.141.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Fri, 20 Oct 2017 21:51:16 +0000 Received: from BY2FFO11FD006.protection.gbl (2a01:111:f400:7c0c::175) by MWHPR02CA0010.outlook.office365.com (2603:10b6:300:4b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4 via Frontend Transport; Fri, 20 Oct 2017 21:51:16 +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 BY2FFO11FD006.mail.protection.outlook.com (10.1.14.127) 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:15 +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:15 -0700 Subject: [PATCH 02/12] hpsa: cleanup sas_phy structures in sysfs when unloading From: Don Brace To: , , , , , , , , , , CC: Date: Fri, 20 Oct 2017 16:51:14 -0500 Message-ID: <150853627417.28275.14954285884974003997.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)(376002)(346002)(2980300002)(438002)(199003)(189002)(4326008)(81166006)(316002)(69596002)(104016004)(76176999)(2950100002)(230700001)(966005)(97736004)(23676002)(77096006)(83506002)(54356999)(86362001)(189998001)(33646002)(50986999)(478600001)(106466001)(2906002)(81156014)(68736007)(58126008)(16576012)(6306002)(8676002)(106002)(8936002)(53936002)(110136005)(5660300001)(47776003)(50466002)(9686003)(305945005)(2201001)(103116003)(33716001)(356003)(921003)(83996005)(1121003)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB0745; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD006; 1:3yjwBJbJsP1690vPDHBo10x4pw3cBEDcBNKqxfce8LLrd20O1e/+ZHCK/yTDa5+aif4tq+/+0vGMjt0BoUW1b+M97XFlLekQc0QubyXRtKt9OuT8Dmnj73ON5w5Y2Mor X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 23a6ba69-653b-4fe3-17d6-08d51804b022 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199); SRVR:CY1PR0201MB0745; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0745; 3:b+4wsvfUCfbVYh3U6YSedwdflLh3PYs6cItm9bo4LCY87l1AUN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QmpMRsARpqXpgzzdxk/1ldSaw6MHcQftBaMhbl302Q0z3Csg8dN4xoxOAYIEkk1rAgquMmDYQfW2BM61rQ4y6BhWf+MPBhayxyaNqH7tvAvzkGLwKwRhdsj0aiOnaVEI7vd/e25yxCVwR/0iKOTnP3Z7b2P2298mgYN61901J9MX7ErmTuMKP3+Ut19GCqeSSrNTuh60Q2uwH8/q6PnxuFviYLuept4K6auvwd3Pf6UE7xM2vzsrNm6kEzKReSndJRKP6zwBZYY29LST1AFx8biCG/XuE+nt9YXQNZUEV89392eK6qFtzEOvlE13MFlFpPYk8REdBVY4PADGtQ/thNBqK0Ac8yCVXlpN0CicNJ9DeOyAYY/YfjEJjU/jbs7dpRiJTo/YL4lDtJzTSHj5azMcVn+uFzyHdFjrZj 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)(93006095)(93004095)(10201501046)(3002001)(100000703101)(100105400095)(3231020)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123555025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR0201MB0745; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR0201MB0745; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0745; 4:BEdTJqrxpKlBMWsxMBdZ5p3qfn5LWXFZ5koQwHcUrDb/2Fq46uZhllQw4xT2PUBE7J68zztLnSMfy5b79IeqavP0zIBC4/p6CkieoA1YAfFr/3+UIOqT+em/WjxzZjk5NQ44GHpZPjUedpM4UZIw5mhEOgayPsVfbXgBo2ybq/xFSBTkC60IcElJ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kD21C?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0745; 6:0DVcuAh+OF5MjL/C85BW/DiPSYAzl9zNEKhaFMkO/Z0uhabgWSttWIXf1ZiivRQWA5tpQiVU2YneB+j9SjM5LC83r3ZioYoAIhCQV0h5bUx0Zp5mNd1vLCyXzl0JjR/bio5x6/fudt9jNyAPFmis6HFr9tOZOQwgftAD5+/NmE6F2KrVU6TMCxyFLEodqydlRwk26ZyRi3+z8Ono6xo95u8oxS4PAOYervOvV0sRMpdKX6fwNVhPCYY5y3uZ+9plvhV5FXz7t2erCBveyHG7SgMkRGhgB4QBuDn+706NCUvQz7CO6EX91dtHUdUBNlliJAEZLEtq/7MLuK2ttKYuOw==; 5:Ni2fY7RklwM+u9cj9iaQYPt+l+LwJM2HEA/SUM2tPnMGSE8sp+kBN25hc8a9ji/l7kHA1gH41PrWJGd5Cn5aDmZodLaPxY761gBE2YyFFFHqhcobYROfya7NJf/7LjpkEckyjiiD6lI8D/dCeoT6Jg==; 24:YkIv1Oc0+d9tCdY50g0fTKcCyQdPAr5Sp5XbhREfNpqHEqf6ommytQ/QupQ6eiyKzJDVXOEy2FUV0sTetaPIFwoiUV4QNDYsQNSHuNlw9bY=; 7:AiCBb92tD8H+L3/Bcaf5jYP7AhV5JrWunF8c8An6mNEkRn0+pMlROTRxHMybeySMApAraQhkfK5siBBGkXeFZYj+ighF0NG/0WMiz3a0Bd5fQNFZFeZ3JJceVhxdKt3YwU7JOf7a21AFacJpzqaf6C12PFhrcXMgFOiLbww9jhZVZsEs0yXEz4rCIRSv16Kb7PkEMEB+6agPaqJnawoxon6lm2J9ZhlhfZBcylvANes= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2017 21:51:15.4413 (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: CY1PR0201MB0745 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 I am resubmitting this patch on behalf of Martin Wilck with his permission. The original patch can be found here: https://www.spinics.net/lists/linux-scsi/msg102083.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 from Martin: -------------------------------------- When the hpsa module is unloaded using rmmod, dangling symlinks remain under /sys/class/sas_phy. Fix this by calling sas_phy_delete() rather than sas_phy_free (which, according to comments, should not be called for PHYs that have been set up successfully, anyway). Tested-by: Don Brace Reviewed-by: Don Brace Signed-off-by: Martin Wilck Signed-off-by: Don Brace --- drivers/scsi/hpsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index aff4a4f..76461c4 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -9207,9 +9207,9 @@ static void hpsa_free_sas_phy(struct hpsa_sas_phy *hpsa_sas_phy) struct sas_phy *phy = hpsa_sas_phy->phy; sas_port_delete_phy(hpsa_sas_phy->parent_port->port, phy); - sas_phy_free(phy); if (hpsa_sas_phy->added_to_port) list_del(&hpsa_sas_phy->phy_list_entry); + sas_phy_delete(phy); kfree(hpsa_sas_phy); }