diff mbox

[2/4] net: stmmac: dwmac-rk: add pd_gmac support for rk3399

Message ID 1472589008-7713-3-git-send-email-wxt@rock-chips.com (mailing list archive)
State New, archived
Headers show

Commit Message

Caesar Wang Aug. 30, 2016, 8:30 p.m. UTC
From: David Wu <david.wu@rock-chips.com>

Add the gmac power domain support for rk3399, in order to save more
power consumption.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
---

 drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

kernel test robot Aug. 30, 2016, 9:07 p.m. UTC | #1
Hi David,

[auto build test ERROR on rockchip/for-next]
[also build test ERROR on v4.8-rc4 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:    https://github.com/0day-ci/linux/commits/Caesar-Wang/Support-the-rk3399-gmac-pd-function/20160831-043741
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git for-next
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All errors (new ones prefixed by >>):

   drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c: In function 'rk_gmac_powerdown':
>> drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c:672:23: error: 'pdev' undeclared (first use in this function)
     pm_runtime_put_sync(&pdev->dev);
                          ^
   drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c:672:23: note: each undeclared identifier is reported only once for each function it appears in
   drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c: At top level:
   drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c:679:12: error: redefinition of 'rk_gmac_init'
    static int rk_gmac_init(struct platform_device *pdev, void *priv)
               ^
   drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c:638:12: note: previous definition of 'rk_gmac_init' was here
    static int rk_gmac_init(struct platform_device *pdev, void *priv)
               ^
   drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c: In function 'rk_gmac_init':
   drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c:683:2: error: implicit declaration of function 'rk_gmac_powerup' [-Werror=implicit-function-declaration]
     return rk_gmac_powerup(bsp_priv);
     ^
   drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c: At top level:
   drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c:638:12: warning: 'rk_gmac_init' defined but not used [-Wunused-function]
    static int rk_gmac_init(struct platform_device *pdev, void *priv)
               ^
   cc1: some warnings being treated as errors

vim +/pdev +672 drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c

   666	
   667		return 0;
   668	}
   669	
   670	static void rk_gmac_powerdown(struct rk_priv_data *gmac)
   671	{
 > 672		pm_runtime_put_sync(&pdev->dev);
   673		pm_runtime_disable(&pdev->dev);
   674	
   675		phy_power_on(gmac, false);

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index ea0e493..71a1ca5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -30,6 +30,7 @@ 
 #include <linux/delay.h>
 #include <linux/mfd/syscon.h>
 #include <linux/regmap.h>
+#include <linux/pm_runtime.h>
 
 #include "stmmac_platform.h"
 
@@ -660,11 +661,17 @@  static int rk_gmac_init(struct platform_device *pdev, void *priv)
 	if (ret)
 		return ret;
 
+	pm_runtime_enable(&pdev->dev);
+	pm_runtime_get_sync(&pdev->dev);
+
 	return 0;
 }
 
 static void rk_gmac_powerdown(struct rk_priv_data *gmac)
 {
+	pm_runtime_put_sync(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
+
 	phy_power_on(gmac, false);
 	gmac_clk_enable(gmac, false);
 }