Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp694546ybh; Tue, 10 Mar 2020 06:36:35 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs7bY1dEv2c3TZQT0mzr6hCvtP7P5auaUAXKnV6eZHdNVI64rIdO7kH4zNbJtjZ1avWCo4u X-Received: by 2002:aca:b4c3:: with SMTP id d186mr1113493oif.131.1583847394958; Tue, 10 Mar 2020 06:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583847394; cv=none; d=google.com; s=arc-20160816; b=lT11hAR7o0wsDagWoPHBTKvMSVAOU+FHpWBUq8vdHT1qpOtKL0FaKJjVtEQS/pw6Ll xOi78sfiRTZE8LTzzoWzvn/nxjzSr/CPdy3sQH6jI2vdPYxjJUBZd8vp/cNo2GffiI5P qtbjV3/WioveJrCrcFvNikeRBuYbQq7pTl/l+3wSezMSWK+pGpF8h2LJzD8FjWjQUeWP SE+CfESIvf5jNjAE0GbeubiawtSNlmEPEJIZWHKSX7F0d6enhIUIaU/JpAtKTc0m8mOJ vVZEDN4VEmfZa4U3+hOrMJsveW0Bt6/ePgxalqD/W916bGesEVHP/G4K2bNZALcTvBdE KYLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IhQIbB+8y2Sbv8tcgaCHgdlzWs0XslSGYeGbv9DL24k=; b=MfOSdEHBwrx4HMxq/cxa3OzmzUjMuVFT/mXQ4X2moIfhoJA5GBINvSa4cqCbqNX4YM EeWj3pYu0H+7g04PIHUq9W2CbA9OP45G681HYem48GuXkk/+wf4mAiMUvYsW+k73+LpG LfMXAVyye2Id/JMoTpaXFR6GxkOryepd2ScJWUDqj2G3bQUdYgOnBcEz/9XPS0Ueuf1g axzUYRu0zub6uEDJQw5EFFkVLnf/0CrHehFutKQ15IvLrIS5QcnJgcwPlqlYtm8Y9d6m 8ke06DqmBMRyMRPf+rLuS1NXqXekT9Fnoht++9Dh2g8hqjM8rXzQBGKaiE7xw0IecoFj eoIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qCRJ696l; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k70si3381617oih.24.2020.03.10.06.36.21; Tue, 10 Mar 2020 06:36:34 -0700 (PDT) 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=@kernel.org header.s=default header.b=qCRJ696l; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726641AbgCJMoj (ORCPT + 99 others); Tue, 10 Mar 2020 08:44:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:46918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727774AbgCJMog (ORCPT ); Tue, 10 Mar 2020 08:44:36 -0400 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 73A7E24691; Tue, 10 Mar 2020 12:44:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583844275; bh=XAUzqqs/iFZqXjyiC3BTwxXkC+Ct1BC8ORsE7GURgB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qCRJ696ly9YC8Ba3vleNZgMIV0zm3Nt9RInoaTLtQUhqVFZ45NsKYpiWOADc51oQm RF3d9Jc7mkLawEYndsnz40PVIk1Q8oLBBy468E7ooPELduSKvw7oztaLPTB2iEDJvg Az5Eyd+QsAkaVb40uHVqQIc2NfMNkhapqCWdDaPw= 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 4.9 22/88] net: phy: restore mdio regs in the iproc mdio driver Date: Tue, 10 Mar 2020 13:38:30 +0100 Message-Id: <20200310123611.443688839@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200310123606.543939933@linuxfoundation.org> References: <20200310123606.543939933@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 @@ -188,6 +188,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 */ }, @@ -198,6 +215,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,