Skip to contentSkip to conversation

ipipe-noarch: Pending fixes and cleanups

PATCH In review Jan Kiszka 2 participants 11 messages Mar 27, 2019

Subsystems (4)
lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

cover ipipe-noarch: Pending fixes and cleanups

The ARM-only reverts I sent before. New are some fixes the the ipipe tracer, the fix for the ipipe timer ack handler, and a small cleanup of grab_timer.

Jan

Jan Kiszka (8):
ipipe: Revert changes to ARM arch_timer_set_cntkctl
Revert "clocksource: imx/imx53: ipipe: add support for user-visible
TSC"
Revert "clocksource: imx/imx51: ipipe: add support for user-visible
TSC"
Revert "clocksource: omap/dmtimer: ipipe: add support for user-visible
TSC"
ipipe: Fix panic output of tracer
ipipe: Fix output layout of tracer
ipipe: Call present ack and end handlers for timer irq unconditionally
ipipe: Drop unneeded NULL check from grab_timer

 arch/arm/include/asm/arch_timer.h         |  4 ---
 arch/arm/mach-imx/mach-imx51.c            |  5 ----
 arch/arm/mach-imx/mach-imx53.c            |  5 ----
 arch/arm/plat-omap/dmtimer.c              | 17 ++----------
 arch/arm/plat-omap/include/plat/dmtimer.h |  6 -----
 kernel/ipipe/timer.c                      | 17 +++++++-----
 kernel/ipipe/tracer.c                     | 44 +++++++++++++++----------------
 7 files changed, 34 insertions(+), 64 deletions(-)
Signature · 1 line
2.16.4
author
#1 lore raw

PATCH 1/8 ipipe: Revert changes to ARM arch_timer_set_cntkctl

From: Jan Kiszka <[email protected]>

This belongs into the ARM tree.

---
 arch/arm/include/asm/arch_timer.h | 4 ----
 1 file changed, 4 deletions(-)
arch/arm/include/asm/arch_timer.h +0 -4
index e9e7656bc137..9327e3a101dc 100644
@@ -106,10 +106,6 @@ static inline u32 arch_timer_get_cntkctl(void)
 
 static inline void arch_timer_set_cntkctl(u32 cntkctl)
 {
-#ifdef CONFIG_IPIPE
-	/* Enable access to user-space (may not be needed) */
-	cntkctl |= ARCH_TIMER_USR_PCT_ACCESS_EN;
-#endif
 	asm volatile("mcr p15, 0, %0, c14, c1, 0" : : "r" (cntkctl));
 }
 
Signature · 1 line
2.16.4
author
#2 lore raw

PATCH 2/8 Revert "clocksource: imx/imx53: ipipe: add support for user-visible TSC"

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

This reverts commit de53c9b26caa1c28785bb642350c07cfac6ebc3a.

Belongs into the ARM tree.

---
 arch/arm/mach-imx/mach-imx53.c | 5 -----
 1 file changed, 5 deletions(-)
arch/arm/mach-imx/mach-imx53.c +0 -5
index a02550b5ef7b..07c2e8dca494 100644
@@ -37,11 +37,6 @@ static void __init imx53_dt_init(void)
 
 static void __init imx53_init_late(void)
 {
-#ifdef CONFIG_IPIPE
-	/* Allow user-space access to emulated tsc */
-	imx_set_aips(IMX_IO_ADDRESS(0x53f00000));
-	imx_set_aips(IMX_IO_ADDRESS(0x63f00000));
-#endif
 	imx53_pm_init();
 }
 
Signature · 1 line
2.16.4
author
#3 lore raw

PATCH 3/8 Revert "clocksource: imx/imx51: ipipe: add support for user-visible TSC"

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

This reverts commit 2f8ff661dfbfa84b14571d1629f73455b2bd707b.

Belongs into the ARM tree.

---
 arch/arm/mach-imx/mach-imx51.c | 5 -----
 1 file changed, 5 deletions(-)
arch/arm/mach-imx/mach-imx51.c +0 -5
index 60975275ff88..3835b6a3423c 100644
@@ -59,11 +59,6 @@ static void __init imx51_dt_init(void)
 static void __init imx51_init_late(void)
 {
 	mx51_neon_fixup();
-#ifdef CONFIG_IPIPE
-	/* Allow user-space access to emulated tsc */
-	imx_set_aips(IMX_IO_ADDRESS(0x73f00000));
-	imx_set_aips(IMX_IO_ADDRESS(0x83f00000));
-#endif
 	imx51_pm_init();
 }
 
Signature · 1 line
2.16.4
author
#4 lore raw

PATCH 4/8 Revert "clocksource: omap/dmtimer: ipipe: add support for user-visible TSC"

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

This reverts commit d35c49508ea205e86de96b005021f46d4199a861.

Belongs into the ARM tree.

---
 arch/arm/plat-omap/dmtimer.c              | 17 ++---------------
 arch/arm/plat-omap/include/plat/dmtimer.h |  6 ------
 2 files changed, 2 insertions(+), 21 deletions(-)
arch/arm/plat-omap/dmtimer.c +2 -15
index 4e8cfc405974..ebef8aacea83 100644
@@ -395,18 +395,6 @@ int omap_dm_timer_get_irq(struct omap_dm_timer *timer)
 }
 EXPORT_SYMBOL_GPL(omap_dm_timer_get_irq);
 
-#ifdef CONFIG_IPIPE
-unsigned long omap_dm_timer_get_phys_counter_addr(struct omap_dm_timer *timer)
-{
-	return timer->phys_base + (OMAP_TIMER_COUNTER_REG & 0xff);
-}
-
-unsigned long omap_dm_timer_get_virt_counter_addr(struct omap_dm_timer *timer)
-{
-	return (unsigned long)timer->io_base + (OMAP_TIMER_COUNTER_REG & 0xff);
-}
-#endif /* CONFIG_IPIPE */
-
 #if defined(CONFIG_ARCH_OMAP1)
 #include <mach/hardware.h>
 /**
@@ -584,7 +572,7 @@ int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
 EXPORT_SYMBOL_GPL(omap_dm_timer_set_source);
 
 int omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload,
-                            unsigned int load)
+			    unsigned int load)
 {
 	u32 l;
 
@@ -611,7 +599,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_set_load);
 
 /* Optimized set_load which removes costly spin wait in timer_start */
 int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload,
-			    unsigned int load)
+                            unsigned int load)
 {
 	u32 l;
 
@@ -876,7 +864,6 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
 	}
 
 	timer->fclk = ERR_PTR(-ENODEV);
-	timer->phys_base = mem->start;
 	timer->io_base = devm_ioremap_resource(dev, mem);
 	if (IS_ERR(timer->io_base))
 		return PTR_ERR(timer->io_base);
arch/arm/plat-omap/include/plat/dmtimer.h +0 -6
index ee368c414bb9..dd79f3005cdf 100644
@@ -104,7 +104,6 @@ struct omap_dm_timer {
 	int irq;
 	struct clk *fclk;
 
-	unsigned long	phys_base;
 	void __iomem	*io_base;
 	void __iomem	*irq_stat;	/* TISR/IRQSTATUS interrupt status */
 	void __iomem	*irq_ena;	/* irq enable */
@@ -416,9 +415,4 @@ static inline void __omap_dm_timer_write_status(struct omap_dm_timer *timer,
 	writel_relaxed(value, timer->irq_stat);
 }
 
-static inline unsigned long __omap_dm_timer_read_status(struct omap_dm_timer *timer)
-{
-	return __raw_readl(timer->irq_stat);
-}
-
 #endif /* __ASM_ARCH_DMTIMER_H */
Signature · 1 line
2.16.4
author
#5 lore raw

PATCH 5/8 ipipe: Fix panic output of tracer

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

Since 4.9, we need to declare continued lines via KERN_CONT.

---
 kernel/ipipe/tracer.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
kernel/ipipe/tracer.c +15 -15
index 2db8cbbddf05..8d58ab143469 100644
@@ -680,7 +680,7 @@ void ipipe_trace_panic_dump(void)
 
 	ipipe_context_check_off();
 
-	printk("I-pipe tracer log (%d points):\n", cnt);
+	printk(KERN_CONT "I-pipe tracer log (%d points):\n", cnt);
 
 	start = pos = WRAP_POINT_NO(panic_path->trace_pos-1);
 
@@ -690,11 +690,11 @@ void ipipe_trace_panic_dump(void)
 		char info[16];
 		int i;
 
-		printk(" %c",
+		printk(KERN_CONT " %c",
 		       (point->flags & IPIPE_TFLG_HWIRQ_OFF) ? '|' : ' ');
 
 		for (i = IPIPE_TFLG_DOMSTATE_BITS; i >= 0; i--)
-			printk("%c",
+			printk(KERN_CONT "%c",
 			       (IPIPE_TFLG_CURRENT_DOMAIN(point) == i) ?
 				(IPIPE_TFLG_DOMAIN_STALLED(point, i) ?
 					'#' : '+') :
@@ -702,40 +702,40 @@ void ipipe_trace_panic_dump(void)
 					'*' : ' '));
 
 		if (!point->eip)
-			printk("-<invalid>-\n");
+			printk(KERN_CONT "-<invalid>-\n");
 		else {
 			__ipipe_trace_point_type(buf, point);
-			printk("%s", buf);
+			printk(KERN_CONT "%s", buf);
 
 			switch (point->type & IPIPE_TYPE_MASK) {
 				case IPIPE_TRACE_FUNC:
-					printk("           ");
+					printk(KERN_CONT "           ");
 					break;
 
 				case IPIPE_TRACE_PID:
 					__ipipe_get_task_info(info,
 							      point, 1);
-					printk("%s", info);
+					printk(KERN_CONT "%s", info);
 					break;
 
 				case IPIPE_TRACE_EVENT:
 					__ipipe_get_event_date(info,
 							       panic_path, point);
-					printk("%s", info);
+					printk(KERN_CONT "%s", info);
 					break;
 
 				default:
-					printk("0x%08lx ", point->v);
+					printk(KERN_CONT "0x%08lx ", point->v);
 			}
 
 			time = __ipipe_signed_tsc2us(point->timestamp -
 				panic_path->point[start].timestamp);
-			printk(" %5ld ", time);
+			printk(KERN_CONT " %5ld ", time);
 
 			__ipipe_print_symname(NULL, point->eip);
-			printk(" (");
+			printk(KERN_CONT " (");
 			__ipipe_print_symname(NULL, point->parent_eip);
-			printk(")\n");
+			printk(KERN_CONT ")\n");
 		}
 		pos = WRAP_POINT_NO(pos - 1);
 	}
@@ -878,11 +878,11 @@ static void __ipipe_print_symname(struct seq_file *m, unsigned long eip)
 	if (!m) {
 		/* panic dump */
 		if (sym_name) {
-			printk("%s+0x%lx", sym_name, offset);
+			printk(KERN_CONT "%s+0x%lx", sym_name, offset);
 			if (modname)
-				printk(" [%s]", modname);
+				printk(KERN_CONT " [%s]", modname);
 		} else
-			printk("<%08lx>", eip);
+			printk(KERN_CONT "<%08lx>", eip);
 	} else
 #endif /* CONFIG_IPIPE_TRACE_PANIC */
 	{
Signature · 1 line
2.16.4
author
#6 lore raw

PATCH 6/8 ipipe: Fix output layout of tracer

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

A long time ago (probably in 2.6-times), someone converted spaces to tabs, shuffling the layout around this way, and by forgetting to account for the multi-domain removal.

---
 kernel/ipipe/tracer.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
kernel/ipipe/tracer.c +7 -7
index 8d58ab143469..2d75199b086b 100644
@@ -842,7 +842,7 @@ __ipipe_print_delay(struct seq_file *m, struct ipipe_trace_point *point)
 {
 	unsigned long delay = 0;
 	int next;
-	char *mark = "	";
+	char *mark = "  ";
 
 	next = WRAP_POINT_NO(point+1 - print_path->point);
 
@@ -916,12 +916,12 @@ static void __ipipe_print_headline(struct seq_file *m)
 			   " +----- Hard IRQs ('|': locked)\n"
 			   " |+-- %s\n"
 			   " ||+- %s%s\n"
-			   " |||			  +---------- "
+		           " |||                        +---------- "
 			       "Delay flag ('+': > %d us, '!': > %d us)\n"
-			   " |||			  |	   +- "
+			   " |||                        |        +- "
 			       "NMI noise ('N')\n"
-			   " |||			  |	   |\n"
-			   "	  Type	  User Val.   Time    Delay  Function "
+			   " |||                        |        |\n"
+			   "    Type    User Val.   Time    Delay  Function "
 			       "(Parent)\n",
 			   name[1], name[0],
 			   " ('*': domain stalled, '+': current, "
@@ -930,9 +930,9 @@ static void __ipipe_print_headline(struct seq_file *m)
 	} else
 		seq_printf(m,
 			   " +--------------- Hard IRQs ('|': locked)\n"
-			   " |		   +- Delay flag "
+			   " |             +- Delay flag "
 			       "('+': > %d us, '!': > %d us)\n"
-			   " |		   |\n"
+			   " |             |\n"
 			   "  Type     Time   Function (Parent)\n",
 			   IPIPE_DELAY_NOTE/1000, IPIPE_DELAY_WARN/1000);
 }
Signature · 1 line
2.16.4
author
#7 lore raw

PATCH 7/8 ipipe: Call present ack and end handlers for timer irq unconditionally

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

These steps must be done unconditionally, because if __ipipe_ack_hrtimer_irq() is called, the tick event will be delivered to the head domain next, which will neither call ipipe_end() for a tick event, nor propagate such event to the root stage (at least not using the same IRQ line).

This plugs a race for timers that are per-CPU but share the same interrupt number. When setting them up, there is a window where the first CPU already called ipipe_request_irq, but some other CPU did not yet ran through grab_timer, thus have ipipe_stolen = 0.

It also solves boot issues with the TSC deadline timer in use.

Based on reasoning provided by Philippe Gerum.

---
 kernel/ipipe/timer.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
kernel/ipipe/timer.c +9 -6
index 5532be93e951..1471a4ed85ea 100644
@@ -367,15 +367,18 @@ static void __ipipe_ack_hrtimer_irq(struct irq_desc *desc)
 {
 	struct ipipe_timer *timer = __ipipe_raw_cpu_read(percpu_timer);
 
+	/*
+	 * Pseudo-IRQs like pipelined IPIs have no descriptor, we have
+	 * to check for this.
+	 */
 	if (desc)
 		desc->ipipe_ack(desc);
 
-	if (timer->host_timer->ipipe_stolen) {
-		if (timer->ack)
-			timer->ack();
-		if (desc)
-			desc->ipipe_end(desc);
-	}
+	if (timer->ack)
+		timer->ack();
+
+	if (desc)
+		desc->ipipe_end(desc);
 }
 
 static int do_set_oneshot(struct clock_event_device *cdev)
Signature · 1 line
2.16.4
author
#8 lore raw

PATCH 8/8 ipipe: Drop unneeded NULL check from grab_timer

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

If evtdev should be NULL, we will crash on get_dev_mode(evtdev) further down. So this test is never false in absence of sever bugs.

---
 kernel/ipipe/timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/ipipe/timer.c +1 -1
index 1471a4ed85ea..22d5e5be874a 100644
@@ -452,7 +452,7 @@ static void grab_timer(void *arg)
 		return;
 	}
 
-	steal = evtdev != NULL && !clockevent_state_detached(evtdev);
+	steal = !clockevent_state_detached(evtdev);
 	if (steal && evtdev->ipipe_stolen == 0) {
 		timer->real_mult = evtdev->mult;
 		timer->real_shift = evtdev->shift;
Signature · 1 line
2.16.4
#9 lore raw
In reply to Jan Kiszka
Quoted 19 lines · Jan Kiszka

The ARM-only reverts I sent before. New are some fixes the the ipipe tracer, the fix for the ipipe timer ack handler, and a small cleanup of grab_timer.

Jan

Jan Kiszka (8):
ipipe: Revert changes to ARM arch_timer_set_cntkctl
Revert "clocksource: imx/imx53: ipipe: add support for user-visible
TSC"
Revert "clocksource: imx/imx51: ipipe: add support for user-visible
TSC"
Revert "clocksource: omap/dmtimer: ipipe: add support for user-visible
TSC"
ipipe: Fix panic output of tracer
ipipe: Fix output layout of tracer
ipipe: Call present ack and end handlers for timer irq unconditionally
ipipe: Drop unneeded NULL check from grab_timer

Quoted 9 lines
 arch/arm/include/asm/arch_timer.h         |  4 ---
 arch/arm/mach-imx/mach-imx51.c            |  5 ----
 arch/arm/mach-imx/mach-imx53.c            |  5 ----
 arch/arm/plat-omap/dmtimer.c              | 17 ++----------
 arch/arm/plat-omap/include/plat/dmtimer.h |  6 -----
 kernel/ipipe/timer.c                      | 17 +++++++-----
 kernel/ipipe/tracer.c                     | 44 +++++++++++++++----------------
 7 files changed, 34 insertions(+), 64 deletions(-)

Merged. In addition, 4.19/arm is running fine on imx6, imx7 ATM. Preview at wip/4.19-noarch and wip/4.19-arm from the ipipe-noarch and ipipe-arm trees respectively. I'll update the master branches in the coming days.

Signature · 1 line
Philippe.
author
#10 lore raw
Quoted 30 lines · Philippe Gerum
Quoted 19 lines · Jan Kiszka

The ARM-only reverts I sent before. New are some fixes the the ipipe tracer, the fix for the ipipe timer ack handler, and a small cleanup of grab_timer.

Jan

Jan Kiszka (8):
ipipe: Revert changes to ARM arch_timer_set_cntkctl
Revert "clocksource: imx/imx53: ipipe: add support for user-visible
TSC"
Revert "clocksource: imx/imx51: ipipe: add support for user-visible
TSC"
Revert "clocksource: omap/dmtimer: ipipe: add support for user-visible
TSC"
ipipe: Fix panic output of tracer
ipipe: Fix output layout of tracer
ipipe: Call present ack and end handlers for timer irq unconditionally
ipipe: Drop unneeded NULL check from grab_timer

Quoted 9 lines
  arch/arm/include/asm/arch_timer.h         |  4 ---
  arch/arm/mach-imx/mach-imx51.c            |  5 ----
  arch/arm/mach-imx/mach-imx53.c            |  5 ----
  arch/arm/plat-omap/dmtimer.c              | 17 ++----------
  arch/arm/plat-omap/include/plat/dmtimer.h |  6 -----
  kernel/ipipe/timer.c                      | 17 +++++++-----
  kernel/ipipe/tracer.c                     | 44 +++++++++++++++----------------
  7 files changed, 34 insertions(+), 64 deletions(-)
Quoted 4 lines

Merged. In addition, 4.19/arm is running fine on imx6, imx7 ATM. Preview at wip/4.19-noarch and wip/4.19-arm from the ipipe-noarch and ipipe-arm trees respectively. I'll update the master branches in the coming days.

Ah, cool! Have to bite my tongue to not promise doing an x86 update to 4.19 soon as well - I first of all need to work through the Xenomai patch backlog.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux