From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97512C3F2C6 for ; Tue, 3 Mar 2020 17:46:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7270920CC7 for ; Tue, 3 Mar 2020 17:46:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583257561; bh=23q8wOej2CGk3XczCcVwpa2g7hpc7dm7DZVNhrIvC0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=q+XXafiO54TxwwEJVbdjmBk5arLI7zV8aObeyEjKlQrvCQqLSA1hT608ZfH86V6/r JaG58ae8baBwEZwiNvWf6wtismR0Edo9lU+Y5X2LxItgoONUZkgLPL82Er2C1TrCG1 PVqH7jTspuOO8qf4BmGc6EX6Urp31R6gH36mrN6s= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730728AbgCCRp7 (ORCPT ); Tue, 3 Mar 2020 12:45:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:52292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731031AbgCCRp5 (ORCPT ); Tue, 3 Mar 2020 12:45:57 -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 E0A102187F; Tue, 3 Mar 2020 17:45:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583257557; bh=23q8wOej2CGk3XczCcVwpa2g7hpc7dm7DZVNhrIvC0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w7SlO17Zto8OFSOYI0BMcJcbXlUZ9p4K90TjfG2l+hEHSHUfqOUCkT0WKEVK9SaGi +i4nnkPaDFZsLHf4CIEGoVtM2KwDyCTo4WsYhX6VqTBA89S6OA9IJLNVmXdaS9GwG/ knRv5qjA1BET9DbvVJHbvXj5ETMgnMIuUICKXZ1Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arun Parameswaran , Scott Branden , Andrew Lunn , Florian Fainelli , "David S. Miller" Subject: [PATCH 5.5 006/176] net: phy: restore mdio regs in the iproc mdio driver Date: Tue, 3 Mar 2020 18:41:10 +0100 Message-Id: <20200303174305.290156569@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200303174304.593872177@linuxfoundation.org> References: <20200303174304.593872177@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arun Parameswaran commit 6f08e98d62799e53c89dbf2c9a49d77e20ca648c upstream. The mii management register in iproc mdio block does not have a retention register so it is lost on suspend. Save and restore value of register while resuming from suspend. Fixes: bb1a619735b4 ("net: phy: Initialize mdio clock at probe function") Signed-off-by: Arun Parameswaran Signed-off-by: Scott Branden Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/mdio-bcm-iproc.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) --- a/drivers/net/phy/mdio-bcm-iproc.c +++ b/drivers/net/phy/mdio-bcm-iproc.c @@ -178,6 +178,23 @@ static int iproc_mdio_remove(struct plat return 0; } +#ifdef CONFIG_PM_SLEEP +int iproc_mdio_resume(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct iproc_mdio_priv *priv = platform_get_drvdata(pdev); + + /* restore the mii clock configuration */ + iproc_mdio_config_clk(priv->base); + + return 0; +} + +static const struct dev_pm_ops iproc_mdio_pm_ops = { + .resume = iproc_mdio_resume +}; +#endif /* CONFIG_PM_SLEEP */ + static const struct of_device_id iproc_mdio_of_match[] = { { .compatible = "brcm,iproc-mdio", }, { /* sentinel */ }, @@ -188,6 +205,9 @@ static struct platform_driver iproc_mdio .driver = { .name = "iproc-mdio", .of_match_table = iproc_mdio_of_match, +#ifdef CONFIG_PM_SLEEP + .pm = &iproc_mdio_pm_ops, +#endif }, .probe = iproc_mdio_probe, .remove = iproc_mdio_remove,