All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch added to the 3.12 stable tree] MIPS: IRQ: Fix disable_irq on CPU IRQs
       [not found] <1423563470-21303-1-git-send-email-jslaby@suse.cz>
@ 2015-02-10 10:17 ` Jiri Slaby
  2015-02-10 10:17 ` [patch added to the 3.12 stable tree] MIPS: Fix kernel lockup or crash after CPU offline/online Jiri Slaby
  2015-02-10 10:17 ` [patch added to the 3.12 stable tree] lib/checksum.c: fix carry in csum_tcpudp_nofold Jiri Slaby
  2 siblings, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2015-02-10 10:17 UTC (permalink / raw)
  To: stable; +Cc: Felix Fietkau, linux-mips, Ralf Baechle, Jiri Slaby

From: Felix Fietkau <nbd@openwrt.org>

This patch has been added to the 3.12 stable tree. If you have any
objections, please let us know.

===============

commit a3e6c1eff54878506b2dddcc202df9cc8180facb upstream.

If the irq_chip does not define .irq_disable, any call to disable_irq
will defer disabling the IRQ until it fires while marked as disabled.
This assumes that the handler function checks for this condition, which
handle_percpu_irq does not. In this case, calling disable_irq leads to
an IRQ storm, if the interrupt fires while disabled.

This optimization is only useful when disabling the IRQ is slow, which
is not true for the MIPS CPU IRQ.

Disable this optimization by implementing .irq_disable and .irq_enable

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8949/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/mips/kernel/irq_cpu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/mips/kernel/irq_cpu.c b/arch/mips/kernel/irq_cpu.c
index 72ef2d25cbf2..ab941a366012 100644
--- a/arch/mips/kernel/irq_cpu.c
+++ b/arch/mips/kernel/irq_cpu.c
@@ -56,6 +56,8 @@ static struct irq_chip mips_cpu_irq_controller = {
 	.irq_mask_ack	= mask_mips_irq,
 	.irq_unmask	= unmask_mips_irq,
 	.irq_eoi	= unmask_mips_irq,
+	.irq_disable	= mask_mips_irq,
+	.irq_enable	= unmask_mips_irq,
 };
 
 /*
@@ -92,6 +94,8 @@ static struct irq_chip mips_mt_cpu_irq_controller = {
 	.irq_mask_ack	= mips_mt_cpu_irq_ack,
 	.irq_unmask	= unmask_mips_irq,
 	.irq_eoi	= unmask_mips_irq,
+	.irq_disable	= mask_mips_irq,
+	.irq_enable	= unmask_mips_irq,
 };
 
 void __init mips_cpu_irq_init(void)
-- 
2.2.2

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

* [patch added to the 3.12 stable tree] MIPS: Fix kernel lockup or crash after CPU offline/online
       [not found] <1423563470-21303-1-git-send-email-jslaby@suse.cz>
  2015-02-10 10:17 ` [patch added to the 3.12 stable tree] MIPS: IRQ: Fix disable_irq on CPU IRQs Jiri Slaby
@ 2015-02-10 10:17 ` Jiri Slaby
  2015-02-10 10:17 ` [patch added to the 3.12 stable tree] lib/checksum.c: fix carry in csum_tcpudp_nofold Jiri Slaby
  2 siblings, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2015-02-10 10:17 UTC (permalink / raw)
  To: stable
  Cc: Hemmo Nieminen, Aaro Koskinen, David Daney, linux-mips,
	linux-kernel, Ralf Baechle, Jiri Slaby

From: Hemmo Nieminen <hemmo.nieminen@iki.fi>

This patch has been added to the 3.12 stable tree. If you have any
objections, please let us know.

===============

commit c7754e75100ed5e3068ac5085747f2bfc386c8d6 upstream.

As printk() invocation can cause e.g. a TLB miss, printk() cannot be
called before the exception handlers have been properly initialized.
This can happen e.g. when netconsole has been loaded as a kernel module
and the TLB table has been cleared when a CPU was offline.

Call cpu_report() in start_secondary() only after the exception handlers
have been initialized to fix this.

Without the patch the kernel will randomly either lockup or crash
after a CPU is onlined and the console driver is a module.

Signed-off-by: Hemmo Nieminen <hemmo.nieminen@iki.fi>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: David Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8953/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/mips/kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 5c208ed8f856..57b89cba1624 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -109,10 +109,10 @@ asmlinkage void start_secondary(void)
 	else
 #endif /* CONFIG_MIPS_MT_SMTC */
 	cpu_probe();
-	cpu_report();
 	per_cpu_trap_init(false);
 	mips_clockevent_init();
 	mp_ops->init_secondary();
+	cpu_report();
 
 	/*
 	 * XXX parity protection should be folded in here when it's converted
-- 
2.2.2


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

* [patch added to the 3.12 stable tree] lib/checksum.c: fix carry in csum_tcpudp_nofold
       [not found] <1423563470-21303-1-git-send-email-jslaby@suse.cz>
  2015-02-10 10:17 ` [patch added to the 3.12 stable tree] MIPS: IRQ: Fix disable_irq on CPU IRQs Jiri Slaby
  2015-02-10 10:17 ` [patch added to the 3.12 stable tree] MIPS: Fix kernel lockup or crash after CPU offline/online Jiri Slaby
@ 2015-02-10 10:17 ` Jiri Slaby
  2 siblings, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2015-02-10 10:17 UTC (permalink / raw)
  To: stable
  Cc: karl beldan, Karl Beldan, Al Viro, Eric Dumazet, Arnd Bergmann,
	Mike Frysinger, netdev, linux-kernel, Eric Dumazet,
	David S. Miller, Jiri Slaby

From: karl beldan <karl.beldan@gmail.com>

This patch has been added to the 3.12 stable tree. If you have any
objections, please let us know.

===============

commit 150ae0e94634714b23919f0c333fee28a5b199d5 upstream.

The carry from the 64->32bits folding was dropped, e.g with:
saddr=0xFFFFFFFF daddr=0xFF0000FF len=0xFFFF proto=0 sum=1,
csum_tcpudp_nofold returned 0 instead of 1.

Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 lib/checksum.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lib/checksum.c b/lib/checksum.c
index 129775eb6de6..fcf38943132c 100644
--- a/lib/checksum.c
+++ b/lib/checksum.c
@@ -47,6 +47,15 @@ static inline unsigned short from32to16(unsigned int x)
 	return x;
 }
 
+static inline u32 from64to32(u64 x)
+{
+	/* add up 32-bit and 32-bit for 32+c bit */
+	x = (x & 0xffffffff) + (x >> 32);
+	/* add up carry.. */
+	x = (x & 0xffffffff) + (x >> 32);
+	return (u32)x;
+}
+
 static unsigned int do_csum(const unsigned char *buff, int len)
 {
 	int odd;
@@ -195,8 +204,7 @@ __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
 #else
 	s += (proto + len) << 8;
 #endif
-	s += (s >> 32);
-	return (__force __wsum)s;
+	return (__force __wsum)from64to32(s);
 }
 EXPORT_SYMBOL(csum_tcpudp_nofold);
 #endif
-- 
2.2.2


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

end of thread, other threads:[~2015-02-10 12:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1423563470-21303-1-git-send-email-jslaby@suse.cz>
2015-02-10 10:17 ` [patch added to the 3.12 stable tree] MIPS: IRQ: Fix disable_irq on CPU IRQs Jiri Slaby
2015-02-10 10:17 ` [patch added to the 3.12 stable tree] MIPS: Fix kernel lockup or crash after CPU offline/online Jiri Slaby
2015-02-10 10:17 ` [patch added to the 3.12 stable tree] lib/checksum.c: fix carry in csum_tcpudp_nofold Jiri Slaby

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.