2023-10-03 08:18:01

by Raag Jadav

[permalink] [raw]
Subject: [PATCH v1 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.

No functional impact.

TODO:
Consider moving to DEFINE_LATE_DEV_PM_OPS() in the future once we have
enough users to account for its introduction.

Signed-off-by: Raag Jadav <[email protected]>
Acked-by: Mika Westerberg <[email protected]>
---
drivers/pinctrl/intel/pinctrl-baytrail.c | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c
index ec76e43527c5..14a61a262be1 100644
--- a/drivers/pinctrl/intel/pinctrl-baytrail.c
+++ b/drivers/pinctrl/intel/pinctrl-baytrail.c
@@ -16,7 +16,6 @@
#include <linux/module.h>
#include <linux/types.h>
#include <linux/platform_device.h>
-#include <linux/pm_runtime.h>
#include <linux/property.h>
#include <linux/seq_file.h>
#include <linux/string_helpers.h>
@@ -722,8 +721,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 +731,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 +1657,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 +1745,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,
},
--
2.17.1


2023-10-03 08:18:20

by Raag Jadav

[permalink] [raw]
Subject: [PATCH v1 2/2] pinctrl: lynxpoint: drop runtime PM support

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.

No functional impact.

Signed-off-by: Raag Jadav <[email protected]>
Acked-by: Mika Westerberg <[email protected]>
---
drivers/pinctrl/intel/pinctrl-lynxpoint.c | 31 ++---------------------
1 file changed, 2 insertions(+), 29 deletions(-)

diff --git a/drivers/pinctrl/intel/pinctrl-lynxpoint.c b/drivers/pinctrl/intel/pinctrl-lynxpoint.c
index c3732a9f0658..18ea1c3fa7bb 100644
--- a/drivers/pinctrl/intel/pinctrl-lynxpoint.c
+++ b/drivers/pinctrl/intel/pinctrl-lynxpoint.c
@@ -15,7 +15,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
-#include <linux/pm_runtime.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/types.h>
@@ -337,8 +336,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 +370,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 +836,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 +853,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 +864,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,
},
};
--
2.17.1

2023-10-03 08:59:46

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v1 1/2] pinctrl: baytrail: drop runtime PM support

On Tue, Oct 03, 2023 at 01:45:18PM +0530, Raag Jadav wrote:
> 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.
>
> No functional impact.

> TODO:
> Consider moving to DEFINE_LATE_DEV_PM_OPS() in the future once we have
> enough users to account for its introduction.

This is not related to the commit message.
I'll drop it.

--
With Best Regards,
Andy Shevchenko


2023-10-03 09:00:49

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v1 2/2] pinctrl: lynxpoint: drop runtime PM support

On Tue, Oct 03, 2023 at 01:45:19PM +0530, Raag Jadav wrote:
> 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.
>
> No functional impact.

Pushed to my review and testing queue, thanks!

--
With Best Regards,
Andy Shevchenko


2023-10-03 09:02:04

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v1 1/2] pinctrl: baytrail: drop runtime PM support

On Tue, Oct 03, 2023 at 11:59:33AM +0300, Andy Shevchenko wrote:
> On Tue, Oct 03, 2023 at 01:45:18PM +0530, Raag Jadav wrote:
> > 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.
> >
> > No functional impact.
>
> > TODO:
> > Consider moving to DEFINE_LATE_DEV_PM_OPS() in the future once we have
> > enough users to account for its introduction.
>
> This is not related to the commit message.
> I'll drop it.

Ah, and next time, please do a cover letter for the series, it can be
better managed from maintainer perspective.

--
With Best Regards,
Andy Shevchenko


2023-10-03 09:05:57

by Raag Jadav

[permalink] [raw]
Subject: Re: [PATCH v1 1/2] pinctrl: baytrail: drop runtime PM support

On Tue, Oct 03, 2023 at 01:45:18PM +0530, Raag Jadav wrote:
> 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.
>
> No functional impact.
>
> TODO:
> Consider moving to DEFINE_LATE_DEV_PM_OPS() in the future once we have
> enough users to account for its introduction.
>
> Signed-off-by: Raag Jadav <[email protected]>
> Acked-by: Mika Westerberg <[email protected]>
> ---
> drivers/pinctrl/intel/pinctrl-baytrail.c | 18 +-----------------
> 1 file changed, 1 insertion(+), 17 deletions(-)
>
> diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c
> index ec76e43527c5..14a61a262be1 100644
> --- a/drivers/pinctrl/intel/pinctrl-baytrail.c
> +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c
> @@ -16,7 +16,6 @@
> #include <linux/module.h>
> #include <linux/types.h>
> #include <linux/platform_device.h>
> -#include <linux/pm_runtime.h>
> #include <linux/property.h>
> #include <linux/seq_file.h>
> #include <linux/string_helpers.h>

I just realized I forgot to add pm.h here.
I'll send out a v2.

Raag

2023-10-03 09:08:53

by Raag Jadav

[permalink] [raw]
Subject: Re: [PATCH v1 2/2] pinctrl: lynxpoint: drop runtime PM support

On Tue, Oct 03, 2023 at 01:45:19PM +0530, Raag Jadav wrote:
> 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.
>
> No functional impact.
>
> Signed-off-by: Raag Jadav <[email protected]>
> Acked-by: Mika Westerberg <[email protected]>
> ---
> drivers/pinctrl/intel/pinctrl-lynxpoint.c | 31 ++---------------------
> 1 file changed, 2 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/pinctrl/intel/pinctrl-lynxpoint.c b/drivers/pinctrl/intel/pinctrl-lynxpoint.c
> index c3732a9f0658..18ea1c3fa7bb 100644
> --- a/drivers/pinctrl/intel/pinctrl-lynxpoint.c
> +++ b/drivers/pinctrl/intel/pinctrl-lynxpoint.c
> @@ -15,7 +15,6 @@
> #include <linux/kernel.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> -#include <linux/pm_runtime.h>
> #include <linux/seq_file.h>
> #include <linux/slab.h>
> #include <linux/types.h>

Same as baytrail.

Raag