--- /dev/null
+From stable-bounces@linux.kernel.org Wed May 23 13:46:07 2007
+Message-ID: <4654A7B4.4080309@redhat.com>
+Date: Wed, 23 May 2007 16:44:36 -0400
+From: Chuck Ebbert <cebbert@redhat.com>
+To: stable@kernel.org, Dave Jones <davej@redhat.com>
+Cc: Takashi Iwai <tiwai@suse.de>
+Subject: ALSA: hda-intel - Fix detection of audio codec on Toshiba A100
+
+From: Takashi Iwai <tiwai@suse.de>
+
+Some boards have the audio codec on slot #3 while the modem codec
+on slot #0. The driver should continue to probe the slots when
+no audio codec is found.
+This fixes the problem of no device on Toshiba A100 (and some other
+ATI SB450 devices).
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Jaroslav Kysela <perex@suse.cz>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ sound/pci/hda/hda_intel.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+--- linux-2.6.21.2.orig/sound/pci/hda/hda_intel.c
++++ linux-2.6.21.2/sound/pci/hda/hda_intel.c
+@@ -979,7 +979,7 @@ static unsigned int azx_max_codecs[] __d
+ static int __devinit azx_codec_create(struct azx *chip, const char *model)
+ {
+ struct hda_bus_template bus_temp;
+- int c, codecs, err;
++ int c, codecs, audio_codecs, err;
+
+ memset(&bus_temp, 0, sizeof(bus_temp));
+ bus_temp.private_data = chip;
+@@ -991,16 +991,19 @@ static int __devinit azx_codec_create(st
+ if ((err = snd_hda_bus_new(chip->card, &bus_temp, &chip->bus)) < 0)
+ return err;
+
+- codecs = 0;
++ codecs = audio_codecs = 0;
+ for (c = 0; c < AZX_MAX_CODECS; c++) {
+ if ((chip->codec_mask & (1 << c)) & probe_mask) {
+- err = snd_hda_codec_new(chip->bus, c, NULL);
++ struct hda_codec *codec;
++ err = snd_hda_codec_new(chip->bus, c, &codec);
+ if (err < 0)
+ continue;
+ codecs++;
++ if (codec->afg)
++ audio_codecs++;
+ }
+ }
+- if (!codecs) {
++ if (!audio_codecs) {
+ /* probe additional slots if no codec is found */
+ for (; c < azx_max_codecs[chip->driver_type]; c++) {
+ if ((chip->codec_mask & (1 << c)) & probe_mask) {
--- /dev/null
+From stable-bounces@linux.kernel.org Wed May 23 13:44:40 2007
+Message-ID: <4654A765.6060902@redhat.com>
+Date: Wed, 23 May 2007 16:43:17 -0400
+From: Chuck Ebbert <cebbert@redhat.com>
+To: stable@kernel.org
+Cc: Takashi Iwai <tiwai@suse.de>, Dave Jones <davej@redhat.com>
+Subject: ALSA: hda-intel - Probe additional slots only if necessary
+
+From: Takashi Iwai <tiwai@suse.de>
+
+Probing the codec slots on ATI controller causes problems on some
+devices like Acer laptops. On these devices, reading from codec
+slot 3 results in the communication failure with the codec chip.
+Meanwhile, some laptops (e.g. Gateway) have the codec connection
+only on slot 3, and probing this slot is mandatory for them.
+The patch improves the probing robustness. The additional slots
+are now checked only when no codecs are found in the primary three
+slots.
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Jaroslav Kysela <perex@suse.cz>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ sound/pci/hda/hda_intel.c | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+--- linux-2.6.21.2.orig/sound/pci/hda/hda_intel.c
++++ linux-2.6.21.2/sound/pci/hda/hda_intel.c
+@@ -198,6 +198,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO
+ #define RIRB_INT_MASK 0x05
+
+ /* STATESTS int mask: SD2,SD1,SD0 */
++#define AZX_MAX_CODECS 3
+ #define STATESTS_INT_MASK 0x07
+
+ /* SD_CTL bits */
+@@ -991,7 +992,7 @@ static int __devinit azx_codec_create(st
+ return err;
+
+ codecs = 0;
+- for (c = 0; c < azx_max_codecs[chip->driver_type]; c++) {
++ for (c = 0; c < AZX_MAX_CODECS; c++) {
+ if ((chip->codec_mask & (1 << c)) & probe_mask) {
+ err = snd_hda_codec_new(chip->bus, c, NULL);
+ if (err < 0)
+@@ -999,7 +1000,18 @@ static int __devinit azx_codec_create(st
+ codecs++;
+ }
+ }
+- if (! codecs) {
++ if (!codecs) {
++ /* probe additional slots if no codec is found */
++ for (; c < azx_max_codecs[chip->driver_type]; c++) {
++ if ((chip->codec_mask & (1 << c)) & probe_mask) {
++ err = snd_hda_codec_new(chip->bus, c, NULL);
++ if (err < 0)
++ continue;
++ codecs++;
++ }
++ }
++ }
++ if (!codecs) {
+ snd_printk(KERN_ERR SFX "no codecs initialized\n");
+ return -ENXIO;
+ }
--- /dev/null
+From stable-bounces@linux.kernel.org Wed May 23 14:00:00 2007
+Message-Id: <200705232057.l4NKvvko031767@shell0.pdx.osdl.net>
+To: torvalds@linux-foundation.org
+From: akpm@linux-foundation.org
+Date: Wed, 23 May 2007 13:57:56 -0700
+Cc: akpm@linux-foundation.org, jirislaby@gmail.com, stable@kernel.org
+Subject: Char: cyclades, fix deadlock
+
+From: Jiri Slaby <jirislaby@gmail.com>
+
+An omitted unlock.
+
+Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+
+ drivers/char/cyclades.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- linux-2.6.21.2.orig/drivers/char/cyclades.c
++++ linux-2.6.21.2/drivers/char/cyclades.c
+@@ -1103,6 +1103,7 @@ static void cyy_intr_chip(struct cyclade
+
+ if (data & info->ignore_status_mask) {
+ info->icount.rx++;
++ spin_unlock(&cinfo->card_lock);
+ return;
+ }
+ if (tty_buffer_request_room(tty, 1)) {
--- /dev/null
+From stable-bounces@linux.kernel.org Mon May 21 02:42:28 2007
+To: akpm@linux-foundation.org, stable@kernel.org
+Message-Id: <E1Hq4Mw-0002qK-00@dorka.pomaz.szeredi.hu>
+From: Miklos Szeredi <miklos@szeredi.hu>
+Date: Mon, 21 May 2007 11:39:58 +0200
+Cc: linux-kernel@vger.kernel.org
+Subject: fuse: fix mknod of regular file
+
+From: Miklos Szeredi <mszeredi@suse.cz>
+
+The wrong lookup flag was tested in ->create() causing havoc (error or
+Oops) when a regular file was created with mknod() in a fuse
+filesystem.
+
+Thanks to J. Cameijo Cerdeira for the report.
+
+Kernels 2.6.18 onward are affected. Please apply to -stable as well.
+
+Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ fs/fuse/dir.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- linux-2.6.21.2.orig/fs/fuse/dir.c
++++ linux-2.6.21.2/fs/fuse/dir.c
+@@ -485,7 +485,7 @@ static int fuse_mknod(struct inode *dir,
+ static int fuse_create(struct inode *dir, struct dentry *entry, int mode,
+ struct nameidata *nd)
+ {
+- if (nd && (nd->flags & LOOKUP_CREATE)) {
++ if (nd && (nd->flags & LOOKUP_OPEN)) {
+ int err = fuse_create_open(dir, entry, mode, nd);
+ if (err != -ENOSYS)
+ return err;
--- /dev/null
+From sshtylyov@ru.mvista.com Wed May 23 14:08:13 2007
+Date: Thu, 24 May 2007 01:09:40 +0400
+Message-Id: <200705240109.40516.sshtylyov@ru.mvista.com>
+From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
+To: stable@kernel.org
+Cc: bzolnier@gmail.com, chrisw@sous-sol.org
+Subject: hpt366: don't check enablebits for HPT36x
+
+HPT36x chip don't seem to have the channel enable bits, so prevent the IDE core
+from checking them...
+
+Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
+Cc: <bzolnier@gmail.com>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+This has been an issue since 2.6.21-rc1...
+
+ drivers/ide/pci/hpt366.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- linux-2.6.21.2.orig/drivers/ide/pci/hpt366.c
++++ linux-2.6.21.2/drivers/ide/pci/hpt366.c
+@@ -1,5 +1,5 @@
+ /*
+- * linux/drivers/ide/pci/hpt366.c Version 1.02 Apr 18, 2007
++ * linux/drivers/ide/pci/hpt366.c Version 1.03 May 4, 2007
+ *
+ * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org>
+ * Portions Copyright (C) 2001 Sun Microsystems, Inc.
+@@ -1527,7 +1527,12 @@ static int __devinit init_setup_hpt366(s
+ if (rev > 2)
+ goto init_single;
+
++ /*
++ * HPT36x chips are single channel and
++ * do not seem to have the channel enable bit...
++ */
+ d->channels = 1;
++ d->enablebits[0].reg = 0;
+
+ if ((dev2 = pci_get_slot(dev->bus, dev->devfn + 1)) != NULL) {
+ u8 pin1 = 0, pin2 = 0;
--- /dev/null
+From 6c977aad03a18019015035958c65b6729cd0574c Mon Sep 17 00:00:00 2001
+From: Andi Kleen <ak@suse.de>
+Date: Mon, 21 May 2007 14:31:45 +0200
+Cc: Chuck Ebbert <cebbert@redhat.com>, Dave Jones <davej@redhat.com>
+Subject: i386: Fix K8/core2 oprofile on multiple CPUs
+
+Only try to allocate MSRs once instead of for every CPU.
+
+This assumes the MSRs are the same on all CPUs which is currently
+true. P4-HT is a special case for different SMT threads, but the code
+always saves/restores all MSRs so it works identical.
+
+Signed-off-by: Andi Kleen <ak@suse.de>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ arch/i386/oprofile/nmi_int.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- linux-2.6.21.2.orig/arch/i386/oprofile/nmi_int.c
++++ linux-2.6.21.2/arch/i386/oprofile/nmi_int.c
+@@ -131,7 +131,6 @@ static void nmi_save_registers(void * du
+ {
+ int cpu = smp_processor_id();
+ struct op_msrs * msrs = &cpu_msrs[cpu];
+- model->fill_in_addresses(msrs);
+ nmi_cpu_save_registers(msrs);
+ }
+
+@@ -195,6 +194,7 @@ static struct notifier_block profile_exc
+ static int nmi_setup(void)
+ {
+ int err=0;
++ int cpu;
+
+ if (!allocate_msrs())
+ return -ENOMEM;
+@@ -207,6 +207,13 @@ static int nmi_setup(void)
+ /* We need to serialize save and setup for HT because the subset
+ * of msrs are distinct for save and setup operations
+ */
++
++ /* Assume saved/restored counters are the same on all CPUs */
++ model->fill_in_addresses(&cpu_msrs[0]);
++ for_each_possible_cpu (cpu) {
++ if (cpu != 0)
++ cpu_msrs[cpu] = cpu_msrs[0];
++ }
+ on_each_cpu(nmi_save_registers, NULL, 0, 1);
+ on_each_cpu(nmi_cpu_setup, NULL, 0, 1);
+ nmi_enabled = 1;
--- /dev/null
+From stable-bounces@linux.kernel.org Sat May 19 07:19:01 2007
+From: Thomas Gleixner <tglx@linutronix.de>
+To: linux-kernel@vger.kernel.org
+Date: Sat, 19 May 2007 16:22:50 +0200
+Message-Id: <1179584570.12981.123.camel@chaos>
+Cc: Andrew Morton <akpm@osdl.org>, Ingo Molnar <mingo@elte.hu>, Darren Hart <dvhltc@us.ibm.com>, stable@kernel.org, Len Brown <lenb@kernel.org>
+Subject: Ignore bogus ACPI info for offline CPUs
+
+Booting a SMP kernel with maxcpus=1 on a SMP system leads to a hard
+hang, because ACPI ignores the maxcpus setting and sends timer broadcast
+info for the offline CPUs. This results in a stuck for ever call to
+smp_call_function_single() on an offline CPU.
+
+Ignore the bogus information and print a kernel error to remind ACPI
+folks to fix it.
+
+Affects 2.6.21 / 2.6.22-rc
+
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+
+---
+ kernel/time/tick-broadcast.c | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+--- linux-2.6.21.2.orig/kernel/time/tick-broadcast.c
++++ linux-2.6.21.2/kernel/time/tick-broadcast.c
+@@ -243,11 +243,18 @@ void tick_broadcast_on_off(unsigned long
+ {
+ int cpu = get_cpu();
+
+- if (cpu == *oncpu)
+- tick_do_broadcast_on_off(&reason);
+- else
+- smp_call_function_single(*oncpu, tick_do_broadcast_on_off,
+- &reason, 1, 1);
++ if (!cpu_isset(*oncpu, cpu_online_map)) {
++ printk(KERN_ERR "tick-braodcast: ignoring broadcast for "
++ "offline CPU #%d\n", *oncpu);
++ } else {
++
++ if (cpu == *oncpu)
++ tick_do_broadcast_on_off(&reason);
++ else
++ smp_call_function_single(*oncpu,
++ tick_do_broadcast_on_off,
++ &reason, 1, 1);
++ }
+ put_cpu();
+ }
+
--- /dev/null
+From stable-bounces@linux.kernel.org Mon May 21 13:53:38 2007
+Message-ID: <46520651.3060003@redhat.com>
+Date: Mon, 21 May 2007 16:51:29 -0400
+From: Chuck Ebbert <cebbert@redhat.com>
+To: stable@kernel.org
+Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
+Subject: make freezeable workqueues singlethread
+
+From: Oleg Nesterov <oleg@tv-sign.ru>
+
+It is a known fact that freezeable multithreaded workqueues doesn't like
+CPU_DEAD. We keep them only for the incoming CPU-hotplug rework.
+
+Sadly, we can't just kill create_freezeable_workqueue() right now, make
+them singlethread.
+
+Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
+Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
+Cc: Gautham R Shenoy <ego@in.ibm.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ include/linux/workqueue.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- linux-2.6.21.2.orig/include/linux/workqueue.h
++++ linux-2.6.21.2/include/linux/workqueue.h
+@@ -162,7 +162,7 @@ extern struct workqueue_struct *__create
+ int singlethread,
+ int freezeable);
+ #define create_workqueue(name) __create_workqueue((name), 0, 0)
+-#define create_freezeable_workqueue(name) __create_workqueue((name), 0, 1)
++#define create_freezeable_workqueue(name) __create_workqueue((name), 1, 1)
+ #define create_singlethread_workqueue(name) __create_workqueue((name), 1, 0)
+
+ extern void destroy_workqueue(struct workqueue_struct *wq);
--- /dev/null
+From stable-bounces@linux.kernel.org Sun May 20 18:35:24 2007
+From: NeilBrown <neilb@suse.de>
+To: akpm@linux-foundation.org
+Date: Mon, 21 May 2007 11:33:03 +1000
+Message-Id: <1070521013303.6655@suse.de>
+Cc: linux-raid@vger.kernel.org, Jeff Zheng <Jeff.Zheng@endace.com>, Neil Brown <neilb@suse.de>, linux-kernel@vger.kernel.org, stable@kernel.org
+Subject: md: Avoid overflow in raid0 calculation with large components.
+
+If a raid0 has a component device larger than 4TB, and is accessed on
+a 32bit machines, then as 'chunk' is unsigned lock,
+ chunk << chunksize_bits
+can overflow (this can be as high as the size of the device in KB).
+chunk itself will not overflow (without triggering a BUG).
+
+So change 'chunk' to be 'sector_t, and get rid of the 'BUG' as it becomes
+impossible to hit.
+
+Cc: "Jeff Zheng" <Jeff.Zheng@endace.com>
+Signed-off-by: Neil Brown <neilb@suse.de>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+
+ drivers/md/raid0.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff .prev/drivers/md/raid0.c ./drivers/md/raid0.c
+--- linux-2.6.21.2.orig/drivers/md/raid0.c
++++ linux-2.6.21.2/drivers/md/raid0.c
+@@ -415,7 +415,7 @@ static int raid0_make_request (request_q
+ raid0_conf_t *conf = mddev_to_conf(mddev);
+ struct strip_zone *zone;
+ mdk_rdev_t *tmp_dev;
+- unsigned long chunk;
++ sector_t chunk;
+ sector_t block, rsect;
+ const int rw = bio_data_dir(bio);
+
+@@ -470,7 +470,6 @@ static int raid0_make_request (request_q
+
+ sector_div(x, zone->nb_dev);
+ chunk = x;
+- BUG_ON(x != (sector_t)chunk);
+
+ x = block >> chunksize_bits;
+ tmp_dev = zone->dev[sector_div(x, zone->nb_dev)];
--- /dev/null
+From stable-bounces@linux.kernel.org Sun May 20 18:35:20 2007
+From: NeilBrown <neilb@suse.de>
+To: akpm@linux-foundation.org
+Date: Mon, 21 May 2007 11:33:10 +1000
+Message-Id: <1070521013310.6687@suse.de>
+Cc: linux-raid@vger.kernel.org, Neil Brown <neilb@suse.de>, linux-kernel@vger.kernel.org, stable@kernel.org
+Subject: md: Don't write more than is required of the last page of a bitmap
+
+
+It is possible that real data or metadata follows the bitmap
+without full page alignment.
+So limit the last write to be only the required number of bytes,
+rounded up to the hard sector size of the device.
+
+Signed-off-by: Neil Brown <neilb@suse.de>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+
+ drivers/md/bitmap.c | 17 ++++++++++++-----
+ include/linux/raid/bitmap.h | 1 +
+ 2 files changed, 13 insertions(+), 5 deletions(-)
+
+diff .prev/drivers/md/bitmap.c ./drivers/md/bitmap.c
+--- linux-2.6.21.2.orig/drivers/md/bitmap.c
++++ linux-2.6.21.2/drivers/md/bitmap.c
+@@ -255,19 +255,25 @@ static struct page *read_sb_page(mddev_t
+
+ }
+
+-static int write_sb_page(mddev_t *mddev, long offset, struct page *page, int wait)
++static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait)
+ {
+ mdk_rdev_t *rdev;
+ struct list_head *tmp;
++ mddev_t *mddev = bitmap->mddev;
+
+ ITERATE_RDEV(mddev, rdev, tmp)
+ if (test_bit(In_sync, &rdev->flags)
+- && !test_bit(Faulty, &rdev->flags))
++ && !test_bit(Faulty, &rdev->flags)) {
++ int size = PAGE_SIZE;
++ if (page->index == bitmap->file_pages-1)
++ size = roundup(bitmap->last_page_size,
++ bdev_hardsect_size(rdev->bdev));
+ md_super_write(mddev, rdev,
+- (rdev->sb_offset<<1) + offset
++ (rdev->sb_offset<<1) + bitmap->offset
+ + page->index * (PAGE_SIZE/512),
+- PAGE_SIZE,
++ size,
+ page);
++ }
+
+ if (wait)
+ md_super_wait(mddev);
+@@ -282,7 +288,7 @@ static int write_page(struct bitmap *bit
+ struct buffer_head *bh;
+
+ if (bitmap->file == NULL)
+- return write_sb_page(bitmap->mddev, bitmap->offset, page, wait);
++ return write_sb_page(bitmap, page, wait);
+
+ bh = page_buffers(page);
+
+@@ -923,6 +929,7 @@ static int bitmap_init_from_disk(struct
+ }
+
+ bitmap->filemap[bitmap->file_pages++] = page;
++ bitmap->last_page_size = count;
+ }
+ paddr = kmap_atomic(page, KM_USER0);
+ if (bitmap->flags & BITMAP_HOSTENDIAN)
+--- linux-2.6.21.2.orig/include/linux/raid/bitmap.h
++++ linux-2.6.21.2/include/linux/raid/bitmap.h
+@@ -232,6 +232,7 @@ struct bitmap {
+ struct page **filemap; /* list of cache pages for the file */
+ unsigned long *filemap_attr; /* attributes associated w/ filemap pages */
+ unsigned long file_pages; /* number of pages in the file */
++ int last_page_size; /* bytes in the last page */
+
+ unsigned long flags;
+
--- /dev/null
+From stable-bounces@linux.kernel.org Wed May 23 14:07:58 2007
+Message-Id: <200705232057.l4NKvbN3031655@shell0.pdx.osdl.net>
+To: torvalds@linux-foundation.org
+From: akpm@linux-foundation.org
+Date: Wed, 23 May 2007 13:57:37 -0700
+Cc: akpm@linux-foundation.org, tglx@linutronix.de, stable@kernel.org
+Subject: NOHZ: Rate limit the local softirq pending warning output
+
+From: Thomas Gleixner <tglx@linutronix.de>
+
+The warning in the NOHZ code, which triggers when a CPU goes idle with
+softirqs pending can fill up the logs quite quickly. Rate limit the output
+until we found the root cause of that problem.
+
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+
+ kernel/time/tick-sched.c | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+--- linux-2.6.21.2.orig/kernel/time/tick-sched.c
++++ linux-2.6.21.2/kernel/time/tick-sched.c
+@@ -167,9 +167,15 @@ void tick_nohz_stop_sched_tick(void)
+ goto end;
+
+ cpu = smp_processor_id();
+- if (unlikely(local_softirq_pending()))
+- printk(KERN_ERR "NOHZ: local_softirq_pending %02x\n",
+- local_softirq_pending());
++ if (unlikely(local_softirq_pending())) {
++ static int ratelimit;
++
++ if (ratelimit < 10) {
++ printk(KERN_ERR "NOHZ: local_softirq_pending %02x\n",
++ local_softirq_pending());
++ ratelimit++;
++ }
++ }
+
+ now = ktime_get();
+ /*
--- /dev/null
+From stable-bounces@linux.kernel.org Mon May 21 23:40:14 2007
+Date: Tue, 22 May 2007 08:38:50 +0200
+From: Ingo Molnar <mingo@elte.hu>
+To: akpm@linux-foundation.org
+Message-ID: <20070522063850.GA23854@elte.hu>
+Cc: linux-kernel@vger.kernel.org, davem@davemloft.net, kernel@prachanda.info, tglx@linutronix.de, torvalds@linux-foundation.org, stable@kernel.org
+Subject: Prevent going idle with softirq pending
+
+From: Thomas Gleixner <tglx@linutronix.de>
+
+The NOHZ patch contains a check for softirqs pending when a CPU goes
+idle. The BUG is unrelated to NOHZ, it just was made visible by the NOHZ
+patch. The BUG showed up mainly on P4 / hyperthreading enabled machines
+which lead the investigations into the wrong direction in the first
+place. The real cause is in cond_resched_softirq():
+
+cond_resched_softirq() is enabling softirqs without invoking the softirq
+daemon when softirqs are pending. This leads to the warning message in
+the NOHZ idle code:
+
+t1 runs softirq disabled code on CPU#0
+interrupt happens, softirq is raised, but deferred (softirqs disabled)
+t1 calls cond_resched_softirq()
+ enables softirqs via _local_bh_enable()
+ calls schedule()
+t2 runs
+t1 is migrated to CPU#1
+t2 is done and invokes idle()
+NOHZ detects the pending softirq
+
+Fix: change _local_bh_enable() to local_bh_enable() so the softirq
+daemon is invoked.
+
+Thanks to Anant Nitya for debugging this with great patience !
+
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Cc: Anant Nitya <kernel@prachanda.info>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ kernel/sched.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+--- linux-2.6.21.2.orig/kernel/sched.c
++++ linux-2.6.21.2/kernel/sched.c
+@@ -4545,9 +4545,7 @@ int __sched cond_resched_softirq(void)
+ BUG_ON(!in_softirq());
+
+ if (need_resched() && system_state == SYSTEM_RUNNING) {
+- raw_local_irq_disable();
+- _local_bh_enable();
+- raw_local_irq_enable();
++ local_bh_enable();
+ __cond_resched();
+ local_bh_disable();
+ return 1;
i386-hpet-check-if-the-counter-works.patch
+ignore-bogus-acpi-info-for-offline-cpus.patch
+nohz-rate-limit-the-local-softirq-pending-warning-output.patch
+i386-fix-k8-core2-oprofile-on-multiple-cpus.patch
+md-avoid-overflow-in-raid0-calculation-with-large-components.patch
+md-don-t-write-more-than-is-required-of-the-last-page-of-a-bitmap.patch
+fuse-fix-mknod-of-regular-file.patch
+make-freezeable-workqueues-singlethread.patch
+prevent-going-idle-with-softirq-pending.patch
+alsa-hda-intel-probe-additional-slots-only-if-necessary.patch
+alsa-hda-intel-fix-detection-of-audio-codec-on-toshiba-a100.patch
+char-cyclades-fix-deadlock.patch
+hpt366-don-t-check-enablebits-for-hpt36x.patch