From patchwork Wed May 29 19:32:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 2632231 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 8B26FDF24C for ; Wed, 29 May 2013 19:33:38 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uhm7t-0007nK-5A; Wed, 29 May 2013 19:33:37 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uhm7p-00068K-VG; Wed, 29 May 2013 19:33:33 +0000 Received: from mail-ea0-x232.google.com ([2a00:1450:4013:c01::232]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uhm7l-00065a-CX for linux-arm-kernel@lists.infradead.org; Wed, 29 May 2013 19:33:30 +0000 Received: by mail-ea0-f178.google.com with SMTP id q15so69897ead.23 for ; Wed, 29 May 2013 12:33:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=1D2bMIaHby6a34MDrRFBIVFo5bZEKz63LZasa3Q+7FU=; b=sbkwzw/BarL+mto7bv8AOXYPnt57/lHPSZWClAGiY+nczIpl/fzGf19gliLItzxwMv RWSgZDV+6wTkaQVGTG3XK1i8pO3wmG7QaEQAms8dccQqhNrr1JSdFZyFAe0FWAyLr3Nf RPip96Ew29Z27hjNMvcVAB+m41+5XG7KrvRbIjv2REn9kCn+VwHSAsGoIPi5nIU7EsLc /G5Dhkp95jiLodkRR9CxzpFzwHdaGocTaBaJU14mnknkEOuMRNvCVZg9Gbq0vYn+7nKz Oq3ip7IOdVpQLV8RGorHSghp6Ic1K1v4Fw6sv/9r2agvuaPMNq2Nc5wRCMMyCXZ23ybu BY8w== X-Received: by 10.15.108.6 with SMTP id cc6mr5963404eeb.28.1369855987827; Wed, 29 May 2013 12:33:07 -0700 (PDT) Received: from topkick.lan (dslc-082-083-251-181.pools.arcor-ip.net. [82.83.251.181]) by mx.google.com with ESMTPSA id y10sm55893421eev.3.2013.05.29.12.33.06 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 May 2013 12:33:07 -0700 (PDT) Received: from edge.mst.uni-hannover.de (firewall.mst.uni-hannover.de [130.75.30.51]) by topkick.lan (Postfix) with ESMTPSA id C964F604D5; Wed, 29 May 2013 21:32:08 +0200 (CEST) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH v5 01/13] net: mv643xx_eth: use phy_disconnect instead of phy_detach Date: Wed, 29 May 2013 21:32:43 +0200 Message-Id: <1369855975-21489-2-git-send-email-sebastian.hesselbarth@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1369855975-21489-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <1369154510-4927-1-git-send-email-sebastian.hesselbarth@gmail.com> <1369855975-21489-1-git-send-email-sebastian.hesselbarth@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130529_153329_554151_1BA1AC92 X-CRM114-Status: GOOD ( 12.98 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sebastian.hesselbarth[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Andrew Lunn , Jason Cooper , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org, David Miller , Lennert Buytenhek X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Using a separated mdio bus driver with mvmdio, phy_detach on network device removal will not stop the phy and finally lead to NULL pointer dereference in mvmdio due to non-existent network device. Use phy_disconnect instead to properly stop phy device from accessing network device prior removal of the network device. Signed-off-by: Sebastian Hesselbarth --- Note: I observed this behavior when removing a modular mv643xx_eth driver after attaching it to a phy handled by (also modular) mvmdio. The mvmdio conversion has been done in commit c3a07134e6aa5b93a37f72ffa3d11fadf72bf757 ("mv643xx_eth: convert to use the Marvell Orion MDIO driver") and should go back any -stable version with that commit (propably only 3.9) Cc: David Miller Cc: Lennert Buytenhek Cc: Jason Cooper Cc: Andrew Lunn Cc: Benjamin Herrenschmidt Cc: netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org --- drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index 2ad1494..2480a2f 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c @@ -2805,7 +2805,7 @@ static int mv643xx_eth_remove(struct platform_device *pdev) unregister_netdev(mp->dev); if (mp->phy != NULL) - phy_detach(mp->phy); + phy_disconnect(mp->phy); cancel_work_sync(&mp->tx_timeout_task); if (!IS_ERR(mp->clk))