Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6550176ybx; Mon, 11 Nov 2019 10:47:47 -0800 (PST) X-Google-Smtp-Source: APXvYqwO/XeqXrLobpl2p6kQGImy4VOmb4VTkdSIeMJuqltUtn/Qz9XzCIj3ZYpwdWPauHxuupU7 X-Received: by 2002:aa7:d60e:: with SMTP id c14mr28335496edr.174.1573498066829; Mon, 11 Nov 2019 10:47:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573498066; cv=none; d=google.com; s=arc-20160816; b=Ip+bWXAmDL9B+Q3QrbAcDwq023xzOaCW1DjgqLrZql9Zst3ZpCi4ld/9X9VaDQIzRr 8O3nF5R1ScKCqj2H1AHrRFovWveKqHm4z+3Hhso3W72x3SWlwRsUbKYqV85VhbkBHpfj RjD23lpqB2N5vIrgvxqXnF/lYxeJwoslwmt1eNvcNu5/UCntEwFKT5WhyOOznnDpRDar pf2WRp4DFV4nimsQe+k9WBelmdTt1jQGcPePF6iY9f5SYmct4RUq9PZwCbutomhMdqGt iSfduQoCKylvtjWW5qMhU5BBedYPZ51XIhh9CROEhbWe6LpAh1YdiE4SkAOoqAoO9/Uv ajPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iYINCbsXqOXo+l1kEG4Ko809hQ3VQ6f4ZsriaTmGkco=; b=QwzH/im87KHJwgU2WDRKhvPPxdgqeAHZNmXqxrPTEkcs24Pgxcgdj+rVrkx0z7CbaN UtUZGJI+LVVmMI+QAClC6fK0w5QZFozTCu/PnHkuNlexY34u2dWFDb1uk+rdpQ5gpiMB R5No1OKyLofBtv+vp/N1n+S+8Kxpyv0AtVvTDJGUO/NC8Qb1bu0cZCQ8BBxIWOdR75Ds G++CgoUVMTm+ePknPd6WDqswZwLyyMMkAGh6toAvA7dDtoUcZ261LtaJEA2SAE2fXZlv CDeW8dQPAEG4O9lJvEnmeTnkASWyg5wWYaEhvAnFe8vfEH8CoV9NKLip91PqATAbbqxU 7Yaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=e8XCzyxz; 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 dt11si10281533ejb.126.2019.11.11.10.47.22; Mon, 11 Nov 2019 10:47:46 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=e8XCzyxz; 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 S1728095AbfKKSp5 (ORCPT + 99 others); Mon, 11 Nov 2019 13:45:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:38162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729362AbfKKSpz (ORCPT ); Mon, 11 Nov 2019 13:45:55 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8EFC920659; Mon, 11 Nov 2019 18:45:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497954; bh=MiB01lvFJ4sJdU+938T48brDjZ+FvCovG0/QzdKzXj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e8XCzyxzZg9y12LOhH4jBDnHkxtI2wYXeyk+seTuxoZHliGEmXCrPqG1qmPbF5Yd7 YPYoQQ1D7hVYKxy22WBhsQR7LLd33mjWfi/n+0c35H4yB7NGyVL11l+/SEJn7NBOPr 3nUjYxKAD38uJ5MA3pCLcu2NS5YJwi99qa1KijKY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiangfeng Xiao , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 106/125] net: hisilicon: Fix "Trying to free already-free IRQ" Date: Mon, 11 Nov 2019 19:29:05 +0100 Message-Id: <20191111181454.103481087@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181438.945353076@linuxfoundation.org> References: <20191111181438.945353076@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiangfeng Xiao [ Upstream commit 63a41746827cb16dc6ad0d4d761ab4e7dda7a0c3 ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 2f8f03e0db81e..644ad78d00515 100644 --- a/drivers/net/ethernet/hisilicon/hip04_eth.c +++ b/drivers/net/ethernet/hisilicon/hip04_eth.c @@ -945,7 +945,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); -- 2.20.1