Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2118812ybv; Fri, 14 Feb 2020 11:50:04 -0800 (PST) X-Google-Smtp-Source: APXvYqwdrmZCoC9zMQYm85X7PH3f4HFse1WUabuxyv+0pw+V5y/V+QITRmF+svKMKZmb1fcyKogt X-Received: by 2002:a05:6830:13d3:: with SMTP id e19mr3575294otq.135.1581709803958; Fri, 14 Feb 2020 11:50:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581709803; cv=none; d=google.com; s=arc-20160816; b=DnxeXlpKLeCaVmqpGuffV5mtwycxUkDM+prcbTkO+3BHYeP06oOe7ya5oAKCpId7hf D6ToP7EdyLyS/NlPd9LgKmW+W682zIa/SF61Ogvc30oudiCNg5hnghcMlEJp+ilWgyZ9 0IUk36Vs/gWxLnqsnERWUn2p8Max6MfTPP/YkxcD3ta+G2IFNBNvf883fNbt4AuhFIr8 GSjTHd5Ml/EWIlCQAnHu6v7da530vk1wlfPiPdAJUNB1HVetvOF+EwxW3vWTN9timC74 nQpPICkBojsD1sc3f7xbwZR0Q+MKfeXsl6kuyhftrVfStD1JPT/rFN6uCX5TYd3WtGlJ W15Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=ZWng66Hoj7xQzhbUhm9kO2M9MQGzsOmKGEij3AJEDXU=; b=otmTEqHllVPskXzzFqzAYGvKbsPdAGvzDf6anc4i+h6HIJpbzKzYtUwMXPWGF0FCPr 0HjGIB1jzui/c4yzz0AOCFOKlqPstDiwbtKZE6fQmg2/ZtwaP7UcNjW0QBaLQmduFz08 UAVO6Mc3lE1Umj/RbY+8sQ7+5+/Z41BHddmSzxf5od/L3mO9gfWqeRD95BCTLXe00P1U +hm/DMOiG1SaezXAWjFFiGvfROx+FqPkK1wnb9792Vau76A1UIOzuyVBBU970pFu5x6S u9lY5d0t0rP5fhK0rFKa2NuUtew51sexibxXUj558pA3Mp5CAapCSuBZ7qixYHA2NBZJ TXSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=ONX9OTdB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f190si3282220oig.229.2020.02.14.11.49.51; Fri, 14 Feb 2020 11:50:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@broadcom.com header.s=google header.b=ONX9OTdB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388678AbgBNTtI (ORCPT + 99 others); Fri, 14 Feb 2020 14:49:08 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:38201 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387508AbgBNTtH (ORCPT ); Fri, 14 Feb 2020 14:49:07 -0500 Received: by mail-pf1-f193.google.com with SMTP id x185so5362572pfc.5 for ; Fri, 14 Feb 2020 11:49:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=ZWng66Hoj7xQzhbUhm9kO2M9MQGzsOmKGEij3AJEDXU=; b=ONX9OTdBNa/5a5mLeDhmt5afoWTqsbefXAjxdh/WIid2nembeEayJx0HLEs8vp++ya qNSBA5/39f/Uiub0eo9h4mFy2IyRKrvLNU62KsbY2C+JbPxgLzOLkU2rAk4X2B4CzKQG 7vZQJzLhiUc00YnSzHTqzKKTWkjPZ/hxr9A0Q= 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; bh=ZWng66Hoj7xQzhbUhm9kO2M9MQGzsOmKGEij3AJEDXU=; b=NJQHtOBKS+GjTHxAUMj/JNo0DrCmzDJjJVVzZuRHhp356+XJTppbDPfeZ9Ynn299N8 gwCMeaIfgtJ7RpspQXkC8VXBtFOMUqGhuOhvhsF9BJA64hfQMwYcMHgRp2eOiA5q73ZS 3w/B10AGB54L1V6LfCO5jzj0mVVPObOIFQXL8pSh8dcWd0ot/pgd/wVDaxseBnhzpqtM Xuw8r+FQ/ZtszlZuNLPcQTzZ+aFrNbL/7aSE27t/cFBRLB4DdbQDW7lcIk1N5TZfOqMn vkg5NpHHMufb7uPdO4n54uJK0w7tLqnmlSyA+EgDA6G2MjJZhmsNyaDMp5CsBIVWeyVM xPEQ== X-Gm-Message-State: APjAAAUfnCks5YpGe2IxyzO/9gV2E3m0dxK62t8rprVDq8wCp31KO5q3 6ZwW+9zdqEz54+gXeZkKRXAg0w== X-Received: by 2002:aa7:9808:: with SMTP id e8mr5202704pfl.32.1581709745136; Fri, 14 Feb 2020 11:49:05 -0800 (PST) Received: from lbrmn-lnxub113.broadcom.net ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id u3sm7349815pjv.32.2020.02.14.11.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 11:49:04 -0800 (PST) From: Scott Branden To: Andrew Lunn , Florian Fainelli , Heiner Kallweit Cc: Russell King , "David S . Miller" , Ray Jui , bcm-kernel-feedback-list@broadcom.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Arun Parameswaran , Scott Branden Subject: [PATCH] net: phy: restore mdio regs in the iproc mdio driver Date: Fri, 14 Feb 2020 11:48:58 -0800 Message-Id: <20200214194858.8528-1-scott.branden@broadcom.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arun Parameswaran The mii management register in iproc mdio block does not have a reention 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 --- drivers/net/phy/mdio-bcm-iproc.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/phy/mdio-bcm-iproc.c b/drivers/net/phy/mdio-bcm-iproc.c index 7e9975d25066..f1ded03f0229 100644 --- 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 platform_device *pdev) 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 = { .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, -- 2.17.1