patches-3.8.13-rt14.tar.xz

md5sum:
aec500b792b43f798b8c17e699de9f58  patches-3.8.13-rt14.tar.xz

Announce:
 ------------------
 Dear RT Folks,

 I'm pleased to announce the 3.8.13-rt14 release.

 changes since v3.8.13-rt13:
 - added a patch from Uwe Kleine-König to fix the UP breakage introduced by
   the recent s/sbin spinlocks/raw_spin_lock/ change.
 - added a fix for a livelock of workqueue vs ata-piix. Found by Carsten
   Emde, patch proposed by Thomas Gleixner.

 The delta patch against v3.8.13-rt13 is appended below and can be found here:

   https://www.kernel.org/pub/linux/kernel/projects/rt/3.8/incr/patch-3.8.13-rt13-rt14.patch.xz

 The RT patch against 3.8.13 can be found here:

   https://www.kernel.org/pub/linux/kernel/projects/rt/3.8/patch-3.8.13-rt14.patch.xz

 The split quilt queue is available at:

   https://www.kernel.org/pub/linux/kernel/projects/rt/3.8/patches-3.8.13-rt14.tar.xz

 Sebastian

 [Delta patch snipped]
 ------------------

http://marc.info/?l=linux-rt-users&m=137352834309286&w=2

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
diff --git a/patches/kernel-workqueue-Add-PF_THREAD_BOUND-after-set_cpu.patch b/patches/kernel-workqueue-Add-PF_THREAD_BOUND-after-set_cpu.patch
index d3e2d02..b2bde4f 100644
--- a/patches/kernel-workqueue-Add-PF_THREAD_BOUND-after-set_cpu.patch
+++ b/patches/kernel-workqueue-Add-PF_THREAD_BOUND-after-set_cpu.patch
@@ -15,7 +15,7 @@
 
 --- a/kernel/workqueue.c
 +++ b/kernel/workqueue.c
-@@ -1637,8 +1637,11 @@ __acquires(&gcwq->lock)
+@@ -1638,8 +1638,11 @@ __acquires(&gcwq->lock)
  		 * it races with cpu hotunplug operation.  Verify
  		 * against GCWQ_DISASSOCIATED.
  		 */
diff --git a/patches/list_bl.h-fix-it-for-for-SMP-DEBUG_SPINLOCK.patch b/patches/list_bl.h-fix-it-for-for-SMP-DEBUG_SPINLOCK.patch
new file mode 100644
index 0000000..1fb18b3
--- /dev/null
+++ b/patches/list_bl.h-fix-it-for-for-SMP-DEBUG_SPINLOCK.patch
@@ -0,0 +1,60 @@
+From 2737cff12eb197cb711f4e5b84a76b9e2b76ef7b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
+Date: Tue, 9 Jul 2013 00:26:32 +0200
+Subject: [PATCH] list_bl.h: fix it for for !SMP && !DEBUG_SPINLOCK
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The patch "list_bl.h: make list head locking RT safe" introduced
+an unconditional
+
+	__set_bit(0, (unsigned long *)b);
+
+in void hlist_bl_lock(struct hlist_bl_head *b). This clobbers the value
+of b->first. When the value of b->first is retrieved using
+hlist_bl_first the clobbering is undone using
+
+	(unsigned long)h->first & ~LIST_BL_LOCKMASK
+
+and so depending on LIST_BL_LOCKMASK being one. But LIST_BL_LOCKMASK is
+only one if at least on of CONFIG_SMP and CONFIG_DEBUG_SPINLOCK are
+defined. Without these the value returned by hlist_bl_first has the
+zeroth bit set which likely results in a crash.
+
+So only do the clobbering in the cases where LIST_BL_LOCKMASK is one.
+An alternative would be to always define LIST_BL_LOCKMASK to one with
+CONFIG_PREEMPT_RT_BASE.
+
+Cc: stable-rt@vger.kernel.org
+Acked-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+Tested-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+---
+ include/linux/list_bl.h |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/include/linux/list_bl.h
++++ b/include/linux/list_bl.h
+@@ -131,8 +131,10 @@ static inline void hlist_bl_lock(struct
+ 	bit_spin_lock(0, (unsigned long *)b);
+ #else
+ 	raw_spin_lock(&b->lock);
++#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
+ 	__set_bit(0, (unsigned long *)b);
+ #endif
++#endif
+ }
+ 
+ static inline void hlist_bl_unlock(struct hlist_bl_head *b)
+@@ -140,7 +142,9 @@ static inline void hlist_bl_unlock(struc
+ #ifndef CONFIG_PREEMPT_RT_BASE
+ 	__bit_spin_unlock(0, (unsigned long *)b);
+ #else
++#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
+ 	__clear_bit(0, (unsigned long *)b);
++#endif
+ 	raw_spin_unlock(&b->lock);
+ #endif
+ }
diff --git a/patches/localversion.patch b/patches/localversion.patch
index 88925b7..113e534 100644
--- a/patches/localversion.patch
+++ b/patches/localversion.patch
@@ -12,4 +12,4 @@
 --- /dev/null
 +++ b/localversion-rt
 @@ -0,0 +1 @@
-+-rt13
++-rt14
diff --git a/patches/series b/patches/series
index 9925713..31d8cc2 100644
--- a/patches/series
+++ b/patches/series
@@ -249,6 +249,7 @@
 fs-replace-bh_uptodate_lock-for-rt.patch
 fs-jbd-replace-bh_state-lock.patch
 list_bl.h-make-list-head-locking-RT-safe.patch
+list_bl.h-fix-it-for-for-SMP-DEBUG_SPINLOCK.patch
 
 # GENIRQ
 genirq-nodebug-shirq.patch
@@ -468,6 +469,7 @@
 # CHECKME workqueue-fix-PF_THREAD_BOUND.patch
 # CHECKME workqueue-hotplug-fix.patch
 # CHECKME workqueue-more-hotplug-fallout.patch
+workqueue-vs-ata-piix-livelock-fixup.patch
 
 # DEBUGOBJECTS
 debugobjects-rt.patch
diff --git a/patches/workqueue-vs-ata-piix-livelock-fixup.patch b/patches/workqueue-vs-ata-piix-livelock-fixup.patch
new file mode 100644
index 0000000..985bf6b
--- /dev/null
+++ b/patches/workqueue-vs-ata-piix-livelock-fixup.patch
@@ -0,0 +1,132 @@
+From 67c748bc146bc83762ff1cfed93b42a744e992a8 Mon Sep 17 00:00:00 2001
+From: Carsten Emde <C.Emde@osadl.org>
+Date: Thu, 11 Jul 2013 08:54:46 +0200
+Subject: [PATCH] workqueue vs ata-piix livelock fixup
+
+An Intel i7 system regularly detected rcu_preempt stalls after the kernel
+was upgraded from 3.6-rt to 3.8-rt. When the stall happened, disk I/O was no
+longer possible, unless the system was restarted.
+
+The kernel message was:
+INFO: rcu_preempt self-detected stall on CPU { 6}
+[..]
+NMI backtrace for cpu 6
+CPU 6
+Pid: 119, comm: irq/19-ata_piix Not tainted 3.8.13-rt13 #11 Shuttle Inc. SX58/SX58
+RIP: 0010:[<ffffffff8124ca60>]  [<ffffffff8124ca60>] ip_compute_csum+0x30/0x30
+RSP: 0018:ffff880333303cb0  EFLAGS: 00000002
+RAX: 0000000000000006 RBX: 00000000000003e9 RCX: 0000000000000034
+RDX: 0000000000000000 RSI: ffffffff81aa16d0 RDI: 0000000000000001
+RBP: ffff880333303ce8 R08: ffffffff81aa16d0 R09: ffffffff81c1b8cc
+R10: 0000000000000000 R11: 0000000000000000 R12: 000000000005161f
+R13: 0000000000000006 R14: ffffffff81aa16d0 R15: 0000000000000002
+FS:  0000000000000000(0000) GS:ffff880333300000(0000) knlGS:0000000000000000
+CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
+CR2: 0000003c1b2bb420 CR3: 0000000001a0f000 CR4: 00000000000007e0
+DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
+Process irq/19-ata_piix (pid: 119, threadinfo ffff88032d88a000, task ffff88032df80000)
+Stack:
+ffffffff8124cb32 000000000005161e 00000000000003e9 0000000000001000
+0000000000009022 ffffffff81aa16d0 0000000000000002 ffff880333303cf8
+ffffffff8124caa9 ffff880333303d08 ffffffff8124cad2 ffff880333303d28
+Call Trace:
+<IRQ>
+[<ffffffff8124cb32>] ? delay_tsc+0x33/0xe3
+[<ffffffff8124caa9>] __delay+0xf/0x11
+[<ffffffff8124cad2>] __const_udelay+0x27/0x29
+[<ffffffff8102d1fa>] native_safe_apic_wait_icr_idle+0x39/0x45
+[<ffffffff8102dc9b>] __default_send_IPI_dest_field.constprop.0+0x1e/0x58
+[<ffffffff8102dd1e>] default_send_IPI_mask_sequence_phys+0x49/0x7d
+[<ffffffff81030326>] physflat_send_IPI_all+0x17/0x19
+[<ffffffff8102de53>] arch_trigger_all_cpu_backtrace+0x50/0x79
+[<ffffffff810b21d0>] rcu_check_callbacks+0x1cb/0x568
+[<ffffffff81048c9c>] ? raise_softirq+0x2e/0x35
+[<ffffffff81086be0>] ? tick_sched_do_timer+0x38/0x38
+[<ffffffff8104f653>] update_process_times+0x44/0x55
+[<ffffffff81086866>] tick_sched_handle+0x4a/0x59
+[<ffffffff81086c1c>] tick_sched_timer+0x3c/0x5b
+[<ffffffff81062845>] __run_hrtimer+0x9b/0x158
+[<ffffffff810631d8>] hrtimer_interrupt+0x172/0x2aa
+[<ffffffff8102d498>] smp_apic_timer_interrupt+0x76/0x89
+[<ffffffff814d881d>] apic_timer_interrupt+0x6d/0x80
+<EOI>
+[<ffffffff81057cd2>] ? __local_lock_irqsave+0x17/0x4a
+[<ffffffff81059336>] try_to_grab_pending+0x42/0x17e
+[<ffffffff8105a699>] mod_delayed_work_on+0x32/0x88
+[<ffffffff8105a70b>] mod_delayed_work+0x1c/0x1e
+[<ffffffff8122ae84>] blk_run_queue_async+0x37/0x39
+[<ffffffff81230985>] flush_end_io+0xf1/0x107
+[<ffffffff8122e0da>] blk_finish_request+0x21e/0x264
+[<ffffffff8122e162>] blk_end_bidi_request+0x42/0x60
+[<ffffffff8122e1ba>] blk_end_request+0x10/0x12
+[<ffffffff8132de46>] scsi_io_completion+0x1bf/0x492
+[<ffffffff81335cec>] ? sd_done+0x298/0x2ef
+[<ffffffff81325a02>] scsi_finish_command+0xe9/0xf2
+[<ffffffff8132dbcb>] scsi_softirq_done+0x106/0x10f
+[<ffffffff812333d3>] blk_done_softirq+0x77/0x87
+[<ffffffff8104826f>] do_current_softirqs+0x172/0x2e1
+[<ffffffff810aa820>] ? irq_thread_fn+0x3a/0x3a
+[<ffffffff81048466>] local_bh_enable+0x43/0x72
+[<ffffffff810aa866>] irq_forced_thread_fn+0x46/0x52
+[<ffffffff810ab089>] irq_thread+0x8c/0x17c
+[<ffffffff810ab179>] ? irq_thread+0x17c/0x17c
+[<ffffffff810aaffd>] ? wake_threads_waitq+0x44/0x44
+[<ffffffff8105eb18>] kthread+0x8d/0x95
+[<ffffffff8105ea8b>] ? __kthread_parkme+0x65/0x65
+[<ffffffff814d7b7c>] ret_from_fork+0x7c/0xb0
+[<ffffffff8105ea8b>] ? __kthread_parkme+0x65/0x65
+
+The state of softirqd of this CPU at the time of the crash was:
+ksoftirqd/6     R  running task        0    53      2 0x00000000
+ffff88032fc39d18 0000000000000046 ffff88033330c4c0 ffff8803303f4710
+ffff88032fc39fd8 ffff88032fc39fd8 0000000000000000 0000000000062500
+ffff88032df88000 ffff8803303f4710 0000000000000000 ffff88032fc38000
+Call Trace:
+[<ffffffff8105a3ae>] ? __queue_work+0x27c/0x27c
+[<ffffffff814d178c>] preempt_schedule+0x61/0x76
+[<ffffffff8106cccf>] migrate_enable+0xe5/0x1df
+[<ffffffff8105a3ae>] ? __queue_work+0x27c/0x27c
+[<ffffffff8104ef52>] run_timer_softirq+0x161/0x1d6
+[<ffffffff8104826f>] do_current_softirqs+0x172/0x2e1
+[<ffffffff8104840b>] run_ksoftirqd+0x2d/0x45
+[<ffffffff8106658a>] smpboot_thread_fn+0x2ea/0x308
+[<ffffffff810662a0>] ? test_ti_thread_flag+0xc/0xc
+[<ffffffff810662a0>] ? test_ti_thread_flag+0xc/0xc
+[<ffffffff8105eb18>] kthread+0x8d/0x95
+[<ffffffff8105ea8b>] ? __kthread_parkme+0x65/0x65
+[<ffffffff814d7afc>] ret_from_fork+0x7c/0xb0
+[<ffffffff8105ea8b>] ? __kthread_parkme+0x65/0x65
+
+Apparently, the softirq demon and the ata_piix IRQ handler were waiting
+for each other to finish ending up in a livelock. After the below patch
+was applied, the system no longer crashes.
+
+Reported-by: Carsten Emde <C.Emde@osadl.org>
+Proposed-by: Thomas Gleixner <tglx@linutronix.de>
+Tested by: Carsten Emde <C.Emde@osadl.org>
+Signed-off-by: Carsten Emde <C.Emde@osadl.org>
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+---
+ kernel/workqueue.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/kernel/workqueue.c
++++ b/kernel/workqueue.c
+@@ -42,6 +42,7 @@
+ #include <linux/lockdep.h>
+ #include <linux/idr.h>
+ #include <linux/locallock.h>
++#include <linux/delay.h>
+ 
+ #include "workqueue_sched.h"
+ 
+@@ -1157,7 +1158,7 @@ fail:
+ 	local_unlock_irqrestore(pendingb_lock, *flags);
+ 	if (work_is_canceling(work))
+ 		return -ENOENT;
+-	cpu_relax();
++	cpu_chill();
+ 	return -EAGAIN;
+ }
+