--- /dev/null
+From stable-bounces@linux.kernel.org Thu May 24 06:37:05 2007
+Message-ID: <465594AA.7070802@gentoo.org>
+Date: Thu, 24 May 2007 09:35:38 -0400
+From: Daniel Drake <dsd@gentoo.org>
+To: stable@kernel.org
+Subject: ALSA: usb-audio: explicitly match Logitech QuickCam
+
+Commit 93c8bf45e083b89dffe3a708363c15c1b220c723 modified the USB device
+matching behaviour to ignore interface class matches if the device class
+is vendor-specific.
+This patch adds explicit ID matches for Logitech QuickCam devices, which
+have a vendor specific device class (but standards-compliant audio
+interfaces).
+This fixes a 2.6.20 regression where the audio component of these
+devices was no longer usable.
+http://bugs.gentoo.org/show_bug.cgi?id=175715
+https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/93822
+https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3040
+Based on a patch from sergiom
+
+Signed-off-by: Daniel Drake <dsd@gentoo.org>
+Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
+Signed-off-by: Jaroslav Kysela <perex@suse.cz>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=a91214589e6527b18f52bc0b31253f9dfb4665e6
+
+ sound/usb/usbquirks.h | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+
+--- linux-2.6.20.12.orig/sound/usb/usbquirks.h
++++ linux-2.6.20.12/sound/usb/usbquirks.h
+@@ -40,6 +40,29 @@
+ .bInterfaceClass = USB_CLASS_VENDOR_SPEC
+
+ /*
++ * Logitech QuickCam: bDeviceClass is vendor-specific, so generic interface
++ * class matches do not take effect without an explicit ID match.
++ */
++{
++ .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
++ USB_DEVICE_ID_MATCH_INT_CLASS |
++ USB_DEVICE_ID_MATCH_INT_SUBCLASS,
++ .idVendor = 0x046d,
++ .idProduct = 0x08f0,
++ .bInterfaceClass = USB_CLASS_AUDIO,
++ .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL
++},
++{
++ .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
++ USB_DEVICE_ID_MATCH_INT_CLASS |
++ USB_DEVICE_ID_MATCH_INT_SUBCLASS,
++ .idVendor = 0x046d,
++ .idProduct = 0x08f6,
++ .bInterfaceClass = USB_CLASS_AUDIO,
++ .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL
++},
++
++/*
+ * Yamaha devices
+ */
+
crypto-api-read-module-pointer-before-freeing-algorithm.patch
fuse-fix-mknod-of-regular-file.patch
acpi-thermal-fix-mod_timer-interval.patch
+alsa-usb-audio-explicitly-match-logitech-quickcam.patch
--- /dev/null
+From stable-bounces@linux.kernel.org Sun May 27 05:42:34 2007
+Message-ID: <46597C9A.40303@gmail.com>
+Date: Sun, 27 May 2007 14:42:02 +0200
+From: Tejun Heo <htejun@gmail.com>
+To: stable@kernel.org
+Cc: Srihari Vijayaraghavan <sriharivijayaraghavan@yahoo.com.au>, Jeff Garzik <jeff@garzik.org>
+Subject: ahci: disable 64bit dma on sb600
+
+SB600 claims it can do 64bit DMA but it can't. Disable it.
+
+Signed-off-by: Tejun Heo <htejun@gmail.com>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+This is backport of commit c7a42156d99bcea7f8173ba7a6034bbaa2ecb77c.
+Due to initialization changes in devel branch, it looks a bit
+different but does the same thing. This problem makes sb600 ahci
+controller malfunction if some memory is over 4G. Please consider for
+-stable. Thanks.
+
+ drivers/ata/ahci.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+--- linux-2.6.21.3.orig/drivers/ata/ahci.c
++++ linux-2.6.21.3/drivers/ata/ahci.c
+@@ -170,6 +170,7 @@ enum {
+ AHCI_FLAG_IGN_IRQ_IF_ERR = (1 << 25), /* ignore IRQ_IF_ERR */
+ AHCI_FLAG_HONOR_PI = (1 << 26), /* honor PORTS_IMPL */
+ AHCI_FLAG_IGN_SERR_INTERNAL = (1 << 27), /* ignore SERR_INTERNAL */
++ AHCI_FLAG_32BIT_ONLY = (1 << 28), /* force 32bit */
+ };
+
+ struct ahci_cmd_hdr {
+@@ -370,7 +371,8 @@ static const struct ata_port_info ahci_p
+ .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
+ ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
+ ATA_FLAG_SKIP_D2H_BSY |
+- AHCI_FLAG_IGN_SERR_INTERNAL,
++ AHCI_FLAG_IGN_SERR_INTERNAL |
++ AHCI_FLAG_32BIT_ONLY,
+ .pio_mask = 0x1f, /* pio0-4 */
+ .udma_mask = 0x7f, /* udma0-6 ; FIXME */
+ .port_ops = &ahci_ops,
+@@ -1579,6 +1581,12 @@ static int ahci_host_init(struct ata_pro
+ probe_ent->n_ports = cap_n_ports;
+
+ using_dac = hpriv->cap & HOST_CAP_64;
++ if (using_dac && (probe_ent->port_flags & AHCI_FLAG_32BIT_ONLY)) {
++ dev_printk(KERN_INFO, &pdev->dev,
++ "controller can't do 64bit DMA, forcing 32bit\n");
++ using_dac = 0;
++ }
++
+ if (using_dac &&
+ !pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
+ rc = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
--- /dev/null
+From stable-bounces@linux.kernel.org Thu May 24 06:37:05 2007
+Message-ID: <465594AA.7070802@gentoo.org>
+Date: Thu, 24 May 2007 09:35:38 -0400
+From: Daniel Drake <dsd@gentoo.org>
+To: stable@kernel.org
+Subject: ALSA: usb-audio: explicitly match Logitech QuickCam
+
+Commit 93c8bf45e083b89dffe3a708363c15c1b220c723 modified the USB device
+matching behaviour to ignore interface class matches if the device class
+is vendor-specific.
+This patch adds explicit ID matches for Logitech QuickCam devices, which
+have a vendor specific device class (but standards-compliant audio
+interfaces).
+This fixes a 2.6.20 regression where the audio component of these
+devices was no longer usable.
+http://bugs.gentoo.org/show_bug.cgi?id=175715
+https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/93822
+https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3040
+Based on a patch from sergiom
+
+Signed-off-by: Daniel Drake <dsd@gentoo.org>
+Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
+Signed-off-by: Jaroslav Kysela <perex@suse.cz>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=a91214589e6527b18f52bc0b31253f9dfb4665e6
+
+ sound/usb/usbquirks.h | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+
+--- linux-2.6.21.3.orig/sound/usb/usbquirks.h
++++ linux-2.6.21.3/sound/usb/usbquirks.h
+@@ -40,6 +40,29 @@
+ .bInterfaceClass = USB_CLASS_VENDOR_SPEC
+
+ /*
++ * Logitech QuickCam: bDeviceClass is vendor-specific, so generic interface
++ * class matches do not take effect without an explicit ID match.
++ */
++{
++ .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
++ USB_DEVICE_ID_MATCH_INT_CLASS |
++ USB_DEVICE_ID_MATCH_INT_SUBCLASS,
++ .idVendor = 0x046d,
++ .idProduct = 0x08f0,
++ .bInterfaceClass = USB_CLASS_AUDIO,
++ .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL
++},
++{
++ .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
++ USB_DEVICE_ID_MATCH_INT_CLASS |
++ USB_DEVICE_ID_MATCH_INT_SUBCLASS,
++ .idVendor = 0x046d,
++ .idProduct = 0x08f6,
++ .bInterfaceClass = USB_CLASS_AUDIO,
++ .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL
++},
++
++/*
+ * Yamaha devices
+ */
+
--- /dev/null
+From 713fb93936bebc158b4bbae6be61a6310923543c Mon Sep 17 00:00:00 2001
+From: Andrew Morton <akpm@linux-foundation.org>
+Date: Sat, 5 May 2007 12:02:25 +0200
+Subject: ALSA: wm8750 typo fix
+
+I quuestion the testing status of that patch!
+
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+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/soc/codecs/wm8750.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- linux-2.6.21.3.orig/sound/soc/codecs/wm8750.c
++++ linux-2.6.21.3/sound/soc/codecs/wm8750.c
+@@ -808,7 +808,7 @@ static int wm8750_init(struct snd_soc_de
+ codec->dai = &wm8750_dai;
+ codec->num_dai = 1;
+ codec->reg_cache_size = sizeof(wm8750_reg);
+- codec->reg_cache = kmemdup(wm8750_reg, sizeof(wm8750_reg), GFP_KRENEL);
++ codec->reg_cache = kmemdup(wm8750_reg, sizeof(wm8750_reg), GFP_KERNEL);
+ if (codec->reg_cache == NULL)
+ return -ENOMEM;
+
--- /dev/null
+From stable-bounces@linux.kernel.org Fri May 25 16:39:56 2007
+Date: Sat, 26 May 2007 00:39:17 +0100 (BST)
+From: Hugh Dickins <hugh@veritas.com>
+To: Linus Torvalds <torvalds@linux-foundation.org>
+Message-ID: <Pine.LNX.4.64.0705260032250.25650@blonde.wat.veritas.com>
+Cc: Egmont Koblinger <egmont@uhulinux.hu>, Andrew Morton <akpm@linux-foundation.org>, stable@kernel.org
+Subject: fix compat console unimap regression
+
+Why is it that since the 2f1a2ccb9c0de632ab07193becf5f7121794f6ae console
+UTF-8 fixes went into 2.6.22-rc1, the PowerMac G5 shows only inverse video
+question marks for the text on tty2-6? whereas tty1 is fine, and so is x86.
+
+No fault of that patch: by removing the old fallback behaviour, it reveals
+that 32-bit setfont running on 64-bit kernels has only really worked on
+the current console, the rest getting faked by that inadequate fallback.
+
+Bring the compat do_unimap_ioctl into line with the main one: PIO_UNIMAP
+and GIO_UNIMAP apply to the specified tty, not redirected to fg_console.
+Use the same checks, and most particularly, remember to check access_ok:
+con_set_unimap and con_get_unimap are using __get_user and __put_user.
+
+And the compat vt_check should ask for the same capability as the main
+one, CAP_SYS_TTY_CONFIG rather than CAP_SYS_ADMIN. Added in vt_ioctl's
+vc_cons_allocated check for safety, though failure may well be impossible.
+
+Signed-off-by: Hugh Dickins <hugh@veritas.com>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+
+ fs/compat_ioctl.c | 33 +++++++++++++++++++++++++--------
+ 1 file changed, 25 insertions(+), 8 deletions(-)
+
+--- linux-2.6.21.3.orig/fs/compat_ioctl.c
++++ linux-2.6.21.3/fs/compat_ioctl.c
+@@ -1178,6 +1178,7 @@ static int vt_check(struct file *file)
+ {
+ struct tty_struct *tty;
+ struct inode *inode = file->f_path.dentry->d_inode;
++ struct vc_data *vc;
+
+ if (file->f_op->ioctl != tty_ioctl)
+ return -EINVAL;
+@@ -1188,12 +1189,16 @@ static int vt_check(struct file *file)
+
+ if (tty->driver->ioctl != vt_ioctl)
+ return -EINVAL;
+-
++
++ vc = (struct vc_data *)tty->driver_data;
++ if (!vc_cons_allocated(vc->vc_num)) /* impossible? */
++ return -ENOIOCTLCMD;
++
+ /*
+ * To have permissions to do most of the vt ioctls, we either have
+- * to be the owner of the tty, or super-user.
++ * to be the owner of the tty, or have CAP_SYS_TTY_CONFIG.
+ */
+- if (current->signal->tty == tty || capable(CAP_SYS_ADMIN))
++ if (current->signal->tty == tty || capable(CAP_SYS_TTY_CONFIG))
+ return 1;
+ return 0;
+ }
+@@ -1294,16 +1299,28 @@ static int do_unimap_ioctl(unsigned int
+ struct unimapdesc32 tmp;
+ struct unimapdesc32 __user *user_ud = compat_ptr(arg);
+ int perm = vt_check(file);
+-
+- if (perm < 0) return perm;
++ struct vc_data *vc;
++
++ if (perm < 0)
++ return perm;
+ if (copy_from_user(&tmp, user_ud, sizeof tmp))
+ return -EFAULT;
++ if (tmp.entries)
++ if (!access_ok(VERIFY_WRITE, compat_ptr(tmp.entries),
++ tmp.entry_ct*sizeof(struct unipair)))
++ return -EFAULT;
++ vc = ((struct tty_struct *)file->private_data)->driver_data;
+ switch (cmd) {
+ case PIO_UNIMAP:
+- if (!perm) return -EPERM;
+- return con_set_unimap(vc_cons[fg_console].d, tmp.entry_ct, compat_ptr(tmp.entries));
++ if (!perm)
++ return -EPERM;
++ return con_set_unimap(vc, tmp.entry_ct,
++ compat_ptr(tmp.entries));
+ case GIO_UNIMAP:
+- return con_get_unimap(vc_cons[fg_console].d, tmp.entry_ct, &(user_ud->entry_ct), compat_ptr(tmp.entries));
++ if (!perm && fg_console != vc->vc_num)
++ return -EPERM;
++ return con_get_unimap(vc, tmp.entry_ct, &(user_ud->entry_ct),
++ compat_ptr(tmp.entries));
+ }
+ return 0;
+ }
--- /dev/null
+From stable-bounces@linux.kernel.org Tue May 29 22:34:17 2007
+Date: Wed, 30 May 2007 07:33:47 +0200 (CEST)
+From: Stefan Richter <stefanr@s5r6.in-berlin.de>
+To: stable@kernel.org
+Message-ID: <tkrat.ba04f8fb4ccaa257@s5r6.in-berlin.de>
+Cc:
+Subject: ieee1394: eth1394: bring back a parent device
+
+From: Stefan Richter <stefanr@s5r6.in-berlin.de>
+
+This adds a real parent device to eth1394's ethX device like in Linux
+2.6.20 and older. However, due to unfinished conversion of the ieee1394
+away from class_device, we now refer to the FireWire controller's PCI
+device as the parent, not to the ieee1394 driver's fw-host device.
+
+Having a real parent device instead of a virtual one allows udev scripts
+to distinguish eth1394 interfaces from networking bridges, bondings and
+the likes.
+
+Fixes a regression since 2.6.21:
+https://bugs.gentoo.org/show_bug.cgi?id=177199
+
+Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+Same as commit ef50a6c59dc66f22eba67704e291d709f21e0456.
+
+ drivers/ieee1394/eth1394.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+--- linux-2.6.21.3.orig/drivers/ieee1394/eth1394.c
++++ linux-2.6.21.3/drivers/ieee1394/eth1394.c
+@@ -584,10 +584,9 @@ static void ether1394_add_host (struct h
+ }
+
+ SET_MODULE_OWNER(dev);
+-#if 0
+- /* FIXME - Is this the correct parent device anyway? */
+- SET_NETDEV_DEV(dev, &host->device);
+-#endif
++
++ /* This used to be &host->device in Linux 2.6.20 and before. */
++ SET_NETDEV_DEV(dev, host->device.parent);
+
+ priv = netdev_priv(dev);
+
--- /dev/null
+From stable-bounces@linux.kernel.org Thu May 24 06:38:57 2007
+Message-ID: <4655951B.5000501@gentoo.org>
+Date: Thu, 24 May 2007 09:37:31 -0400
+From: Daniel Drake <dsd@gentoo.org>
+To: stable@kernel.org
+Subject: Input: i8042 - fix AUX port detection with some chips
+
+From: Roland Scheidegger <sroland@tungstengraphics.com>
+
+The i8042 driver fails detection of the AUX port with some chips,
+because they apparently do not change the I8042_CTR_AUXDIS bit
+immediately. This is known to affect at least HP500/HP510 notebooks,
+consequently the built-in touchpad will not work. The patch will simply
+reread the value until it gets the expected value or a retry limit is
+hit, without touching other workaround code in the same area.
+
+Signed-off-by: Roland Scheidegger <sroland@tungstengraphics.com>
+Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=d2ada5597d33a9108acb2caf912f85cbc9caab1e
+
+ drivers/input/serio/i8042.c | 35 +++++++++++++++++++++++++++++------
+ 1 file changed, 29 insertions(+), 6 deletions(-)
+
+--- linux-2.6.21.3.orig/drivers/input/serio/i8042.c
++++ linux-2.6.21.3/drivers/input/serio/i8042.c
+@@ -526,6 +526,33 @@ static irqreturn_t __devinit i8042_aux_t
+ return IRQ_HANDLED;
+ }
+
++/*
++ * i8042_toggle_aux - enables or disables AUX port on i8042 via command and
++ * verifies success by readinng CTR. Used when testing for presence of AUX
++ * port.
++ */
++static int __devinit i8042_toggle_aux(int on)
++{
++ unsigned char param;
++ int i;
++
++ if (i8042_command(¶m,
++ on ? I8042_CMD_AUX_ENABLE : I8042_CMD_AUX_DISABLE))
++ return -1;
++
++ /* some chips need some time to set the I8042_CTR_AUXDIS bit */
++ for (i = 0; i < 100; i++) {
++ udelay(50);
++
++ if (i8042_command(¶m, I8042_CMD_CTL_RCTR))
++ return -1;
++
++ if (!(param & I8042_CTR_AUXDIS) == on)
++ return 0;
++ }
++
++ return -1;
++}
+
+ /*
+ * i8042_check_aux() applies as much paranoia as it can at detecting
+@@ -580,16 +607,12 @@ static int __devinit i8042_check_aux(voi
+ * Bit assignment test - filters out PS/2 i8042's in AT mode
+ */
+
+- if (i8042_command(¶m, I8042_CMD_AUX_DISABLE))
+- return -1;
+- if (i8042_command(¶m, I8042_CMD_CTL_RCTR) || (~param & I8042_CTR_AUXDIS)) {
++ if (i8042_toggle_aux(0)) {
+ printk(KERN_WARNING "Failed to disable AUX port, but continuing anyway... Is this a SiS?\n");
+ printk(KERN_WARNING "If AUX port is really absent please use the 'i8042.noaux' option.\n");
+ }
+
+- if (i8042_command(¶m, I8042_CMD_AUX_ENABLE))
+- return -1;
+- if (i8042_command(¶m, I8042_CMD_CTL_RCTR) || (param & I8042_CTR_AUXDIS))
++ if (i8042_toggle_aux(1))
+ return -1;
+
+ /*
--- /dev/null
+From adaplas@gmail.com Tue Jun 5 04:35:07 2007
+Message-ID: <46654A63.6000308@gmail.com>
+Date: Tue, 05 Jun 2007 19:34:59 +0800
+From: "Antonino A. Daplas" <adaplas@gmail.com>
+To: Chris Wright <chrisw@sous-sol.org>
+CC: torvalds@linux-foundation.org, stable@kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, penberg@cs.helsinki.fi, teanropo@jyu.fi
+Subject: neofb: Fix pseudo_palette array overrun in neofb_setcolreg
+
+The pseudo_palette has room for 16 entries only, but in truecolor mode, it
+attempts to write 256.
+
+Signed-off-by: Antonino Daplas <adaplas@gmail.com>
+Acked-by: Tero Roponen <teanropo@jyu.fi>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+This fixes the following regression/bug reported as follows:
+
+Subject : tty-related oops in latest kernel(s)
+References : http://lkml.org/lkml/2007/5/27/104
+Submitter : Tero Roponen <teanropo@jyu.fi>
+Status : problem is being debugged
+
+According to Tero, this is also reproducible with 2.6.21.3.
+
+(Resending, wrong email address for stable@kernel.org)
+
+Tony
+
+ drivers/video/neofb.c | 30 ++++++++++++++++--------------
+ 1 file changed, 16 insertions(+), 14 deletions(-)
+
+--- linux-2.6.21.3.orig/drivers/video/neofb.c
++++ linux-2.6.21.3/drivers/video/neofb.c
+@@ -1285,34 +1285,36 @@ static int neofb_setcolreg(u_int regno,
+ if (regno >= fb->cmap.len || regno > 255)
+ return -EINVAL;
+
+- switch (fb->var.bits_per_pixel) {
+- case 8:
++ if (fb->var.bits_per_pixel <= 8) {
+ outb(regno, 0x3c8);
+
+ outb(red >> 10, 0x3c9);
+ outb(green >> 10, 0x3c9);
+ outb(blue >> 10, 0x3c9);
+- break;
+- case 16:
+- ((u32 *) fb->pseudo_palette)[regno] =
++ } else if (regno < 16) {
++ switch (fb->var.bits_per_pixel) {
++ case 16:
++ ((u32 *) fb->pseudo_palette)[regno] =
+ ((red & 0xf800)) | ((green & 0xfc00) >> 5) |
+ ((blue & 0xf800) >> 11);
+- break;
+- case 24:
+- ((u32 *) fb->pseudo_palette)[regno] =
++ break;
++ case 24:
++ ((u32 *) fb->pseudo_palette)[regno] =
+ ((red & 0xff00) << 8) | ((green & 0xff00)) |
+ ((blue & 0xff00) >> 8);
+- break;
++ break;
+ #ifdef NO_32BIT_SUPPORT_YET
+- case 32:
+- ((u32 *) fb->pseudo_palette)[regno] =
++ case 32:
++ ((u32 *) fb->pseudo_palette)[regno] =
+ ((transp & 0xff00) << 16) | ((red & 0xff00) << 8) |
+ ((green & 0xff00)) | ((blue & 0xff00) >> 8);
+- break;
++ break;
+ #endif
+- default:
+- return 1;
++ default:
++ return 1;
++ }
+ }
++
+ return 0;
+ }
+
--- /dev/null
+From 1fc799e1b4efdbc405d87d9f154d64d9bc299e5c Mon Sep 17 00:00:00 2001
+From: Andrew Morton <akpm@linux-foundation.org>
+Date: Thu, 31 May 2007 00:40:49 -0700
+Subject: ntfs_init_locked_inode(): fix array indexing
+
+Local variable `i' is a byte-counter. Don't use it as an index into an array
+of le32's.
+
+Reported-by: "young dave" <hidave.darkstar@gmail.com>
+Cc: "Christoph Lameter" <clameter@sgi.com>
+Acked-by: Anton Altaparmakov <aia21@cantab.net>
+Cc: <stable@kernel.org>
+Cc: Adrian Bunk <bunk@stusta.de>
+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>
+---
+ fs/ntfs/inode.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- linux-2.6.21.3.orig/fs/ntfs/inode.c
++++ linux-2.6.21.3/fs/ntfs/inode.c
+@@ -141,7 +141,7 @@ static int ntfs_init_locked_inode(struct
+ if (!ni->name)
+ return -ENOMEM;
+ memcpy(ni->name, na->name, i);
+- ni->name[i] = 0;
++ ni->name[na->name_len] = 0;
+ }
+ return 0;
+ }
--- /dev/null
+From 184b812f7da6726d7ea4ca409c7a8762ff6c6df6 Mon Sep 17 00:00:00 2001
+Message-ID: <20070526220104.GA11530@osprey.hogchain.net>
+From: Jay Cliburn <jacliburn@bellsouth.net>
+Date: Sat, 26 May 2007 17:01:04 -0500
+To: gregkh@suse.de, chrisw@sous-sol.org
+Cc: acliburn@bellsouth.net, csnook@redhat.com, ebiederm@xmission.com, stable@kernel.org
+Subject: PCI: quirk disable MSI on via vt3351
+
+The Via VT3351 APIC does not play well with MSI and unleashes a flood
+of APIC errors when MSI is used to deliver interrupts. The problem
+was recently exposed when the atl1 network device driver, which enables
+MSI by default, stimulated APIC errors on an Asus M2V mainboard, which
+employs the Via VT3351.
+See http://bugzilla.kernel.org/show_bug.cgi?id=8472 for additional
+details on this bug.
+
+Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ drivers/pci/quirks.c | 1 +
+ include/linux/pci_ids.h | 1 +
+ 2 files changed, 2 insertions(+)
+
+--- linux-2.6.21.3.orig/drivers/pci/quirks.c
++++ linux-2.6.21.3/drivers/pci/quirks.c
+@@ -1751,6 +1751,7 @@ static void __init quirk_disable_all_msi
+ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_disable_all_msi);
+ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_all_msi);
+ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_all_msi);
++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351, quirk_disable_all_msi);
+
+ /* Disable MSI on chipsets that are known to not support it */
+ static void __devinit quirk_disable_msi(struct pci_dev *dev)
+--- linux-2.6.21.3.orig/include/linux/pci_ids.h
++++ linux-2.6.21.3/include/linux/pci_ids.h
+@@ -1287,6 +1287,7 @@
+ #define PCI_DEVICE_ID_VIA_P4M800CE 0x0314
+ #define PCI_DEVICE_ID_VIA_P4M890 0x0327
+ #define PCI_DEVICE_ID_VIA_VT3336 0x0336
++#define PCI_DEVICE_ID_VIA_VT3351 0x0351
+ #define PCI_DEVICE_ID_VIA_8371_0 0x0391
+ #define PCI_DEVICE_ID_VIA_8501_0 0x0501
+ #define PCI_DEVICE_ID_VIA_82C561 0x0561
--- /dev/null
+From 24faa9eef876d39e0826a36f31ae0e8b0eeb9835 Mon Sep 17 00:00:00 2001
+Message-ID: <39B20DF628532344BC7A2692CB6AEE07015B2121@orsmsx420.amr.corp.intel.com>
+From: Jason Gaston <jason.d.gaston@intel.com>
+Date: Fri, 1 Jun 2007 00:46:38 -0700
+Subject: pci_ids: update patch for Intel ICH9M
+
+This patch updates the Intel ICH9M LPC Controller DID's, due to a
+specification change.
+
+Signed-off-by: Jason Gaston <jason.d.gaston@intel.com>
+Cc: <stable@kernel.org>
+Cc: Greg KH <greg@kroah.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/pci_ids.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- linux-2.6.21.3.orig/include/linux/pci_ids.h
++++ linux-2.6.21.3/include/linux/pci_ids.h
+@@ -2260,11 +2260,11 @@
+ #define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e
+ #define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850
+ #define PCI_DEVICE_ID_INTEL_ICH9_0 0x2910
+-#define PCI_DEVICE_ID_INTEL_ICH9_1 0x2911
++#define PCI_DEVICE_ID_INTEL_ICH9_1 0x2917
+ #define PCI_DEVICE_ID_INTEL_ICH9_2 0x2912
+ #define PCI_DEVICE_ID_INTEL_ICH9_3 0x2913
+ #define PCI_DEVICE_ID_INTEL_ICH9_4 0x2914
+-#define PCI_DEVICE_ID_INTEL_ICH9_5 0x2915
++#define PCI_DEVICE_ID_INTEL_ICH9_5 0x2919
+ #define PCI_DEVICE_ID_INTEL_ICH9_6 0x2930
+ #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340
+ #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
char-cyclades-fix-deadlock.patch
hpt366-don-t-check-enablebits-for-hpt36x.patch
e1000-fix-netif_poll_enable-crash-in-e1000_open.patch
+alsa-usb-audio-explicitly-match-logitech-quickcam.patch
+input-i8042-fix-aux-port-detection-with-some-chips.patch
+ieee1394-eth1394-bring-back-a-parent-device.patch
+v4l-dvb-budget-ci-fix-tuning-for-tdm-1316.patch
+zd1211rw-add-al2230s-rf-support.patch
+fix-compat-console-unimap-regression.patch
+ahci-disable-64bit-dma-on-sb600.patch
+ntfs_init_locked_inode-fix-array-indexing.patch
+pci-quirk-disable-msi-on-via-vt3351.patch
+pci_ids-update-patch-for-intel-ich9m.patch
+x86_64-allocate-sparsemem-memmap-above-4g.patch
+tty-fix-leakage-of-erestartsys-to-userland.patch
+timer-statistics-fix-race.patch
+timer-stats-speedups.patch
+alsa-wm8750-typo-fix.patch
+neofb-fix-pseudo_palette-array-overrun-in-neofb_setcolreg.patch
+tg3-fix-link-problem-on-dell-s-onboard-5906.patch
+uml-improve-host-ptrace_sysemu-check.patch
--- /dev/null
+From stable-bounces@linux.kernel.org Tue Jun 5 10:44:30 2007
+From: "Michael Chan" <mchan@broadcom.com>
+To: stable@kernel.org
+Date: Tue, 05 Jun 2007 11:34:20 -0700
+Message-ID: <1181068460.4832.5.camel@dell>
+Subject: TG3: Fix link problem on Dell's onboard 5906.
+
+The bug is caused by code that always set
+(TG3_FLAG_USE_MI_INTERRUPT | TG3_FLAG_USE_LINKCHG_REG) on all Dell's
+onboard devices. With these 2 flags set, the link status is polled
+by tg3_timer() and will only work when the PHY is set up to interrupt
+the MAC on link changes. This breaks 5906 because the 5906 PHY does
+not support TG3_FLAG_USE_MI_INTERRUPT the same as other PHYs.
+
+For correctness, only 5701 on Dell systems needs these 2 flags to be
+set. This change will fix the 5906 problem and will change other
+Dell devices except 5700 and 5701 to use the more efficient
+interrupt-driven link changes.
+
+Update version to 3.75.2.
+
+Signed-off-by: Michael Chan <mchan@broadcom.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+
+---
+ drivers/net/tg3.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- linux-2.6.21.3.orig/drivers/net/tg3.c
++++ linux-2.6.21.3/drivers/net/tg3.c
+@@ -64,8 +64,8 @@
+
+ #define DRV_MODULE_NAME "tg3"
+ #define PFX DRV_MODULE_NAME ": "
+-#define DRV_MODULE_VERSION "3.75.1"
+-#define DRV_MODULE_RELDATE "May 7, 2007"
++#define DRV_MODULE_VERSION "3.75.2"
++#define DRV_MODULE_RELDATE "June 5, 2007"
+
+ #define TG3_DEF_MAC_MODE 0
+ #define TG3_DEF_RX_MODE 0
+@@ -10942,6 +10942,7 @@ static int __devinit tg3_get_invariants(
+ * upon subsystem IDs.
+ */
+ if (tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL &&
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 &&
+ !(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)) {
+ tp->tg3_flags |= (TG3_FLAG_USE_MI_INTERRUPT |
+ TG3_FLAG_USE_LINKCHG_REG);
--- /dev/null
+From 9fcc15ec3c1c287a781a4620e52522b6186f26f6 Mon Sep 17 00:00:00 2001
+Message-Id: <20070601112004.1f358c0e.akpm@linux-foundation.org>
+From: Bjorn Steinbrink <B.Steinbrink@gmx.de>
+Date: Fri, 1 Jun 2007 00:47:15 -0700
+Subject: timer statistics: fix race
+
+Fix two races in the timer stats lookup code. One by ensuring that the
+initialization of a new entry is finished upon insertion of that entry.
+The other by cleaning up the hash table when the entries array is cleared,
+so that we don't have any "pre-inserted" entries.
+
+Thanks to Eric Dumazet for reminding me of the memory barriers.
+
+Signed-off-by: Bjorn Steinbrink <B.Steinbrink@gmx.de>
+Signed-off-by: Ian Kumlien <pomac@vapor.com>
+Acked-by: Ingo Molnar <mingo@elte.hu>
+Cc: Eric Dumazet <dada1@cosmosbay.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+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>
+---
+ kernel/time/timer_stats.c | 37 +++++++++++++++++++++----------------
+ 1 file changed, 21 insertions(+), 16 deletions(-)
+
+--- linux-2.6.21.3.orig/kernel/time/timer_stats.c
++++ linux-2.6.21.3/kernel/time/timer_stats.c
+@@ -117,21 +117,6 @@ static struct entry entries[MAX_ENTRIES]
+
+ static atomic_t overflow_count;
+
+-static void reset_entries(void)
+-{
+- nr_entries = 0;
+- memset(entries, 0, sizeof(entries));
+- atomic_set(&overflow_count, 0);
+-}
+-
+-static struct entry *alloc_entry(void)
+-{
+- if (nr_entries >= MAX_ENTRIES)
+- return NULL;
+-
+- return entries + nr_entries++;
+-}
+-
+ /*
+ * The entries are in a hash-table, for fast lookup:
+ */
+@@ -149,6 +134,22 @@ static struct entry *alloc_entry(void)
+
+ static struct entry *tstat_hash_table[TSTAT_HASH_SIZE] __read_mostly;
+
++static void reset_entries(void)
++{
++ nr_entries = 0;
++ memset(entries, 0, sizeof(entries));
++ memset(tstat_hash_table, 0, sizeof(tstat_hash_table));
++ atomic_set(&overflow_count, 0);
++}
++
++static struct entry *alloc_entry(void)
++{
++ if (nr_entries >= MAX_ENTRIES)
++ return NULL;
++
++ return entries + nr_entries++;
++}
++
+ static int match_entries(struct entry *entry1, struct entry *entry2)
+ {
+ return entry1->timer == entry2->timer &&
+@@ -202,12 +203,15 @@ static struct entry *tstat_lookup(struct
+ if (curr) {
+ *curr = *entry;
+ curr->count = 0;
++ curr->next = NULL;
+ memcpy(curr->comm, comm, TASK_COMM_LEN);
++
++ smp_mb(); /* Ensure that curr is initialized before insert */
++
+ if (prev)
+ prev->next = curr;
+ else
+ *head = curr;
+- curr->next = NULL;
+ }
+ out_unlock:
+ spin_unlock(&table_lock);
+@@ -364,6 +368,7 @@ static ssize_t tstats_write(struct file
+ if (!active) {
+ reset_entries();
+ time_start = ktime_get();
++ smp_mb();
+ active = 1;
+ }
+ break;
--- /dev/null
+From c1a834dc704763673df10282995257f2de93cbe9 Mon Sep 17 00:00:00 2001
+Message-Id: <20070601112111.1b4e4935.akpm@linux-foundation.org>
+From: Ingo Molnar <mingo@elte.hu>
+Date: Fri, 1 Jun 2007 00:47:16 -0700
+Subject: timer stats: speedups
+
+Make timer-stats have almost zero overhead when enabled in the config but
+not used. (this way distros can enable it more easily)
+
+Also update the documentation about overhead of timer_stats - it was
+written for the first version which had a global lock and a linear list
+walk based lookup ;-)
+
+Andrew says:
+And this. Not a bugfix, but trivial and obvious and apparently some
+distros don't want to enable timer_stats because of the performance
+issue, but powertop uses timer_stats.
+
+Ingo replies:
+seconded. I have tested this with and without CONFIG_TIMER_STATS, with
+and without timer_stats collection activated.
+
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+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>
+---
+ Documentation/hrtimer/timer_stats.txt | 7 ++++---
+ kernel/time/timer_stats.c | 7 ++++++-
+ lib/Kconfig.debug | 5 ++++-
+ 3 files changed, 14 insertions(+), 5 deletions(-)
+
+--- linux-2.6.21.3.orig/Documentation/hrtimer/timer_stats.txt
++++ linux-2.6.21.3/Documentation/hrtimer/timer_stats.txt
+@@ -2,9 +2,10 @@ timer_stats - timer usage statistics
+ ------------------------------------
+
+ timer_stats is a debugging facility to make the timer (ab)usage in a Linux
+-system visible to kernel and userspace developers. It is not intended for
+-production usage as it adds significant overhead to the (hr)timer code and the
+-(hr)timer data structures.
++system visible to kernel and userspace developers. If enabled in the config
++but not used it has almost zero runtime overhead, and a relatively small
++data structure overhead. Even if collection is enabled runtime all the
++locking is per-CPU and lookup is hashed.
+
+ timer_stats should be used by kernel and userspace developers to verify that
+ their code does not make unduly use of timers. This helps to avoid unnecessary
+--- linux-2.6.21.3.orig/kernel/time/timer_stats.c
++++ linux-2.6.21.3/kernel/time/timer_stats.c
+@@ -236,10 +236,15 @@ void timer_stats_update_stats(void *time
+ /*
+ * It doesnt matter which lock we take:
+ */
+- spinlock_t *lock = &per_cpu(lookup_lock, raw_smp_processor_id());
++ spinlock_t *lock;
+ struct entry *entry, input;
+ unsigned long flags;
+
++ if (likely(!active))
++ return;
++
++ lock = &per_cpu(lookup_lock, raw_smp_processor_id());
++
+ input.timer = timer;
+ input.start_func = startf;
+ input.expire_func = timerf;
+--- linux-2.6.21.3.orig/lib/Kconfig.debug
++++ linux-2.6.21.3/lib/Kconfig.debug
+@@ -143,7 +143,10 @@ config TIMER_STATS
+ reprogrammed. The statistics can be read from /proc/timer_stats.
+ The statistics collection is started by writing 1 to /proc/timer_stats,
+ writing 0 stops it. This feature is useful to collect information
+- about timer usage patterns in kernel and userspace.
++ about timer usage patterns in kernel and userspace. This feature
++ is lightweight if enabled in the kernel config but not activated
++ (it defaults to deactivated on bootup and will only be activated
++ if some application like powertop activates it explicitly).
+
+ config DEBUG_SLAB
+ bool "Debug slab memory allocations"
--- /dev/null
+From stable-bounces@linux.kernel.org Fri Jun 1 01:04:32 2007
+Message-Id: <200706010746.l517kqtC005536@shell0.pdx.osdl.net>
+To: torvalds@linux-foundation.org
+From: akpm@linux-foundation.org
+Date: Fri, 01 Jun 2007 00:46:53 -0700
+Cc: stable@kernel.org, oleg@tv-sign.ru, alan@lxorguk.ukuu.org.uk, takeuchi_satoru@jp.fujitsu.com, akpm@linux-foundation.org, roland@redhat.com
+Subject: tty: fix leakage of -ERESTARTSYS to userland
+
+From: Oleg Nesterov <oleg@tv-sign.ru>
+
+Spotted by Satoru Takeuchi.
+
+kill_pgrp(task_pgrp(current)) sends the signal to the current's thread
+group, but can choose any sub-thread as a target for signal_wake_up().
+This means that job_control() and tty_check_change() may return
+-ERESTARTSYS without signal_pending().
+
+Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
+Cc: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
+Cc: Roland McGrath <roland@redhat.com>
+Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
+Cc: <stable@kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+
+ drivers/char/n_tty.c | 1 +
+ drivers/char/tty_io.c | 3 ++-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+--- linux-2.6.21.3.orig/drivers/char/n_tty.c
++++ linux-2.6.21.3/drivers/char/n_tty.c
+@@ -1191,6 +1191,7 @@ static int job_control(struct tty_struct
+ is_current_pgrp_orphaned())
+ return -EIO;
+ kill_pgrp(task_pgrp(current), SIGTTIN, 1);
++ set_thread_flag(TIF_SIGPENDING);
+ return -ERESTARTSYS;
+ }
+ }
+--- linux-2.6.21.3.orig/drivers/char/tty_io.c
++++ linux-2.6.21.3/drivers/char/tty_io.c
+@@ -1121,7 +1121,8 @@ int tty_check_change(struct tty_struct *
+ return 0;
+ if (is_current_pgrp_orphaned())
+ return -EIO;
+- (void) kill_pgrp(task_pgrp(current), SIGTTOU, 1);
++ kill_pgrp(task_pgrp(current), SIGTTOU, 1);
++ set_thread_flag(TIF_SIGPENDING);
+ return -ERESTARTSYS;
+ }
+
--- /dev/null
+From stable-bounces@linux.kernel.org Tue Jun 5 14:07:03 2007
+Date: Tue, 5 Jun 2007 16:57:50 -0400
+From: Jeff Dike <jdike@addtoit.com>
+To: stable@kernel.org
+Message-ID: <20070605205750.GA9851@c2.user-mode-linux.org>
+Cc: linux-kernel@vger.kernel.org, user-mode-linux-devel@lists.sourceforge.net
+Subject: [stable] [PATCH] UML - Improve host PTRACE_SYSEMU check
+
+Make the PTRACE_SYSEMU checking more robust. It will make sure that
+system call numbers are reported correctly. If there is a problem, it
+will disable PTRACE_SYSEMU use and use PTRACE_SYSCALL instead.
+
+This fixes a hang on boot on FC6 hosts with a broken PTRACE_SYSEMU.
+
+Signed-off-by: Jeff Dike <jdike@linux.intel.com>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+--
+ arch/um/os-Linux/start_up.c | 24 ++++++++++++++++--------
+ 1 file changed, 16 insertions(+), 8 deletions(-)
+
+--- linux-2.6.21.3.orig/arch/um/os-Linux/start_up.c
++++ linux-2.6.21.3/arch/um/os-Linux/start_up.c
+@@ -144,9 +144,7 @@ static int stop_ptraced_child(int pid, v
+ int exit_with = WEXITSTATUS(status);
+ if (exit_with == 2)
+ non_fatal("check_ptrace : child exited with status 2. "
+- "Serious trouble happening! Try updating "
+- "your host skas patch!\nDisabling SYSEMU "
+- "support.");
++ "\nDisabling SYSEMU support.\n");
+ non_fatal("check_ptrace : child exited with exitcode %d, while "
+ "expecting %d; status 0x%x\n", exit_with,
+ exitcode, status);
+@@ -209,6 +207,7 @@ __uml_setup("nosysemu", nosysemu_cmd_par
+ static void __init check_sysemu(void)
+ {
+ void *stack;
++ unsigned long regs[MAX_REG_NR];
+ int pid, n, status, count=0;
+
+ non_fatal("Checking syscall emulation patch for ptrace...");
+@@ -225,11 +224,20 @@ static void __init check_sysemu(void)
+ fatal("check_sysemu : expected SIGTRAP, got status = %d",
+ status);
+
+- n = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_RET_OFFSET,
+- os_getpid());
+- if(n < 0)
+- fatal_perror("check_sysemu : failed to modify system call "
+- "return");
++ if(ptrace(PTRACE_GETREGS, pid, 0, regs) < 0)
++ fatal_perror("check_sysemu : PTRACE_GETREGS failed");
++ if(PT_SYSCALL_NR(regs) != __NR_getpid){
++ non_fatal("check_sysemu got system call number %d, "
++ "expected %d...", PT_SYSCALL_NR(regs), __NR_getpid);
++ goto fail;
++ }
++
++ n = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_RET_OFFSET, os_getpid());
++ if(n < 0){
++ non_fatal("check_sysemu : failed to modify system call "
++ "return");
++ goto fail;
++ }
+
+ if (stop_ptraced_child(pid, stack, 0, 0) < 0)
+ goto fail_stopped;
--- /dev/null
+From 910a7b68350516e114294064fbec4a9e58f59efc Mon Sep 17 00:00:00 2001
+Message-ID: <465F1151.4010700@redhat.com>
+From: Oliver Endriss <o.endriss@gmx.de>
+Cc: Chuck Ebbert <cebbert@redhat.com>, Dave Jones <davej@redhat.com>
+Date: Thu, 3 May 2007 13:16:12 -0300
+Subject: V4L/DVB (5593): Budget-ci: Fix tuning for TDM 1316 (160..200 MHz)
+
+Revert changeset
+ http://linuxtv.org/hg/v4l-dvb?cmd=changeset;node=e7c424bbf9aa;style=gitweb
+
+Petri Helin found that this changeset broke tuning:
+
+'Well, after going through the changes that might have had effect on
+tuning, I found out the one which had caused this problem. I do not know
+the actual reason behind the change, but the changelog says that it
+was meant to "Fix TD1316 tuner for DVBC". But at least in my case it
+seams to have broken the tuner instead.'
+
+Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
+Thanks-to: Petri Helin <phelin@googlemail.com>
+Acked-by: e9hack <e9hack@googlemail.com>
+Acked-by: Thomas Kaiser <linux-dvb@kaiser-linux.li>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
+Acked-by: Michael Krufky <mkrufky@linuxtv.org>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ drivers/media/dvb/ttpci/budget-ci.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- linux-2.6.21.3.orig/drivers/media/dvb/ttpci/budget-ci.c
++++ linux-2.6.21.3/drivers/media/dvb/ttpci/budget-ci.c
+@@ -926,7 +926,7 @@ static int dvbc_philips_tdm1316l_tuner_s
+ band = 1;
+ } else if (tuner_frequency < 200000000) {
+ cp = 6;
+- band = 2;
++ band = 1;
+ } else if (tuner_frequency < 290000000) {
+ cp = 3;
+ band = 2;
--- /dev/null
+From 2e1c49db4c640b35df13889b86b9d62215ade4b6 Mon Sep 17 00:00:00 2001
+Message-Id: <200706010746.l517kRj9005448@shell0.pdx.osdl.net>
+From: Zou Nan hai <nanhai.zou@intel.com>
+Date: Fri, 1 Jun 2007 00:46:28 -0700
+Subject: x86_64: allocate sparsemem memmap above 4G
+
+On systems with huge amount of physical memory, VFS cache and memory memmap
+may eat all available system memory under 4G, then the system may fail to
+allocate swiotlb bounce buffer.
+
+There was a fix for this issue in arch/x86_64/mm/numa.c, but that fix dose
+not cover sparsemem model.
+
+This patch add fix to sparsemem model by first try to allocate memmap above
+4G.
+
+Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
+Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
+Cc: Andi Kleen <ak@suse.de>
+Cc: <stable@kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+[chrisw: trivial backport]
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ arch/x86_64/mm/init.c | 6 ++++++
+ include/linux/bootmem.h | 1 +
+ mm/sparse.c | 11 +++++++++++
+ 3 files changed, 18 insertions(+)
+
+--- linux-2.6.21.3.orig/arch/x86_64/mm/init.c
++++ linux-2.6.21.3/arch/x86_64/mm/init.c
+@@ -776,3 +776,9 @@ int in_gate_area_no_task(unsigned long a
+ {
+ return (addr >= VSYSCALL_START) && (addr < VSYSCALL_END);
+ }
++
++void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
++{
++ return __alloc_bootmem_core(pgdat->bdata, size,
++ SMP_CACHE_BYTES, (4UL*1024*1024*1024), 0);
++}
+--- linux-2.6.21.3.orig/include/linux/bootmem.h
++++ linux-2.6.21.3/include/linux/bootmem.h
+@@ -59,6 +59,7 @@ extern void *__alloc_bootmem_core(struct
+ unsigned long align,
+ unsigned long goal,
+ unsigned long limit);
++extern void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size);
+
+ #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
+ extern void reserve_bootmem(unsigned long addr, unsigned long size);
+--- linux-2.6.21.3.orig/mm/sparse.c
++++ linux-2.6.21.3/mm/sparse.c
+@@ -209,6 +209,12 @@ static int sparse_init_one_section(struc
+ return 1;
+ }
+
++__attribute__((weak))
++void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
++{
++ return NULL;
++}
++
+ static struct page *sparse_early_mem_map_alloc(unsigned long pnum)
+ {
+ struct page *map;
+@@ -219,6 +225,11 @@ static struct page *sparse_early_mem_map
+ if (map)
+ return map;
+
++ map = alloc_bootmem_high_node(NODE_DATA(nid),
++ sizeof(struct page) * PAGES_PER_SECTION);
++ if (map)
++ return map;
++
+ map = alloc_bootmem_node(NODE_DATA(nid),
+ sizeof(struct page) * PAGES_PER_SECTION);
+ if (map)
--- /dev/null
+From stable-bounces@linux.kernel.org Thu May 24 06:36:39 2007
+Message-ID: <46559487.8090607@gentoo.org>
+Date: Thu, 24 May 2007 09:35:03 -0400
+From: Daniel Drake <dsd@gentoo.org>
+To: stable@kernel.org
+Subject: zd1211rw: Add AL2230S RF support
+
+From: Daniel Drake <dsd@gentoo.org>
+
+ZD1211 appears to be back in production: a number of new devices have
+been appearing! Some of them are using new radios.
+
+This patch adds support for the next generation AL2230 RF chip which has
+been spotted in a few new devices.
+
+[As this patch was too late for 2.6.21, the kernel was modified to reject
+AL2230S devices because for me and others, the devices silently failed (and
+this looked like a driver bug). After doing so, a few people reported that
+AL2230S devices were working correctly for them even before AL2230S support was
+present. I'd like to propose that we fix both situations by backporting
+the AL2230S support into 2.6.21-stable]
+
+Signed-off-by: Daniel Drake <dsd@gentoo.org>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ drivers/net/wireless/zd1211rw/zd_chip.c | 5 -
+ drivers/net/wireless/zd1211rw/zd_rf.c | 2
+ drivers/net/wireless/zd1211rw/zd_rf.h | 2
+ drivers/net/wireless/zd1211rw/zd_rf_al2230.c | 89 ++++++++++++++++++++++-----
+ 4 files changed, 78 insertions(+), 20 deletions(-)
+
+--- linux-2.6.21.3.orig/drivers/net/wireless/zd1211rw/zd_chip.c
++++ linux-2.6.21.3/drivers/net/wireless/zd1211rw/zd_chip.c
+@@ -67,11 +67,12 @@ static int scnprint_id(struct zd_chip *c
+ i += scnprint_mac_oui(chip->e2p_mac, buffer+i, size-i);
+ i += scnprintf(buffer+i, size-i, " ");
+ i += zd_rf_scnprint_id(&chip->rf, buffer+i, size-i);
+- i += scnprintf(buffer+i, size-i, " pa%1x %c%c%c%c", chip->pa_type,
++ i += scnprintf(buffer+i, size-i, " pa%1x %c%c%c%c%c", chip->pa_type,
+ chip->patch_cck_gain ? 'g' : '-',
+ chip->patch_cr157 ? '7' : '-',
+ chip->patch_6m_band_edge ? '6' : '-',
+- chip->new_phy_layout ? 'N' : '-');
++ chip->new_phy_layout ? 'N' : '-',
++ chip->al2230s_bit ? 'S' : '-');
+ return i;
+ }
+
+--- linux-2.6.21.3.orig/drivers/net/wireless/zd1211rw/zd_rf.c
++++ linux-2.6.21.3/drivers/net/wireless/zd1211rw/zd_rf.c
+@@ -34,7 +34,7 @@ static const char *rfs[] = {
+ [AL2210_RF] = "AL2210_RF",
+ [MAXIM_NEW_RF] = "MAXIM_NEW_RF",
+ [UW2453_RF] = "UW2453_RF",
+- [AL2230S_RF] = "AL2230S_RF",
++ [UNKNOWN_A_RF] = "UNKNOWN_A_RF",
+ [RALINK_RF] = "RALINK_RF",
+ [INTERSIL_RF] = "INTERSIL_RF",
+ [RF2959_RF] = "RF2959_RF",
+--- linux-2.6.21.3.orig/drivers/net/wireless/zd1211rw/zd_rf.h
++++ linux-2.6.21.3/drivers/net/wireless/zd1211rw/zd_rf.h
+@@ -26,7 +26,7 @@
+ #define AL2210_RF 0x7
+ #define MAXIM_NEW_RF 0x8
+ #define UW2453_RF 0x9
+-#define AL2230S_RF 0xa
++#define UNKNOWN_A_RF 0xa
+ #define RALINK_RF 0xb
+ #define INTERSIL_RF 0xc
+ #define RF2959_RF 0xd
+--- linux-2.6.21.3.orig/drivers/net/wireless/zd1211rw/zd_rf_al2230.c
++++ linux-2.6.21.3/drivers/net/wireless/zd1211rw/zd_rf_al2230.c
+@@ -59,6 +59,18 @@ static const struct zd_ioreq16 zd1211b_i
+ { CR240, 0x57 }, { CR9, 0xe0 },
+ };
+
++static const struct zd_ioreq16 ioreqs_init_al2230s[] = {
++ { CR47, 0x1e }, /* MARK_002 */
++ { CR106, 0x22 },
++ { CR107, 0x2a }, /* MARK_002 */
++ { CR109, 0x13 }, /* MARK_002 */
++ { CR118, 0xf8 }, /* MARK_002 */
++ { CR119, 0x12 }, { CR122, 0xe0 },
++ { CR128, 0x10 }, /* MARK_001 from 0xe->0x10 */
++ { CR129, 0x0e }, /* MARK_001 from 0xd->0x0e */
++ { CR130, 0x10 }, /* MARK_001 from 0xb->0x0d */
++};
++
+ static int zd1211b_al2230_finalize_rf(struct zd_chip *chip)
+ {
+ int r;
+@@ -90,7 +102,7 @@ static int zd1211_al2230_init_hw(struct
+ int r;
+ struct zd_chip *chip = zd_rf_to_chip(rf);
+
+- static const struct zd_ioreq16 ioreqs[] = {
++ static const struct zd_ioreq16 ioreqs_init[] = {
+ { CR15, 0x20 }, { CR23, 0x40 }, { CR24, 0x20 },
+ { CR26, 0x11 }, { CR28, 0x3e }, { CR29, 0x00 },
+ { CR44, 0x33 }, { CR106, 0x2a }, { CR107, 0x1a },
+@@ -117,10 +129,9 @@ static int zd1211_al2230_init_hw(struct
+ { CR119, 0x10 }, { CR120, 0x4f }, { CR121, 0x77 },
+ { CR122, 0xe0 }, { CR137, 0x88 }, { CR252, 0xff },
+ { CR253, 0xff },
++ };
+
+- /* These following happen separately in the vendor driver */
+- { },
+-
++ static const struct zd_ioreq16 ioreqs_pll[] = {
+ /* shdnb(PLL_ON)=0 */
+ { CR251, 0x2f },
+ /* shdnb(PLL_ON)=1 */
+@@ -128,7 +139,7 @@ static int zd1211_al2230_init_hw(struct
+ { CR138, 0x28 }, { CR203, 0x06 },
+ };
+
+- static const u32 rv[] = {
++ static const u32 rv1[] = {
+ /* Channel 1 */
+ 0x03f790,
+ 0x033331,
+@@ -137,6 +148,9 @@ static int zd1211_al2230_init_hw(struct
+ 0x0b3331,
+ 0x03b812,
+ 0x00fff3,
++ };
++
++ static const u32 rv2[] = {
+ 0x000da4,
+ 0x0f4dc5, /* fix freq shift, 0x04edc5 */
+ 0x0805b6,
+@@ -148,8 +162,9 @@ static int zd1211_al2230_init_hw(struct
+ 0x0bdffc,
+ 0x00000d,
+ 0x00500f,
++ };
+
+- /* These writes happen separately in the vendor driver */
++ static const u32 rv3[] = {
+ 0x00d00f,
+ 0x004c0f,
+ 0x00540f,
+@@ -157,11 +172,38 @@ static int zd1211_al2230_init_hw(struct
+ 0x00500f,
+ };
+
+- r = zd_iowrite16a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
++ r = zd_iowrite16a_locked(chip, ioreqs_init, ARRAY_SIZE(ioreqs_init));
+ if (r)
+ return r;
+
+- r = zd_rfwritev_locked(chip, rv, ARRAY_SIZE(rv), RF_RV_BITS);
++ if (chip->al2230s_bit) {
++ r = zd_iowrite16a_locked(chip, ioreqs_init_al2230s,
++ ARRAY_SIZE(ioreqs_init_al2230s));
++ if (r)
++ return r;
++ }
++
++ r = zd_rfwritev_locked(chip, rv1, ARRAY_SIZE(rv1), RF_RV_BITS);
++ if (r)
++ return r;
++
++ /* improve band edge for AL2230S */
++ if (chip->al2230s_bit)
++ r = zd_rfwrite_locked(chip, 0x000824, RF_RV_BITS);
++ else
++ r = zd_rfwrite_locked(chip, 0x0005a4, RF_RV_BITS);
++ if (r)
++ return r;
++
++ r = zd_rfwritev_locked(chip, rv2, ARRAY_SIZE(rv2), RF_RV_BITS);
++ if (r)
++ return r;
++
++ r = zd_iowrite16a_locked(chip, ioreqs_pll, ARRAY_SIZE(ioreqs_pll));
++ if (r)
++ return r;
++
++ r = zd_rfwritev_locked(chip, rv3, ARRAY_SIZE(rv3), RF_RV_BITS);
+ if (r)
+ return r;
+
+@@ -227,7 +269,9 @@ static int zd1211b_al2230_init_hw(struct
+ 0x481dc0,
+ 0xcfff00,
+ 0x25a000,
++ };
+
++ static const u32 rv2[] = {
+ /* To improve AL2230 yield, improve phase noise, 4713 */
+ 0x25a000,
+ 0xa3b2f0,
+@@ -250,7 +294,7 @@ static int zd1211b_al2230_init_hw(struct
+ { CR251, 0x7f }, /* shdnb(PLL_ON)=1 */
+ };
+
+- static const u32 rv2[] = {
++ static const u32 rv3[] = {
+ /* To improve AL2230 yield, 4713 */
+ 0xf01b00,
+ 0xf01e00,
+@@ -269,18 +313,37 @@ static int zd1211b_al2230_init_hw(struct
+ r = zd_iowrite16a_locked(chip, ioreqs1, ARRAY_SIZE(ioreqs1));
+ if (r)
+ return r;
++
++ if (chip->al2230s_bit) {
++ r = zd_iowrite16a_locked(chip, ioreqs_init_al2230s,
++ ARRAY_SIZE(ioreqs_init_al2230s));
++ if (r)
++ return r;
++ }
++
+ r = zd_rfwritev_cr_locked(chip, zd1211b_al2230_table[0], 3);
+ if (r)
+ return r;
+ r = zd_rfwritev_cr_locked(chip, rv1, ARRAY_SIZE(rv1));
+ if (r)
+ return r;
+- r = zd_iowrite16a_locked(chip, ioreqs2, ARRAY_SIZE(ioreqs2));
++
++ if (chip->al2230s_bit)
++ r = zd_rfwrite_locked(chip, 0x241000, RF_RV_BITS);
++ else
++ r = zd_rfwrite_locked(chip, 0x25a000, RF_RV_BITS);
+ if (r)
+ return r;
++
+ r = zd_rfwritev_cr_locked(chip, rv2, ARRAY_SIZE(rv2));
+ if (r)
+ return r;
++ r = zd_iowrite16a_locked(chip, ioreqs2, ARRAY_SIZE(ioreqs2));
++ if (r)
++ return r;
++ r = zd_rfwritev_cr_locked(chip, rv3, ARRAY_SIZE(rv3));
++ if (r)
++ return r;
+ r = zd_iowrite16a_locked(chip, ioreqs3, ARRAY_SIZE(ioreqs3));
+ if (r)
+ return r;
+@@ -358,12 +421,6 @@ int zd_rf_init_al2230(struct zd_rf *rf)
+ {
+ struct zd_chip *chip = zd_rf_to_chip(rf);
+
+- if (chip->al2230s_bit) {
+- dev_err(zd_chip_dev(chip), "AL2230S devices are not yet "
+- "supported by this driver.\n");
+- return -ENODEV;
+- }
+-
+ rf->switch_radio_off = al2230_switch_radio_off;
+ if (chip->is_zd1211b) {
+ rf->init_hw = zd1211b_al2230_init_hw;