Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4102519ybg; Fri, 25 Oct 2019 13:21:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwc3Ah0ZVii0OblBXcfTIxM4VlG4F1nVSLuIk4V8juBVMGjUW6ARi7jU90yBIFUMAck6xnH X-Received: by 2002:a17:906:4e55:: with SMTP id g21mr5492797ejw.0.1572034907076; Fri, 25 Oct 2019 13:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572034907; cv=none; d=google.com; s=arc-20160816; b=X2gkTA5oRyLgPNMGBarJuvsa8X4ydFL0G3dC/zlh9dJLdqatc6gFwGeVUV7Dd9HqUd v1HBNVJLHdB9D8jmESnHQUHD5yfEG7gFEutyFzJxwE31jZxD2GeE40pkCl6PdHFqxwZU O+XiUqZME66khLOB6nmQE2buCYNfHPc1WTo6adtSGrn2DGgETyCpAdndOUZgn+4EJAR9 00jXMY2HsYF5INBQrDeacc3Q9V7/AbVYSlUl8J7gIskV9/CS+TQ52mxvs6nH3rpG5VTK Gwyn9ZgOGL7lmtJNbKid5H7XV8uq+tnRVnehvXDrihAN40bucUTJY5HuGuOnttfFS6QT klmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=2QTk2U8ciOQOxyYMBjHB3DKk8rx3c749esOrsZYdH1Y=; b=k4ubL5q8g3iw6jEuv+9fgprYKVf0+oo+8oOqbiY5avZ8qgnIWLtIrc5V/MHPFm/Mj3 waONrSOlouSs74d93lYbey3+nzwwiOthOhyQ06uJIevNTgMscm8z6AwM3eTuXIRdshZ4 cdrccdVUzKC56gBn3msAeOdNkvm8AFquQzSWSkbjZqIL323Uupa4epY6I/terdOs2opY l/Q1Jd5gRbyiOSKLpjoemulQ9aBLqQQ2rJVy4KWbrBKjuIQ13ZjNdkiKIzLw7CGlAJaM hfXxA8ce9LId6B4oO3Zgxta7PvUv7WVRmkC0ExI1+SWHAM7LjIAp7nz8poijnJg5/3RP ZYEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y56si1870768edd.275.2019.10.25.13.21.23; Fri, 25 Oct 2019 13:21:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504912AbfJYNsq (ORCPT + 99 others); Fri, 25 Oct 2019 09:48:46 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:4764 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2502085AbfJYNsq (ORCPT ); Fri, 25 Oct 2019 09:48:46 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id DD827330F78C1E52A52B; Fri, 25 Oct 2019 21:48:41 +0800 (CST) Received: from huawei.com (10.67.189.167) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Fri, 25 Oct 2019 21:48:34 +0800 From: Jiangfeng Xiao To: , , , CC: , , , , Subject: [PATCH] net: hisilicon: Fix "Trying to free already-free IRQ" Date: Fri, 25 Oct 2019 21:48:22 +0800 Message-ID: <1572011302-48605-1-git-send-email-xiaojiangfeng@huawei.com> X-Mailer: git-send-email 1.8.5.6 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.189.167] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When rmmod hip04_eth.ko, we can get the following warning: Task track: rmmod(1623)>bash(1591)>login(1581)>init(1) ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1623 at kernel/irq/manage.c:1557 __free_irq+0xa4/0x2ac() Trying to free already-free IRQ 200 Modules linked in: ping(O) pramdisk(O) cpuinfo(O) rtos_snapshot(O) interrupt_ctrl(O) mtdblock mtd_blkdevrtfs nfs_acl nfs lockd grace sunrpc xt_tcpudp ipt_REJECT iptable_filter ip_tables x_tables nf_reject_ipv CPU: 0 PID: 1623 Comm: rmmod Tainted: G O 4.4.193 #1 Hardware name: Hisilicon A15 [] (rtos_unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0xa0/0xd8) [] (dump_stack) from [] (warn_slowpath_common+0x84/0xb0) [] (warn_slowpath_common) from [] (warn_slowpath_fmt+0x3c/0x68) [] (warn_slowpath_fmt) from [] (__free_irq+0xa4/0x2ac) [] (__free_irq) from [] (free_irq+0x60/0x7c) [] (free_irq) from [] (release_nodes+0x1c4/0x1ec) [] (release_nodes) from [] (__device_release_driver+0xa8/0x104) [] (__device_release_driver) from [] (driver_detach+0xd0/0xf8) [] (driver_detach) from [] (bus_remove_driver+0x64/0x8c) [] (bus_remove_driver) from [] (SyS_delete_module+0x198/0x1e0) [] (SyS_delete_module) from [] (__sys_trace_return+0x0/0x10) ---[ end trace bb25d6123d849b44 ]--- Currently "rmmod hip04_eth.ko" call free_irq more than once as devres_release_all and hip04_remove both call free_irq. This results in a 'Trying to free already-free IRQ' warning. To solve the problem free_irq has been moved out of hip04_remove. Signed-off-by: Jiangfeng Xiao --- drivers/net/ethernet/hisilicon/hip04_eth.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c index c841674..ad6d912 100644 --- a/drivers/net/ethernet/hisilicon/hip04_eth.c +++ b/drivers/net/ethernet/hisilicon/hip04_eth.c @@ -1038,7 +1038,6 @@ static int hip04_remove(struct platform_device *pdev) hip04_free_ring(ndev, d); unregister_netdev(ndev); - free_irq(ndev->irq, ndev); of_node_put(priv->phy_node); cancel_work_sync(&priv->tx_timeout_task); free_netdev(ndev); -- 1.8.5.6