All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RT 00/20] Linux 4.1.27-rt31-rc1
@ 2016-07-12 14:24 Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 01/20] ARM: at91: pm: simply call at91_pm_init Steven Rostedt
                   ` (20 more replies)
  0 siblings, 21 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker


Dear RT Folks,

This is the RT stable review cycle of patch 4.1.27-rt31-rc1.

Please scream at me if I messed something up. Please test the patches too.

The -rc release will be uploaded to kernel.org and will be deleted when
the final release is out. This is just a review release (or release candidate).

The pre-releases will not be pushed to the git repository, only the
final release is.

If all goes well, this patch will be converted to the next main release
on 7/14/2016.

Enjoy,

-- Steve


To build 4.1.27-rt31-rc1 directly, the following patches should be applied:

  http://www.kernel.org/pub/linux/kernel/v3.x/linux-4.1.tar.xz

  http://www.kernel.org/pub/linux/kernel/v3.x/patch-4.1.27.xz

  http://www.kernel.org/pub/linux/kernel/projects/rt/4.1/patch-4.1.27-rt31-rc1.patch.xz

You can also build from 4.1.27-rt30 by applying the incremental patch:

http://www.kernel.org/pub/linux/kernel/projects/rt/4.1/incr/patch-4.1.27-rt30-rt31-rc1.patch.xz


Changes from 4.1.27-rt30:

---


Alexandre Belloni (5):
      ARM: at91: pm: simply call at91_pm_init
      ARM: at91: pm: find and remap the pmc
      ARM: at91: pm: move idle functions to pm.c
      ARM: at91: remove useless includes and function prototypes
      usb: gadget: atmel: access the PMC using regmap

Josh Cartwright (1):
      list_bl: fixup bogus lockdep warning

Luiz Capitulino (1):
      mm: perform lru_add_drain_all() remotely

Mike Galbraith (2):
      mm/zsmalloc: Use get/put_cpu_light in zs_map_object()/zs_unmap_object()
      drivers/block/zram: Replace bit spinlocks with rtmutex for -rt

Peter Zijlstra (1):
      sched,preempt: Fix preempt_count manipulations

Rik van Riel (1):
      kvm, rt: change async pagefault code locking for PREEMPT_RT

Sebastian Andrzej Siewior (7):
      net: dev: always take qdisc's busylock in __dev_xmit_skb()
      ARM: imx: always use TWD on IMX6Q
      drivers/block/zram: fixup compile for !RT
      kernel/printk: Don't try to print from IRQ/NMI region
      arm: lazy preempt: correct resched condition
      locallock: add local_lock_on()
      trace: correct off by one while recording the trace-event

Steven Rostedt (Red Hat) (1):
      Linux 4.1.27-rt31-rc1

Thomas Gleixner (1):
      perf/x86/intel/rapl: Make PMU lock raw

----
 arch/arm/kernel/entry-armv.S                |  6 ++-
 arch/arm/mach-at91/at91rm9200.c             |  2 -
 arch/arm/mach-at91/at91sam9.c               |  2 -
 arch/arm/mach-at91/generic.h                | 13 +-----
 arch/arm/mach-at91/pm.c                     | 70 ++++++++++++++++++++++++-----
 arch/arm/mach-at91/sama5.c                  |  2 +-
 arch/arm/mach-imx/Kconfig                   |  2 +-
 arch/x86/kernel/cpu/perf_event_intel_rapl.c | 20 ++++-----
 arch/x86/kernel/kvm.c                       | 37 +++++++--------
 drivers/block/zram/zram_drv.c               | 30 +++++++------
 drivers/block/zram/zram_drv.h               | 41 +++++++++++++++++
 drivers/clk/at91/pmc.c                      | 15 -------
 drivers/usb/gadget/udc/atmel_usba_udc.c     | 20 ++++-----
 drivers/usb/gadget/udc/atmel_usba_udc.h     |  2 +
 include/asm-generic/preempt.h               |  4 +-
 include/linux/list_bl.h                     | 12 ++---
 include/linux/locallock.h                   |  6 +++
 kernel/printk/printk.c                      | 10 +++++
 kernel/trace/trace_events.c                 |  8 ++++
 localversion-rt                             |  2 +-
 mm/swap.c                                   | 37 ++++++++++++---
 mm/zsmalloc.c                               |  4 +-
 net/core/dev.c                              |  4 ++
 23 files changed, 236 insertions(+), 113 deletions(-)

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

* [PATCH RT 01/20] ARM: at91: pm: simply call at91_pm_init
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 02/20] ARM: at91: pm: find and remap the pmc Steven Rostedt
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Alexandre Belloni, Boris Brezillon

[-- Attachment #1: 0001-ARM-at91-pm-simply-call-at91_pm_init.patch --]
[-- Type: text/plain, Size: 1607 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Alexandre Belloni <alexandre.belloni@free-electrons.com>

at91_pm_init() doesn't return a value, as is the case for its callers,
simply call it instead of returning its non-existent return value.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/arm/mach-at91/pm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 5062699cbb12..460181caf51e 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -427,7 +427,7 @@ void __init at91sam9260_pm_init(void)
 	at91_dt_ramc();
 	at91_pm_data.memctrl = AT91_MEMCTRL_SDRAMC;
 	at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP;
-	return at91_pm_init();
+	at91_pm_init();
 }
 
 void __init at91sam9g45_pm_init(void)
@@ -435,7 +435,7 @@ void __init at91sam9g45_pm_init(void)
 	at91_dt_ramc();
 	at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP;
 	at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
-	return at91_pm_init();
+	at91_pm_init();
 }
 
 void __init at91sam9x5_pm_init(void)
@@ -443,5 +443,5 @@ void __init at91sam9x5_pm_init(void)
 	at91_dt_ramc();
 	at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP;
 	at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
-	return at91_pm_init();
+	at91_pm_init();
 }
-- 
2.8.1

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

* [PATCH RT 02/20] ARM: at91: pm: find and remap the pmc
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 01/20] ARM: at91: pm: simply call at91_pm_init Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 03/20] ARM: at91: pm: move idle functions to pm.c Steven Rostedt
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Alexandre Belloni, Boris Brezillon

[-- Attachment #1: 0002-ARM-at91-pm-find-and-remap-the-pmc.patch --]
[-- Type: text/plain, Size: 2924 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Alexandre Belloni <alexandre.belloni@free-electrons.com>

To avoid relying on at91_pmc_read(), find the pmc node and remap it
locally.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/arm/mach-at91/pm.c | 33 +++++++++++++++++++++++++++------
 1 file changed, 27 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 460181caf51e..1aebb2e9b258 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -35,6 +35,8 @@
 #include "generic.h"
 #include "pm.h"
 
+static void __iomem *pmc;
+
 /*
  * FIXME: this is needed to communicate between the pinctrl driver and
  * the PM implementation in the machine. Possibly part of the PM
@@ -85,7 +87,7 @@ static int at91_pm_verify_clocks(void)
 	unsigned long scsr;
 	int i;
 
-	scsr = at91_pmc_read(AT91_PMC_SCSR);
+	scsr = readl(pmc + AT91_PMC_SCSR);
 
 	/* USB must not be using PLLB */
 	if ((scsr & at91_pm_data.uhp_udp_mask) != 0) {
@@ -99,8 +101,7 @@ static int at91_pm_verify_clocks(void)
 
 		if ((scsr & (AT91_PMC_PCK0 << i)) == 0)
 			continue;
-
-		css = at91_pmc_read(AT91_PMC_PCKR(i)) & AT91_PMC_CSS;
+		css = readl(pmc + AT91_PMC_PCKR(i)) & AT91_PMC_CSS;
 		if (css != AT91_PMC_CSS_SLOW) {
 			pr_err("AT91: PM - Suspend-to-RAM with PCK%d src %d\n", i, css);
 			return 0;
@@ -143,8 +144,8 @@ static void at91_pm_suspend(suspend_state_t state)
 	flush_cache_all();
 	outer_disable();
 
-	at91_suspend_sram_fn(at91_pmc_base, at91_ramc_base[0],
-				at91_ramc_base[1], pm_data);
+	at91_suspend_sram_fn(pmc, at91_ramc_base[0],
+			     at91_ramc_base[1], pm_data);
 
 	outer_resume();
 }
@@ -394,13 +395,33 @@ static void __init at91_pm_sram_init(void)
 			&at91_pm_suspend_in_sram, at91_pm_suspend_in_sram_sz);
 }
 
+static const struct of_device_id atmel_pmc_ids[] __initconst = {
+	{ .compatible = "atmel,at91rm9200-pmc"  },
+	{ .compatible = "atmel,at91sam9260-pmc" },
+	{ .compatible = "atmel,at91sam9g45-pmc" },
+	{ .compatible = "atmel,at91sam9n12-pmc" },
+	{ .compatible = "atmel,at91sam9x5-pmc" },
+	{ .compatible = "atmel,sama5d3-pmc" },
+	{ .compatible = "atmel,sama5d2-pmc" },
+	{ /* sentinel */ },
+};
+
 static void __init at91_pm_init(void)
 {
-	at91_pm_sram_init();
+	struct device_node *pmc_np;
 
 	if (at91_cpuidle_device.dev.platform_data)
 		platform_device_register(&at91_cpuidle_device);
 
+	pmc_np = of_find_matching_node(NULL, atmel_pmc_ids);
+	pmc = of_iomap(pmc_np, 0);
+	if (!pmc) {
+		pr_err("AT91: PM not supported, PMC not found\n");
+		return;
+	}
+
+	at91_pm_sram_init();
+
 	if (at91_suspend_sram_fn)
 		suspend_set_ops(&at91_pm_ops);
 	else
-- 
2.8.1

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

* [PATCH RT 03/20] ARM: at91: pm: move idle functions to pm.c
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 01/20] ARM: at91: pm: simply call at91_pm_init Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 02/20] ARM: at91: pm: find and remap the pmc Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 04/20] ARM: at91: remove useless includes and function prototypes Steven Rostedt
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Alexandre Belloni, Boris Brezillon

[-- Attachment #1: 0003-ARM-at91-pm-move-idle-functions-to-pm.c.patch --]
[-- Type: text/plain, Size: 6469 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Alexandre Belloni <alexandre.belloni@free-electrons.com>

Avoid using code from clk/at91 for PM.
This also has the bonus effect of setting arm_pm_idle for sama5 platforms.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/arm/mach-at91/at91rm9200.c |  2 --
 arch/arm/mach-at91/at91sam9.c   |  2 --
 arch/arm/mach-at91/generic.h    |  6 ++----
 arch/arm/mach-at91/pm.c         | 37 ++++++++++++++++++++++++++++++++-----
 arch/arm/mach-at91/sama5.c      |  2 +-
 drivers/clk/at91/pmc.c          | 15 ---------------
 6 files changed, 35 insertions(+), 29 deletions(-)

diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index eaf58f88ef5d..8d3cb458a99c 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -13,7 +13,6 @@
 #include <linux/of_platform.h>
 
 #include <asm/mach/arch.h>
-#include <asm/system_misc.h>
 
 #include "generic.h"
 #include "soc.h"
@@ -34,7 +33,6 @@ static void __init at91rm9200_dt_device_init(void)
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev);
 
-	arm_pm_idle = at91rm9200_idle;
 	at91rm9200_pm_init();
 }
 
diff --git a/arch/arm/mach-at91/at91sam9.c b/arch/arm/mach-at91/at91sam9.c
index e47a2093a0e7..d2bede665a1b 100644
--- a/arch/arm/mach-at91/at91sam9.c
+++ b/arch/arm/mach-at91/at91sam9.c
@@ -62,8 +62,6 @@ static void __init at91sam9_common_init(void)
 		soc_dev = soc_device_to_device(soc);
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev);
-
-	arm_pm_idle = at91sam9_idle;
 }
 
 static void __init at91sam9_dt_device_init(void)
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index b0fa7dc7286d..d224e195706a 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -18,20 +18,18 @@
 extern void __init at91_map_io(void);
 extern void __init at91_alt_map_io(void);
 
-/* idle */
-extern void at91rm9200_idle(void);
-extern void at91sam9_idle(void);
-
 #ifdef CONFIG_PM
 extern void __init at91rm9200_pm_init(void);
 extern void __init at91sam9260_pm_init(void);
 extern void __init at91sam9g45_pm_init(void);
 extern void __init at91sam9x5_pm_init(void);
+extern void __init sama5_pm_init(void);
 #else
 static inline void __init at91rm9200_pm_init(void) { }
 static inline void __init at91sam9260_pm_init(void) { }
 static inline void __init at91sam9g45_pm_init(void) { }
 static inline void __init at91sam9x5_pm_init(void) { }
+static inline void __init sama5_pm_init(void) { }
 #endif
 
 #endif /* _AT91_GENERIC_H */
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 1aebb2e9b258..3be82cf983dd 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -31,6 +31,7 @@
 #include <asm/mach/irq.h>
 #include <asm/fncpy.h>
 #include <asm/cacheflush.h>
+#include <asm/system_misc.h>
 
 #include "generic.h"
 #include "pm.h"
@@ -349,6 +350,21 @@ static __init void at91_dt_ramc(void)
 	at91_pm_set_standby(standby);
 }
 
+void at91rm9200_idle(void)
+{
+	/*
+	 * Disable the processor clock.  The processor will be automatically
+	 * re-enabled by an interrupt or by a reset.
+	 */
+	writel(AT91_PMC_PCK, pmc + AT91_PMC_SCDR);
+}
+
+void at91sam9_idle(void)
+{
+	writel(AT91_PMC_PCK, pmc + AT91_PMC_SCDR);
+	cpu_do_idle();
+}
+
 static void __init at91_pm_sram_init(void)
 {
 	struct gen_pool *sram_pool;
@@ -406,7 +422,7 @@ static const struct of_device_id atmel_pmc_ids[] __initconst = {
 	{ /* sentinel */ },
 };
 
-static void __init at91_pm_init(void)
+static void __init at91_pm_init(void (*pm_idle)(void))
 {
 	struct device_node *pmc_np;
 
@@ -420,6 +436,9 @@ static void __init at91_pm_init(void)
 		return;
 	}
 
+	if (pm_idle)
+		arm_pm_idle = pm_idle;
+
 	at91_pm_sram_init();
 
 	if (at91_suspend_sram_fn)
@@ -440,7 +459,7 @@ void __init at91rm9200_pm_init(void)
 	at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP;
 	at91_pm_data.memctrl = AT91_MEMCTRL_MC;
 
-	at91_pm_init();
+	at91_pm_init(at91rm9200_idle);
 }
 
 void __init at91sam9260_pm_init(void)
@@ -448,7 +467,7 @@ void __init at91sam9260_pm_init(void)
 	at91_dt_ramc();
 	at91_pm_data.memctrl = AT91_MEMCTRL_SDRAMC;
 	at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP;
-	at91_pm_init();
+	at91_pm_init(at91sam9_idle);
 }
 
 void __init at91sam9g45_pm_init(void)
@@ -456,7 +475,7 @@ void __init at91sam9g45_pm_init(void)
 	at91_dt_ramc();
 	at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP;
 	at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
-	at91_pm_init();
+	at91_pm_init(at91sam9_idle);
 }
 
 void __init at91sam9x5_pm_init(void)
@@ -464,5 +483,13 @@ void __init at91sam9x5_pm_init(void)
 	at91_dt_ramc();
 	at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP;
 	at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
-	at91_pm_init();
+	at91_pm_init(at91sam9_idle);
+}
+
+void __init sama5_pm_init(void)
+{
+	at91_dt_ramc();
+	at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP;
+	at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
+	at91_pm_init(NULL);
 }
diff --git a/arch/arm/mach-at91/sama5.c b/arch/arm/mach-at91/sama5.c
index 41d829d8e7d5..3755da6decf5 100644
--- a/arch/arm/mach-at91/sama5.c
+++ b/arch/arm/mach-at91/sama5.c
@@ -49,7 +49,7 @@ static void __init sama5_dt_device_init(void)
 		soc_dev = soc_device_to_device(soc);
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev);
-	at91sam9x5_pm_init();
+	sama5_pm_init();
 }
 
 static const char *sama5_dt_board_compat[] __initconst = {
diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c
index 3f27d21fb729..b83480f599ce 100644
--- a/drivers/clk/at91/pmc.c
+++ b/drivers/clk/at91/pmc.c
@@ -27,21 +27,6 @@
 void __iomem *at91_pmc_base;
 EXPORT_SYMBOL_GPL(at91_pmc_base);
 
-void at91rm9200_idle(void)
-{
-	/*
-	 * Disable the processor clock.  The processor will be automatically
-	 * re-enabled by an interrupt or by a reset.
-	 */
-	at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK);
-}
-
-void at91sam9_idle(void)
-{
-	at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK);
-	cpu_do_idle();
-}
-
 int of_at91_get_clk_range(struct device_node *np, const char *propname,
 			  struct clk_range *range)
 {
-- 
2.8.1

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

* [PATCH RT 04/20] ARM: at91: remove useless includes and function prototypes
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (2 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 03/20] ARM: at91: pm: move idle functions to pm.c Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 05/20] usb: gadget: atmel: access the PMC using regmap Steven Rostedt
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Alexandre Belloni, Boris Brezillon

[-- Attachment #1: 0004-ARM-at91-remove-useless-includes-and-function-protot.patch --]
[-- Type: text/plain, Size: 1072 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Alexandre Belloni <alexandre.belloni@free-electrons.com>

Remove leftover from the previous cleanup

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/arm/mach-at91/generic.h | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index d224e195706a..28ca57a2060f 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -11,13 +11,6 @@
 #ifndef _AT91_GENERIC_H
 #define _AT91_GENERIC_H
 
-#include <linux/of.h>
-#include <linux/reboot.h>
-
- /* Map io */
-extern void __init at91_map_io(void);
-extern void __init at91_alt_map_io(void);
-
 #ifdef CONFIG_PM
 extern void __init at91rm9200_pm_init(void);
 extern void __init at91sam9260_pm_init(void);
-- 
2.8.1

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

* [PATCH RT 05/20] usb: gadget: atmel: access the PMC using regmap
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (3 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 04/20] ARM: at91: remove useless includes and function prototypes Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 06/20] kvm, rt: change async pagefault code locking for PREEMPT_RT Steven Rostedt
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Alexandre Belloni, Boris Brezillon,
	Felipe Balbi

[-- Attachment #1: 0005-usb-gadget-atmel-access-the-PMC-using-regmap.patch --]
[-- Type: text/plain, Size: 2916 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Alexandre Belloni <alexandre.belloni@free-electrons.com>

Use regmap to access the PMC to avoid using at91_pmc_read and
at91_pmc_write.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/usb/gadget/udc/atmel_usba_udc.c | 20 ++++++++++----------
 drivers/usb/gadget/udc/atmel_usba_udc.h |  2 ++
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index d6ca3697d3c8..ee6bc64f9656 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -17,7 +17,9 @@
 #include <linux/device.h>
 #include <linux/dma-mapping.h>
 #include <linux/list.h>
+#include <linux/mfd/syscon.h>
 #include <linux/platform_device.h>
+#include <linux/regmap.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
 #include <linux/usb/atmel_usba_udc.h>
@@ -1889,20 +1891,15 @@ static int atmel_usba_stop(struct usb_gadget *gadget)
 #ifdef CONFIG_OF
 static void at91sam9rl_toggle_bias(struct usba_udc *udc, int is_on)
 {
-	unsigned int uckr = at91_pmc_read(AT91_CKGR_UCKR);
-
-	if (is_on)
-		at91_pmc_write(AT91_CKGR_UCKR, uckr | AT91_PMC_BIASEN);
-	else
-		at91_pmc_write(AT91_CKGR_UCKR, uckr & ~(AT91_PMC_BIASEN));
+	regmap_update_bits(udc->pmc, AT91_CKGR_UCKR, AT91_PMC_BIASEN,
+			   is_on ? AT91_PMC_BIASEN : 0);
 }
 
 static void at91sam9g45_pulse_bias(struct usba_udc *udc)
 {
-	unsigned int uckr = at91_pmc_read(AT91_CKGR_UCKR);
-
-	at91_pmc_write(AT91_CKGR_UCKR, uckr & ~(AT91_PMC_BIASEN));
-	at91_pmc_write(AT91_CKGR_UCKR, uckr | AT91_PMC_BIASEN);
+	regmap_update_bits(udc->pmc, AT91_CKGR_UCKR, AT91_PMC_BIASEN, 0);
+	regmap_update_bits(udc->pmc, AT91_CKGR_UCKR, AT91_PMC_BIASEN,
+			   AT91_PMC_BIASEN);
 }
 
 static const struct usba_udc_errata at91sam9rl_errata = {
@@ -1939,6 +1936,9 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev,
 		return ERR_PTR(-EINVAL);
 
 	udc->errata = match->data;
+	udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9g45-pmc");
+	if (udc->errata && IS_ERR(udc->pmc))
+		return ERR_CAST(udc->pmc);
 
 	udc->num_ep = 0;
 
diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.h b/drivers/usb/gadget/udc/atmel_usba_udc.h
index ea448a344767..3e1c9d589dfa 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.h
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.h
@@ -354,6 +354,8 @@ struct usba_udc {
 	struct dentry *debugfs_root;
 	struct dentry *debugfs_regs;
 #endif
+
+	struct regmap *pmc;
 };
 
 static inline struct usba_ep *to_usba_ep(struct usb_ep *ep)
-- 
2.8.1

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

* [PATCH RT 06/20] kvm, rt: change async pagefault code locking for PREEMPT_RT
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (4 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 05/20] usb: gadget: atmel: access the PMC using regmap Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 07/20] mm/zsmalloc: Use get/put_cpu_light in zs_map_object()/zs_unmap_object() Steven Rostedt
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Rik van Riel, Paolo Bonzini

[-- Attachment #1: 0006-kvm-rt-change-async-pagefault-code-locking-for-PREEM.patch --]
[-- Type: text/plain, Size: 4517 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Rik van Riel <riel@redhat.com>

The async pagefault wake code can run from the idle task in exception
context, so everything here needs to be made non-preemptible.

Conversion to a simple wait queue and raw spinlock does the trick.

Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/x86/kernel/kvm.c | 37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 9435620062df..ba97b5b45879 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -36,6 +36,7 @@
 #include <linux/kprobes.h>
 #include <linux/debugfs.h>
 #include <linux/nmi.h>
+#include <linux/wait-simple.h>
 #include <asm/timer.h>
 #include <asm/cpu.h>
 #include <asm/traps.h>
@@ -91,14 +92,14 @@ static void kvm_io_delay(void)
 
 struct kvm_task_sleep_node {
 	struct hlist_node link;
-	wait_queue_head_t wq;
+	struct swait_head wq;
 	u32 token;
 	int cpu;
 	bool halted;
 };
 
 static struct kvm_task_sleep_head {
-	spinlock_t lock;
+	raw_spinlock_t lock;
 	struct hlist_head list;
 } async_pf_sleepers[KVM_TASK_SLEEP_HASHSIZE];
 
@@ -122,17 +123,17 @@ void kvm_async_pf_task_wait(u32 token)
 	u32 key = hash_32(token, KVM_TASK_SLEEP_HASHBITS);
 	struct kvm_task_sleep_head *b = &async_pf_sleepers[key];
 	struct kvm_task_sleep_node n, *e;
-	DEFINE_WAIT(wait);
+	DEFINE_SWAITER(wait);
 
 	rcu_irq_enter();
 
-	spin_lock(&b->lock);
+	raw_spin_lock(&b->lock);
 	e = _find_apf_task(b, token);
 	if (e) {
 		/* dummy entry exist -> wake up was delivered ahead of PF */
 		hlist_del(&e->link);
 		kfree(e);
-		spin_unlock(&b->lock);
+		raw_spin_unlock(&b->lock);
 
 		rcu_irq_exit();
 		return;
@@ -141,13 +142,13 @@ void kvm_async_pf_task_wait(u32 token)
 	n.token = token;
 	n.cpu = smp_processor_id();
 	n.halted = is_idle_task(current) || preempt_count() > 1;
-	init_waitqueue_head(&n.wq);
+	init_swait_head(&n.wq);
 	hlist_add_head(&n.link, &b->list);
-	spin_unlock(&b->lock);
+	raw_spin_unlock(&b->lock);
 
 	for (;;) {
 		if (!n.halted)
-			prepare_to_wait(&n.wq, &wait, TASK_UNINTERRUPTIBLE);
+			swait_prepare(&n.wq, &wait, TASK_UNINTERRUPTIBLE);
 		if (hlist_unhashed(&n.link))
 			break;
 
@@ -166,7 +167,7 @@ void kvm_async_pf_task_wait(u32 token)
 		}
 	}
 	if (!n.halted)
-		finish_wait(&n.wq, &wait);
+		swait_finish(&n.wq, &wait);
 
 	rcu_irq_exit();
 	return;
@@ -178,8 +179,8 @@ static void apf_task_wake_one(struct kvm_task_sleep_node *n)
 	hlist_del_init(&n->link);
 	if (n->halted)
 		smp_send_reschedule(n->cpu);
-	else if (waitqueue_active(&n->wq))
-		wake_up(&n->wq);
+	else if (swaitqueue_active(&n->wq))
+		swait_wake(&n->wq);
 }
 
 static void apf_task_wake_all(void)
@@ -189,14 +190,14 @@ static void apf_task_wake_all(void)
 	for (i = 0; i < KVM_TASK_SLEEP_HASHSIZE; i++) {
 		struct hlist_node *p, *next;
 		struct kvm_task_sleep_head *b = &async_pf_sleepers[i];
-		spin_lock(&b->lock);
+		raw_spin_lock(&b->lock);
 		hlist_for_each_safe(p, next, &b->list) {
 			struct kvm_task_sleep_node *n =
 				hlist_entry(p, typeof(*n), link);
 			if (n->cpu == smp_processor_id())
 				apf_task_wake_one(n);
 		}
-		spin_unlock(&b->lock);
+		raw_spin_unlock(&b->lock);
 	}
 }
 
@@ -212,7 +213,7 @@ void kvm_async_pf_task_wake(u32 token)
 	}
 
 again:
-	spin_lock(&b->lock);
+	raw_spin_lock(&b->lock);
 	n = _find_apf_task(b, token);
 	if (!n) {
 		/*
@@ -225,17 +226,17 @@ again:
 			 * Allocation failed! Busy wait while other cpu
 			 * handles async PF.
 			 */
-			spin_unlock(&b->lock);
+			raw_spin_unlock(&b->lock);
 			cpu_relax();
 			goto again;
 		}
 		n->token = token;
 		n->cpu = smp_processor_id();
-		init_waitqueue_head(&n->wq);
+		init_swait_head(&n->wq);
 		hlist_add_head(&n->link, &b->list);
 	} else
 		apf_task_wake_one(n);
-	spin_unlock(&b->lock);
+	raw_spin_unlock(&b->lock);
 	return;
 }
 EXPORT_SYMBOL_GPL(kvm_async_pf_task_wake);
@@ -486,7 +487,7 @@ void __init kvm_guest_init(void)
 	paravirt_ops_setup();
 	register_reboot_notifier(&kvm_pv_reboot_nb);
 	for (i = 0; i < KVM_TASK_SLEEP_HASHSIZE; i++)
-		spin_lock_init(&async_pf_sleepers[i].lock);
+		raw_spin_lock_init(&async_pf_sleepers[i].lock);
 	if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF))
 		x86_init.irqs.trap_init = kvm_apf_trap_init;
 
-- 
2.8.1

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

* [PATCH RT 07/20] mm/zsmalloc: Use get/put_cpu_light in zs_map_object()/zs_unmap_object()
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (5 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 06/20] kvm, rt: change async pagefault code locking for PREEMPT_RT Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 08/20] net: dev: always take qdiscs busylock in __dev_xmit_skb() Steven Rostedt
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Mike Galbraith

[-- Attachment #1: 0007-mm-zsmalloc-Use-get-put_cpu_light-in-zs_map_object-z.patch --]
[-- Type: text/plain, Size: 1229 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Mike Galbraith <umgwanakikbuti@gmail.com>

Otherwise, we get a ___might_sleep() splat.

Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 mm/zsmalloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index fb1ec10ce449..e819dffd142c 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1289,7 +1289,7 @@ void *zs_map_object(struct zs_pool *pool, unsigned long handle,
 	class = pool->size_class[class_idx];
 	off = obj_idx_to_offset(page, obj_idx, class->size);
 
-	area = &get_cpu_var(zs_map_area);
+	area = per_cpu_ptr(&zs_map_area, get_cpu_light());
 	area->vm_mm = mm;
 	if (off + class->size <= PAGE_SIZE) {
 		/* this object is contained entirely within a page */
@@ -1342,7 +1342,7 @@ void zs_unmap_object(struct zs_pool *pool, unsigned long handle)
 
 		__zs_unmap_object(area, pages, off, class->size);
 	}
-	put_cpu_var(zs_map_area);
+	put_cpu_light();
 	unpin_tag(handle);
 }
 EXPORT_SYMBOL_GPL(zs_unmap_object);
-- 
2.8.1

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

* [PATCH RT 08/20] net: dev: always take qdiscs busylock in __dev_xmit_skb()
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (6 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 07/20] mm/zsmalloc: Use get/put_cpu_light in zs_map_object()/zs_unmap_object() Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 09/20] drivers/block/zram: Replace bit spinlocks with rtmutex for -rt Steven Rostedt
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker

[-- Attachment #1: 0008-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch --]
[-- Type: text/plain, Size: 1420 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

The root-lock is dropped before dev_hard_start_xmit() is invoked and after
setting the __QDISC___STATE_RUNNING bit. If this task is now pushed away
by a task with a higher priority then the task with the higher priority
won't be able to submit packets to the NIC directly instead they will be
enqueued into the Qdisc. The NIC will remain idle until the task(s) with
higher priority leave the CPU and the task with lower priority gets back
and finishes the job.

If we take always the busylock we ensure that the RT task can boost the
low-prio task and submit the packet.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/core/dev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/core/dev.c b/net/core/dev.c
index a824c9998283..78912da59fc1 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2828,7 +2828,11 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
 	 * This permits __QDISC___STATE_RUNNING owner to get the lock more
 	 * often and dequeue packets faster.
 	 */
+#ifdef CONFIG_PREEMPT_RT_FULL
+	contended = true;
+#else
 	contended = qdisc_is_running(q);
+#endif
 	if (unlikely(contended))
 		spin_lock(&q->busylock);
 
-- 
2.8.1

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

* [PATCH RT 09/20] drivers/block/zram: Replace bit spinlocks with rtmutex for -rt
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (7 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 08/20] net: dev: always take qdiscs busylock in __dev_xmit_skb() Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 10/20] list_bl: fixup bogus lockdep warning Steven Rostedt
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Mike Galbraith

[-- Attachment #1: 0009-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch --]
[-- Type: text/plain, Size: 6097 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Mike Galbraith <umgwanakikbuti@gmail.com>

They're nondeterministic, and lead to ___might_sleep() splats in -rt.
OTOH, they're a lot less wasteful than an rtmutex per page.

Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/block/zram/zram_drv.c | 30 ++++++++++++++++--------------
 drivers/block/zram/zram_drv.h | 41 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+), 14 deletions(-)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 6e134f4759c0..d2782d492630 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -386,6 +386,8 @@ static struct zram_meta *zram_meta_alloc(int device_id, u64 disksize)
 		goto out_error;
 	}
 
+	zram_meta_init_table_locks(meta, disksize);
+
 	return meta;
 
 out_error:
@@ -484,12 +486,12 @@ static int zram_decompress_page(struct zram *zram, char *mem, u32 index)
 	unsigned long handle;
 	size_t size;
 
-	bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value);
+	zram_lock_table(&meta->table[index]);
 	handle = meta->table[index].handle;
 	size = zram_get_obj_size(meta, index);
 
 	if (!handle || zram_test_flag(meta, index, ZRAM_ZERO)) {
-		bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value);
+		zram_unlock_table(&meta->table[index]);
 		clear_page(mem);
 		return 0;
 	}
@@ -500,7 +502,7 @@ static int zram_decompress_page(struct zram *zram, char *mem, u32 index)
 	else
 		ret = zcomp_decompress(zram->comp, cmem, size, mem);
 	zs_unmap_object(meta->mem_pool, handle);
-	bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value);
+	zram_unlock_table(&meta->table[index]);
 
 	/* Should NEVER happen. Return bio error if it does. */
 	if (unlikely(ret)) {
@@ -520,14 +522,14 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,
 	struct zram_meta *meta = zram->meta;
 	page = bvec->bv_page;
 
-	bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value);
+	zram_lock_table(&meta->table[index]);
 	if (unlikely(!meta->table[index].handle) ||
 			zram_test_flag(meta, index, ZRAM_ZERO)) {
-		bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value);
+		zram_unlock_table(&meta->table[index]);
 		handle_zero_page(bvec);
 		return 0;
 	}
-	bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value);
+	zram_unlock_table(&meta->table[index]);
 
 	if (is_partial_io(bvec))
 		/* Use  a temporary buffer to decompress the page */
@@ -622,10 +624,10 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 		if (user_mem)
 			kunmap_atomic(user_mem);
 		/* Free memory associated with this sector now. */
-		bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value);
+		zram_lock_table(&meta->table[index]);
 		zram_free_page(zram, index);
 		zram_set_flag(meta, index, ZRAM_ZERO);
-		bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value);
+		zram_unlock_table(&meta->table[index]);
 
 		atomic64_inc(&zram->stats.zero_pages);
 		ret = 0;
@@ -685,12 +687,12 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 	 * Free memory associated with this sector
 	 * before overwriting unused sectors.
 	 */
-	bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value);
+	zram_lock_table(&meta->table[index]);
 	zram_free_page(zram, index);
 
 	meta->table[index].handle = handle;
 	zram_set_obj_size(meta, index, clen);
-	bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value);
+	zram_unlock_table(&meta->table[index]);
 
 	/* Update stats */
 	atomic64_add(clen, &zram->stats.compr_data_size);
@@ -762,9 +764,9 @@ static void zram_bio_discard(struct zram *zram, u32 index,
 	}
 
 	while (n >= PAGE_SIZE) {
-		bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value);
+		zram_lock_table(&meta->table[index]);
 		zram_free_page(zram, index);
-		bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value);
+		zram_unlock_table(&meta->table[index]);
 		atomic64_inc(&zram->stats.notify_free);
 		index++;
 		n -= PAGE_SIZE;
@@ -1007,9 +1009,9 @@ static void zram_slot_free_notify(struct block_device *bdev,
 	zram = bdev->bd_disk->private_data;
 	meta = zram->meta;
 
-	bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value);
+	zram_lock_table(&meta->table[index]);
 	zram_free_page(zram, index);
-	bit_spin_unlock(ZRAM_ACCESS, &meta->table[index].value);
+	zram_unlock_table(&meta->table[index]);
 	atomic64_inc(&zram->stats.notify_free);
 }
 
diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h
index 570c598f4ce9..5f1eb86a307b 100644
--- a/drivers/block/zram/zram_drv.h
+++ b/drivers/block/zram/zram_drv.h
@@ -78,6 +78,9 @@ enum zram_pageflags {
 struct zram_table_entry {
 	unsigned long handle;
 	unsigned long value;
+#ifdef CONFIG_PREEMPT_RT_BASE
+	spinlock_t lock;
+#endif
 };
 
 struct zram_stats {
@@ -122,4 +125,42 @@ struct zram {
 	u64 disksize;	/* bytes */
 	char compressor[10];
 };
+
+#ifndef CONFIG_PREEMPT_RT_BASE
+static inline void zram_lock_table(struct zram_table_entry *table)
+{
+	bit_spin_lock(ZRAM_ACCESS, &table->value);
+}
+
+static inline void zram_unlock_table(struct zram_table_entry *table)
+{
+	bit_spin_unlock(ZRAM_ACCESS, &table->value);
+}
+
+static inline void zram_meta_init_locks(struct zram_meta *meta, u64 disksize) { }
+#else /* CONFIG_PREEMPT_RT_BASE */
+static inline void zram_lock_table(struct zram_table_entry *table)
+{
+	spin_lock(&table->lock);
+	__set_bit(ZRAM_ACCESS, &table->value);
+}
+
+static inline void zram_unlock_table(struct zram_table_entry *table)
+{
+	__clear_bit(ZRAM_ACCESS, &table->value);
+	spin_unlock(&table->lock);
+}
+
+static inline void zram_meta_init_table_locks(struct zram_meta *meta, u64 disksize)
+{
+        size_t num_pages = disksize >> PAGE_SHIFT;
+        size_t index;
+
+        for (index = 0; index < num_pages; index++) {
+		spinlock_t *lock = &meta->table[index].lock;
+		spin_lock_init(lock);
+        }
+}
+#endif /* CONFIG_PREEMPT_RT_BASE */
+
 #endif
-- 
2.8.1

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

* [PATCH RT 10/20] list_bl: fixup bogus lockdep warning
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (8 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 09/20] drivers/block/zram: Replace bit spinlocks with rtmutex for -rt Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 11/20] ARM: imx: always use TWD on IMX6Q Steven Rostedt
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Luis Claudio R. Goncalves,
	Josh Cartwright

[-- Attachment #1: 0010-list_bl-fixup-bogus-lockdep-warning.patch --]
[-- Type: text/plain, Size: 3029 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Josh Cartwright <joshc@ni.com>

At first glance, the use of 'static inline' seems appropriate for
INIT_HLIST_BL_HEAD().

However, when a 'static inline' function invocation is inlined by gcc,
all callers share any static local data declared within that inline
function.

This presents a problem for how lockdep classes are setup.  raw_spinlocks, for
example, when CONFIG_DEBUG_SPINLOCK,

	# define raw_spin_lock_init(lock)				\
	do {								\
		static struct lock_class_key __key;			\
									\
		__raw_spin_lock_init((lock), #lock, &__key);		\
	} while (0)

When this macro is expanded into a 'static inline' caller, like
INIT_HLIST_BL_HEAD():

	static inline INIT_HLIST_BL_HEAD(struct hlist_bl_head *h)
	{
		h->first = NULL;
		raw_spin_lock_init(&h->lock);
	}

...the static local lock_class_key object is made a function static.

For compilation units which initialize invoke INIT_HLIST_BL_HEAD() more
than once, then, all of the invocations share this same static local
object.

This can lead to some very confusing lockdep splats (example below).
Solve this problem by forcing the INIT_HLIST_BL_HEAD() to be a macro,
which prevents the lockdep class object sharing.

 =============================================
 [ INFO: possible recursive locking detected ]
 4.4.4-rt11 #4 Not tainted
 ---------------------------------------------
 kswapd0/59 is trying to acquire lock:
  (&h->lock#2){+.+.-.}, at: mb_cache_shrink_scan

 but task is already holding lock:
  (&h->lock#2){+.+.-.}, at:  mb_cache_shrink_scan

 other info that might help us debug this:
  Possible unsafe locking scenario:

        CPU0
        ----
   lock(&h->lock#2);
   lock(&h->lock#2);

  *** DEADLOCK ***

  May be due to missing lock nesting notation

 2 locks held by kswapd0/59:
  #0:  (shrinker_rwsem){+.+...}, at: rt_down_read_trylock
  #1:  (&h->lock#2){+.+.-.}, at: mb_cache_shrink_scan

Reported-by: Luis Claudio R. Goncalves <lclaudio@uudg.org>
Tested-by: Luis Claudio R. Goncalves <lclaudio@uudg.org>
Signed-off-by: Josh Cartwright <joshc@ni.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/list_bl.h | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h
index d8876a0cf036..017d0f1c1eb4 100644
--- a/include/linux/list_bl.h
+++ b/include/linux/list_bl.h
@@ -42,13 +42,15 @@ struct hlist_bl_node {
 	struct hlist_bl_node *next, **pprev;
 };
 
-static inline void INIT_HLIST_BL_HEAD(struct hlist_bl_head *h)
-{
-	h->first = NULL;
 #ifdef CONFIG_PREEMPT_RT_BASE
-	raw_spin_lock_init(&h->lock);
+#define INIT_HLIST_BL_HEAD(h)		\
+do {					\
+	(h)->first = NULL;		\
+	raw_spin_lock_init(&(h)->lock);	\
+} while (0)
+#else
+#define INIT_HLIST_BL_HEAD(h) (h)->first = NULL
 #endif
-}
 
 static inline void INIT_HLIST_BL_NODE(struct hlist_bl_node *h)
 {
-- 
2.8.1

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

* [PATCH RT 11/20] ARM: imx: always use TWD on IMX6Q
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (9 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 10/20] list_bl: fixup bogus lockdep warning Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 20:04   ` Sebastian Andrzej Siewior
  2016-07-12 14:24 ` [PATCH RT 12/20] drivers/block/zram: fixup compile for !RT Steven Rostedt
                   ` (9 subsequent siblings)
  20 siblings, 1 reply; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker

[-- Attachment #1: 0011-ARM-imx-always-use-TWD-on-IMX6Q.patch --]
[-- Type: text/plain, Size: 1126 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

There is no reason to limit the TWD to be used on SMP kernels only if the
hardware has it available.
On Wandboard i.MX6SOLO, running PREEMPT-RT and cyclictest I see as max
immediately after start in idle:
UP : ~90us
SMP: ~50us
UP + TWD: ~20us.
Based on this numbers I prefer the TWD over the slightly slower MXC
timer.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/arm/mach-imx/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 3a3d3e9d7bfd..92c0cf1276fe 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -558,7 +558,7 @@ config SOC_IMX6Q
 	bool "i.MX6 Quad/DualLite support"
 	select ARM_ERRATA_764369 if SMP
 	select HAVE_ARM_SCU if SMP
-	select HAVE_ARM_TWD if SMP
+	select HAVE_ARM_TWD
 	select PCI_DOMAINS if PCI
 	select PINCTRL_IMX6Q
 	select SOC_IMX6
-- 
2.8.1

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

* [PATCH RT 12/20] drivers/block/zram: fixup compile for !RT
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (10 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 11/20] ARM: imx: always use TWD on IMX6Q Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 13/20] perf/x86/intel/rapl: Make PMU lock raw Steven Rostedt
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker

[-- Attachment #1: 0012-drivers-block-zram-fixup-compile-for-RT.patch --]
[-- Type: text/plain, Size: 989 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/block/zram/zram_drv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h
index 5f1eb86a307b..22c0173b00e3 100644
--- a/drivers/block/zram/zram_drv.h
+++ b/drivers/block/zram/zram_drv.h
@@ -137,7 +137,7 @@ static inline void zram_unlock_table(struct zram_table_entry *table)
 	bit_spin_unlock(ZRAM_ACCESS, &table->value);
 }
 
-static inline void zram_meta_init_locks(struct zram_meta *meta, u64 disksize) { }
+static inline void zram_meta_init_table_locks(struct zram_meta *meta, u64 disksize) { }
 #else /* CONFIG_PREEMPT_RT_BASE */
 static inline void zram_lock_table(struct zram_table_entry *table)
 {
-- 
2.8.1

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

* [PATCH RT 13/20] perf/x86/intel/rapl: Make PMU lock raw
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (11 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 12/20] drivers/block/zram: fixup compile for !RT Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 14/20] sched,preempt: Fix preempt_count manipulations Steven Rostedt
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Peter Zijlstra (Intel),
	Andi Kleen, Arnaldo Carvalho de Melo, Borislav Petkov,
	Harish Chegondi, Jacob Pan, Jiri Olsa, Kan Liang, Linus Torvalds,
	Stephane Eranian, Vince Weaver, stable-rt, Ingo Molnar

[-- Attachment #1: 0013-perf-x86-intel-rapl-Make-PMU-lock-raw.patch --]
[-- Type: text/plain, Size: 4162 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Thomas Gleixner <tglx@linutronix.de>

Upstream commit: a208749c6426 ("perf/x86/intel/rapl: Make PMU lock raw")

This lock is taken in hard interrupt context even on Preempt-RT. Make it raw
so RT does not have to patch it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andi Kleen <andi.kleen@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Harish Chegondi <harish.chegondi@intel.com>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: linux-kernel@vger.kernel.org
Cc: stable-rt@vger.kernel.org
Link: http://lkml.kernel.org/r/20160222221012.669411833@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/x86/kernel/cpu/perf_event_intel_rapl.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c b/arch/x86/kernel/cpu/perf_event_intel_rapl.c
index 358c54ad20d4..94689f19ad92 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c
@@ -119,7 +119,7 @@ static struct perf_pmu_events_attr event_attr_##v = {			\
 };
 
 struct rapl_pmu {
-	spinlock_t	 lock;
+	raw_spinlock_t	 lock;
 	int		 n_active; /* number of active events */
 	struct list_head active_list;
 	struct pmu	 *pmu; /* pointer to rapl_pmu_class */
@@ -223,13 +223,13 @@ static enum hrtimer_restart rapl_hrtimer_handle(struct hrtimer *hrtimer)
 	if (!pmu->n_active)
 		return HRTIMER_NORESTART;
 
-	spin_lock_irqsave(&pmu->lock, flags);
+	raw_spin_lock_irqsave(&pmu->lock, flags);
 
 	list_for_each_entry(event, &pmu->active_list, active_entry) {
 		rapl_event_update(event);
 	}
 
-	spin_unlock_irqrestore(&pmu->lock, flags);
+	raw_spin_unlock_irqrestore(&pmu->lock, flags);
 
 	hrtimer_forward_now(hrtimer, pmu->timer_interval);
 
@@ -266,9 +266,9 @@ static void rapl_pmu_event_start(struct perf_event *event, int mode)
 	struct rapl_pmu *pmu = __this_cpu_read(rapl_pmu);
 	unsigned long flags;
 
-	spin_lock_irqsave(&pmu->lock, flags);
+	raw_spin_lock_irqsave(&pmu->lock, flags);
 	__rapl_pmu_event_start(pmu, event);
-	spin_unlock_irqrestore(&pmu->lock, flags);
+	raw_spin_unlock_irqrestore(&pmu->lock, flags);
 }
 
 static void rapl_pmu_event_stop(struct perf_event *event, int mode)
@@ -277,7 +277,7 @@ static void rapl_pmu_event_stop(struct perf_event *event, int mode)
 	struct hw_perf_event *hwc = &event->hw;
 	unsigned long flags;
 
-	spin_lock_irqsave(&pmu->lock, flags);
+	raw_spin_lock_irqsave(&pmu->lock, flags);
 
 	/* mark event as deactivated and stopped */
 	if (!(hwc->state & PERF_HES_STOPPED)) {
@@ -302,7 +302,7 @@ static void rapl_pmu_event_stop(struct perf_event *event, int mode)
 		hwc->state |= PERF_HES_UPTODATE;
 	}
 
-	spin_unlock_irqrestore(&pmu->lock, flags);
+	raw_spin_unlock_irqrestore(&pmu->lock, flags);
 }
 
 static int rapl_pmu_event_add(struct perf_event *event, int mode)
@@ -311,14 +311,14 @@ static int rapl_pmu_event_add(struct perf_event *event, int mode)
 	struct hw_perf_event *hwc = &event->hw;
 	unsigned long flags;
 
-	spin_lock_irqsave(&pmu->lock, flags);
+	raw_spin_lock_irqsave(&pmu->lock, flags);
 
 	hwc->state = PERF_HES_UPTODATE | PERF_HES_STOPPED;
 
 	if (mode & PERF_EF_START)
 		__rapl_pmu_event_start(pmu, event);
 
-	spin_unlock_irqrestore(&pmu->lock, flags);
+	raw_spin_unlock_irqrestore(&pmu->lock, flags);
 
 	return 0;
 }
@@ -594,7 +594,7 @@ static int rapl_cpu_prepare(int cpu)
 	pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu));
 	if (!pmu)
 		return -1;
-	spin_lock_init(&pmu->lock);
+	raw_spin_lock_init(&pmu->lock);
 
 	INIT_LIST_HEAD(&pmu->active_list);
 
-- 
2.8.1

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

* [PATCH RT 14/20] sched,preempt: Fix preempt_count manipulations
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (12 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 13/20] perf/x86/intel/rapl: Make PMU lock raw Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 15/20] kernel/printk: Dont try to print from IRQ/NMI region Steven Rostedt
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, stable, stable-rt, Vikram Mulukutla,
	Peter Zijlstra (Intel)

[-- Attachment #1: 0014-sched-preempt-Fix-preempt_count-manipulations.patch --]
[-- Type: text/plain, Size: 2023 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Peter Zijlstra <peterz@infradead.org>

Vikram reported that his ARM64 compiler managed to 'optimize' away the
preempt_count manipulations in code like:

	preempt_enable_no_resched();
	put_user();
	preempt_disable();

Irrespective of that fact that that is horrible code that should be
fixed for many reasons, it does highlight a deficiency in the generic
preempt_count manipulators. As it is never right to combine/elide
preempt_count manipulations like this.

Therefore sprinkle some volatile in the two generic accessors to
ensure the compiler is aware of the fact that the preempt_count is
observed outside of the regular program-order view and thus cannot be
optimized away like this.

x86; the only arch not using the generic code is not affected as we
do all this in asm in order to use the segment base per-cpu stuff.

Cc: stable@vger.kernel.org
Cc: stable-rt@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: a787870924db ("sched, arch: Create asm/preempt.h")
Reported-by: Vikram Mulukutla <markivx@codeaurora.org>
Tested-by: Vikram Mulukutla <markivx@codeaurora.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/asm-generic/preempt.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/asm-generic/preempt.h b/include/asm-generic/preempt.h
index b6a53e8e526a..c91d3d764c36 100644
--- a/include/asm-generic/preempt.h
+++ b/include/asm-generic/preempt.h
@@ -7,10 +7,10 @@
 
 static __always_inline int preempt_count(void)
 {
-	return current_thread_info()->preempt_count;
+	return READ_ONCE(current_thread_info()->preempt_count);
 }
 
-static __always_inline int *preempt_count_ptr(void)
+static __always_inline volatile int *preempt_count_ptr(void)
 {
 	return &current_thread_info()->preempt_count;
 }
-- 
2.8.1

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

* [PATCH RT 15/20] kernel/printk: Dont try to print from IRQ/NMI region
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (13 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 14/20] sched,preempt: Fix preempt_count manipulations Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 16/20] arm: lazy preempt: correct resched condition Steven Rostedt
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker

[-- Attachment #1: 0015-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch --]
[-- Type: text/plain, Size: 1408 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

On -RT we try to acquire sleeping locks which might lead to warnings
from lockdep or a warn_on() from spin_try_lock() (which is a rtmutex on
RT).
We don't print in general from a IRQ off region so we should not try
this via console_unblank() / bust_spinlocks() as well.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/printk/printk.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 899645a2ebcc..398bf2bbd3bc 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1426,6 +1426,11 @@ static void call_console_drivers(int level, const char *text, size_t len)
 	if (!console_drivers)
 		return;
 
+	if (IS_ENABLED(CONFIG_PREEMPT_RT_BASE)) {
+		if (in_irq() || in_nmi())
+			return;
+	}
+
 	migrate_disable();
 	for_each_console(con) {
 		if (exclusive_console && con != exclusive_console)
@@ -2392,6 +2397,11 @@ void console_unblank(void)
 {
 	struct console *c;
 
+	if (IS_ENABLED(CONFIG_PREEMPT_RT_BASE)) {
+		if (in_irq() || in_nmi())
+			return;
+	}
+
 	/*
 	 * console_unblank can no longer be called in interrupt context unless
 	 * oops_in_progress is set to 1..
-- 
2.8.1

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

* [PATCH RT 16/20] arm: lazy preempt: correct resched condition
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (14 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 15/20] kernel/printk: Dont try to print from IRQ/NMI region Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 17/20] locallock: add local_lock_on() Steven Rostedt
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, stable-rt

[-- Attachment #1: 0016-arm-lazy-preempt-correct-resched-condition.patch --]
[-- Type: text/plain, Size: 1182 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

If we get out of preempt_schedule_irq() then we check for NEED_RESCHED
and call the former function again if set because the preemption counter
has be zero at this point.
However the counter for lazy-preempt might not be zero therefore we have
to check the counter before looking at the need_resched_lazy flag.

Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/arm/kernel/entry-armv.S | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index e0ca45754231..797a13d959b7 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -237,7 +237,11 @@ svc_preempt:
 	bne	1b
 	tst	r0, #_TIF_NEED_RESCHED_LAZY
 	reteq	r8				@ go again
-	b	1b
+	ldr	r0, [tsk, #TI_PREEMPT_LAZY]	@ get preempt lazy count
+	teq	r0, #0				@ if preempt lazy count != 0
+	beq	1b
+	ret	r8				@ go again
+
 #endif
 
 __und_fault:
-- 
2.8.1

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

* [PATCH RT 17/20] locallock: add local_lock_on()
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (15 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 16/20] arm: lazy preempt: correct resched condition Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 18/20] mm: perform lru_add_drain_all() remotely Steven Rostedt
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker

[-- Attachment #1: 0017-locallock-add-local_lock_on.patch --]
[-- Type: text/plain, Size: 1282 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/locallock.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/locallock.h b/include/linux/locallock.h
index 339ba00adb9a..0edbf192f6d1 100644
--- a/include/linux/locallock.h
+++ b/include/linux/locallock.h
@@ -66,6 +66,9 @@ static inline void __local_lock(struct local_irq_lock *lv)
 #define local_lock(lvar)					\
 	do { __local_lock(&get_local_var(lvar)); } while (0)
 
+#define local_lock_on(lvar, cpu)				\
+	do { __local_lock(&per_cpu(lvar, cpu)); } while (0)
+
 static inline int __local_trylock(struct local_irq_lock *lv)
 {
 	if (lv->owner != current && spin_trylock_local(&lv->lock)) {
@@ -104,6 +107,9 @@ static inline void __local_unlock(struct local_irq_lock *lv)
 		put_local_var(lvar);				\
 	} while (0)
 
+#define local_unlock_on(lvar, cpu)                       \
+	do { __local_unlock(&per_cpu(lvar, cpu)); } while (0)
+
 static inline void __local_lock_irq(struct local_irq_lock *lv)
 {
 	spin_lock_irqsave(&lv->lock, lv->flags);
-- 
2.8.1

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

* [PATCH RT 18/20] mm: perform lru_add_drain_all() remotely
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (16 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 17/20] locallock: add local_lock_on() Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 19/20] trace: correct off by one while recording the trace-event Steven Rostedt
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, Rik van Riel, Luiz Capitulino

[-- Attachment #1: 0018-mm-perform-lru_add_drain_all-remotely.patch --]
[-- Type: text/plain, Size: 3201 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Luiz Capitulino <lcapitulino@redhat.com>

lru_add_drain_all() works by scheduling lru_add_drain_cpu() to run
on all CPUs that have non-empty LRU pagevecs and then waiting for
the scheduled work to complete. However, workqueue threads may never
have the chance to run on a CPU that's running a SCHED_FIFO task.
This causes lru_add_drain_all() to block forever.

This commit solves this problem by changing lru_add_drain_all()
to drain the LRU pagevecs of remote CPUs. This is done by grabbing
swapvec_lock and calling lru_add_drain_cpu().

PS: This is based on an idea and initial implementation by
    Rik van Riel.

Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 mm/swap.c | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/mm/swap.c b/mm/swap.c
index 1785ac603fb0..20432b7721ed 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -819,9 +819,15 @@ void lru_add_drain_cpu(int cpu)
 		unsigned long flags;
 
 		/* No harm done if a racing interrupt already did this */
+#ifdef CONFIG_PREEMPT_RT_BASE
+		local_lock_irqsave_on(rotate_lock, flags, cpu);
+		pagevec_move_tail(pvec);
+		local_unlock_irqrestore_on(rotate_lock, flags, cpu);
+#else
 		local_lock_irqsave(rotate_lock, flags);
 		pagevec_move_tail(pvec);
 		local_unlock_irqrestore(rotate_lock, flags);
+#endif
 	}
 
 	pvec = &per_cpu(lru_deactivate_file_pvecs, cpu);
@@ -864,12 +870,32 @@ void lru_add_drain(void)
 	local_unlock_cpu(swapvec_lock);
 }
 
+
+#ifdef CONFIG_PREEMPT_RT_BASE
+static inline void remote_lru_add_drain(int cpu, struct cpumask *has_work)
+{
+	local_lock_on(swapvec_lock, cpu);
+	lru_add_drain_cpu(cpu);
+	local_unlock_on(swapvec_lock, cpu);
+}
+
+#else
+
 static void lru_add_drain_per_cpu(struct work_struct *dummy)
 {
 	lru_add_drain();
 }
 
 static DEFINE_PER_CPU(struct work_struct, lru_add_drain_work);
+static inline void remote_lru_add_drain(int cpu, struct cpumask *has_work)
+{
+	struct work_struct *work = &per_cpu(lru_add_drain_work, cpu);
+
+	INIT_WORK(work, lru_add_drain_per_cpu);
+	schedule_work_on(cpu, work);
+	cpumask_set_cpu(cpu, has_work);
+}
+#endif
 
 void lru_add_drain_all(void)
 {
@@ -882,20 +908,17 @@ void lru_add_drain_all(void)
 	cpumask_clear(&has_work);
 
 	for_each_online_cpu(cpu) {
-		struct work_struct *work = &per_cpu(lru_add_drain_work, cpu);
-
 		if (pagevec_count(&per_cpu(lru_add_pvec, cpu)) ||
 		    pagevec_count(&per_cpu(lru_rotate_pvecs, cpu)) ||
 		    pagevec_count(&per_cpu(lru_deactivate_file_pvecs, cpu)) ||
-		    need_activate_page_drain(cpu)) {
-			INIT_WORK(work, lru_add_drain_per_cpu);
-			schedule_work_on(cpu, work);
-			cpumask_set_cpu(cpu, &has_work);
-		}
+		    need_activate_page_drain(cpu))
+			remote_lru_add_drain(cpu, &has_work);
 	}
 
+#ifndef CONFIG_PREEMPT_RT_BASE
 	for_each_cpu(cpu, &has_work)
 		flush_work(&per_cpu(lru_add_drain_work, cpu));
+#endif
 
 	put_online_cpus();
 	mutex_unlock(&lock);
-- 
2.8.1

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

* [PATCH RT 19/20] trace: correct off by one while recording the trace-event
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (17 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 18/20] mm: perform lru_add_drain_all() remotely Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 14:24 ` [PATCH RT 20/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
  2016-07-12 23:18 ` Linux 4.1.27-rt31-rc2 Steven Rostedt
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker, stable-rt

[-- Attachment #1: 0019-trace-correct-off-by-one-while-recording-the-trace-e.patch --]
[-- Type: text/plain, Size: 1431 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Trace events like raw_syscalls show always a preempt code of one. The
reason is that on PREEMPT kernels rcu_read_lock_sched_notrace()
increases the preemption counter and the function recording the counter
is caller within the RCU section.

Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
[ Changed this to upstream version. See commit e947841c0dce ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace_events.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 64c1ac17af8f..b83d6a4d3912 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -200,6 +200,14 @@ void *ftrace_event_buffer_reserve(struct ftrace_event_buffer *fbuffer,
 
 	local_save_flags(fbuffer->flags);
 	fbuffer->pc = preempt_count();
+	/*
+	 * If CONFIG_PREEMPT is enabled, then the tracepoint itself disables
+	 * preemption (adding one to the preempt_count). Since we are
+	 * interested in the preempt_count at the time the tracepoint was
+	 * hit, we need to subtract one to offset the increment.
+	 */
+	if (IS_ENABLED(CONFIG_PREEMPT))
+		fbuffer->pc--;
 	fbuffer->ftrace_file = ftrace_file;
 
 	fbuffer->event =
-- 
2.8.1

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

* [PATCH RT 20/20] Linux 4.1.27-rt31-rc1
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (18 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 19/20] trace: correct off by one while recording the trace-event Steven Rostedt
@ 2016-07-12 14:24 ` Steven Rostedt
  2016-07-12 23:18 ` Linux 4.1.27-rt31-rc2 Steven Rostedt
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 14:24 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker

[-- Attachment #1: 0020-Linux-4.1.27-rt31-rc1.patch --]
[-- Type: text/plain, Size: 411 bytes --]

4.1.27-rt31-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

---
 localversion-rt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/localversion-rt b/localversion-rt
index b72862e06be4..7f30ff78f82f 100644
--- a/localversion-rt
+++ b/localversion-rt
@@ -1 +1 @@
--rt30
+-rt31-rc1
-- 
2.8.1

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

* Re: [PATCH RT 11/20] ARM: imx: always use TWD on IMX6Q
  2016-07-12 14:24 ` [PATCH RT 11/20] ARM: imx: always use TWD on IMX6Q Steven Rostedt
@ 2016-07-12 20:04   ` Sebastian Andrzej Siewior
  2016-07-12 20:25     ` Steven Rostedt
  2016-07-18 17:18     ` Grygorii Strashko
  0 siblings, 2 replies; 25+ messages in thread
From: Sebastian Andrzej Siewior @ 2016-07-12 20:04 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: linux-kernel, linux-rt-users, Thomas Gleixner, Carsten Emde,
	John Kacur, Paul Gortmaker

* Steven Rostedt | 2016-07-12 10:24:16 [-0400]:

>4.1.27-rt31-rc1 stable review patch.
>If anyone has any objections, please let me know.

I don't recommend to cherry-pick this. The symbol it selects
(HAVE_ARM_TWD) has "depends on SMP" in v4.1. In v4.4 there should be
AM43xx which is UP and also uses the TWD so the change is simple here.

Sebastian

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

* Re: [PATCH RT 11/20] ARM: imx: always use TWD on IMX6Q
  2016-07-12 20:04   ` Sebastian Andrzej Siewior
@ 2016-07-12 20:25     ` Steven Rostedt
  2016-07-18 17:18     ` Grygorii Strashko
  1 sibling, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 20:25 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-kernel, linux-rt-users, Thomas Gleixner, Carsten Emde,
	John Kacur, Paul Gortmaker

On Tue, 12 Jul 2016 22:04:29 +0200
Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:

> * Steven Rostedt | 2016-07-12 10:24:16 [-0400]:
> 
> >4.1.27-rt31-rc1 stable review patch.
> >If anyone has any objections, please let me know.  
> 
> I don't recommend to cherry-pick this. The symbol it selects
> (HAVE_ARM_TWD) has "depends on SMP" in v4.1. In v4.4 there should be
> AM43xx which is UP and also uses the TWD so the change is simple here.

So remove it from 4.1 and older?

I can do that.

-- Steve

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

* Linux 4.1.27-rt31-rc2
  2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
                   ` (19 preceding siblings ...)
  2016-07-12 14:24 ` [PATCH RT 20/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
@ 2016-07-12 23:18 ` Steven Rostedt
  20 siblings, 0 replies; 25+ messages in thread
From: Steven Rostedt @ 2016-07-12 23:18 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users
  Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
	John Kacur, Paul Gortmaker


Dear RT Folks,

This is the RT stable review cycle of patch 4.1.27-rt31-rc2.

Please scream at me if I messed something up. Please test the patches too.

The -rc release will be uploaded to kernel.org and will be deleted when
the final release is out. This is just a review release (or release candidate).

The pre-releases will not be pushed to the git repository, only the
final release is.

If all goes well, this patch will be converted to the next main release
on 7/14/2016.

Only difference from v1 is the removal of "ARM: imx: always use TWD on
IMX6Q"

Enjoy,

-- Steve


To build 4.1.27-rt31-rc2 directly, the following patches should be applied:

  http://www.kernel.org/pub/linux/kernel/v3.x/linux-4.1.tar.xz

  http://www.kernel.org/pub/linux/kernel/v3.x/patch-4.1.27.xz

  http://www.kernel.org/pub/linux/kernel/projects/rt/4.1/patch-4.1.27-rt31-rc2.patch.xz

You can also build from 4.1.27-rt30 by applying the incremental patch:

http://www.kernel.org/pub/linux/kernel/projects/rt/4.1/incr/patch-4.1.27-rt30-rt31-rc2.patch.xz


Changes from 4.1.27-rt30:

---


Alexandre Belloni (5):
      ARM: at91: pm: simply call at91_pm_init
      ARM: at91: pm: find and remap the pmc
      ARM: at91: pm: move idle functions to pm.c
      ARM: at91: remove useless includes and function prototypes
      usb: gadget: atmel: access the PMC using regmap

Josh Cartwright (1):
      list_bl: fixup bogus lockdep warning

Luiz Capitulino (1):
      mm: perform lru_add_drain_all() remotely

Mike Galbraith (2):
      mm/zsmalloc: Use get/put_cpu_light in zs_map_object()/zs_unmap_object()
      drivers/block/zram: Replace bit spinlocks with rtmutex for -rt

Peter Zijlstra (1):
      sched,preempt: Fix preempt_count manipulations

Rik van Riel (1):
      kvm, rt: change async pagefault code locking for PREEMPT_RT

Sebastian Andrzej Siewior (6):
      net: dev: always take qdisc's busylock in __dev_xmit_skb()
      drivers/block/zram: fixup compile for !RT
      kernel/printk: Don't try to print from IRQ/NMI region
      arm: lazy preempt: correct resched condition
      locallock: add local_lock_on()
      trace: correct off by one while recording the trace-event

Steven Rostedt (Red Hat) (1):
      Linux 4.1.27-rt31-rc2

Thomas Gleixner (1):
      perf/x86/intel/rapl: Make PMU lock raw

----
 arch/arm/kernel/entry-armv.S                |  6 ++-
 arch/arm/mach-at91/at91rm9200.c             |  2 -
 arch/arm/mach-at91/at91sam9.c               |  2 -
 arch/arm/mach-at91/generic.h                | 13 +-----
 arch/arm/mach-at91/pm.c                     | 70 ++++++++++++++++++++++++-----
 arch/arm/mach-at91/sama5.c                  |  2 +-
 arch/x86/kernel/cpu/perf_event_intel_rapl.c | 20 ++++-----
 arch/x86/kernel/kvm.c                       | 37 +++++++--------
 drivers/block/zram/zram_drv.c               | 30 +++++++------
 drivers/block/zram/zram_drv.h               | 41 +++++++++++++++++
 drivers/clk/at91/pmc.c                      | 15 -------
 drivers/usb/gadget/udc/atmel_usba_udc.c     | 20 ++++-----
 drivers/usb/gadget/udc/atmel_usba_udc.h     |  2 +
 include/asm-generic/preempt.h               |  4 +-
 include/linux/list_bl.h                     | 12 ++---
 include/linux/locallock.h                   |  6 +++
 kernel/printk/printk.c                      | 10 +++++
 kernel/trace/trace_events.c                 |  8 ++++
 localversion-rt                             |  2 +-
 mm/swap.c                                   | 37 ++++++++++++---
 mm/zsmalloc.c                               |  4 +-
 net/core/dev.c                              |  4 ++
 22 files changed, 235 insertions(+), 112 deletions(-)

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

* Re: [PATCH RT 11/20] ARM: imx: always use TWD on IMX6Q
  2016-07-12 20:04   ` Sebastian Andrzej Siewior
  2016-07-12 20:25     ` Steven Rostedt
@ 2016-07-18 17:18     ` Grygorii Strashko
  1 sibling, 0 replies; 25+ messages in thread
From: Grygorii Strashko @ 2016-07-18 17:18 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior, Steven Rostedt
  Cc: linux-kernel, linux-rt-users, Thomas Gleixner, Carsten Emde,
	John Kacur, Paul Gortmaker

On 07/12/2016 11:04 PM, Sebastian Andrzej Siewior wrote:
> * Steven Rostedt | 2016-07-12 10:24:16 [-0400]:
> 
>> 4.1.27-rt31-rc1 stable review patch.
>> If anyone has any objections, please let me know.
> 
> I don't recommend to cherry-pick this. The symbol it selects
> (HAVE_ARM_TWD) has "depends on SMP" in v4.1. In v4.4 there should be
> AM43xx which is UP and also uses the TWD so the change is simple here.
> 

yes. AM43xx is UP and supports ARM TWD, but there could be some 'issues' in !RT case :(

ARM TWD might be powered off in deep CPU Idle states and lose its context if !RT & CPUIDLE,
so there are should be backup broadcast timer configured. And that can cause build issues
related to tick_broadcast()->smp_cross_call().

I've solved it locally for OMAP2 only: commit 0b3e6fca4d1af4aa150d32506220f4241323a00c

^Just FYI. But may be it can be done in more generic way.

regards,
-grygorii

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

end of thread, other threads:[~2016-07-18 18:19 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-12 14:24 [PATCH RT 00/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 01/20] ARM: at91: pm: simply call at91_pm_init Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 02/20] ARM: at91: pm: find and remap the pmc Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 03/20] ARM: at91: pm: move idle functions to pm.c Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 04/20] ARM: at91: remove useless includes and function prototypes Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 05/20] usb: gadget: atmel: access the PMC using regmap Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 06/20] kvm, rt: change async pagefault code locking for PREEMPT_RT Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 07/20] mm/zsmalloc: Use get/put_cpu_light in zs_map_object()/zs_unmap_object() Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 08/20] net: dev: always take qdiscs busylock in __dev_xmit_skb() Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 09/20] drivers/block/zram: Replace bit spinlocks with rtmutex for -rt Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 10/20] list_bl: fixup bogus lockdep warning Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 11/20] ARM: imx: always use TWD on IMX6Q Steven Rostedt
2016-07-12 20:04   ` Sebastian Andrzej Siewior
2016-07-12 20:25     ` Steven Rostedt
2016-07-18 17:18     ` Grygorii Strashko
2016-07-12 14:24 ` [PATCH RT 12/20] drivers/block/zram: fixup compile for !RT Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 13/20] perf/x86/intel/rapl: Make PMU lock raw Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 14/20] sched,preempt: Fix preempt_count manipulations Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 15/20] kernel/printk: Dont try to print from IRQ/NMI region Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 16/20] arm: lazy preempt: correct resched condition Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 17/20] locallock: add local_lock_on() Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 18/20] mm: perform lru_add_drain_all() remotely Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 19/20] trace: correct off by one while recording the trace-event Steven Rostedt
2016-07-12 14:24 ` [PATCH RT 20/20] Linux 4.1.27-rt31-rc1 Steven Rostedt
2016-07-12 23:18 ` Linux 4.1.27-rt31-rc2 Steven Rostedt

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.