2015-04-27 18:24:39

by [email protected]

[permalink] [raw]
Subject: [PATCH 0/3] Introduce SET_NOIRQ_SYSTEM_SLEEP_PM_OPS and use it

From: Grygorii Strashko <[email protected]>

While working on suspend-to-disk functionality on TI dra7-evm (DRA7xx SoC)
i've found that the most common problem I have to dial with is absence
of corresponding PM callbacks in drivers and, in particular, noirq callbacks.
So, I've fixed one driver first
commit 6248015d6867 "ARM: omap-device: add missed callback for suspend-to-disk"
but then found another one which need to be fixed too (omap_l3_noc.c).
At this moment I decided to make my life easier and added new macro
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS using the same approach as for the existing
SET_SYSTEM_SLEEP_PM_OPS macro.

SET_NOIRQ_SYSTEM_SLEEP_PM_OPS: defined for CONFIG_PM_SLEEP and
assigns ->suspend_noirq, ->freeze_noirq and ->poweroff_noirq to the same
function. Vice versa happens for ->resume_noirq, ->thaw_noirq and
->restore_noirq.

Further two patches reuse this newly introduced macro.

SET_NOIRQ_SYSTEM_SLEEP_PM_OPS, defined for CONFIG_PM_SLEEP, will
point ->suspend_noirq, ->freeze_noirq and ->poweroff_noirq to the same
function. Vice versa happens for ->resume_noirq, ->thaw_noirq and
->restore_noirq.

Cc: Tony Lindgren <[email protected]>
Cc: Nishanth Menon <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Santosh Shilimkar <[email protected]>

Grygorii Strashko (3):
PM / Sleep: Add macro to define common noirq system PM callbacks
bus: omap_l3_noc: add missed callbacks for suspend-to-disk
ARM: omap-device: use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS

arch/arm/mach-omap2/omap_device.c | 7 ++-----
drivers/bus/omap_l3_noc.c | 4 ++--
include/linux/pm.h | 12 ++++++++++++
3 files changed, 16 insertions(+), 7 deletions(-)

--
1.9.1


2015-04-27 18:26:08

by [email protected]

[permalink] [raw]
Subject: [PATCH 1/3] PM / Sleep: Add macro to define common noirq system PM callbacks

From: Grygorii Strashko <[email protected]>

The same approach is used as for the existing SET_SYSTEM_SLEEP_PM_OPS,
but for noirq callbacks.

New SET_NOIRQ_SYSTEM_SLEEP_PM_OPS, defined for CONFIG_PM_SLEEP, will
point ->suspend_noirq, ->freeze_noirq and ->poweroff_noirq to the same
function. Vice versa happens for ->resume_noirq, ->thaw_noirq and
->restore_noirq.

Cc: Tony Lindgren <[email protected]>
Cc: Nishanth Menon <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Santosh Shilimkar <[email protected]>
Signed-off-by: Grygorii Strashko <[email protected]>
---
include/linux/pm.h | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/include/linux/pm.h b/include/linux/pm.h
index 2d29c64..4890743 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -342,6 +342,18 @@ struct dev_pm_ops {
#define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
#endif

+#ifdef CONFIG_PM_SLEEP
+#define SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
+ .suspend_noirq = suspend_fn, \
+ .resume_noirq = resume_fn, \
+ .freeze_noirq = suspend_fn, \
+ .thaw_noirq = resume_fn, \
+ .poweroff_noirq = suspend_fn, \
+ .restore_noirq = resume_fn,
+#else
+#define SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
+#endif
+
#ifdef CONFIG_PM
#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
.runtime_suspend = suspend_fn, \
--
1.9.1

2015-04-27 18:24:44

by [email protected]

[permalink] [raw]
Subject: [PATCH 2/3] bus: omap_l3_noc: add missed callbacks for suspend-to-disk

From: Grygorii Strashko <[email protected]>

Add missed callbacks needed for proper supporting of suspend-to-disk
by using recently introduced macro SET_NOIRQ_SYSTEM_SLEEP_PM_OPS.

Cc: Tony Lindgren <[email protected]>
Cc: Nishanth Menon <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Santosh Shilimkar <[email protected]>
Signed-off-by: Grygorii Strashko <[email protected]>
---
drivers/bus/omap_l3_noc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c
index 11f7982..6ae3884 100644
--- a/drivers/bus/omap_l3_noc.c
+++ b/drivers/bus/omap_l3_noc.c
@@ -300,7 +300,7 @@ static int omap_l3_probe(struct platform_device *pdev)
return ret;
}

-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP

/**
* l3_resume_noirq() - resume function for l3_noc
@@ -346,7 +346,7 @@ static int l3_resume_noirq(struct device *dev)
}

static const struct dev_pm_ops l3_dev_pm_ops = {
- .resume_noirq = l3_resume_noirq,
+ SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(NULL, l3_resume_noirq)
};

#define L3_DEV_PM_OPS (&l3_dev_pm_ops)
--
1.9.1

2015-04-27 18:25:03

by [email protected]

[permalink] [raw]
Subject: [PATCH 3/3] ARM: omap-device: use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS

From: Grygorii Strashko <[email protected]>

Use recently introduced macro SET_NOIRQ_SYSTEM_SLEEP_PM_OPS to
set up PM callbacks. This also fixes missed assignment of
.poweroff_noirq() callback.

Cc: Tony Lindgren <[email protected]>
Cc: Nishanth Menon <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Santosh Shilimkar <[email protected]>
Signed-off-by: Grygorii Strashko <[email protected]>
---
arch/arm/mach-omap2/omap_device.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index 166b18f..83a0f5a 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -688,11 +688,8 @@ struct dev_pm_domain omap_device_pm_domain = {
SET_RUNTIME_PM_OPS(_od_runtime_suspend, _od_runtime_resume,
NULL)
USE_PLATFORM_PM_SLEEP_OPS
- .suspend_noirq = _od_suspend_noirq,
- .resume_noirq = _od_resume_noirq,
- .freeze_noirq = _od_suspend_noirq,
- .thaw_noirq = _od_resume_noirq,
- .restore_noirq = _od_resume_noirq,
+ SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(_od_suspend_noirq,
+ _od_resume_noirq)
}
};

--
1.9.1

2015-04-27 19:30:41

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH 2/3] bus: omap_l3_noc: add missed callbacks for suspend-to-disk

On Mon, Apr 27, 2015 at 1:24 PM, <[email protected]> wrote:
> From: Grygorii Strashko <[email protected]>
>
> Add missed callbacks needed for proper supporting of suspend-to-disk
> by using recently introduced macro SET_NOIRQ_SYSTEM_SLEEP_PM_OPS.
>
> Cc: Tony Lindgren <[email protected]>
> Cc: Nishanth Menon <[email protected]>
> Cc: Kevin Hilman <[email protected]>
> Cc: Santosh Shilimkar <[email protected]>
> Signed-off-by: Grygorii Strashko <[email protected]>
> ---
> drivers/bus/omap_l3_noc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c
> index 11f7982..6ae3884 100644
> --- a/drivers/bus/omap_l3_noc.c
> +++ b/drivers/bus/omap_l3_noc.c
> @@ -300,7 +300,7 @@ static int omap_l3_probe(struct platform_device *pdev)
> return ret;
> }
>
> -#ifdef CONFIG_PM
> +#ifdef CONFIG_PM_SLEEP
>
> /**
> * l3_resume_noirq() - resume function for l3_noc
> @@ -346,7 +346,7 @@ static int l3_resume_noirq(struct device *dev)
> }
>
> static const struct dev_pm_ops l3_dev_pm_ops = {
> - .resume_noirq = l3_resume_noirq,
> + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(NULL, l3_resume_noirq)
> };
>
> #define L3_DEV_PM_OPS (&l3_dev_pm_ops)
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

Acked-by: Nishanth Menon <[email protected]>

--
---
Regards,
Nishanth Menon

2015-04-27 20:27:54

by Santosh Shilimkar

[permalink] [raw]
Subject: Re: [PATCH 0/3] Introduce SET_NOIRQ_SYSTEM_SLEEP_PM_OPS and use it



On 4/27/2015 11:24 AM, [email protected] wrote:
> From: Grygorii Strashko <[email protected]>
>
> While working on suspend-to-disk functionality on TI dra7-evm (DRA7xx SoC)
> i've found that the most common problem I have to dial with is absence
> of corresponding PM callbacks in drivers and, in particular, noirq callbacks.
> So, I've fixed one driver first
> commit 6248015d6867 "ARM: omap-device: add missed callback for suspend-to-disk"
> but then found another one which need to be fixed too (omap_l3_noc.c).
> At this moment I decided to make my life easier and added new macro
> SET_NOIRQ_SYSTEM_SLEEP_PM_OPS using the same approach as for the existing
> SET_SYSTEM_SLEEP_PM_OPS macro.
>
> SET_NOIRQ_SYSTEM_SLEEP_PM_OPS: defined for CONFIG_PM_SLEEP and
> assigns ->suspend_noirq, ->freeze_noirq and ->poweroff_noirq to the same
> function. Vice versa happens for ->resume_noirq, ->thaw_noirq and
> ->restore_noirq.
>
> Further two patches reuse this newly introduced macro.
>
> SET_NOIRQ_SYSTEM_SLEEP_PM_OPS, defined for CONFIG_PM_SLEEP, will
> point ->suspend_noirq, ->freeze_noirq and ->poweroff_noirq to the same
> function. Vice versa happens for ->resume_noirq, ->thaw_noirq and
> ->restore_noirq.
>
[...]

>
> Grygorii Strashko (3):
> PM / Sleep: Add macro to define common noirq system PM callbacks
> bus: omap_l3_noc: add missed callbacks for suspend-to-disk
> ARM: omap-device: use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS
>
> arch/arm/mach-omap2/omap_device.c | 7 ++-----
> drivers/bus/omap_l3_noc.c | 4 ++--
> include/linux/pm.h | 12 ++++++++++++
> 3 files changed, 16 insertions(+), 7 deletions(-)
>
Looks fine to me.....
Acked-by: Santosh Shilimkar <[email protected]>

2015-04-28 07:40:42

by Ulf Hansson

[permalink] [raw]
Subject: Re: [PATCH 0/3] Introduce SET_NOIRQ_SYSTEM_SLEEP_PM_OPS and use it

On 27 April 2015 at 20:24, <[email protected]> wrote:
> From: Grygorii Strashko <[email protected]>
>
> While working on suspend-to-disk functionality on TI dra7-evm (DRA7xx SoC)
> i've found that the most common problem I have to dial with is absence
> of corresponding PM callbacks in drivers and, in particular, noirq callbacks.
> So, I've fixed one driver first
> commit 6248015d6867 "ARM: omap-device: add missed callback for suspend-to-disk"
> but then found another one which need to be fixed too (omap_l3_noc.c).
> At this moment I decided to make my life easier and added new macro
> SET_NOIRQ_SYSTEM_SLEEP_PM_OPS using the same approach as for the existing
> SET_SYSTEM_SLEEP_PM_OPS macro.
>
> SET_NOIRQ_SYSTEM_SLEEP_PM_OPS: defined for CONFIG_PM_SLEEP and
> assigns ->suspend_noirq, ->freeze_noirq and ->poweroff_noirq to the same
> function. Vice versa happens for ->resume_noirq, ->thaw_noirq and
> ->restore_noirq.
>
> Further two patches reuse this newly introduced macro.
>
> SET_NOIRQ_SYSTEM_SLEEP_PM_OPS, defined for CONFIG_PM_SLEEP, will
> point ->suspend_noirq, ->freeze_noirq and ->poweroff_noirq to the same
> function. Vice versa happens for ->resume_noirq, ->thaw_noirq and
> ->restore_noirq.
>
> Cc: Tony Lindgren <[email protected]>
> Cc: Nishanth Menon <[email protected]>
> Cc: Kevin Hilman <[email protected]>
> Cc: Santosh Shilimkar <[email protected]>
>
> Grygorii Strashko (3):
> PM / Sleep: Add macro to define common noirq system PM callbacks
> bus: omap_l3_noc: add missed callbacks for suspend-to-disk
> ARM: omap-device: use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS
>
> arch/arm/mach-omap2/omap_device.c | 7 ++-----
> drivers/bus/omap_l3_noc.c | 4 ++--
> include/linux/pm.h | 12 ++++++++++++
> 3 files changed, 16 insertions(+), 7 deletions(-)
>
> --
> 1.9.1
>

For the patchset.

Reviewed-by: Ulf Hansson <[email protected]>

Kind regards
Uffe

2015-04-28 15:40:10

by Kevin Hilman

[permalink] [raw]
Subject: Re: [PATCH 0/3] Introduce SET_NOIRQ_SYSTEM_SLEEP_PM_OPS and use it

<[email protected]> writes:

> From: Grygorii Strashko <[email protected]>
>
> While working on suspend-to-disk functionality on TI dra7-evm (DRA7xx SoC)
> i've found that the most common problem I have to dial with is absence
> of corresponding PM callbacks in drivers and, in particular, noirq callbacks.
> So, I've fixed one driver first
> commit 6248015d6867 "ARM: omap-device: add missed callback for suspend-to-disk"
> but then found another one which need to be fixed too (omap_l3_noc.c).
> At this moment I decided to make my life easier and added new macro
> SET_NOIRQ_SYSTEM_SLEEP_PM_OPS using the same approach as for the existing
> SET_SYSTEM_SLEEP_PM_OPS macro.
>
> SET_NOIRQ_SYSTEM_SLEEP_PM_OPS: defined for CONFIG_PM_SLEEP and
> assigns ->suspend_noirq, ->freeze_noirq and ->poweroff_noirq to the same
> function. Vice versa happens for ->resume_noirq, ->thaw_noirq and
> ->restore_noirq.
>
> Further two patches reuse this newly introduced macro.
>
> SET_NOIRQ_SYSTEM_SLEEP_PM_OPS, defined for CONFIG_PM_SLEEP, will
> point ->suspend_noirq, ->freeze_noirq and ->poweroff_noirq to the same
> function. Vice versa happens for ->resume_noirq, ->thaw_noirq and
> ->restore_noirq.

For the series:

Reviewed-by: Kevin Hilman <[email protected]>

And for the omap_device changes:

Acked-by: Kevin Hilman <[email protected]>

2015-04-30 17:37:43

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH 0/3] Introduce SET_NOIRQ_SYSTEM_SLEEP_PM_OPS and use it

On Mon 2015-04-27 21:24:29, [email protected] wrote:
> From: Grygorii Strashko <[email protected]>
>
> While working on suspend-to-disk functionality on TI dra7-evm (DRA7xx SoC)
> i've found that the most common problem I have to dial with is absence
> of corresponding PM callbacks in drivers and, in particular, noirq callbacks.
> So, I've fixed one driver first
> commit 6248015d6867 "ARM: omap-device: add missed callback for suspend-to-disk"
> but then found another one which need to be fixed too (omap_l3_noc.c).
> At this moment I decided to make my life easier and added new macro
> SET_NOIRQ_SYSTEM_SLEEP_PM_OPS using the same approach as for the existing
> SET_SYSTEM_SLEEP_PM_OPS macro.
>
> SET_NOIRQ_SYSTEM_SLEEP_PM_OPS: defined for CONFIG_PM_SLEEP and
> assigns ->suspend_noirq, ->freeze_noirq and ->poweroff_noirq to the same
> function. Vice versa happens for ->resume_noirq, ->thaw_noirq and
> ->restore_noirq.
>
> Further two patches reuse this newly introduced macro.
>
> SET_NOIRQ_SYSTEM_SLEEP_PM_OPS, defined for CONFIG_PM_SLEEP, will
> point ->suspend_noirq, ->freeze_noirq and ->poweroff_noirq to the same
> function. Vice versa happens for ->resume_noirq, ->thaw_noirq and
> ->restore_noirq.
>
> Cc: Tony Lindgren <[email protected]>
> Cc: Nishanth Menon <[email protected]>
> Cc: Kevin Hilman <[email protected]>
> Cc: Santosh Shilimkar <[email protected]>

Looks ok to me.

Acked-by: Pavel Machek <[email protected]>

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2015-05-14 23:41:39

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH 0/3] Introduce SET_NOIRQ_SYSTEM_SLEEP_PM_OPS and use it

On Tuesday, April 28, 2015 08:40:04 AM Kevin Hilman wrote:
> <[email protected]> writes:
>
> > From: Grygorii Strashko <[email protected]>
> >
> > While working on suspend-to-disk functionality on TI dra7-evm (DRA7xx SoC)
> > i've found that the most common problem I have to dial with is absence
> > of corresponding PM callbacks in drivers and, in particular, noirq callbacks.
> > So, I've fixed one driver first
> > commit 6248015d6867 "ARM: omap-device: add missed callback for suspend-to-disk"
> > but then found another one which need to be fixed too (omap_l3_noc.c).
> > At this moment I decided to make my life easier and added new macro
> > SET_NOIRQ_SYSTEM_SLEEP_PM_OPS using the same approach as for the existing
> > SET_SYSTEM_SLEEP_PM_OPS macro.
> >
> > SET_NOIRQ_SYSTEM_SLEEP_PM_OPS: defined for CONFIG_PM_SLEEP and
> > assigns ->suspend_noirq, ->freeze_noirq and ->poweroff_noirq to the same
> > function. Vice versa happens for ->resume_noirq, ->thaw_noirq and
> > ->restore_noirq.
> >
> > Further two patches reuse this newly introduced macro.
> >
> > SET_NOIRQ_SYSTEM_SLEEP_PM_OPS, defined for CONFIG_PM_SLEEP, will
> > point ->suspend_noirq, ->freeze_noirq and ->poweroff_noirq to the same
> > function. Vice versa happens for ->resume_noirq, ->thaw_noirq and
> > ->restore_noirq.
>
> For the series:
>
> Reviewed-by: Kevin Hilman <[email protected]>
>
> And for the omap_device changes:
>
> Acked-by: Kevin Hilman <[email protected]>

All three queued up for 4.2, thanks!


--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.