From patchwork Mon Jun 26 08:01:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 106313 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp103178qge; Mon, 26 Jun 2017 01:01:50 -0700 (PDT) X-Received: by 10.98.155.148 with SMTP id e20mr17762466pfk.149.1498464110708; Mon, 26 Jun 2017 01:01:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498464110; cv=none; d=google.com; s=arc-20160816; b=u2MbaJFDyyAaw3Mg1gL5mHo+TOzJB2rh/MhmrXw8XZ1wkgvARJzG8fMs+xHsHaoCKj R8D2xllJhOinkTTZDkLTPxKEnHytZZIkniImtejQ1OhS/lmBdKgAMw0LVt7iAtgX+eA5 CVpQ4eqzc2xmJ/VYMsM6jiJHb23wySPwtzjIrrHjD5LOoGg4ppyXLArY2DXziaO6SPGZ EKYyYy5rwWHz73w4B13LMXkjCRKIXz8AC2ebs1iLprRAtil4rCCXpUUZHbjpg6M4a4Fy 0w1jqmTs1LWl7tVTgYjQ0HIXQWLNV3YQ1fMfn/4jd1QSW0aeOL/qZ1FiFAl2Jg0ZKRGO 80QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=cTnD2cB7+oyI8DVI4p4hqokyCE1fEdliLNmjKLKDzbU=; b=xXd04Zoi+hQPcqyRUDV1fOfUags762nNAiYDtD5GQJzYo20z4liHBGRX7HZFvRGAt5 IDeE9S8mkf3Yyebl2SwxTCY+mTi8Y8Z2/wCFF2h4X9iqRAXFSd24vnAFhUx271Atq5XO ZAMN7X6zMdrSq1hG8EOdMLZ6czVX03Oc+hnyRxkY0+1II+4rQqphDqIsDCPKKc84hq+p uajNKLA11O4vSKEbKEgVPHoopMjmlj2ZRrYypj5C2/eeEkLd5pyRlhlFH/4Xdi0sbAAl wDqJ/7rMEyLxXCrHV2wEek8tkMN/BHB3xcgFbIQ/hV5moXeQeEOMx6Z21g32Vj5qtyUv tJXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=bDrpL3dX; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 102si8959663pld.125.2017.06.26.01.01.50; Mon, 26 Jun 2017 01:01:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@linaro.org header.b=bDrpL3dX; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751390AbdFZIBu (ORCPT + 6 others); Mon, 26 Jun 2017 04:01:50 -0400 Received: from mail-pg0-f47.google.com ([74.125.83.47]:35161 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353AbdFZIBt (ORCPT ); Mon, 26 Jun 2017 04:01:49 -0400 Received: by mail-pg0-f47.google.com with SMTP id j186so15349706pge.2 for ; Mon, 26 Jun 2017 01:01:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cTnD2cB7+oyI8DVI4p4hqokyCE1fEdliLNmjKLKDzbU=; b=bDrpL3dX4is60LfIrz45t5ojiQ4UY2+Z9lnqtdcZE/BjxWPJZyk3dTrb0c7H2VJWN/ pCT3ilRrnyZ0Ci7MkqqxD3AvOMdBpW9zOzH/JVbzMxi3ziL+kJ9gxQIOXYbGvPnZCAaT lx5pnVB7GxSK0WN/pkEyrIFPVlXMpg0LjsYVU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cTnD2cB7+oyI8DVI4p4hqokyCE1fEdliLNmjKLKDzbU=; b=lXvTS63sYrVhPKQsZaZCIlCoXJ5uoRw8ZfJ8qKOujYw9LmoOXhjK1B1xzu8yyo1VEV haquxW0q4nvXovdHY6DtlTIRiUqwBYaVGfb4e/eLckk+zFQtIxcYbC+nIHO66zcmTW70 gmUKdGOY4RVUwzximiD6jdNKh0yvGqdNELwbzd6lgNoy/YBDkv9adnlgobp7XKz1Z/Dr vOLwVBGhGA3tjnJsdyedmbhIcRGmT/6jTlyzS5UxEolvuUnt3xT2ei6jOR8oadbS9poR +50owoM3svpukPziHqX6cyD/dt/f8drzEjHJ1kVq6s1x/69sFKUm1vwJO59wrmzzay30 uQfg== X-Gm-Message-State: AKS2vOxXWh77TFdxTisNZ0oCrUkrpl4OTCXyAExtwkhQrSwZ4v7NmwqT uY92+qUThqfwT23p X-Received: by 10.84.217.26 with SMTP id o26mr22934296pli.223.1498464108753; Mon, 26 Jun 2017 01:01:48 -0700 (PDT) Received: from localhost.localdomain ([106.51.139.251]) by smtp.gmail.com with ESMTPSA id 67sm23673640pfa.83.2017.06.26.01.01.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Jun 2017 01:01:47 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Yendapally Reddy Dhananjaya Reddy , Jon Mason , "David S . Miller" Subject: [PATCH for-4.9 4/7] net: phy: Initialize mdio clock at probe function Date: Mon, 26 Jun 2017 13:31:28 +0530 Message-Id: <1498464091-26753-5-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498464091-26753-1-git-send-email-amit.pundir@linaro.org> References: <1498464091-26753-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Yendapally Reddy Dhananjaya Reddy commit bb1a619735b4660f21bce3e728b937640024b4ad upstream. USB PHYs need the MDIO clock divisor enabled earlier to work. Initialize mdio clock divisor in probe function. The ext bus bit available in the same register will be used by mdio mux to enable external mdio. Signed-off-by: Yendapally Reddy Dhananjaya Reddy Fixes: ddc24ae1 ("net: phy: Broadcom iProc MDIO bus driver") Reviewed-by: Florian Fainelli Signed-off-by: Jon Mason Signed-off-by: David S. Miller Signed-off-by: Amit Pundir --- drivers/net/phy/mdio-bcm-iproc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/drivers/net/phy/mdio-bcm-iproc.c b/drivers/net/phy/mdio-bcm-iproc.c index c0b4e65267af..46fe1ae919a3 100644 --- a/drivers/net/phy/mdio-bcm-iproc.c +++ b/drivers/net/phy/mdio-bcm-iproc.c @@ -81,8 +81,6 @@ static int iproc_mdio_read(struct mii_bus *bus, int phy_id, int reg) if (rc) return rc; - iproc_mdio_config_clk(priv->base); - /* Prepare the read operation */ cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) | (reg << MII_DATA_RA_SHIFT) | @@ -112,8 +110,6 @@ static int iproc_mdio_write(struct mii_bus *bus, int phy_id, if (rc) return rc; - iproc_mdio_config_clk(priv->base); - /* Prepare the write operation */ cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) | (reg << MII_DATA_RA_SHIFT) | @@ -163,6 +159,8 @@ static int iproc_mdio_probe(struct platform_device *pdev) bus->read = iproc_mdio_read; bus->write = iproc_mdio_write; + iproc_mdio_config_clk(priv->base); + rc = of_mdiobus_register(bus, pdev->dev.of_node); if (rc) { dev_err(&pdev->dev, "MDIO bus registration failed\n");