some clockdev patches
diff --git a/patches.renesas/clkdev-const-ify-connection-id-to-clk_add_alias.patch b/patches.renesas/clkdev-const-ify-connection-id-to-clk_add_alias.patch
new file mode 100644
index 0000000..8fc80e2
--- /dev/null
+++ b/patches.renesas/clkdev-const-ify-connection-id-to-clk_add_alias.patch
@@ -0,0 +1,49 @@
+From geert@linux-m68k.org Tue Dec  8 09:38:03 2015
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Tue,  8 Dec 2015 18:37:39 +0100
+Subject: [PATCH 3/5] clkdev: const-ify connection id to clk_add_alias()
+To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: Simon Horman <horms@verge.net.au>, Magnus Damm <magnus.damm@gmail.com>, ltsi-dev@lists.linuxfoundation.org, Russell King <rmk+kernel@arm.linux.org.uk>, Geert Uytterhoeven <geert+renesas@glider.be>
+Message-ID: <1449596261-31005-4-git-send-email-geert+renesas@glider.be>
+
+
+From: Russell King <rmk+kernel@arm.linux.org.uk>
+
+The connection id is only passed to clk_get() which is already const.
+Const-ify this argument too.
+
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+(cherry picked from commit b3d8d7e89fab374d731dfb46fe048f09766ca9c8)
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+---
+ drivers/clk/clkdev.c   |    6 +++---
+ include/linux/clkdev.h |    2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/clk/clkdev.c
++++ b/drivers/clk/clkdev.c
+@@ -288,10 +288,10 @@ clkdev_alloc(struct clk *clk, const char
+ }
+ EXPORT_SYMBOL(clkdev_alloc);
+ 
+-int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
+-	struct device *dev)
++int clk_add_alias(const char *alias, const char *alias_dev_name,
++	const char *con_id, struct device *dev)
+ {
+-	struct clk *r = clk_get(dev, id);
++	struct clk *r = clk_get(dev, con_id);
+ 	struct clk_lookup *l;
+ 
+ 	if (IS_ERR(r))
+--- a/include/linux/clkdev.h
++++ b/include/linux/clkdev.h
+@@ -39,7 +39,7 @@ void clkdev_add(struct clk_lookup *cl);
+ void clkdev_drop(struct clk_lookup *cl);
+ 
+ void clkdev_add_table(struct clk_lookup *, size_t);
+-int clk_add_alias(const char *, const char *, char *, struct device *);
++int clk_add_alias(const char *, const char *, const char *, struct device *);
+ 
+ int clk_register_clkdev(struct clk *, const char *, const char *, ...);
+ int clk_register_clkdevs(struct clk *, struct clk_lookup *, size_t);
diff --git a/patches.renesas/clkdev-get-rid-of-redundant-clk_add_alias-prototype-in-linux-clk.h.patch b/patches.renesas/clkdev-get-rid-of-redundant-clk_add_alias-prototype-in-linux-clk.h.patch
new file mode 100644
index 0000000..251052d
--- /dev/null
+++ b/patches.renesas/clkdev-get-rid-of-redundant-clk_add_alias-prototype-in-linux-clk.h.patch
@@ -0,0 +1,111 @@
+From geert@linux-m68k.org Tue Dec  8 09:38:05 2015
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Tue,  8 Dec 2015 18:37:40 +0100
+Subject: [PATCH 4/5] clkdev: get rid of redundant clk_add_alias() prototype in linux/clk.h
+To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: Simon Horman <horms@verge.net.au>, Magnus Damm <magnus.damm@gmail.com>, ltsi-dev@lists.linuxfoundation.org, Russell King <rmk+kernel@arm.linux.org.uk>, Geert Uytterhoeven <geert+renesas@glider.be>
+Message-ID: <1449596261-31005-5-git-send-email-geert+renesas@glider.be>
+
+
+From: Russell King <rmk+kernel@arm.linux.org.uk>
+
+clk_add_alias() is provided by clkdev, and is not part of the clk API.
+Howver, it is prototyped in two locations: linux/clkdev.h and
+linux/clk.h.  This is a mess.  Get rid of the redundant and unnecessary
+version in linux/clk.h.
+
+Acked-by: Tony Lindgren <tony@atomide.com>
+Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
+Acked-by: Sekhar Nori <nsekhar@ti.com>
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+(cherry picked from commit 2d34e507293102f29ee94d9a9c5b890696d42452)
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+---
+ arch/arm/mach-davinci/da850.c        |    1 +
+ arch/arm/mach-omap1/board-nokia770.c |    2 +-
+ arch/arm/mach-pxa/eseries.c          |    1 +
+ arch/arm/mach-pxa/lubbock.c          |    1 +
+ arch/arm/mach-pxa/tosa.c             |    1 +
+ include/linux/clk.h                  |   13 -------------
+ 6 files changed, 5 insertions(+), 14 deletions(-)
+
+--- a/arch/arm/mach-davinci/da850.c
++++ b/arch/arm/mach-davinci/da850.c
+@@ -11,6 +11,7 @@
+  * is licensed "as is" without any warranty of any kind, whether express
+  * or implied.
+  */
++#include <linux/clkdev.h>
+ #include <linux/gpio.h>
+ #include <linux/init.h>
+ #include <linux/clk.h>
+--- a/arch/arm/mach-omap1/board-nokia770.c
++++ b/arch/arm/mach-omap1/board-nokia770.c
+@@ -7,6 +7,7 @@
+  * it under the terms of the GNU General Public License version 2 as
+  * published by the Free Software Foundation.
+  */
++#include <linux/clkdev.h>
+ #include <linux/irq.h>
+ #include <linux/gpio.h>
+ #include <linux/kernel.h>
+@@ -14,7 +15,6 @@
+ #include <linux/mutex.h>
+ #include <linux/platform_device.h>
+ #include <linux/input.h>
+-#include <linux/clk.h>
+ #include <linux/omapfb.h>
+ 
+ #include <linux/spi/spi.h>
+--- a/arch/arm/mach-pxa/eseries.c
++++ b/arch/arm/mach-pxa/eseries.c
+@@ -10,6 +10,7 @@
+  *
+  */
+ 
++#include <linux/clkdev.h>
+ #include <linux/kernel.h>
+ #include <linux/init.h>
+ #include <linux/gpio.h>
+--- a/arch/arm/mach-pxa/lubbock.c
++++ b/arch/arm/mach-pxa/lubbock.c
+@@ -11,6 +11,7 @@
+  *  it under the terms of the GNU General Public License version 2 as
+  *  published by the Free Software Foundation.
+  */
++#include <linux/clkdev.h>
+ #include <linux/gpio.h>
+ #include <linux/gpio/machine.h>
+ #include <linux/module.h>
+--- a/arch/arm/mach-pxa/tosa.c
++++ b/arch/arm/mach-pxa/tosa.c
+@@ -12,6 +12,7 @@
+  *
+  */
+ 
++#include <linux/clkdev.h>
+ #include <linux/kernel.h>
+ #include <linux/init.h>
+ #include <linux/platform_device.h>
+--- a/include/linux/clk.h
++++ b/include/linux/clk.h
+@@ -471,19 +471,6 @@ static inline void clk_disable_unprepare
+ 	clk_unprepare(clk);
+ }
+ 
+-/**
+- * clk_add_alias - add a new clock alias
+- * @alias: name for clock alias
+- * @alias_dev_name: device name
+- * @id: platform specific clock name
+- * @dev: device
+- *
+- * Allows using generic clock names for drivers by adding a new alias.
+- * Assumes clkdev, see clkdev.h for more info.
+- */
+-int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
+-			struct device *dev);
+-
+ struct device_node;
+ struct of_phandle_args;
+ 
diff --git a/patches.renesas/clkdev-use-clk_hw-internally.patch b/patches.renesas/clkdev-use-clk_hw-internally.patch
new file mode 100644
index 0000000..3084935
--- /dev/null
+++ b/patches.renesas/clkdev-use-clk_hw-internally.patch
@@ -0,0 +1,125 @@
+From geert@linux-m68k.org Tue Dec  8 09:38:00 2015
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Tue,  8 Dec 2015 18:37:38 +0100
+Subject: [PATCH 2/5] clkdev: use clk_hw internally
+To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: Simon Horman <horms@verge.net.au>, Magnus Damm <magnus.damm@gmail.com>, ltsi-dev@lists.linuxfoundation.org, Russell King <rmk+kernel@arm.linux.org.uk>, Geert Uytterhoeven <geert+renesas@glider.be>
+Message-ID: <1449596261-31005-3-git-send-email-geert+renesas@glider.be>
+
+
+From: Russell King <rmk+kernel@arm.linux.org.uk>
+
+clk_add_alias() calls clk_get() followed by clk_put() but in between
+those two calls it saves away the struct clk pointer to a clk_lookup
+structure. This leaves the 'clk' member of the clk_lookup pointing at
+freed memory on configurations where CONFIG_COMMON_CLK=y. This is a
+problem because clk_get_sys() will eventually try to dereference the
+freed pointer by calling __clk_get_hw() on it. Fix this by saving away
+the struct clk_hw pointer instead of the struct clk pointer so that when
+we try to create a per-user struct clk in clk_get_sys() we don't
+dereference a junk pointer.
+
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+(cherry picked from commit d5622a9c13752be46e6fcde9d31391ce0bb0598b)
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+---
+ drivers/clk/clkdev.c   |   24 ++++++++++++++++--------
+ include/linux/clkdev.h |    1 +
+ 2 files changed, 17 insertions(+), 8 deletions(-)
+
+--- a/drivers/clk/clkdev.c
++++ b/drivers/clk/clkdev.c
+@@ -177,7 +177,7 @@ struct clk *clk_get_sys(const char *dev_
+ 	if (!cl)
+ 		goto out;
+ 
+-	clk = __clk_create_clk(__clk_get_hw(cl->clk), dev_id, con_id);
++	clk = __clk_create_clk(cl->clk_hw, dev_id, con_id);
+ 	if (IS_ERR(clk))
+ 		goto out;
+ 
+@@ -215,18 +215,26 @@ void clk_put(struct clk *clk)
+ }
+ EXPORT_SYMBOL(clk_put);
+ 
+-void clkdev_add(struct clk_lookup *cl)
++static void __clkdev_add(struct clk_lookup *cl)
+ {
+ 	mutex_lock(&clocks_mutex);
+ 	list_add_tail(&cl->node, &clocks);
+ 	mutex_unlock(&clocks_mutex);
+ }
++
++void clkdev_add(struct clk_lookup *cl)
++{
++	if (!cl->clk_hw)
++		cl->clk_hw = __clk_get_hw(cl->clk);
++	__clkdev_add(cl);
++}
+ EXPORT_SYMBOL(clkdev_add);
+ 
+ void __init clkdev_add_table(struct clk_lookup *cl, size_t num)
+ {
+ 	mutex_lock(&clocks_mutex);
+ 	while (num--) {
++		cl->clk_hw = __clk_get_hw(cl->clk);
+ 		list_add_tail(&cl->node, &clocks);
+ 		cl++;
+ 	}
+@@ -243,7 +251,7 @@ struct clk_lookup_alloc {
+ };
+ 
+ static struct clk_lookup * __init_refok
+-vclkdev_alloc(struct clk *clk, const char *con_id, const char *dev_fmt,
++vclkdev_alloc(struct clk_hw *hw, const char *con_id, const char *dev_fmt,
+ 	va_list ap)
+ {
+ 	struct clk_lookup_alloc *cla;
+@@ -252,7 +260,7 @@ vclkdev_alloc(struct clk *clk, const cha
+ 	if (!cla)
+ 		return NULL;
+ 
+-	cla->cl.clk = clk;
++	cla->cl.clk_hw = hw;
+ 	if (con_id) {
+ 		strlcpy(cla->con_id, con_id, sizeof(cla->con_id));
+ 		cla->cl.con_id = cla->con_id;
+@@ -273,7 +281,7 @@ clkdev_alloc(struct clk *clk, const char
+ 	va_list ap;
+ 
+ 	va_start(ap, dev_fmt);
+-	cl = vclkdev_alloc(clk, con_id, dev_fmt, ap);
++	cl = vclkdev_alloc(__clk_get_hw(clk), con_id, dev_fmt, ap);
+ 	va_end(ap);
+ 
+ 	return cl;
+@@ -334,7 +342,7 @@ int clk_register_clkdev(struct clk *clk,
+ 		return PTR_ERR(clk);
+ 
+ 	va_start(ap, dev_fmt);
+-	cl = vclkdev_alloc(clk, con_id, dev_fmt, ap);
++	cl = vclkdev_alloc(__clk_get_hw(clk), con_id, dev_fmt, ap);
+ 	va_end(ap);
+ 
+ 	if (!cl)
+@@ -365,8 +373,8 @@ int clk_register_clkdevs(struct clk *clk
+ 		return PTR_ERR(clk);
+ 
+ 	for (i = 0; i < num; i++, cl++) {
+-		cl->clk = clk;
+-		clkdev_add(cl);
++		cl->clk_hw = __clk_get_hw(clk);
++		__clkdev_add(cl);
+ 	}
+ 
+ 	return 0;
+--- a/include/linux/clkdev.h
++++ b/include/linux/clkdev.h
+@@ -22,6 +22,7 @@ struct clk_lookup {
+ 	const char		*dev_id;
+ 	const char		*con_id;
+ 	struct clk		*clk;
++	struct clk_hw		*clk_hw;
+ };
+ 
+ #define CLKDEV_INIT(d, n, c)	\
diff --git a/patches.renesas/clockevents-drivers-sh_cmt-only-perform-clocksource-suspend-resume-if-enabled.patch b/patches.renesas/clockevents-drivers-sh_cmt-only-perform-clocksource-suspend-resume-if-enabled.patch
new file mode 100644
index 0000000..c92f0a2
--- /dev/null
+++ b/patches.renesas/clockevents-drivers-sh_cmt-only-perform-clocksource-suspend-resume-if-enabled.patch
@@ -0,0 +1,107 @@
+From geert@linux-m68k.org Tue Dec  8 09:38:00 2015
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Tue,  8 Dec 2015 18:37:37 +0100
+Subject: [PATCH 1/5] clockevents/drivers/sh_cmt: Only perform clocksource suspend/resume if enabled
+To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: Simon Horman <horms@verge.net.au>, Magnus Damm <magnus.damm@gmail.com>, ltsi-dev@lists.linuxfoundation.org, Geert Uytterhoeven <geert+renesas@glider.be>, Daniel Lezcano <daniel.lezcano@linaro.org>, Peter Zijlstra <peterz@infradead.org>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@kernel.org>
+Message-ID: <1449596261-31005-2-git-send-email-geert+renesas@glider.be>
+
+
+Currently the sh_cmt clocksource timer is disabled or enabled
+unconditionally on clocksource suspend resp. resume, even if a
+better clocksource is present (e.g. arch_sys_counter) and the
+sh_cmt clocksource is not enabled.
+
+As sh_cmt is a syscore device when its timer is enabled, this
+may lead to a genpd.prepared_count imbalance in the presence of
+PM Domains, which may cause a lock-up during reboot after s2ram.
+
+During suspend:
+  - pm_genpd_prepare() is called for all non-syscore devices (incl.
+    sh_cmt), increasing genpd.prepared_count for each device,
+  - clocksource.suspend() is called for all clocksource devices,
+  - sh_cmt_clocksource_suspend() calls sh_cmt_stop(), which is a no-op
+    as the clocksource was not enabled.
+
+During resume:
+  - clocksource.resume() is called for all clocksource devices,
+  - sh_cmt_clocksource_resume() calls sh_cmt_start(), which enables the
+    clocksource timer, and turns sh_cmt into a syscore device,
+  - pm_genpd_complete() is called for all non-syscore devices (excl.
+    sh_cmt now!), decreasing genpd.prepared_count for each device but
+    sh_cmt.
+
+Now genpd.prepared_count of the PM Domain containing sh_cmt is
+still 1 instead of zero.  On subsequent suspend/resume cycles,
+sh_cmt is still a syscore device, hence it's skipped for
+pm_genpd_{prepare,complete}(), keeping the imbalance of
+genpd.prepared_count at 1.
+
+During reboot:
+
+  - platform_drv_shutdown() is called for any platform device that has
+    a driver with a .shutdown() method (only rcar-dmac on R-Car Gen2),
+
+  - platform_drv_shutdown() calls dev_pm_domain_detach(), which
+    calls genpd_dev_pm_detach(),
+
+  - genpd_dev_pm_detach() keeps calling pm_genpd_remove_device() until
+    it doesn't return -EAGAIN[*],
+
+  - If the device is part of the same PM Domain as sh_cmt,
+    pm_genpd_remove_device() always fails with -EAGAIN due to
+    genpd.prepared_count > 0.
+
+  - Infinite loop in genpd_dev_pm_detach()[*].
+
+[*] Commit 93af5e9354432828 ("PM / Domains: Avoid infinite loops in
+    attach/detach code") already limited the number of loop iterations,
+    avoiding the lock-up.
+
+To fix this, only disable or enable the clocksource timer on
+clocksource suspend resp. resume if the clocksource was enabled.
+
+This was tested on r8a7791/koelsch with the CPG Clock Domain:
+
+  - using arch_sys_counter as the clocksource, which is the default, and
+    which showed the problem,
+
+  - using sh_cmt as a clocksource ("echo ffca0000.timer > \
+    /sys/devices/system/clocksource/clocksource0/current_clocksource"),
+    which behaves the same as before.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Link: http://lkml.kernel.org/r/1438875126-12596-2-git-send-email-daniel.lezcano@linaro.org
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+(cherry picked from commit 54d46b7fbcbd00fe4b20a27208e5909facc714e3)
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+---
+ drivers/clocksource/sh_cmt.c |    6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/clocksource/sh_cmt.c
++++ b/drivers/clocksource/sh_cmt.c
+@@ -661,6 +661,9 @@ static void sh_cmt_clocksource_suspend(s
+ {
+ 	struct sh_cmt_channel *ch = cs_to_sh_cmt(cs);
+ 
++	if (!ch->cs_enabled)
++		return;
++
+ 	sh_cmt_stop(ch, FLAG_CLOCKSOURCE);
+ 	pm_genpd_syscore_poweroff(&ch->cmt->pdev->dev);
+ }
+@@ -669,6 +672,9 @@ static void sh_cmt_clocksource_resume(st
+ {
+ 	struct sh_cmt_channel *ch = cs_to_sh_cmt(cs);
+ 
++	if (!ch->cs_enabled)
++		return;
++
+ 	pm_genpd_syscore_poweron(&ch->cmt->pdev->dev);
+ 	sh_cmt_start(ch, FLAG_CLOCKSOURCE);
+ }
diff --git a/patches.renesas/pm-domains-skip-timings-during-syscore-suspend-resume.patch b/patches.renesas/pm-domains-skip-timings-during-syscore-suspend-resume.patch
new file mode 100644
index 0000000..46f5eed
--- /dev/null
+++ b/patches.renesas/pm-domains-skip-timings-during-syscore-suspend-resume.patch
@@ -0,0 +1,215 @@
+From geert@linux-m68k.org Tue Dec  8 09:38:07 2015
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Tue,  8 Dec 2015 18:37:41 +0100
+Subject: [PATCH 5/5] PM / Domains: Skip timings during syscore suspend/resume
+To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: Simon Horman <horms@verge.net.au>, Magnus Damm <magnus.damm@gmail.com>, ltsi-dev@lists.linuxfoundation.org, Geert Uytterhoeven <geert+renesas@glider.be>, "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
+Message-ID: <1449596261-31005-6-git-send-email-geert+renesas@glider.be>
+
+
+The PM Domain code uses ktime_get() to perform various latency
+measurements.  However, if ktime_get() is called while timekeeping is
+suspended, the following warning is printed:
+
+    WARNING: CPU: 0 PID: 1340 at kernel/time/timekeeping.c:576 ktime_get+0x3
+
+This happens when resuming the PM Domain that contains the clock events
+source, which calls pm_genpd_syscore_poweron(). Chain of operations is:
+
+    timekeeping_resume()
+    {
+	clockevents_resume()
+	    sh_cmt_clock_event_resume()
+		pm_genpd_syscore_poweron()
+		    pm_genpd_sync_poweron()
+			genpd_syscore_switch()
+			    genpd_power_on()
+				ktime_get(), but timekeeping_suspended == 1
+	...
+	timekeeping_suspended = 0;
+    }
+
+Fix this by adding a "timed" parameter to genpd_power_{on,off}() and
+pm_genpd_sync_power{off,on}(), to indicate whether latency measurements
+are allowed.  This parameter is passed as false in
+genpd_syscore_switch() (i.e. during syscore suspend/resume), and true in
+all other cases.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+(cherry picked from commit a4630c61274322eda7c4a4d17051f7c72a9e03b1)
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+---
+ drivers/base/power/domain.c |   42 ++++++++++++++++++++++++++----------------
+ 1 file changed, 26 insertions(+), 16 deletions(-)
+
+--- a/drivers/base/power/domain.c
++++ b/drivers/base/power/domain.c
+@@ -181,7 +181,7 @@ static void genpd_recalc_cpu_exit_latenc
+ 	genpd->cpuidle_data->idle_state->exit_latency = usecs64;
+ }
+ 
+-static int genpd_power_on(struct generic_pm_domain *genpd)
++static int genpd_power_on(struct generic_pm_domain *genpd, bool timed)
+ {
+ 	ktime_t time_start;
+ 	s64 elapsed_ns;
+@@ -190,6 +190,9 @@ static int genpd_power_on(struct generic
+ 	if (!genpd->power_on)
+ 		return 0;
+ 
++	if (!timed)
++		return genpd->power_on(genpd);
++
+ 	time_start = ktime_get();
+ 	ret = genpd->power_on(genpd);
+ 	if (ret)
+@@ -208,7 +211,7 @@ static int genpd_power_on(struct generic
+ 	return ret;
+ }
+ 
+-static int genpd_power_off(struct generic_pm_domain *genpd)
++static int genpd_power_off(struct generic_pm_domain *genpd, bool timed)
+ {
+ 	ktime_t time_start;
+ 	s64 elapsed_ns;
+@@ -217,6 +220,9 @@ static int genpd_power_off(struct generi
+ 	if (!genpd->power_off)
+ 		return 0;
+ 
++	if (!timed)
++		return genpd->power_off(genpd);
++
+ 	time_start = ktime_get();
+ 	ret = genpd->power_off(genpd);
+ 	if (ret == -EBUSY)
+@@ -305,7 +311,7 @@ static int __pm_genpd_poweron(struct gen
+ 		}
+ 	}
+ 
+-	ret = genpd_power_on(genpd);
++	ret = genpd_power_on(genpd, true);
+ 	if (ret)
+ 		goto err;
+ 
+@@ -615,7 +621,7 @@ static int pm_genpd_poweroff(struct gene
+ 		 * the pm_genpd_poweron() restore power for us (this shouldn't
+ 		 * happen very often).
+ 		 */
+-		ret = genpd_power_off(genpd);
++		ret = genpd_power_off(genpd, true);
+ 		if (ret == -EBUSY) {
+ 			genpd_set_active(genpd);
+ 			goto out;
+@@ -827,6 +833,7 @@ static bool genpd_dev_active_wakeup(stru
+ /**
+  * pm_genpd_sync_poweroff - Synchronously power off a PM domain and its masters.
+  * @genpd: PM domain to power off, if possible.
++ * @timed: True if latency measurements are allowed.
+  *
+  * Check if the given PM domain can be powered off (during system suspend or
+  * hibernation) and do that if so.  Also, in that case propagate to its masters.
+@@ -836,7 +843,8 @@ static bool genpd_dev_active_wakeup(stru
+  * executed sequentially, so it is guaranteed that it will never run twice in
+  * parallel).
+  */
+-static void pm_genpd_sync_poweroff(struct generic_pm_domain *genpd)
++static void pm_genpd_sync_poweroff(struct generic_pm_domain *genpd,
++				   bool timed)
+ {
+ 	struct gpd_link *link;
+ 
+@@ -847,26 +855,28 @@ static void pm_genpd_sync_poweroff(struc
+ 	    || atomic_read(&genpd->sd_count) > 0)
+ 		return;
+ 
+-	genpd_power_off(genpd);
++	genpd_power_off(genpd, timed);
+ 
+ 	genpd->status = GPD_STATE_POWER_OFF;
+ 
+ 	list_for_each_entry(link, &genpd->slave_links, slave_node) {
+ 		genpd_sd_counter_dec(link->master);
+-		pm_genpd_sync_poweroff(link->master);
++		pm_genpd_sync_poweroff(link->master, timed);
+ 	}
+ }
+ 
+ /**
+  * pm_genpd_sync_poweron - Synchronously power on a PM domain and its masters.
+  * @genpd: PM domain to power on.
++ * @timed: True if latency measurements are allowed.
+  *
+  * This function is only called in "noirq" and "syscore" stages of system power
+  * transitions, so it need not acquire locks (all of the "noirq" callbacks are
+  * executed sequentially, so it is guaranteed that it will never run twice in
+  * parallel).
+  */
+-static void pm_genpd_sync_poweron(struct generic_pm_domain *genpd)
++static void pm_genpd_sync_poweron(struct generic_pm_domain *genpd,
++				  bool timed)
+ {
+ 	struct gpd_link *link;
+ 
+@@ -874,11 +884,11 @@ static void pm_genpd_sync_poweron(struct
+ 		return;
+ 
+ 	list_for_each_entry(link, &genpd->slave_links, slave_node) {
+-		pm_genpd_sync_poweron(link->master);
++		pm_genpd_sync_poweron(link->master, timed);
+ 		genpd_sd_counter_inc(link->master);
+ 	}
+ 
+-	genpd_power_on(genpd);
++	genpd_power_on(genpd, timed);
+ 
+ 	genpd->status = GPD_STATE_ACTIVE;
+ }
+@@ -1056,7 +1066,7 @@ static int pm_genpd_suspend_noirq(struct
+ 	 * the same PM domain, so it is not necessary to use locking here.
+ 	 */
+ 	genpd->suspended_count++;
+-	pm_genpd_sync_poweroff(genpd);
++	pm_genpd_sync_poweroff(genpd, true);
+ 
+ 	return 0;
+ }
+@@ -1086,7 +1096,7 @@ static int pm_genpd_resume_noirq(struct
+ 	 * guaranteed that this function will never run twice in parallel for
+ 	 * the same PM domain, so it is not necessary to use locking here.
+ 	 */
+-	pm_genpd_sync_poweron(genpd);
++	pm_genpd_sync_poweron(genpd, true);
+ 	genpd->suspended_count--;
+ 
+ 	return genpd_start_dev(genpd, dev);
+@@ -1300,7 +1310,7 @@ static int pm_genpd_restore_noirq(struct
+ 			 * If the domain was off before the hibernation, make
+ 			 * sure it will be off going forward.
+ 			 */
+-			genpd_power_off(genpd);
++			genpd_power_off(genpd, true);
+ 
+ 			return 0;
+ 		}
+@@ -1309,7 +1319,7 @@ static int pm_genpd_restore_noirq(struct
+ 	if (genpd->suspend_power_off)
+ 		return 0;
+ 
+-	pm_genpd_sync_poweron(genpd);
++	pm_genpd_sync_poweron(genpd, true);
+ 
+ 	return genpd_start_dev(genpd, dev);
+ }
+@@ -1367,9 +1377,9 @@ static void genpd_syscore_switch(struct
+ 
+ 	if (suspend) {
+ 		genpd->suspended_count++;
+-		pm_genpd_sync_poweroff(genpd);
++		pm_genpd_sync_poweroff(genpd, false);
+ 	} else {
+-		pm_genpd_sync_poweron(genpd);
++		pm_genpd_sync_poweron(genpd, false);
+ 		genpd->suspended_count--;
+ 	}
+ }
diff --git a/series b/series
index 981d220..4a50044 100644
--- a/series
+++ b/series
@@ -354,6 +354,11 @@
 patches.renesas/0335-staging-make-board-support-depend-on-OF_IRQ-and-CLKD.patch
 patches.renesas/0336-staging-board-Migrate-away-from-__pm_genpd_name_add_.patch
 patches.renesas/0337-ARM-dts-fix-gpio-keys-wakeup-source-property.patch
+patches.renesas/clockevents-drivers-sh_cmt-only-perform-clocksource-suspend-resume-if-enabled.patch
+patches.renesas/clkdev-use-clk_hw-internally.patch
+patches.renesas/clkdev-const-ify-connection-id-to-clk_add_alias.patch
+patches.renesas/clkdev-get-rid-of-redundant-clk_add_alias-prototype-in-linux-clk.h.patch
+patches.renesas/pm-domains-skip-timings-during-syscore-suspend-resume.patch
 
 #############################################################################
 # Altera patches