Skip to contentSkip to conversation

Drop runtime PM support for Baytrail and Lynxpoint pinctrl

PATCH In review Raag Jadav 2 participants 7 messages Oct 3, 2023

Subsystems (3)
lore
Share & tools
lore

Raag Jadav

author
#0 lore raw

v2 cover Drop runtime PM support for Baytrail and Lynxpoint pinctrl

This series removes runtime PM support for the devices that are not explicitly attached to acpi_lpss_pm_domain as it is dead code anyway.

This has no functional impact and helps reduce their code and memory footprint.

bloat-o-meter:
==============

Baytrail:
add/remove: 2/4 grow/shrink: 0/3 up/down: 49/-103 (-54)
Total: Before=16104, After=16050, chg -0.34%

Lynxpoint:
add/remove: 7/10 grow/shrink: 1/3 up/down: 152/-223 (-71)
Total: Before=7506, After=7435, chg -0.95%

Changes since v1:
- Add missing pm.h

Raag Jadav (2):
pinctrl: baytrail: drop runtime PM support
pinctrl: lynxpoint: drop runtime PM support

 drivers/pinctrl/intel/pinctrl-baytrail.c  | 19 ++------------
 drivers/pinctrl/intel/pinctrl-lynxpoint.c | 32 +++--------------------
 2 files changed, 5 insertions(+), 46 deletions(-)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH v2 1/2 pinctrl: baytrail: drop runtime PM support

Since Baytrail pinctrl device is not attached to acpi_lpss_pm_domain, runtime PM serves no purpose here. Drop it and switch to pm_sleep_ptr() as now we only have suspend and resume handles in place.

---
 drivers/pinctrl/intel/pinctrl-baytrail.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)
drivers/pinctrl/intel/pinctrl-baytrail.c +2 -17
index ec76e43527c5..c9a9bc594c63 100644
@@ -16,7 +16,7 @@
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/platform_device.h>
-#include <linux/pm_runtime.h>
+#include <linux/pm.h>
 #include <linux/property.h>
 #include <linux/seq_file.h>
 #include <linux/string_helpers.h>
@@ -722,8 +722,6 @@ static int byt_gpio_request_enable(struct pinctrl_dev *pctl_dev,
 
 	raw_spin_unlock_irqrestore(&byt_lock, flags);
 
-	pm_runtime_get(vg->dev);
-
 	return 0;
 }
 
@@ -734,7 +732,6 @@ static void byt_gpio_disable_free(struct pinctrl_dev *pctl_dev,
 	struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctl_dev);
 
 	byt_gpio_clear_triggering(vg, offset);
-	pm_runtime_put(vg->dev);
 }
 
 static void byt_gpio_direct_irq_check(struct intel_pinctrl *vg,
@@ -1661,7 +1658,6 @@ static int byt_pinctrl_probe(struct platform_device *pdev)
 		return ret;
 
 	platform_set_drvdata(pdev, vg);
-	pm_runtime_enable(dev);
 
 	return 0;
 }
@@ -1750,26 +1746,15 @@ static int byt_gpio_resume(struct device *dev)
 	return 0;
 }
 
-static int byt_gpio_runtime_suspend(struct device *dev)
-{
-	return 0;
-}
-
-static int byt_gpio_runtime_resume(struct device *dev)
-{
-	return 0;
-}
-
 static const struct dev_pm_ops byt_gpio_pm_ops = {
 	LATE_SYSTEM_SLEEP_PM_OPS(byt_gpio_suspend, byt_gpio_resume)
-	RUNTIME_PM_OPS(byt_gpio_runtime_suspend, byt_gpio_runtime_resume, NULL)
 };
 
 static struct platform_driver byt_gpio_driver = {
 	.probe          = byt_pinctrl_probe,
 	.driver         = {
 		.name			= "byt_gpio",
-		.pm			= pm_ptr(&byt_gpio_pm_ops),
+		.pm			= pm_sleep_ptr(&byt_gpio_pm_ops),
 		.acpi_match_table	= byt_gpio_acpi_match,
 		.suppress_bind_attrs	= true,
 	},
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH v2 2/2 pinctrl: lynxpoint: drop runtime PM support

In reply to Raag Jadav

Since Lynxpoint pinctrl device is not attached to acpi_lpss_pm_domain, runtime PM serves no purpose here. Drop it and switch to pm_sleep_ptr() as now we only have resume handle in place.

---
 drivers/pinctrl/intel/pinctrl-lynxpoint.c | 32 +++--------------------
 1 file changed, 3 insertions(+), 29 deletions(-)
drivers/pinctrl/intel/pinctrl-lynxpoint.c +3 -29
index c3732a9f0658..068cfd27f97f 100644
@@ -15,7 +15,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
-#include <linux/pm_runtime.h>
+#include <linux/pm.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
 #include <linux/types.h>
@@ -337,8 +337,6 @@ static int lp_gpio_request_enable(struct pinctrl_dev *pctldev,
 	unsigned long flags;
 	u32 value;
 
-	pm_runtime_get(lg->dev);
-
 	raw_spin_lock_irqsave(&lg->lock, flags);
 
 	/*
@@ -373,8 +371,6 @@ static void lp_gpio_disable_free(struct pinctrl_dev *pctldev,
 	lp_gpio_disable_input(conf2);
 
 	raw_spin_unlock_irqrestore(&lg->lock, flags);
-
-	pm_runtime_put(lg->dev);
 }
 
 static int lp_gpio_set_direction(struct pinctrl_dev *pctldev,
@@ -841,24 +837,6 @@ static int lp_gpio_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	pm_runtime_enable(dev);
-
-	return 0;
-}
-
-static int lp_gpio_remove(struct platform_device *pdev)
-{
-	pm_runtime_disable(&pdev->dev);
-	return 0;
-}
-
-static int lp_gpio_runtime_suspend(struct device *dev)
-{
-	return 0;
-}
-
-static int lp_gpio_runtime_resume(struct device *dev)
-{
 	return 0;
 }
 
@@ -876,10 +854,7 @@ static int lp_gpio_resume(struct device *dev)
 	return 0;
 }
 
-static const struct dev_pm_ops lp_gpio_pm_ops = {
-	SYSTEM_SLEEP_PM_OPS(NULL, lp_gpio_resume)
-	RUNTIME_PM_OPS(lp_gpio_runtime_suspend, lp_gpio_runtime_resume, NULL)
-};
+static DEFINE_SIMPLE_DEV_PM_OPS(lp_gpio_pm_ops, NULL, lp_gpio_resume);
 
 static const struct acpi_device_id lynxpoint_gpio_acpi_match[] = {
 	{ "INT33C7", (kernel_ulong_t)&lptlp_soc_data },
@@ -890,10 +865,9 @@ MODULE_DEVICE_TABLE(acpi, lynxpoint_gpio_acpi_match);
 
 static struct platform_driver lp_gpio_driver = {
 	.probe          = lp_gpio_probe,
-	.remove         = lp_gpio_remove,
 	.driver         = {
 		.name   = "lp_gpio",
-		.pm	= pm_ptr(&lp_gpio_pm_ops),
+		.pm	= pm_sleep_ptr(&lp_gpio_pm_ops),
 		.acpi_match_table = lynxpoint_gpio_acpi_match,
 	},
 };
Signature · 1 line
2.17.1
#3 lore raw
In reply to Raag Jadav
Quoted 20 lines · Raag Jadav

This series removes runtime PM support for the devices that are not explicitly attached to acpi_lpss_pm_domain as it is dead code anyway.

This has no functional impact and helps reduce their code and memory footprint.

bloat-o-meter:
==============

Baytrail:
add/remove: 2/4 grow/shrink: 0/3 up/down: 49/-103 (-54)
Total: Before=16104, After=16050, chg -0.34%

Lynxpoint:
add/remove: 7/10 grow/shrink: 1/3 up/down: 152/-223 (-71)
Total: Before=7506, After=7435, chg -0.95%

Changes since v1:
- Add missing pm.h

Quoted 7 lines

Raag Jadav (2):
pinctrl: baytrail: drop runtime PM support
pinctrl: lynxpoint: drop runtime PM support

 drivers/pinctrl/intel/pinctrl-baytrail.c  | 19 ++------------
 drivers/pinctrl/intel/pinctrl-lynxpoint.c | 32 +++--------------------
 2 files changed, 5 insertions(+), 46 deletions(-)

You forgot --base... :-(

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author
#4 lore raw
Quoted 25 lines · Andy Shevchenko
Quoted 24 lines · Raag Jadav

This series removes runtime PM support for the devices that are not explicitly attached to acpi_lpss_pm_domain as it is dead code anyway.

This has no functional impact and helps reduce their code and memory footprint.

bloat-o-meter:
==============

Baytrail:
add/remove: 2/4 grow/shrink: 0/3 up/down: 49/-103 (-54)
Total: Before=16104, After=16050, chg -0.34%

Lynxpoint:
add/remove: 7/10 grow/shrink: 1/3 up/down: 152/-223 (-71)
Total: Before=7506, After=7435, chg -0.95%

Changes since v1:
- Add missing pm.h

Raag Jadav (2):
pinctrl: baytrail: drop runtime PM support
pinctrl: lynxpoint: drop runtime PM support

Quoted 5 lines
Quoted 3 lines
 drivers/pinctrl/intel/pinctrl-baytrail.c  | 19 ++------------
 drivers/pinctrl/intel/pinctrl-lynxpoint.c | 32 +++--------------------
 2 files changed, 5 insertions(+), 46 deletions(-)

You forgot --base... :-(

Sorry, I need to go figure out some send-email automation.

Raag

#6 lore raw
In reply to Raag Jadav
Quoted 9 lines · Raag Jadav

This series removes runtime PM support for the devices that are not explicitly attached to acpi_lpss_pm_domain as it is dead code anyway.

This has no functional impact and helps reduce their code and memory footprint.

bloat-o-meter:
==============

Quoted 7 lines

Baytrail:
add/remove: 2/4 grow/shrink: 0/3 up/down: 49/-103 (-54)
Total: Before=16104, After=16050, chg -0.34%

Lynxpoint:
add/remove: 7/10 grow/shrink: 1/3 up/down: 152/-223 (-71)
Total: Before=7506, After=7435, chg -0.95%

Pushed to my review and testing queue, thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko