From patchwork Sun Sep 18 11:54:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 4162 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 204D023EFB for ; Sun, 18 Sep 2011 11:53:14 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 0EAD5A1842C for ; Sun, 18 Sep 2011 11:53:14 +0000 (UTC) Received: by fxe23 with SMTP id 23so4345525fxe.11 for ; Sun, 18 Sep 2011 04:53:13 -0700 (PDT) Received: by 10.223.33.19 with SMTP id f19mr2954120fad.122.1316346793901; Sun, 18 Sep 2011 04:53:13 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.18.198 with SMTP id y6cs4611lad; Sun, 18 Sep 2011 04:53:13 -0700 (PDT) Received: by 10.43.133.65 with SMTP id hx1mr2338253icc.133.1316346792841; Sun, 18 Sep 2011 04:53:12 -0700 (PDT) Received: from mail-iy0-f178.google.com (mail-iy0-f178.google.com [209.85.210.178]) by mx.google.com with ESMTPS id ee1si7405128icb.108.2011.09.18.04.53.12 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 18 Sep 2011 04:53:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=209.85.210.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: by iabz21 with SMTP id z21so6897952iab.37 for ; Sun, 18 Sep 2011 04:53:11 -0700 (PDT) Received: by 10.68.33.231 with SMTP id u7mr2697349pbi.292.1316346791541; Sun, 18 Sep 2011 04:53:11 -0700 (PDT) Received: from localhost.localdomain ([180.106.36.88]) by mx.google.com with ESMTPS id 4sm2053371pbk.5.2011.09.18.04.52.37 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 18 Sep 2011 04:53:11 -0700 (PDT) From: Shawn Guo To: netdev@vger.kernel.org Cc: "David S. Miller" , linux-arm-kernel@lists.infradead.org, patches@linaro.org, Shawn Guo Subject: [PATCH 3/4] net/fec: set phy_speed to the optimal frequency 2.5 MHz Date: Sun, 18 Sep 2011 19:54:11 +0800 Message-Id: <1316346852-17090-4-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1316346852-17090-1-git-send-email-shawn.guo@linaro.org> References: <1316346852-17090-1-git-send-email-shawn.guo@linaro.org> With the unnecessary 1 bit left-shift on fep->phy_speed during the calculation, the phy_speed always runs at the half frequency of the optimal one 2.5 MHz. The patch removes that 1 bit left-shift to get the optimal phy_speed. Signed-off-by: Shawn Guo --- drivers/net/fec.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 5ef0e34..04206e4 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c @@ -1007,7 +1007,7 @@ static int fec_enet_mii_init(struct platform_device *pdev) /* * Set MII speed to 2.5 MHz (= clk_get_rate() / 2 * phy_speed) */ - fep->phy_speed = DIV_ROUND_UP(clk_get_rate(fep->clk), 5000000) << 1; + fep->phy_speed = DIV_ROUND_UP(clk_get_rate(fep->clk), 5000000); writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED); fep->mii_bus = mdiobus_alloc();