All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: ti: Add missing pm_runtime_disable() in probe function
@ 2022-01-05  9:02 ` Miaoqian Lin
  0 siblings, 0 replies; 10+ messages in thread
From: Miaoqian Lin @ 2022-01-05  9:02 UTC (permalink / raw)
  Cc: linmq006, Kishon Vijay Abraham I, Vinod Koul, Randy Dunlap,
	Roger Quadros, linux-phy, linux-kernel

If the probe fails, we should use pm_runtime_disable() to balance
pm_runtime_enable().
Add missing pm_runtime_disable() for serdes_am654_probe().

Fixes: 71e2f5c ("phy: ti: Add a new SERDES driver for TI's AM654x SoC")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/phy/ti/phy-am654-serdes.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/ti/phy-am654-serdes.c b/drivers/phy/ti/phy-am654-serdes.c
index c1211c4f863c..b77ef9e0e0c7 100644
--- a/drivers/phy/ti/phy-am654-serdes.c
+++ b/drivers/phy/ti/phy-am654-serdes.c
@@ -838,7 +838,8 @@ static int serdes_am654_probe(struct platform_device *pdev)
 
 clk_err:
 	of_clk_del_provider(node);
-
+err_pm_disable:
+	pm_runtime_disable(dev);
 	return ret;
 }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] phy: ti: Add missing pm_runtime_disable() in probe function
@ 2022-01-05  9:02 ` Miaoqian Lin
  0 siblings, 0 replies; 10+ messages in thread
From: Miaoqian Lin @ 2022-01-05  9:02 UTC (permalink / raw)
  Cc: linmq006, Kishon Vijay Abraham I, Vinod Koul, Randy Dunlap,
	Roger Quadros, linux-phy, linux-kernel

If the probe fails, we should use pm_runtime_disable() to balance
pm_runtime_enable().
Add missing pm_runtime_disable() for serdes_am654_probe().

Fixes: 71e2f5c ("phy: ti: Add a new SERDES driver for TI's AM654x SoC")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/phy/ti/phy-am654-serdes.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/ti/phy-am654-serdes.c b/drivers/phy/ti/phy-am654-serdes.c
index c1211c4f863c..b77ef9e0e0c7 100644
--- a/drivers/phy/ti/phy-am654-serdes.c
+++ b/drivers/phy/ti/phy-am654-serdes.c
@@ -838,7 +838,8 @@ static int serdes_am654_probe(struct platform_device *pdev)
 
 clk_err:
 	of_clk_del_provider(node);
-
+err_pm_disable:
+	pm_runtime_disable(dev);
 	return ret;
 }
 
-- 
2.17.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] phy: ti: Add missing pm_runtime_disable() in probe function
  2022-01-05  9:02 ` Miaoqian Lin
  (?)
@ 2022-01-05 14:16   ` kernel test robot
  -1 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2022-01-05 14:16 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: llvm, kbuild-all, linmq006, Kishon Vijay Abraham I, Vinod Koul,
	Randy Dunlap, Roger Quadros, linux-phy, linux-kernel

Hi Miaoqian,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.16-rc8 next-20220105]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Miaoqian-Lin/phy-ti-Add-missing-pm_runtime_disable-in-probe-function/20220105-170334
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git c9e6606c7fe92b50a02ce51dda82586ebdf99b48
config: riscv-randconfig-r013-20220105 (https://download.01.org/0day-ci/archive/20220105/202201052240.Rjl0xRWG-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d5b6e30ed3acad794dd0aec400e617daffc6cc3d)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/dc404b65a54364bb2937baba85bb37960c514167
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Miaoqian-Lin/phy-ti-Add-missing-pm_runtime_disable-in-probe-function/20220105-170334
        git checkout dc404b65a54364bb2937baba85bb37960c514167
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/phy/ti/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/phy/ti/phy-am654-serdes.c:841:1: warning: unused label 'err_pm_disable' [-Wunused-label]
   err_pm_disable:
   ^~~~~~~~~~~~~~~
   1 warning generated.


vim +/err_pm_disable +841 drivers/phy/ti/phy-am654-serdes.c

   751	
   752	static int serdes_am654_probe(struct platform_device *pdev)
   753	{
   754		struct phy_provider *phy_provider;
   755		struct device *dev = &pdev->dev;
   756		struct device_node *node = dev->of_node;
   757		struct clk_onecell_data *clk_data;
   758		struct serdes_am654 *am654_phy;
   759		struct mux_control *control;
   760		const char *clock_name;
   761		struct regmap *regmap;
   762		void __iomem *base;
   763		struct phy *phy;
   764		int ret;
   765		int i;
   766	
   767		am654_phy = devm_kzalloc(dev, sizeof(*am654_phy), GFP_KERNEL);
   768		if (!am654_phy)
   769			return -ENOMEM;
   770	
   771		base = devm_platform_ioremap_resource(pdev, 0);
   772		if (IS_ERR(base))
   773			return PTR_ERR(base);
   774	
   775		regmap = devm_regmap_init_mmio(dev, base, &serdes_am654_regmap_config);
   776		if (IS_ERR(regmap)) {
   777			dev_err(dev, "Failed to initialize regmap\n");
   778			return PTR_ERR(regmap);
   779		}
   780	
   781		control = devm_mux_control_get(dev, NULL);
   782		if (IS_ERR(control))
   783			return PTR_ERR(control);
   784	
   785		am654_phy->dev = dev;
   786		am654_phy->of_node = node;
   787		am654_phy->regmap = regmap;
   788		am654_phy->control = control;
   789		am654_phy->type = PHY_NONE;
   790	
   791		ret = serdes_am654_regfield_init(am654_phy);
   792		if (ret) {
   793			dev_err(dev, "Failed to initialize regfields\n");
   794			return ret;
   795		}
   796	
   797		platform_set_drvdata(pdev, am654_phy);
   798	
   799		for (i = 0; i < SERDES_NUM_CLOCKS; i++) {
   800			ret = of_property_read_string_index(node, "clock-output-names",
   801							    i, &clock_name);
   802			if (ret) {
   803				dev_err(dev, "Failed to get clock name\n");
   804				return ret;
   805			}
   806	
   807			ret = serdes_am654_clk_register(am654_phy, clock_name, i);
   808			if (ret) {
   809				dev_err(dev, "Failed to initialize clock %s\n",
   810					clock_name);
   811				return ret;
   812			}
   813		}
   814	
   815		clk_data = &am654_phy->clk_data;
   816		clk_data->clks = am654_phy->clks;
   817		clk_data->clk_num = SERDES_NUM_CLOCKS;
   818		ret = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
   819		if (ret)
   820			return ret;
   821	
   822		pm_runtime_enable(dev);
   823	
   824		phy = devm_phy_create(dev, NULL, &ops);
   825		if (IS_ERR(phy)) {
   826			ret = PTR_ERR(phy);
   827			goto clk_err;
   828		}
   829	
   830		phy_set_drvdata(phy, am654_phy);
   831		phy_provider = devm_of_phy_provider_register(dev, serdes_am654_xlate);
   832		if (IS_ERR(phy_provider)) {
   833			ret = PTR_ERR(phy_provider);
   834			goto clk_err;
   835		}
   836	
   837		return 0;
   838	
   839	clk_err:
   840		of_clk_del_provider(node);
 > 841	err_pm_disable:
   842		pm_runtime_disable(dev);
   843		return ret;
   844	}
   845	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] phy: ti: Add missing pm_runtime_disable() in probe function
@ 2022-01-05 14:16   ` kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2022-01-05 14:16 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: llvm, kbuild-all, linmq006, Kishon Vijay Abraham I, Vinod Koul,
	Randy Dunlap, Roger Quadros, linux-phy, linux-kernel

Hi Miaoqian,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.16-rc8 next-20220105]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Miaoqian-Lin/phy-ti-Add-missing-pm_runtime_disable-in-probe-function/20220105-170334
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git c9e6606c7fe92b50a02ce51dda82586ebdf99b48
config: riscv-randconfig-r013-20220105 (https://download.01.org/0day-ci/archive/20220105/202201052240.Rjl0xRWG-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d5b6e30ed3acad794dd0aec400e617daffc6cc3d)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/dc404b65a54364bb2937baba85bb37960c514167
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Miaoqian-Lin/phy-ti-Add-missing-pm_runtime_disable-in-probe-function/20220105-170334
        git checkout dc404b65a54364bb2937baba85bb37960c514167
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/phy/ti/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/phy/ti/phy-am654-serdes.c:841:1: warning: unused label 'err_pm_disable' [-Wunused-label]
   err_pm_disable:
   ^~~~~~~~~~~~~~~
   1 warning generated.


vim +/err_pm_disable +841 drivers/phy/ti/phy-am654-serdes.c

   751	
   752	static int serdes_am654_probe(struct platform_device *pdev)
   753	{
   754		struct phy_provider *phy_provider;
   755		struct device *dev = &pdev->dev;
   756		struct device_node *node = dev->of_node;
   757		struct clk_onecell_data *clk_data;
   758		struct serdes_am654 *am654_phy;
   759		struct mux_control *control;
   760		const char *clock_name;
   761		struct regmap *regmap;
   762		void __iomem *base;
   763		struct phy *phy;
   764		int ret;
   765		int i;
   766	
   767		am654_phy = devm_kzalloc(dev, sizeof(*am654_phy), GFP_KERNEL);
   768		if (!am654_phy)
   769			return -ENOMEM;
   770	
   771		base = devm_platform_ioremap_resource(pdev, 0);
   772		if (IS_ERR(base))
   773			return PTR_ERR(base);
   774	
   775		regmap = devm_regmap_init_mmio(dev, base, &serdes_am654_regmap_config);
   776		if (IS_ERR(regmap)) {
   777			dev_err(dev, "Failed to initialize regmap\n");
   778			return PTR_ERR(regmap);
   779		}
   780	
   781		control = devm_mux_control_get(dev, NULL);
   782		if (IS_ERR(control))
   783			return PTR_ERR(control);
   784	
   785		am654_phy->dev = dev;
   786		am654_phy->of_node = node;
   787		am654_phy->regmap = regmap;
   788		am654_phy->control = control;
   789		am654_phy->type = PHY_NONE;
   790	
   791		ret = serdes_am654_regfield_init(am654_phy);
   792		if (ret) {
   793			dev_err(dev, "Failed to initialize regfields\n");
   794			return ret;
   795		}
   796	
   797		platform_set_drvdata(pdev, am654_phy);
   798	
   799		for (i = 0; i < SERDES_NUM_CLOCKS; i++) {
   800			ret = of_property_read_string_index(node, "clock-output-names",
   801							    i, &clock_name);
   802			if (ret) {
   803				dev_err(dev, "Failed to get clock name\n");
   804				return ret;
   805			}
   806	
   807			ret = serdes_am654_clk_register(am654_phy, clock_name, i);
   808			if (ret) {
   809				dev_err(dev, "Failed to initialize clock %s\n",
   810					clock_name);
   811				return ret;
   812			}
   813		}
   814	
   815		clk_data = &am654_phy->clk_data;
   816		clk_data->clks = am654_phy->clks;
   817		clk_data->clk_num = SERDES_NUM_CLOCKS;
   818		ret = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
   819		if (ret)
   820			return ret;
   821	
   822		pm_runtime_enable(dev);
   823	
   824		phy = devm_phy_create(dev, NULL, &ops);
   825		if (IS_ERR(phy)) {
   826			ret = PTR_ERR(phy);
   827			goto clk_err;
   828		}
   829	
   830		phy_set_drvdata(phy, am654_phy);
   831		phy_provider = devm_of_phy_provider_register(dev, serdes_am654_xlate);
   832		if (IS_ERR(phy_provider)) {
   833			ret = PTR_ERR(phy_provider);
   834			goto clk_err;
   835		}
   836	
   837		return 0;
   838	
   839	clk_err:
   840		of_clk_del_provider(node);
 > 841	err_pm_disable:
   842		pm_runtime_disable(dev);
   843		return ret;
   844	}
   845	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] phy: ti: Add missing pm_runtime_disable() in probe function
@ 2022-01-05 14:16   ` kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2022-01-05 14:16 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 5137 bytes --]

Hi Miaoqian,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.16-rc8 next-20220105]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Miaoqian-Lin/phy-ti-Add-missing-pm_runtime_disable-in-probe-function/20220105-170334
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git c9e6606c7fe92b50a02ce51dda82586ebdf99b48
config: riscv-randconfig-r013-20220105 (https://download.01.org/0day-ci/archive/20220105/202201052240.Rjl0xRWG-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d5b6e30ed3acad794dd0aec400e617daffc6cc3d)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/dc404b65a54364bb2937baba85bb37960c514167
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Miaoqian-Lin/phy-ti-Add-missing-pm_runtime_disable-in-probe-function/20220105-170334
        git checkout dc404b65a54364bb2937baba85bb37960c514167
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/phy/ti/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/phy/ti/phy-am654-serdes.c:841:1: warning: unused label 'err_pm_disable' [-Wunused-label]
   err_pm_disable:
   ^~~~~~~~~~~~~~~
   1 warning generated.


vim +/err_pm_disable +841 drivers/phy/ti/phy-am654-serdes.c

   751	
   752	static int serdes_am654_probe(struct platform_device *pdev)
   753	{
   754		struct phy_provider *phy_provider;
   755		struct device *dev = &pdev->dev;
   756		struct device_node *node = dev->of_node;
   757		struct clk_onecell_data *clk_data;
   758		struct serdes_am654 *am654_phy;
   759		struct mux_control *control;
   760		const char *clock_name;
   761		struct regmap *regmap;
   762		void __iomem *base;
   763		struct phy *phy;
   764		int ret;
   765		int i;
   766	
   767		am654_phy = devm_kzalloc(dev, sizeof(*am654_phy), GFP_KERNEL);
   768		if (!am654_phy)
   769			return -ENOMEM;
   770	
   771		base = devm_platform_ioremap_resource(pdev, 0);
   772		if (IS_ERR(base))
   773			return PTR_ERR(base);
   774	
   775		regmap = devm_regmap_init_mmio(dev, base, &serdes_am654_regmap_config);
   776		if (IS_ERR(regmap)) {
   777			dev_err(dev, "Failed to initialize regmap\n");
   778			return PTR_ERR(regmap);
   779		}
   780	
   781		control = devm_mux_control_get(dev, NULL);
   782		if (IS_ERR(control))
   783			return PTR_ERR(control);
   784	
   785		am654_phy->dev = dev;
   786		am654_phy->of_node = node;
   787		am654_phy->regmap = regmap;
   788		am654_phy->control = control;
   789		am654_phy->type = PHY_NONE;
   790	
   791		ret = serdes_am654_regfield_init(am654_phy);
   792		if (ret) {
   793			dev_err(dev, "Failed to initialize regfields\n");
   794			return ret;
   795		}
   796	
   797		platform_set_drvdata(pdev, am654_phy);
   798	
   799		for (i = 0; i < SERDES_NUM_CLOCKS; i++) {
   800			ret = of_property_read_string_index(node, "clock-output-names",
   801							    i, &clock_name);
   802			if (ret) {
   803				dev_err(dev, "Failed to get clock name\n");
   804				return ret;
   805			}
   806	
   807			ret = serdes_am654_clk_register(am654_phy, clock_name, i);
   808			if (ret) {
   809				dev_err(dev, "Failed to initialize clock %s\n",
   810					clock_name);
   811				return ret;
   812			}
   813		}
   814	
   815		clk_data = &am654_phy->clk_data;
   816		clk_data->clks = am654_phy->clks;
   817		clk_data->clk_num = SERDES_NUM_CLOCKS;
   818		ret = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
   819		if (ret)
   820			return ret;
   821	
   822		pm_runtime_enable(dev);
   823	
   824		phy = devm_phy_create(dev, NULL, &ops);
   825		if (IS_ERR(phy)) {
   826			ret = PTR_ERR(phy);
   827			goto clk_err;
   828		}
   829	
   830		phy_set_drvdata(phy, am654_phy);
   831		phy_provider = devm_of_phy_provider_register(dev, serdes_am654_xlate);
   832		if (IS_ERR(phy_provider)) {
   833			ret = PTR_ERR(phy_provider);
   834			goto clk_err;
   835		}
   836	
   837		return 0;
   838	
   839	clk_err:
   840		of_clk_del_provider(node);
 > 841	err_pm_disable:
   842		pm_runtime_disable(dev);
   843		return ret;
   844	}
   845	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2] phy: ti: Add missing pm_runtime_disable() in serdes_am654_probe
  2022-01-05  9:02 ` Miaoqian Lin
@ 2022-03-01  2:58   ` Miaoqian Lin
  -1 siblings, 0 replies; 10+ messages in thread
From: Miaoqian Lin @ 2022-03-01  2:58 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Miaoqian Lin, Randy Dunlap,
	Roger Quadros, linux-phy, linux-kernel

The pm_runtime_enable() will increase power disable depth.
If the probe fails, we should use pm_runtime_disable() to balance
pm_runtime_enable().
Add missing pm_runtime_disable() for serdes_am654_probe().

Fixes: 71e2f5c ("phy: ti: Add a new SERDES driver for TI's AM654x SoC")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
changes in v2:
- remove unused label
---
 drivers/phy/ti/phy-am654-serdes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/ti/phy-am654-serdes.c b/drivers/phy/ti/phy-am654-serdes.c
index c1211c4f863c..0be727bb9f79 100644
--- a/drivers/phy/ti/phy-am654-serdes.c
+++ b/drivers/phy/ti/phy-am654-serdes.c
@@ -838,7 +838,7 @@ static int serdes_am654_probe(struct platform_device *pdev)
 
 clk_err:
 	of_clk_del_provider(node);
-
+	pm_runtime_disable(dev);
 	return ret;
 }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2] phy: ti: Add missing pm_runtime_disable() in serdes_am654_probe
@ 2022-03-01  2:58   ` Miaoqian Lin
  0 siblings, 0 replies; 10+ messages in thread
From: Miaoqian Lin @ 2022-03-01  2:58 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Miaoqian Lin, Randy Dunlap,
	Roger Quadros, linux-phy, linux-kernel

The pm_runtime_enable() will increase power disable depth.
If the probe fails, we should use pm_runtime_disable() to balance
pm_runtime_enable().
Add missing pm_runtime_disable() for serdes_am654_probe().

Fixes: 71e2f5c ("phy: ti: Add a new SERDES driver for TI's AM654x SoC")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
changes in v2:
- remove unused label
---
 drivers/phy/ti/phy-am654-serdes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/ti/phy-am654-serdes.c b/drivers/phy/ti/phy-am654-serdes.c
index c1211c4f863c..0be727bb9f79 100644
--- a/drivers/phy/ti/phy-am654-serdes.c
+++ b/drivers/phy/ti/phy-am654-serdes.c
@@ -838,7 +838,7 @@ static int serdes_am654_probe(struct platform_device *pdev)
 
 clk_err:
 	of_clk_del_provider(node);
-
+	pm_runtime_disable(dev);
 	return ret;
 }
 
-- 
2.17.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] phy: ti: Add missing pm_runtime_disable() in serdes_am654_probe
  2022-03-01  2:58   ` Miaoqian Lin
@ 2022-04-13 10:55     ` Vinod Koul
  -1 siblings, 0 replies; 10+ messages in thread
From: Vinod Koul @ 2022-04-13 10:55 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Kishon Vijay Abraham I, Randy Dunlap, Roger Quadros, linux-phy,
	linux-kernel

On 01-03-22, 02:58, Miaoqian Lin wrote:
> The pm_runtime_enable() will increase power disable depth.
> If the probe fails, we should use pm_runtime_disable() to balance
> pm_runtime_enable().
> Add missing pm_runtime_disable() for serdes_am654_probe().

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] phy: ti: Add missing pm_runtime_disable() in serdes_am654_probe
@ 2022-04-13 10:55     ` Vinod Koul
  0 siblings, 0 replies; 10+ messages in thread
From: Vinod Koul @ 2022-04-13 10:55 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Kishon Vijay Abraham I, Randy Dunlap, Roger Quadros, linux-phy,
	linux-kernel

On 01-03-22, 02:58, Miaoqian Lin wrote:
> The pm_runtime_enable() will increase power disable depth.
> If the probe fails, we should use pm_runtime_disable() to balance
> pm_runtime_enable().
> Add missing pm_runtime_disable() for serdes_am654_probe().

Applied, thanks

-- 
~Vinod

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] phy: ti: Add missing pm_runtime_disable() in probe function
@ 2022-01-05 17:50 kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2022-01-05 17:50 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 10059 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20220105090225.20507-1-linmq006@gmail.com>
References: <20220105090225.20507-1-linmq006@gmail.com>
TO: Miaoqian Lin <linmq006@gmail.com>
CC: linmq006(a)gmail.com
CC: Kishon Vijay Abraham I <kishon@ti.com>
CC: Vinod Koul <vkoul@kernel.org>
CC: Randy Dunlap <rdunlap@infradead.org>
CC: Roger Quadros <rogerq@ti.com>
CC: linux-phy(a)lists.infradead.org
CC: linux-kernel(a)vger.kernel.org

Hi Miaoqian,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.16-rc8 next-20220105]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Miaoqian-Lin/phy-ti-Add-missing-pm_runtime_disable-in-probe-function/20220105-170334
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git c9e6606c7fe92b50a02ce51dda82586ebdf99b48
:::::: branch date: 9 hours ago
:::::: commit date: 9 hours ago
config: microblaze-randconfig-s031-20220105 (https://download.01.org/0day-ci/archive/20220106/202201060123.PR3DWie4-lkp(a)intel.com/config)
compiler: microblaze-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/0day-ci/linux/commit/dc404b65a54364bb2937baba85bb37960c514167
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Miaoqian-Lin/phy-ti-Add-missing-pm_runtime_disable-in-probe-function/20220105-170334
        git checkout dc404b65a54364bb2937baba85bb37960c514167
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=microblaze SHELL=/bin/bash drivers/phy/ti/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> drivers/phy/ti/phy-am654-serdes.c:841:1: sparse: sparse: unused label 'err_pm_disable'

vim +/err_pm_disable +841 drivers/phy/ti/phy-am654-serdes.c

71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  751  
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  752  static int serdes_am654_probe(struct platform_device *pdev)
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  753  {
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  754  	struct phy_provider *phy_provider;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  755  	struct device *dev = &pdev->dev;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  756  	struct device_node *node = dev->of_node;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  757  	struct clk_onecell_data *clk_data;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  758  	struct serdes_am654 *am654_phy;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  759  	struct mux_control *control;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  760  	const char *clock_name;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  761  	struct regmap *regmap;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  762  	void __iomem *base;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  763  	struct phy *phy;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  764  	int ret;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  765  	int i;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  766  
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  767  	am654_phy = devm_kzalloc(dev, sizeof(*am654_phy), GFP_KERNEL);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  768  	if (!am654_phy)
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  769  		return -ENOMEM;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  770  
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  771  	base = devm_platform_ioremap_resource(pdev, 0);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  772  	if (IS_ERR(base))
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  773  		return PTR_ERR(base);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  774  
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  775  	regmap = devm_regmap_init_mmio(dev, base, &serdes_am654_regmap_config);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  776  	if (IS_ERR(regmap)) {
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  777  		dev_err(dev, "Failed to initialize regmap\n");
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  778  		return PTR_ERR(regmap);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  779  	}
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  780  
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  781  	control = devm_mux_control_get(dev, NULL);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  782  	if (IS_ERR(control))
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  783  		return PTR_ERR(control);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  784  
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  785  	am654_phy->dev = dev;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  786  	am654_phy->of_node = node;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  787  	am654_phy->regmap = regmap;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  788  	am654_phy->control = control;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  789  	am654_phy->type = PHY_NONE;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  790  
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  791  	ret = serdes_am654_regfield_init(am654_phy);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  792  	if (ret) {
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  793  		dev_err(dev, "Failed to initialize regfields\n");
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  794  		return ret;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  795  	}
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  796  
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  797  	platform_set_drvdata(pdev, am654_phy);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  798  
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  799  	for (i = 0; i < SERDES_NUM_CLOCKS; i++) {
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  800  		ret = of_property_read_string_index(node, "clock-output-names",
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  801  						    i, &clock_name);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  802  		if (ret) {
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  803  			dev_err(dev, "Failed to get clock name\n");
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  804  			return ret;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  805  		}
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  806  
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  807  		ret = serdes_am654_clk_register(am654_phy, clock_name, i);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  808  		if (ret) {
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  809  			dev_err(dev, "Failed to initialize clock %s\n",
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  810  				clock_name);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  811  			return ret;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  812  		}
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  813  	}
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  814  
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  815  	clk_data = &am654_phy->clk_data;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  816  	clk_data->clks = am654_phy->clks;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  817  	clk_data->clk_num = SERDES_NUM_CLOCKS;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  818  	ret = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  819  	if (ret)
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  820  		return ret;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  821  
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  822  	pm_runtime_enable(dev);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  823  
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  824  	phy = devm_phy_create(dev, NULL, &ops);
850280156f6421 Dan Carpenter          2020-09-05  825  	if (IS_ERR(phy)) {
850280156f6421 Dan Carpenter          2020-09-05  826  		ret = PTR_ERR(phy);
850280156f6421 Dan Carpenter          2020-09-05  827  		goto clk_err;
850280156f6421 Dan Carpenter          2020-09-05  828  	}
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  829  
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  830  	phy_set_drvdata(phy, am654_phy);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  831  	phy_provider = devm_of_phy_provider_register(dev, serdes_am654_xlate);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  832  	if (IS_ERR(phy_provider)) {
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  833  		ret = PTR_ERR(phy_provider);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  834  		goto clk_err;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  835  	}
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  836  
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  837  	return 0;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  838  
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  839  clk_err:
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  840  	of_clk_del_provider(node);
dc404b65a54364 Miaoqian Lin           2022-01-05 @841  err_pm_disable:
dc404b65a54364 Miaoqian Lin           2022-01-05  842  	pm_runtime_disable(dev);
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  843  	return ret;
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  844  }
71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17  845  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-04-13 10:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05  9:02 [PATCH] phy: ti: Add missing pm_runtime_disable() in probe function Miaoqian Lin
2022-01-05  9:02 ` Miaoqian Lin
2022-01-05 14:16 ` kernel test robot
2022-01-05 14:16   ` kernel test robot
2022-01-05 14:16   ` kernel test robot
2022-03-01  2:58 ` [PATCH v2] phy: ti: Add missing pm_runtime_disable() in serdes_am654_probe Miaoqian Lin
2022-03-01  2:58   ` Miaoqian Lin
2022-04-13 10:55   ` Vinod Koul
2022-04-13 10:55     ` Vinod Koul
2022-01-05 17:50 [PATCH] phy: ti: Add missing pm_runtime_disable() in probe function kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.