From patchwork Wed Sep 10 07:51:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Perier X-Patchwork-Id: 4874951 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DAA749F371 for ; Wed, 10 Sep 2014 07:51:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E99F201BF for ; Wed, 10 Sep 2014 07:51:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 191192018B for ; Wed, 10 Sep 2014 07:51:29 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XRceT-000890-4I; Wed, 10 Sep 2014 07:49:17 +0000 Received: from mail-we0-x232.google.com ([2a00:1450:400c:c03::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XRceR-00083k-5x; Wed, 10 Sep 2014 07:49:15 +0000 Received: by mail-we0-f178.google.com with SMTP id q58so5775877wes.9 for ; Wed, 10 Sep 2014 00:48:51 -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; bh=LghkMm4tdUiR2/jzxHJLSPwCsWmxAdBrHGNZC1VQlrQ=; b=O9sNTM2EjF7s+PN69LnHWOvSuNW+FGEjiMNBo6gFkAAdvxqR6g7QGLqi4oOD8G3mfL 2/Fk7mLy1CW3rY2l6LQNjxpoB1W8oC6Gla3gRDfy36X/xFbnkCnGGDP+gJLa+bgLwSFv UwXmMWdsNCK8ZENMn4gok0OTD4+DzesoclntOa8A4qwh+iH1aXJNqss8fsn1WYmDHQ7c OxTk2ZUfGih65sZlH17zHGj3vHl5McOP0U3mq4RQ7tXU1QBfsG8IiBwxSYCpgVCm2hBk MPFqtY7ZhpbB8ys34bMohchXbZ5PYRpCLzvr66ZEbn18cHtfc/wqQVts1e9YCa/0/CML Pf8w== X-Received: by 10.194.249.164 with SMTP id yv4mr49169528wjc.34.1410335331840; Wed, 10 Sep 2014 00:48:51 -0700 (PDT) Received: from localhost.localdomain (AToulouse-554-1-131-65.w90-60.abo.wanadoo.fr. [90.60.106.65]) by mx.google.com with ESMTPSA id r19sm1451603wik.0.2014.09.10.00.48.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Sep 2014 00:48:51 -0700 (PDT) From: Romain Perier To: heiko@sntech.de Subject: [PATCH v1] net: ethernet: arc: Don't free Rockchip resources before disconnect from phy Date: Wed, 10 Sep 2014 07:51:13 +0000 Message-Id: <1410335473-23573-1-git-send-email-romain.perier@gmail.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140910_004915_368931_2DFD3D06 X-CRM114-Status: GOOD ( 10.14 ) X-Spam-Score: -0.8 (/) Cc: linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Free resources before being disconnected from phy and calling core driver is wrong and should not happen. It avoids a delay of 4-5s caused by the timeout of phy_disconnect(). Signed-off-by: Romain Perier --- drivers/net/ethernet/arc/emac_rockchip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/arc/emac_rockchip.c b/drivers/net/ethernet/arc/emac_rockchip.c index 51d0585..c31c740 100644 --- a/drivers/net/ethernet/arc/emac_rockchip.c +++ b/drivers/net/ethernet/arc/emac_rockchip.c @@ -202,12 +202,13 @@ static int emac_rockchip_remove(struct platform_device *pdev) struct rockchip_priv_data *priv = netdev_priv(ndev); int err; + err = arc_emac_remove(ndev); + clk_disable_unprepare(priv->refclk); if (priv->regulator) regulator_disable(priv->regulator); - err = arc_emac_remove(ndev); free_netdev(ndev); return err; }