rpms/kernel/devel alsa-dont-reset-stream-at-each-prepare-callb.patch, NONE, 1.1.2.1 alsa-hda-dont-reset-BDL-unnecessarily.patch, NONE, 1.1.2.1 alsa-hda_intel-fix-unexpected-ring-buffer-positio.patch, NONE, 1.1.2.1 alsa-pcm-midlevel-add-more-strict-buffer-position.patch, NONE, 1.1.2.1 drm-intel-gen3-fb-hack.patch, NONE, 1.1.2.1 drm-intel-lying-systems-without-lvds.patch, NONE, 1.1.2.1 linux-2.6-acer-wmi-bail-on-aao.patch, NONE, 1.1.2.1 linux-2.6-add-qcserial.patch, NONE, 1.1.2.1 linux-2.6-btrfs-fix-umount-hang.patch, NONE, 1.2.2.2 linux-2.6-crash-driver.patch, 1.12.6.2, 1.12.6.3 linux-2.6-dma-debug-fixes.patch, NONE, 1.1.2.1 linux-2.6-e820-acpi3-bios-workaround.patch, NONE, 1.1.2.1 linux-2.6-e820-guard-against-pre-acpi3.patch, NONE, 1.1.2.1 linux-2.6-e820-mark-esi-clobbered.patch, NONE, 1.1.2.1 linux-2.6-e820-save-restore-edi-ebp.patch, NONE, 1.1.2.1 linux-2.6-ext4-really-print-warning-once.patch, NONE, 1.1.2.1 linux-2.6-fiemap-header-install.patch, NONE, 1.2.2.2 linux-2.6-input-wacom-bluetooth.patch, NONE, 1.1.2.1 linux-2.6-iommu-fixes.patch, NONE, 1.1.2.1 linux-2.6-iwl3945-report-killswitch-changes-even-if-the-interface-is-down.patch, NONE, 1.1.2.1 linux-2.6-iwlagn-fix-hw-rfkill-while-the-interface-is-down.patch, NONE, 1.1.2.1 linux-2.6-kvm-kconfig-irqchip.patch, NONE, 1.1.2.1 linux-2.6-kvm-mask-notifiers.patch, NONE, 1.1.2.1 linux-2.6-kvm-reset-pit-irq-on-unmask.patch, NONE, 1.1.2.1 linux-2.6-md-raid1-dont-assume-new-bvecs-are-init.patch, NONE, 1.1.2.1 linux-2.6-mm-define-unique-value-for-as_unevictable.patch, NONE, 1.1.2.1 linux-2.6-posix-timers-fix-clock-monotonicity.patch, NONE, 1.1.2.1 linux-2.6-posix-timers-fix-rlimit_cpu-fork-2.patch, NONE, 1.1.2.1 linux-2.6-posix-timers-fix-rlimit_cpu-fork.patch, NONE, 1.1.2.1 linux-2.6-posix-timers-fix-rlimit_cpu-setitimer.patch, NONE, 1.1.2.1 linux-2.6-shut-up-efifb.patch, NONE, 1.1.2.1 linux-2.6-usb-cdc-acm-remove-low-latency-flag.patch, NONE, 1.1.2.1 linux-2.6-v4l-dvb-fix-uint16_t-audio-h.patch, NONE, 1.1.2.1 linux-2.6.29-alsa-update-quirks.patch, NONE, 1.1.2.1 linux-2.6.29.1-sparc-regression.patch, NONE, 1.1.2.1 patch-2.6.29.1.bz2.sign, NONE, 1.1.2.1 squashfs-broken-when-pagesize-greater-than-blocksize.patch, NONE, 1.1.2.1 .cvsignore, 1.1014.2.8, 1.1014.2.9 Makefile, 1.97.6.2, 1.97.6.3 TODO, 1.54.6.4, 1.54.6.5 branch, 1.1.2.1, 1.1.2.2 config-debug, 1.23, 1.23.6.1 config-generic, 1.238.6.15, 1.238.6.16 config-nodebug, 1.31, 1.31.6.1 config-sparc64-generic, 1.21.6.1, 1.21.6.2 config-sparc64-smp, 1.2, 1.2.16.1 config-x86-generic, 1.68.6.5, 1.68.6.6 config-x86_64-generic, 1.68.2.5, 1.68.2.6 drm-modesetting-radeon.patch, 1.54.6.7, 1.54.6.8 drm-next.patch, 1.6.6.5, 1.6.6.6 drm-nouveau.patch, 1.8.6.8, 1.8.6.9 kernel.spec, 1.1294.2.18, 1.1294.2.19 linux-2.6-acpi-video-didl-intel-outputs.patch, 1.1.2.3, 1.1.2.4 linux-2.6-sony-laptop-rfkill.patch, 1.2.6.2, 1.2.6.3 linux-2.6-v4l-dvb-fixes.patch, 1.2.8.7, 1.2.8.8 sources, 1.976.2.9, 1.976.2.10 upstream, 1.888.2.8, 1.888.2.9 xen.pvops.patch, 1.1.2.15, 1.1.2.16 xen.pvops.post.patch, 1.1.2.9, 1.1.2.10 xen.pvops.pre.patch, 1.1.2.8, 1.1.2.9 dma-api-debug-fixes.patch, 1.1.6.2, NONE linux-2.6-debug-dma-api.patch, 1.2.6.1, NONE linux-2.6-net-fix-gro-bug.patch, 1.1.2.2, NONE linux-2.6-net-xfrm-fix-spin-unlock.patch, 1.1.2.2, NONE linux-2.6.29-pat-fixes.patch, 1.1.2.2, NONE squashfs-fixups.patch, 1.1.2.1, NONE squashfs3.patch, 1.1.2.1, NONE

Michael Young myoung at fedoraproject.org
Tue Apr 14 22:10:58 UTC 2009


Author: myoung

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10317

Modified Files:
      Tag: private-myoung-dom0-branch
	.cvsignore Makefile TODO branch config-debug config-generic 
	config-nodebug config-sparc64-generic config-sparc64-smp 
	config-x86-generic config-x86_64-generic 
	drm-modesetting-radeon.patch drm-next.patch drm-nouveau.patch 
	kernel.spec linux-2.6-acpi-video-didl-intel-outputs.patch 
	linux-2.6-sony-laptop-rfkill.patch 
	linux-2.6-v4l-dvb-fixes.patch sources upstream xen.pvops.patch 
	xen.pvops.post.patch xen.pvops.pre.patch 
Added Files:
      Tag: private-myoung-dom0-branch
	alsa-dont-reset-stream-at-each-prepare-callb.patch 
	alsa-hda-dont-reset-BDL-unnecessarily.patch 
	alsa-hda_intel-fix-unexpected-ring-buffer-positio.patch 
	alsa-pcm-midlevel-add-more-strict-buffer-position.patch 
	drm-intel-gen3-fb-hack.patch 
	drm-intel-lying-systems-without-lvds.patch 
	linux-2.6-acer-wmi-bail-on-aao.patch 
	linux-2.6-add-qcserial.patch 
	linux-2.6-btrfs-fix-umount-hang.patch 
	linux-2.6-crash-driver.patch linux-2.6-dma-debug-fixes.patch 
	linux-2.6-e820-acpi3-bios-workaround.patch 
	linux-2.6-e820-guard-against-pre-acpi3.patch 
	linux-2.6-e820-mark-esi-clobbered.patch 
	linux-2.6-e820-save-restore-edi-ebp.patch 
	linux-2.6-ext4-really-print-warning-once.patch 
	linux-2.6-fiemap-header-install.patch 
	linux-2.6-input-wacom-bluetooth.patch 
	linux-2.6-iommu-fixes.patch 
	linux-2.6-iwl3945-report-killswitch-changes-even-if-the-interface-is-down.patch 
	linux-2.6-iwlagn-fix-hw-rfkill-while-the-interface-is-down.patch 
	linux-2.6-kvm-kconfig-irqchip.patch 
	linux-2.6-kvm-mask-notifiers.patch 
	linux-2.6-kvm-reset-pit-irq-on-unmask.patch 
	linux-2.6-md-raid1-dont-assume-new-bvecs-are-init.patch 
	linux-2.6-mm-define-unique-value-for-as_unevictable.patch 
	linux-2.6-posix-timers-fix-clock-monotonicity.patch 
	linux-2.6-posix-timers-fix-rlimit_cpu-fork-2.patch 
	linux-2.6-posix-timers-fix-rlimit_cpu-fork.patch 
	linux-2.6-posix-timers-fix-rlimit_cpu-setitimer.patch 
	linux-2.6-shut-up-efifb.patch 
	linux-2.6-usb-cdc-acm-remove-low-latency-flag.patch 
	linux-2.6-v4l-dvb-fix-uint16_t-audio-h.patch 
	linux-2.6.29-alsa-update-quirks.patch 
	linux-2.6.29.1-sparc-regression.patch patch-2.6.29.1.bz2.sign 
	squashfs-broken-when-pagesize-greater-than-blocksize.patch 
Removed Files:
      Tag: private-myoung-dom0-branch
	dma-api-debug-fixes.patch linux-2.6-debug-dma-api.patch 
	linux-2.6-net-fix-gro-bug.patch 
	linux-2.6-net-xfrm-fix-spin-unlock.patch 
	linux-2.6.29-pat-fixes.patch squashfs-fixups.patch 
	squashfs3.patch 
Log Message:
Base xen pvops patch on 2.6.29.1 F-11 branch for the moment


alsa-dont-reset-stream-at-each-prepare-callb.patch:

--- NEW FILE alsa-dont-reset-stream-at-each-prepare-callb.patch ---
>From fc546201dfe40d09c1a1e82384dc3774025984da Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai at suse.de>
Date: Wed, 18 Mar 2009 15:15:37 +0100
Subject: ALSA: hda - Don't reset stream at each prepare callback

Don't reset the stream at each prepare callback but do it only once
after the open.

Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
 sound/pci/hda/hda_intel.c |   33 ++++++++++++++++++++++-----------
 1 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index b7a61a1..931a62d 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -858,13 +858,18 @@ static void azx_stream_start(struct azx *chip, struct azx_dev *azx_dev)
 		      SD_CTL_DMA_START | SD_INT_MASK);
 }
 
-/* stop a stream */
-static void azx_stream_stop(struct azx *chip, struct azx_dev *azx_dev)
+/* stop DMA */
+static void azx_stream_clear(struct azx *chip, struct azx_dev *azx_dev)
 {
-	/* stop DMA */
 	azx_sd_writeb(azx_dev, SD_CTL, azx_sd_readb(azx_dev, SD_CTL) &
 		      ~(SD_CTL_DMA_START | SD_INT_MASK));
 	azx_sd_writeb(azx_dev, SD_STS, SD_INT_MASK); /* to be sure */
+}
+
+/* stop a stream */
+static void azx_stream_stop(struct azx *chip, struct azx_dev *azx_dev)
+{
+	azx_stream_clear(chip, azx_dev);
 	/* disable SIE */
 	azx_writeb(chip, INTCTL,
 		   azx_readb(chip, INTCTL) & ~(1 << azx_dev->index));
@@ -1125,18 +1130,14 @@ static int azx_setup_periods(struct azx *chip,
 	return -EINVAL;
 }
 
-/*
- * set up the SD for streaming
- */
-static int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev)
+/* reset stream */
+static void azx_stream_reset(struct azx *chip, struct azx_dev *azx_dev)
 {
 	unsigned char val;
 	int timeout;
 
-	/* make sure the run bit is zero for SD */
-	azx_sd_writeb(azx_dev, SD_CTL, azx_sd_readb(azx_dev, SD_CTL) &
-		      ~SD_CTL_DMA_START);
-	/* reset stream */
+	azx_stream_clear(chip, azx_dev);
+
 	azx_sd_writeb(azx_dev, SD_CTL, azx_sd_readb(azx_dev, SD_CTL) |
 		      SD_CTL_STREAM_RESET);
 	udelay(3);
@@ -1153,7 +1154,15 @@ static int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev)
 	while (((val = azx_sd_readb(azx_dev, SD_CTL)) & SD_CTL_STREAM_RESET) &&
 	       --timeout)
 		;
+}
 
+/*
+ * set up the SD for streaming
+ */
+static int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev)
+{
+	/* make sure the run bit is zero for SD */
+	azx_stream_clear(chip, azx_dev);
 	/* program the stream_tag */
 	azx_sd_writel(azx_dev, SD_CTL,
 		      (azx_sd_readl(azx_dev, SD_CTL) & ~SD_CTL_STREAM_TAG_MASK)|
@@ -1399,6 +1408,8 @@ static int azx_pcm_open(struct snd_pcm_substream *substream)
 	runtime->private_data = azx_dev;
 	snd_pcm_set_sync(substream);
 	mutex_unlock(&chip->open_mutex);
+
+	azx_stream_reset(chip, azx_dev);
 	return 0;
 }
 
-- 
1.6.2.2


alsa-hda-dont-reset-BDL-unnecessarily.patch:

--- NEW FILE alsa-hda-dont-reset-BDL-unnecessarily.patch ---
>From b98a9f6d1619b7fe32c2a6a4e5190121830f979b Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai at suse.de>
Date: Wed, 18 Mar 2009 15:09:13 +0100
Subject: ALSA: hda - Don't reset BDL unnecessarily

So far, the prepare callback is called multiple times, BDL entries
are reset and re-programmed at each time.

This patch adds the check to avoid the reset of BDL entries when the
same parameters are used.

Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
 sound/pci/hda/hda_intel.c |   46 +++++++++++++++++++++++++++++++-------------
 1 files changed, 32 insertions(+), 14 deletions(-)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index f3b5723..b7a61a1 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1075,8 +1075,7 @@ static int azx_setup_periods(struct azx *chip,
 	azx_sd_writel(azx_dev, SD_BDLPL, 0);
 	azx_sd_writel(azx_dev, SD_BDLPU, 0);
 
-	period_bytes = snd_pcm_lib_period_bytes(substream);
-	azx_dev->period_bytes = period_bytes;
+	period_bytes = azx_dev->period_bytes;
 	periods = azx_dev->bufsize / period_bytes;
 
 	/* program the initial BDL entries */
@@ -1123,9 +1122,6 @@ static int azx_setup_periods(struct azx *chip,
  error:
 	snd_printk(KERN_ERR "Too many BDL entries: buffer=%d, period=%d\n",
 		   azx_dev->bufsize, period_bytes);
-	/* reset */
-	azx_sd_writel(azx_dev, SD_BDLPL, 0);
-	azx_sd_writel(azx_dev, SD_BDLPU, 0);
 	return -EINVAL;
 }
 
@@ -1429,6 +1425,11 @@ static int azx_pcm_close(struct snd_pcm_substream *substream)
 static int azx_pcm_hw_params(struct snd_pcm_substream *substream,
 			     struct snd_pcm_hw_params *hw_params)
 {
+	struct azx_dev *azx_dev = get_azx_dev(substream);
+
+	azx_dev->bufsize = 0;
+	azx_dev->period_bytes = 0;
+	azx_dev->format_val = 0;
 	return snd_pcm_lib_malloc_pages(substream,
 					params_buffer_bytes(hw_params));
 }
@@ -1443,6 +1444,9 @@ static int azx_pcm_hw_free(struct snd_pcm_substream *substream)
 	azx_sd_writel(azx_dev, SD_BDLPL, 0);
 	azx_sd_writel(azx_dev, SD_BDLPU, 0);
 	azx_sd_writel(azx_dev, SD_CTL, 0);
+	azx_dev->bufsize = 0;
+	azx_dev->period_bytes = 0;
+	azx_dev->format_val = 0;
 
 	hinfo->ops.cleanup(hinfo, apcm->codec, substream);
 
@@ -1456,23 +1460,37 @@ static int azx_pcm_prepare(struct snd_pcm_substream *substream)
 	struct azx_dev *azx_dev = get_azx_dev(substream);
 	struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream];
 	struct snd_pcm_runtime *runtime = substream->runtime;
+	unsigned int bufsize, period_bytes, format_val;
+	int err;
 
-	azx_dev->bufsize = snd_pcm_lib_buffer_bytes(substream);
-	azx_dev->format_val = snd_hda_calc_stream_format(runtime->rate,
-							 runtime->channels,
-							 runtime->format,
-							 hinfo->maxbps);
-	if (!azx_dev->format_val) {
+	format_val = snd_hda_calc_stream_format(runtime->rate,
+						runtime->channels,
+						runtime->format,
+						hinfo->maxbps);
+	if (!format_val) {
 		snd_printk(KERN_ERR SFX
 			   "invalid format_val, rate=%d, ch=%d, format=%d\n",
 			   runtime->rate, runtime->channels, runtime->format);
 		return -EINVAL;
 	}
 
+	bufsize = snd_pcm_lib_buffer_bytes(substream);
+	period_bytes = snd_pcm_lib_period_bytes(substream);
+
 	snd_printdd("azx_pcm_prepare: bufsize=0x%x, format=0x%x\n",
-		    azx_dev->bufsize, azx_dev->format_val);
-	if (azx_setup_periods(chip, substream, azx_dev) < 0)
-		return -EINVAL;
+		    bufsize, format_val);
+
+	if (bufsize != azx_dev->bufsize ||
+	    period_bytes != azx_dev->period_bytes ||
+	    format_val != azx_dev->format_val) {
+		azx_dev->bufsize = bufsize;
+		azx_dev->period_bytes = period_bytes;
+		azx_dev->format_val = format_val;
+		err = azx_setup_periods(chip, substream, azx_dev);
+		if (err < 0)
+			return err;
+	}
+
 	azx_setup_controller(chip, azx_dev);
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
 		azx_dev->fifo_size = azx_sd_readw(azx_dev, SD_FIFOSIZE) + 1;
-- 
1.6.2.2


alsa-hda_intel-fix-unexpected-ring-buffer-positio.patch:

--- NEW FILE alsa-hda_intel-fix-unexpected-ring-buffer-positio.patch ---
>From 8820b651ddf48830af44520a13e63f5b9c5b9f9f Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex at perex.cz>
Date: Fri, 10 Apr 2009 12:20:45 +0200
Subject: [ALSA] hda_intel: fix unexpected ring buffer positions

I found two issues with ICH7-M (it should be related to other HDA chipsets
as well):

- the ring buffer position is not reset when stream restarts (after xrun) -
  solved by moving azx_stream_reset() call from open() to prepare() callback
  and reset posbuf to zero (it might be filled with hw later than position()
  callback is called)
- irq_ignore flag should be set also when ring buffer memory area is not
  changed in prepare() callback - this patch replaces irq_ignore with
  more universal check based on jiffies clock

Signed-off-by: Jaroslav Kysela <perex at perex.cz>
---
 sound/pci/hda/hda_intel.c |   39 +++++++++++++++++++++++++--------------
 1 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 931a62d..7112e0e 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -312,6 +312,9 @@ struct azx_dev {
 	unsigned int period_bytes; /* size of the period in bytes */
 	unsigned int frags;	/* number for period in the play buffer */
 	unsigned int fifo_size;	/* FIFO size */
+	unsigned int start_flag: 1;	/* stream full start flag */
+	unsigned long start_jiffies;	/* start + minimum jiffies */
+	unsigned long min_jiffies;	/* minimum jiffies before position is valid */
 
 	void __iomem *sd_addr;	/* stream descriptor pointer */
 
@@ -330,7 +333,6 @@ struct azx_dev {
 	unsigned int opened :1;
 	unsigned int running :1;
 	unsigned int irq_pending :1;
-	unsigned int irq_ignore :1;
 	/*
 	 * For VIA:
 	 *  A flag to ensure DMA position is 0
@@ -974,7 +976,7 @@ static irqreturn_t azx_interrupt(int irq, void *dev_id)
 	struct azx *chip = dev_id;
 	struct azx_dev *azx_dev;
 	u32 status;
-	int i;
+	int i, ok;
 
 	spin_lock(&chip->reg_lock);
 
@@ -990,18 +992,14 @@ static irqreturn_t azx_interrupt(int irq, void *dev_id)
 			azx_sd_writeb(azx_dev, SD_STS, SD_INT_MASK);
 			if (!azx_dev->substream || !azx_dev->running)
 				continue;
-			/* ignore the first dummy IRQ (due to pos_adj) */
-			if (azx_dev->irq_ignore) {
-				azx_dev->irq_ignore = 0;
-				continue;
-			}
 			/* check whether this IRQ is really acceptable */
-			if (azx_position_ok(chip, azx_dev)) {
+			ok = azx_position_ok(chip, azx_dev);
+			if (ok == 1) {
 				azx_dev->irq_pending = 0;
 				spin_unlock(&chip->reg_lock);
 				snd_pcm_period_elapsed(azx_dev->substream);
 				spin_lock(&chip->reg_lock);
-			} else if (chip->bus && chip->bus->workq) {
+			} else if (ok == 0 && chip->bus && chip->bus->workq) {
 				/* bogus IRQ, process it later */
 				azx_dev->irq_pending = 1;
 				queue_work(chip->bus->workq,
@@ -1087,7 +1085,6 @@ static int azx_setup_periods(struct azx *chip,
 	bdl = (u32 *)azx_dev->bdl.area;
 	ofs = 0;
 	azx_dev->frags = 0;
-	azx_dev->irq_ignore = 0;
 	pos_adj = bdl_pos_adj[chip->dev_index];
 	if (pos_adj > 0) {
 		struct snd_pcm_runtime *runtime = substream->runtime;
@@ -1108,7 +1105,6 @@ static int azx_setup_periods(struct azx *chip,
 					 &bdl, ofs, pos_adj, 1);
 			if (ofs < 0)
 				goto error;
-			azx_dev->irq_ignore = 1;
 		}
 	} else
 		pos_adj = 0;
@@ -1154,6 +1150,9 @@ static void azx_stream_reset(struct azx *chip, struct azx_dev *azx_dev)
 	while (((val = azx_sd_readb(azx_dev, SD_CTL)) & SD_CTL_STREAM_RESET) &&
 	       --timeout)
 		;
+
+	/* reset first position - may not be synced with hw at this time */
+	*azx_dev->posbuf = 0;
 }
 
 /*
@@ -1409,7 +1408,6 @@ static int azx_pcm_open(struct snd_pcm_substream *substream)
 	snd_pcm_set_sync(substream);
 	mutex_unlock(&chip->open_mutex);
 
-	azx_stream_reset(chip, azx_dev);
 	return 0;
 }
 
@@ -1474,6 +1472,7 @@ static int azx_pcm_prepare(struct snd_pcm_substream *substream)
 	unsigned int bufsize, period_bytes, format_val;
 	int err;
 
+	azx_stream_reset(chip, azx_dev);
 	format_val = snd_hda_calc_stream_format(runtime->rate,
 						runtime->channels,
 						runtime->format,
@@ -1502,6 +1501,8 @@ static int azx_pcm_prepare(struct snd_pcm_substream *substream)
 			return err;
 	}
 
+	azx_dev->min_jiffies = (runtime->period_size * HZ) /
+						(runtime->rate * 2);
 	azx_setup_controller(chip, azx_dev);
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
 		azx_dev->fifo_size = azx_sd_readw(azx_dev, SD_FIFOSIZE) + 1;
@@ -1518,13 +1519,14 @@ static int azx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
 	struct azx *chip = apcm->chip;
 	struct azx_dev *azx_dev;
 	struct snd_pcm_substream *s;
-	int start, nsync = 0, sbits = 0;
+	int rstart = 0, start, nsync = 0, sbits = 0;
 	int nwait, timeout;
 
 	switch (cmd) {
+	case SNDRV_PCM_TRIGGER_START:
+		rstart = 1;
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
 	case SNDRV_PCM_TRIGGER_RESUME:
-	case SNDRV_PCM_TRIGGER_START:
 		start = 1;
 		break;
 	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
@@ -1554,6 +1556,10 @@ static int azx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
 		if (s->pcm->card != substream->pcm->card)
 			continue;
 		azx_dev = get_azx_dev(s);
+		if (rstart) {
+			azx_dev->start_flag = 1;
+			azx_dev->start_jiffies = jiffies + azx_dev->min_jiffies;
+		}
 		if (start)
 			azx_stream_start(chip, azx_dev);
 		else
@@ -1703,6 +1709,11 @@ static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev)
 {
 	unsigned int pos;
 
+	if (azx_dev->start_flag &&
+	    time_before_eq(jiffies, azx_dev->start_jiffies))
+		return -1;	/* bogus (too early) interrupt */
+	azx_dev->start_flag = 0;
+
 	pos = azx_get_position(chip, azx_dev);
 	if (chip->position_fix == POS_FIX_AUTO) {
 		if (!pos) {
-- 
1.6.2.2


alsa-pcm-midlevel-add-more-strict-buffer-position.patch:

--- NEW FILE alsa-pcm-midlevel-add-more-strict-buffer-position.patch ---
>From bbf6ad1399e9516b0a95de3ad58ffbaed670e4cc Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex at perex.cz>
Date: Fri, 10 Apr 2009 12:28:58 +0200
Subject: [ALSA] pcm-midlevel: Add more strict buffer position checks based on jiffies

Some drivers like Intel8x0 or Intel HDA are broken for some hardware variants.
This patch adds more strict buffer position checks based on jiffies when
internal hw_ptr is updated. Enable xrun_debug to see mangling of wrong
positions.

As a side effect, the hw_ptr interrupt update routine might do slightly better
job when many interrupts are lost.

Signed-off-by: Jaroslav Kysela <perex at perex.cz>
---
 include/sound/pcm.h  |    3 ++-
 sound/core/pcm_lib.c |   47 +++++++++++++++++++++++++++++++++++++++--------
 2 files changed, 41 insertions(+), 9 deletions(-)

diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 8904b19..c172968 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -268,7 +268,8 @@ struct snd_pcm_runtime {
 	int overrange;
 	snd_pcm_uframes_t avail_max;
 	snd_pcm_uframes_t hw_ptr_base;	/* Position at buffer restart */
-	snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time*/
+	snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */
+	unsigned long hw_ptr_jiffies;	/* Time when hw_ptr is updated */
 
 	/* -- HW params -- */
 	snd_pcm_access_t access;	/* access mode */
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index fbb2e39..63d088f 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -209,9 +209,11 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
 {
 	struct snd_pcm_runtime *runtime = substream->runtime;
 	snd_pcm_uframes_t pos;
-	snd_pcm_uframes_t new_hw_ptr, hw_ptr_interrupt, hw_base;
-	snd_pcm_sframes_t delta;
+	snd_pcm_uframes_t old_hw_ptr, new_hw_ptr, hw_ptr_interrupt, hw_base;
+	snd_pcm_sframes_t hdelta, delta;
+	unsigned long jdelta;
 
+	old_hw_ptr = runtime->status->hw_ptr;
 	pos = snd_pcm_update_hw_ptr_pos(substream, runtime);
 	if (pos == SNDRV_PCM_POS_XRUN) {
 		xrun(substream);
@@ -247,7 +249,30 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
 			new_hw_ptr = hw_base + pos;
 		}
 	}
-	if (delta > runtime->period_size) {
+	hdelta = new_hw_ptr - old_hw_ptr;
+	jdelta = jiffies - runtime->hw_ptr_jiffies;
+	if (((hdelta * HZ) / runtime->rate) > jdelta + HZ/100) {
+		delta = jdelta /
+			(((runtime->period_size * HZ) / runtime->rate)
+								+ HZ/100);
+		hw_ptr_error(substream,
+			     "hw_ptr skipping! [Q] "
+			     "(pos=%ld, delta=%ld, period=%ld, "
+			     "jdelta=%lu/%lu/%lu)\n",
+			     (long)pos, (long)hdelta,
+			     (long)runtime->period_size, jdelta,
+			     ((hdelta * HZ) / runtime->rate), delta);
+		hw_ptr_interrupt = runtime->hw_ptr_interrupt +
+				   runtime->period_size * delta;
+		if (hw_ptr_interrupt >= runtime->boundary)
+			hw_ptr_interrupt -= runtime->boundary;
+		/* rebase to interrupt position */
+		hw_base = new_hw_ptr = hw_ptr_interrupt;
+		/* align hw_base to buffer_size */
+		hw_base -= hw_base % runtime->buffer_size;
+		delta = 0;
+	}
+	if (delta > runtime->period_size + runtime->period_size / 2) {
 		hw_ptr_error(substream,
 			     "Lost interrupts? "
 			     "(stream=%i, delta=%ld, intr_ptr=%ld)\n",
@@ -263,6 +288,7 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
 
 	runtime->hw_ptr_base = hw_base;
 	runtime->status->hw_ptr = new_hw_ptr;
+	runtime->hw_ptr_jiffies = jiffies;
 	runtime->hw_ptr_interrupt = hw_ptr_interrupt;
 
 	return snd_pcm_update_hw_ptr_post(substream, runtime);
@@ -275,6 +301,7 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
 	snd_pcm_uframes_t pos;
 	snd_pcm_uframes_t old_hw_ptr, new_hw_ptr, hw_base;
 	snd_pcm_sframes_t delta;
+	unsigned long jdelta;
 
 	old_hw_ptr = runtime->status->hw_ptr;
 	pos = snd_pcm_update_hw_ptr_pos(substream, runtime);
@@ -286,14 +313,15 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
 	new_hw_ptr = hw_base + pos;
 
 	delta = new_hw_ptr - old_hw_ptr;
+	jdelta = jiffies - runtime->hw_ptr_jiffies;
 	if (delta < 0) {
 		delta += runtime->buffer_size;
 		if (delta < 0) {
 			hw_ptr_error(substream, 
 				     "Unexpected hw_pointer value [2] "
-				     "(stream=%i, pos=%ld, old_ptr=%ld)\n",
+				     "(stream=%i, pos=%ld, old_ptr=%ld, jdelta=%li)\n",
 				     substream->stream, (long)pos,
-				     (long)old_hw_ptr);
+				     (long)old_hw_ptr, jdelta);
 			return 0;
 		}
 		hw_base += runtime->buffer_size;
@@ -301,12 +329,13 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
 			hw_base = 0;
 		new_hw_ptr = hw_base + pos;
 	}
-	if (delta > runtime->period_size && runtime->periods > 1) {
+	if (((delta * HZ) / runtime->rate) > jdelta + HZ/100) {
 		hw_ptr_error(substream,
 			     "hw_ptr skipping! "
-			     "(pos=%ld, delta=%ld, period=%ld)\n",
+			     "(pos=%ld, delta=%ld, period=%ld, jdelta=%lu/%lu)\n",
 			     (long)pos, (long)delta,
-			     (long)runtime->period_size);
+			     (long)runtime->period_size, jdelta,
+			     ((delta * HZ) / runtime->rate));
 		return 0;
 	}
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
@@ -315,6 +344,7 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
 
 	runtime->hw_ptr_base = hw_base;
 	runtime->status->hw_ptr = new_hw_ptr;
+	runtime->hw_ptr_jiffies = jiffies;
 
 	return snd_pcm_update_hw_ptr_post(substream, runtime);
 }
@@ -1441,6 +1471,7 @@ static int snd_pcm_lib_ioctl_reset(struct snd_pcm_substream *substream,
 		runtime->status->hw_ptr %= runtime->buffer_size;
 	else
 		runtime->status->hw_ptr = 0;
+	runtime->hw_ptr_jiffies = jiffies;
 	snd_pcm_stream_unlock_irqrestore(substream, flags);
 	return 0;
 }
-- 
1.6.2.2


drm-intel-gen3-fb-hack.patch:

--- NEW FILE drm-intel-gen3-fb-hack.patch ---
diff -up linux-2.6.29.noarch/drivers/gpu/drm/i915/intel_display.c.jx linux-2.6.29.noarch/drivers/gpu/drm/i915/intel_display.c
--- linux-2.6.29.noarch/drivers/gpu/drm/i915/intel_display.c.jx	2009-04-09 13:42:51.000000000 -0400
+++ linux-2.6.29.noarch/drivers/gpu/drm/i915/intel_display.c	2009-04-09 13:44:14.000000000 -0400
@@ -2011,8 +2011,8 @@ void intel_modeset_init(struct drm_devic
 		dev->mode_config.max_width = 8192;
 		dev->mode_config.max_height = 8192;
 	} else {
-		dev->mode_config.max_width = 2048;
-		dev->mode_config.max_height = 2048;
+		dev->mode_config.max_width = 4096;
+		dev->mode_config.max_height = 4096;
 	}
 
 	/* set memory base */

drm-intel-lying-systems-without-lvds.patch:

--- NEW FILE drm-intel-lying-systems-without-lvds.patch ---
[PATCH] drm: ignore LVDS on intel graphics systems that lie about having it

There are a number of small form factor desktop systems with Intel mobile
graphics chips that lie and say they have an LVDS. With kernel mode-setting,
this becomes a problem, and makes native resolution boot go haywire -- for
example, my Dell Studio Hybrid, hooked to a 1920x1080 display claims to
have a 1024x768 LVDS, and the resulting graphical boot on the 1920x1080
display uses only the top left 1024x768, and auto-configured X will end
up only 1024x768 as well. With this change, graphical boot and X
both do 1920x1080 as expected.

Nb: one minor issue... Current Fedora rawhide, video playback using Xv
makes X go off into the weeds with this patch added... But that's a bug
elsewhere, still confident this patch DTRT.

Signed-off-by: Jarod Wilson <jarod at redhat.com>

---
 drivers/gpu/drm/i915/intel_lvds.c |   46 ++++++++++++++++++++++++++++++------
 1 files changed, 38 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 6619f26..4d64686 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -384,7 +384,51 @@ static const struct drm_encoder_funcs intel_lvds_enc_funcs = {
 	.destroy = intel_lvds_enc_destroy,
 };
 
+static int __init intel_no_lvds_dmi_callback(const struct dmi_system_id *id)
+{
+	DRM_DEBUG("Skipping LVDS initialization for %s\n", id->ident);
+	return 1;
+}
 
+/* These systems claim to have LVDS, but really don't */
+static const struct dmi_system_id __initdata intel_no_lvds[] = {
+	{
+		.callback = intel_no_lvds_dmi_callback,
+		.ident = "Apple Mac Mini (Core series)",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"),
+		},
+	},
+	{
+		.callback = intel_no_lvds_dmi_callback,
+		.ident = "Apple Mac Mini (Core 2 series)",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Macmini2,1"),
+		},
+	},
+	{
+		.callback = intel_no_lvds_dmi_callback,
+		.ident = "MSI IM-945GSE-A",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "MSI"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "A9830IMS"),
+		},
+	},
+	{
+		.callback = intel_no_lvds_dmi_callback,
+		.ident = "Dell Studio Hybrid",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Studio Hybrid 140g"),
+		},
+	},
+
+	/* FIXME: add a check for the Aopen Mini PC */
+
+	{ }	/* terminating entry */
+};
 
 /**
  * intel_lvds_init - setup LVDS connectors on this device
@@ -404,15 +440,9 @@ void intel_lvds_init(struct drm_device *dev)
 	u32 lvds;
 	int pipe;
 
-	/* Blacklist machines that we know falsely report LVDS. */
-	/* FIXME: add a check for the Aopen Mini PC */
-
-	/* Apple Mac Mini Core Duo and Mac Mini Core 2 Duo */
-	if(dmi_match(DMI_PRODUCT_NAME, "Macmini1,1") ||
-	   dmi_match(DMI_PRODUCT_NAME, "Macmini2,1")) {
-		DRM_DEBUG("Skipping LVDS initialization for Apple Mac Mini\n");
+	/* Skip init on machines we know falsely report LVDS */
+	if (dmi_check_system(intel_no_lvds))
 		return;
-	}
 
 	intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL);
 	if (!intel_output) {

linux-2.6-acer-wmi-bail-on-aao.patch:

--- NEW FILE linux-2.6-acer-wmi-bail-on-aao.patch ---
From: Carlos Corbacho <carlos at strangeworlds.co.uk>
Date: Sat, 4 Apr 2009 08:33:29 +0000 (+0100)
Subject: acer-wmi: Blacklist Acer Aspire One
X-Git-Tag: v2.6.30-rc1~199^2~15^2~2
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=a74dd5fdabcd34c93e17e9c7024eeb503c92b048

acer-wmi: Blacklist Acer Aspire One

The Aspire One's ACPI-WMI interface is a placeholder that does nothing,
and the invalid results that we get from it are now causing userspace
problems as acer-wmi always returns that the rfkill is enabled (i.e. the
radio is off, when it isn't). As it's hardware controlled, acer-wmi
isn't needed on the Aspire One either.

Thanks to Andy Whitcroft at Canonical for tracking down Ubuntu's userspace
issues to this.

Signed-off-by: Carlos Corbacho <carlos at strangeworlds.co.uk>
Reported-by: Andy Whitcroft <apw at canonical.com>
Cc: stable at kernel.org
Signed-off-by: Len Brown <len.brown at intel.com>
---

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index a6a42e8..60fbef2 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -225,6 +225,25 @@ static struct quirk_entry quirk_fujitsu_amilo_li_1718 = {
 	.wireless = 2,
 };
 
+/* The Aspire One has a dummy ACPI-WMI interface - disable it */
+static struct dmi_system_id __devinitdata acer_blacklist[] = {
+	{
+		.ident = "Acer Aspire One (SSD)",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
+		},
+	},
+	{
+		.ident = "Acer Aspire One (HDD)",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
+		},
+	},
+	{}
+};
+
 static struct dmi_system_id acer_quirks[] = {
 	{
 		.callback = dmi_matched,
@@ -1254,6 +1273,12 @@ static int __init acer_wmi_init(void)
 
 	printk(ACER_INFO "Acer Laptop ACPI-WMI Extras\n");
 
+	if (dmi_check_system(acer_blacklist)) {
+		printk(ACER_INFO "Blacklisted hardware detected - "
+				"not loading\n");
+		return -ENODEV;
+	}
+
 	find_quirks();
 
 	/*

linux-2.6-add-qcserial.patch:

--- NEW FILE linux-2.6-add-qcserial.patch ---
diff -up linux-2.6.29.noarch/drivers/usb/serial/Kconfig.qcserial linux-2.6.29.noarch/drivers/usb/serial/Kconfig
--- linux-2.6.29.noarch/drivers/usb/serial/Kconfig.qcserial	2009-03-23 23:12:14.000000000 +0000
+++ linux-2.6.29.noarch/drivers/usb/serial/Kconfig	2009-04-04 18:25:46.000000000 +0100
@@ -472,6 +472,15 @@ config USB_SERIAL_OTI6858
 	  To compile this driver as a module, choose M here: the
 	  module will be called oti6858.
 
+config USB_SERIAL_QUALCOMM
+	tristate "USB Qualcomm Serial modem"
+	help
+	  Say Y here if you have a Qualcomm USB modem device.  These are
+	  usually wireless cellular modems.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called qcserial.
+
 config USB_SERIAL_SPCP8X5
 	tristate "USB SPCP8x5 USB To Serial Driver"
 	help
diff -up linux-2.6.29.noarch/drivers/usb/serial/Makefile.qcserial linux-2.6.29.noarch/drivers/usb/serial/Makefile
--- linux-2.6.29.noarch/drivers/usb/serial/Makefile.qcserial	2009-03-23 23:12:14.000000000 +0000
+++ linux-2.6.29.noarch/drivers/usb/serial/Makefile	2009-04-04 18:25:46.000000000 +0100
@@ -45,6 +45,7 @@ obj-$(CONFIG_USB_SERIAL_OPTICON)		+= opt
 obj-$(CONFIG_USB_SERIAL_OPTION)			+= option.o
 obj-$(CONFIG_USB_SERIAL_OTI6858)		+= oti6858.o
 obj-$(CONFIG_USB_SERIAL_PL2303)			+= pl2303.o
+obj-$(CONFIG_USB_SERIAL_QUALCOMM)		+= qcserial.o
 obj-$(CONFIG_USB_SERIAL_SAFE)			+= safe_serial.o
 obj-$(CONFIG_USB_SERIAL_SIEMENS_MPI)		+= siemens_mpi.o
 obj-$(CONFIG_USB_SERIAL_SIERRAWIRELESS)		+= sierra.o
diff -up /dev/null linux-2.6.29.noarch/drivers/usb/serial/qcserial.c
--- /dev/null	2009-04-03 17:11:07.397135076 +0100
+++ linux-2.6.29.noarch/drivers/usb/serial/qcserial.c	2009-04-04 18:26:00.000000000 +0100
@@ -0,0 +1,168 @@
+/*
+ * Qualcomm Serial USB driver
+ *
+ *	Copyright (c) 2008 QUALCOMM Incorporated.
+ *	Copyright (c) 2009 Greg Kroah-Hartman <gregkh at suse.de>
+ *	Copyright (c) 2009 Novell Inc.
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License version
+ *	2 as published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
+#include <linux/usb.h>
+#include <linux/usb/serial.h>
+
+#define DRIVER_AUTHOR "Qualcomm Inc"
+#define DRIVER_DESC "Qualcomm USB Serial driver"
+
+static int debug;
+
+static struct usb_device_id id_table[] = {
+	{USB_DEVICE(0x05c6, 0x9211)},	/* Acer Gobi QDL device */
+	{USB_DEVICE(0x05c6, 0x9212)},	/* Acer Gobi Modem Device */
+	{USB_DEVICE(0x03f0, 0x1f1d)},	/* HP un2400 Gobi Modem Device */
+	{USB_DEVICE(0x03f0, 0x201d)},	/* HP un2400 Gobi QDL Device */
+	{USB_DEVICE(0x04da, 0x250d)},	/* Panasonic Gobi Modem device */
+	{USB_DEVICE(0x04da, 0x250c)},	/* Panasonic Gobi QDL device */
+	{USB_DEVICE(0x413c, 0x8172)},	/* Dell Gobi Modem device */
+	{USB_DEVICE(0x413c, 0x8171)},	/* Dell Gobi QDL device */
+	{USB_DEVICE(0x1410, 0xa001)},	/* Novatel Gobi Modem device */
+	{USB_DEVICE(0x1410, 0xa008)},	/* Novatel Gobi QDL device */
+	{USB_DEVICE(0x0b05, 0x1776)},	/* Asus Gobi Modem device */
+	{USB_DEVICE(0x0b05, 0x1774)},	/* Asus Gobi QDL device */
+	{USB_DEVICE(0x19d2, 0xfff3)},	/* ONDA Gobi Modem device */
+	{USB_DEVICE(0x19d2, 0xfff2)},	/* ONDA Gobi QDL device */
+	{USB_DEVICE(0x1557, 0x0a80)},	/* OQO Gobi QDL device */
+	{USB_DEVICE(0x05c6, 0x9001)},   /* Generic Gobi Modem device */
+	{USB_DEVICE(0x05c6, 0x9002)},	/* Generic Gobi Modem device */
+	{USB_DEVICE(0x05c6, 0x9202)},	/* Generic Gobi Modem device */
+	{USB_DEVICE(0x05c6, 0x9203)},	/* Generic Gobi Modem device */
+	{USB_DEVICE(0x05c6, 0x9222)},	/* Generic Gobi Modem device */
+	{USB_DEVICE(0x05c6, 0x9008)},	/* Generic Gobi QDL device */
+	{USB_DEVICE(0x05c6, 0x9201)},	/* Generic Gobi QDL device */
+	{USB_DEVICE(0x05c6, 0x9221)},	/* Generic Gobi QDL device */
+	{USB_DEVICE(0x05c6, 0x9231)},	/* Generic Gobi QDL device */
+	{USB_DEVICE(0x1f45, 0x0001)},	/* Unknown Gobi QDL device */
+	{ }				/* Terminating entry */
+};
+MODULE_DEVICE_TABLE(usb, id_table);
+
+static struct usb_driver qcdriver = {
+	.name			= "qcserial",
+	.probe			= usb_serial_probe,
+	.disconnect		= usb_serial_disconnect,
+	.id_table		= id_table,
+	.suspend		= usb_serial_suspend,
+	.resume			= usb_serial_resume,
+	.supports_autosuspend	= true,
+};
+
+static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
+{
+	int retval = -ENODEV;
+	__u8 nintf;
+	__u8 ifnum;
+
+	dbg("%s", __func__);
+
+	nintf = serial->dev->actconfig->desc.bNumInterfaces;
+	dbg("Num Interfaces = %d", nintf);
+	ifnum = serial->interface->cur_altsetting->desc.bInterfaceNumber;
+	dbg("This Interface = %d", ifnum);
+
+	switch (nintf) {
+	case 1:
+		/* QDL mode */
+		if (serial->interface->num_altsetting == 2) {
+			struct usb_host_interface *intf;
+
+			intf = &serial->interface->altsetting[1];
+			if (intf->desc.bNumEndpoints == 2) {
+				if (usb_endpoint_is_bulk_in(&intf->endpoint[0].desc) &&
+				    usb_endpoint_is_bulk_out(&intf->endpoint[1].desc)) {
+					dbg("QDL port found");
+					retval = usb_set_interface(serial->dev, ifnum, 1);
+					if (retval < 0) {
+						dev_err(&serial->dev->dev,
+							"Could not set interface, error %d\n",
+							retval);
+						retval = -ENODEV;
+					}
+					return retval;
+				}
+			}
+		}
+		break;
+
+	case 4:
+		/* Composite mode */
+		if (ifnum == 2) {
+			dbg("Modem port found");
+			retval = usb_set_interface(serial->dev, ifnum, 0);
+			if (retval < 0) {
+				dev_err(&serial->dev->dev,
+					"Could not set interface, error %d\n",
+					retval);
+				retval = -ENODEV;
+			}
+			return retval;
+		}
+		break;
+
+	default:
+		dev_err(&serial->dev->dev,
+			"unknown number of interfaces: %d\n", nintf);
+		return -ENODEV;
+	}
+
+	return retval;
+}
+
+static struct usb_serial_driver qcdevice = {
+	.driver = {
+		.owner     = THIS_MODULE,
+		.name      = "qcserial",
+	},
+	.description         = "Qualcomm USB modem",
+	.id_table            = id_table,
+	.usb_driver          = &qcdriver,
+	.num_ports           = 1,
+	.probe               = qcprobe,
+};
+
+static int __init qcinit(void)
+{
+	int retval;
+
+	retval = usb_serial_register(&qcdevice);
+	if (retval)
+		return retval;
+
+	retval = usb_register(&qcdriver);
+	if (retval) {
+		usb_serial_deregister(&qcdevice);
+		return retval;
+	}
+
+	return 0;
+}
+
+static void __exit qcexit(void)
+{
+	usb_deregister(&qcdriver);
+	usb_serial_deregister(&qcdevice);
+}
+
+module_init(qcinit);
+module_exit(qcexit);
+
+MODULE_AUTHOR(DRIVER_AUTHOR);
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_LICENSE("GPL v2");
+
+module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Debug enabled or not");

linux-2.6-btrfs-fix-umount-hang.patch:

--- NEW FILE linux-2.6-btrfs-fix-umount-hang.patch ---
Need to check kthread_should_stop after schedule_timeout() before calling schedule(). This causes threads to sleep with potentially no one to wake them up causing mount(2) to hang in btrfs_stop_workers waiting for threads to stop. Race, IMO, is more evident on UP than on SMP.

Signed-off-by: Amit Gud <gud at ksu.edu>

diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
index c84ca1f..4c1f3e5 100644
--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
@@ -195,6 +195,9 @@ again_locked:
 				if (!list_empty(&worker->pending))
 					continue;
 
+				if (kthread_should_stop())
+					return 0;
+
 				/* still no more work?, sleep for real */
 				spin_lock_irq(&worker->lock);
 				set_current_state(TASK_INTERRUPTIBLE);

linux-2.6-crash-driver.patch:

Index: linux-2.6-crash-driver.patch
===================================================================
RCS file: linux-2.6-crash-driver.patch
diff -N linux-2.6-crash-driver.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-crash-driver.patch	14 Apr 2009 22:09:15 -0000	1.12.6.3
@@ -0,0 +1,363 @@
+diff --git a/arch/ia64/include/asm/crash.h b/arch/ia64/include/asm/crash.h
+new file mode 100644
+index 0000000..541af84
+--- /dev/null
++++ b/arch/ia64/include/asm/crash.h
+@@ -0,0 +1,90 @@
++#ifndef _ASM_IA64_CRASH_H
++#define _ASM_IA64_CRASH_H
++
++/*
++ * linux/include/asm-ia64/crash.h
++ *
++ * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ *
++ */
++
++#ifdef __KERNEL__
++
++#include <linux/efi.h>
++#include <linux/mm.h>
++#include <asm/mmzone.h>
++
++static inline void *
++map_virtual(u64 offset, struct page **pp)
++{
++	struct page *page;
++	unsigned long pfn;
++	u32 type;
++
++	if (REGION_NUMBER(offset) == 5) {
++		char byte;
++
++		if (__get_user(byte, (char *)offset) == 0)
++			return (void *)offset;
++		else
++			return NULL;
++	}
++
++	switch (type = efi_mem_type(offset)) 
++	{
++	case EFI_LOADER_CODE:
++	case EFI_LOADER_DATA:
++	case EFI_BOOT_SERVICES_CODE:
++	case EFI_BOOT_SERVICES_DATA:
++	case EFI_CONVENTIONAL_MEMORY:
++		break;
++
++	default:
++		printk(KERN_INFO
++		    "crash memory driver: invalid memory type for %lx: %d\n", 
++			offset, type);
++		return NULL;
++	}
++
++	pfn = offset >> PAGE_SHIFT;
++
++	if (!pfn_valid(pfn)) {
++		printk(KERN_INFO
++			"crash memory driver: invalid pfn: %lx )\n", pfn);
++		return NULL;
++	}
++
++	page = pfn_to_page(pfn);
++
++	if (!page->virtual) {
++		printk(KERN_INFO
++		    "crash memory driver: offset: %lx page: %lx page->virtual: NULL\n", 
++			offset, (unsigned long)page);
++		return NULL;
++	}
++
++	return (page->virtual + (offset & (PAGE_SIZE-1)));
++}
++
++static inline void unmap_virtual(struct page *page) 
++{ 
++	return;
++}
++
++#endif /* __KERNEL__ */
++
++#endif /* _ASM_IA64_CRASH_H */
+diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c
+index 6da1f20..2984fb3 100644
+--- a/arch/ia64/kernel/ia64_ksyms.c
++++ b/arch/ia64/kernel/ia64_ksyms.c
+@@ -86,6 +86,9 @@ EXPORT_SYMBOL(ia64_save_scratch_fpregs);
+ #include <asm/unwind.h>
+ EXPORT_SYMBOL(unw_init_running);
+ 
++#include <linux/efi.h>
++EXPORT_SYMBOL_GPL(efi_mem_type);
++
+ #ifdef ASM_SUPPORTED
+ # ifdef CONFIG_SMP
+ #  if (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
+diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
+index d4c4307..d1c968f 100644
+--- a/arch/x86/mm/ioremap.c
++++ b/arch/x86/mm/ioremap.c
+@@ -133,6 +133,7 @@ int page_is_ram(unsigned long pagenr)
+ 	}
+ 	return 0;
+ }
++EXPORT_SYMBOL_GPL(page_is_ram);
+ 
+ /*
+  * Fix up the linear direct mapping of the kernel to avoid cache attribute
+diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
+index 43d6ba8..0d81c9a 100644
+--- a/drivers/char/Kconfig
++++ b/drivers/char/Kconfig
+@@ -460,6 +460,8 @@ config LEGACY_PTYS
+ 	  security.  This option enables these legacy devices; on most
+ 	  systems, it is safe to say N.
+ 
++config CRASH
++        tristate "Crash Utility memory driver"
+ 
+ config LEGACY_PTY_COUNT
+ 	int "Maximum number of legacy PTY in use"
+diff --git a/drivers/char/Makefile b/drivers/char/Makefile
+index 438f713..1b7767b 100644
+--- a/drivers/char/Makefile
++++ b/drivers/char/Makefile
+@@ -109,6 +109,8 @@ obj-$(CONFIG_PS3_FLASH)		+= ps3flash.o
+ obj-$(CONFIG_JS_RTC)		+= js-rtc.o
+ js-rtc-y = rtc.o
+ 
++obj-$(CONFIG_CRASH)		+= crash.o
++
+ # Files generated that shall be removed upon make clean
+ clean-files := consolemap_deftbl.c defkeymap.c
+ 
+diff --git a/drivers/char/crash.c b/drivers/char/crash.c
+new file mode 100644
+index 0000000..e5437de
+--- /dev/null
++++ b/drivers/char/crash.c
+@@ -0,0 +1,128 @@
++/*
++ *  linux/drivers/char/crash.c
++ *
++ *  Copyright (C) 2004  Dave Anderson <anderson at redhat.com>
++ *  Copyright (C) 2004  Red Hat, Inc.
++ */
++
++/******************************************************************************
++ *
++ *   This program is free software; you can redistribute it and/or modify
++ *   it under the terms of the GNU General Public License as published by
++ *   the Free Software Foundation; either version 2, or (at your option)
++ *   any later version.
++ *
++ *   This program is distributed in the hope that it will be useful,
++ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ *   GNU General Public License for more details.
++ *
++ *   You should have received a copy of the GNU General Public License
++ *   along with this program; if not, write to the Free Software
++ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ *
++ *****************************************************************************/
++
++#include <linux/module.h>
++#include <linux/types.h>
++#include <linux/miscdevice.h>
++#include <linux/init.h>
++#include <asm/io.h>
++#include <asm/uaccess.h>
++#include <asm/types.h>
++#include <asm/crash.h>
++
++#define CRASH_VERSION   "1.0"
++
++/*
++ *  These are the file operation functions that allow crash utility
++ *  access to physical memory.
++ */
++
++static loff_t 
++crash_llseek(struct file * file, loff_t offset, int orig)
++{
++	switch (orig) {
++	case 0:
++		file->f_pos = offset;
++		return file->f_pos;
++	case 1:
++		file->f_pos += offset;
++		return file->f_pos;
++	default:
++		return -EINVAL;
++	}
++}
++
++/*
++ *  Determine the page address for an address offset value, 
++ *  get a virtual address for it, and copy it out.
++ *  Accesses must fit within a page.
++ */
++static ssize_t
++crash_read(struct file *file, char *buf, size_t count, loff_t *poff)
++{
++	void *vaddr;
++	struct page *page;
++	u64 offset;
++	ssize_t read;
++
++	offset = *poff;
++	if (offset >> PAGE_SHIFT != (offset+count-1) >> PAGE_SHIFT) 
++		return -EINVAL;
++
++	vaddr = map_virtual(offset, &page);
++	if (!vaddr)
++		return -EFAULT;
++
++	if (copy_to_user(buf, vaddr, count)) {
++		unmap_virtual(page);
++		return -EFAULT;
++	}
++	unmap_virtual(page);
++
++	read = count;
++	*poff += read;
++	return read;
++}
++
++static struct file_operations crash_fops = {
++	.owner = THIS_MODULE,
++	.llseek = crash_llseek,
++	.read = crash_read,
++};
++
++static struct miscdevice crash_dev = {
++	MISC_DYNAMIC_MINOR,
++	"crash",
++	&crash_fops
++};
++
++static int __init
++crash_init(void)
++{
++	int ret;
++
++	ret = misc_register(&crash_dev);
++	if (ret) {
++		printk(KERN_ERR 
++		    "crash memory driver: cannot misc_register (MISC_DYNAMIC_MINOR)\n");
++		goto out;
++	}
++	
++	ret = 0;
++	printk(KERN_INFO "crash memory driver: version %s\n", CRASH_VERSION);
++out:
++	return ret;
++}
++
++static void __exit
++crash_cleanup_module(void)
++{
++	misc_deregister(&crash_dev);
++}
++
++module_init(crash_init);
++module_exit(crash_cleanup_module);
++
++MODULE_LICENSE("GPL");
+diff --git a/include/asm-x86/crash.h b/include/asm-x86/crash.h
+new file mode 100644
+index 0000000..dfcc006
+--- /dev/null
++++ b/include/asm-x86/crash.h
+@@ -0,0 +1,75 @@
++#ifndef _ASM_I386_CRASH_H
++#define _ASM_I386_CRASH_H
++
++/*
++ * linux/include/asm-i386/crash.h
++ *
++ * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ *
++ */
++
++#ifdef __KERNEL__
++
++#include <linux/mm.h>
++#include <linux/highmem.h>
++#include <asm/mmzone.h>
++
++extern int page_is_ram(unsigned long);
++
++static inline void *
++map_virtual(u64 offset, struct page **pp)
++{
++	struct page *page;
++	unsigned long pfn;
++	void *vaddr;
++
++	pfn = (unsigned long)(offset >> PAGE_SHIFT);
++
++	if (!page_is_ram(pfn)) {
++		printk(KERN_INFO
++		    "crash memory driver: !page_is_ram(pfn: %lx)\n", pfn);
++		return NULL;
++	}
++
++	if (!pfn_valid(pfn)) {
++		printk(KERN_INFO
++		    "crash memory driver: invalid pfn: %lx )\n", pfn);
++		return NULL;
++	}
++
++	page = pfn_to_page(pfn);
++
++	vaddr = kmap(page);
++	if (!vaddr) {
++		printk(KERN_INFO
++		    "crash memory driver: pfn: %lx kmap(page: %lx) failed\n", 
++			pfn, (unsigned long)page);
++		return NULL;
++	}
++
++	*pp = page;
++	return (vaddr + (offset & (PAGE_SIZE-1)));
++}
++
++static inline void unmap_virtual(struct page *page) 
++{ 
++	kunmap(page);
++}
++
++#endif /* __KERNEL__ */
++
++#endif /* _ASM_I386_CRASH_H */

linux-2.6-dma-debug-fixes.patch:

--- NEW FILE linux-2.6-dma-debug-fixes.patch ---
Date: 	Fri, 3 Apr 2009 15:50:14 +0200
From: Joerg Roedel <joerg.roedel at amd.com>
To: mingo at redhat.com
CC: linux-kernel at vger.kernel.org, shemminger at vyatta.com
Subject: [git pull] dma-debug fixes for 2.6.30-rc
Message-ID: <20090403135014.GG22472 at amd.com>

Hi Ingo,

The following changes since commit 8fe74cf053de7ad2124a894996f84fa890a81093:
  Linus Torvalds (1):
        Merge branch 'for-linus' of git://git.kernel.org/.../viro/vfs-2.6

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu.git dma-debug

Joerg Roedel (1):
      x86/dma: unify definition of pci_unmap_addr* and pci_unmap_len macros

 arch/x86/include/asm/pci.h    |   36 ++++++++++++++++++++++++++++++++----
 arch/x86/include/asm/pci_32.h |   34 ----------------------------------
 arch/x86/include/asm/pci_64.h |   22 ----------------------
 3 files changed, 32 insertions(+), 60 deletions(-)
 delete mode 100644 arch/x86/include/asm/pci_32.h

This unification fixes dma-debug false positives on i386 reporting that a dma
mapping was freed with another length than it was allocated. The full diff is
also attached. This patch is against linus/master since your HEAD of latest
tip/core/iommu branch is currently 2.6.29 final. Please pull.

diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index a977de2..e403448 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -86,12 +86,40 @@ static inline void early_quirks(void) { }
 
 extern void pci_iommu_alloc(void);
 
-#endif  /* __KERNEL__ */
+#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
+
+#if defined(CONFIG_X86_64) || defined(CONFIG_DMA_API_DEBUG)
+
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)       \
+	        dma_addr_t ADDR_NAME;
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)         \
+	        __u32 LEN_NAME;
+#define pci_unmap_addr(PTR, ADDR_NAME)                  \
+	        ((PTR)->ADDR_NAME)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL)         \
+	        (((PTR)->ADDR_NAME) = (VAL))
+#define pci_unmap_len(PTR, LEN_NAME)                    \
+	        ((PTR)->LEN_NAME)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL)           \
+	        (((PTR)->LEN_NAME) = (VAL))
 
-#ifdef CONFIG_X86_32
-# include "pci_32.h"
 #else
-# include "pci_64.h"
+
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)       dma_addr_t ADDR_NAME[0];
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) unsigned LEN_NAME[0];
+#define pci_unmap_addr(PTR, ADDR_NAME)  sizeof((PTR)->ADDR_NAME)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
+	        do { break; } while (pci_unmap_addr(PTR, ADDR_NAME))
+#define pci_unmap_len(PTR, LEN_NAME)            sizeof((PTR)->LEN_NAME)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
+	        do { break; } while (pci_unmap_len(PTR, LEN_NAME))
+
+#endif
+
+#endif  /* __KERNEL__ */
+
+#ifdef CONFIG_X86_64
+#include "pci_64.h"
 #endif
 
 /* implement the pci_ DMA API in terms of the generic device dma_ one */
diff --git a/arch/x86/include/asm/pci_64.h b/arch/x86/include/asm/pci_64.h
index 4da2079..ae5e40f 100644
--- a/arch/x86/include/asm/pci_64.h
+++ b/arch/x86/include/asm/pci_64.h
@@ -24,28 +24,6 @@ extern int (*pci_config_write)(int seg, int bus, int dev, int fn,
 
 extern void dma32_reserve_bootmem(void);
 
-/* The PCI address space does equal the physical memory
- * address space.  The networking and block device layers use
- * this boolean for bounce buffer decisions
- *
- * On AMD64 it mostly equals, but we set it to zero if a hardware
- * IOMMU (gart) of sotware IOMMU (swiotlb) is available.
- */
-#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
-
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)	\
-	dma_addr_t ADDR_NAME;
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)		\
-	__u32 LEN_NAME;
-#define pci_unmap_addr(PTR, ADDR_NAME)			\
-	((PTR)->ADDR_NAME)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL)		\
-	(((PTR)->ADDR_NAME) = (VAL))
-#define pci_unmap_len(PTR, LEN_NAME)			\
-	((PTR)->LEN_NAME)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL)		\
-	(((PTR)->LEN_NAME) = (VAL))
-
 #endif /* __KERNEL__ */
 
 #endif /* _ASM_X86_PCI_64_H */

linux-2.6-e820-acpi3-bios-workaround.patch:

--- NEW FILE linux-2.6-e820-acpi3-bios-workaround.patch ---
From: H. Peter Anvin <hpa at zytor.com>
Date: Sat, 28 Mar 2009 20:53:26 +0000 (-0700)
Subject: x86, setup: ACPI 3, BIOS workaround for E820-probing code
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=c549e71d073a6e9a4847497344db28a784061455

x86, setup: ACPI 3, BIOS workaround for E820-probing code

Impact: ACPI 3 spec compliance, BIOS bug workaround

The ACPI 3 spec added another field to the E820 buffer -- which is
backwards incompatible, since it contains a validity bit.
Furthermore, there has been at least one report of a BIOS which
assumes that the buffer it is pointed at is the same buffer as for the
previous E820 call.  Therefore, read the data into a temporary buffer
and copy the standard part of it if and only if the valid bit is set.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>
---

diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c
index fcdb10a..d5d2360 100644
--- a/arch/x86/boot/memory.c
+++ b/arch/x86/boot/memory.c
@@ -2,6 +2,7 @@
  *
  *   Copyright (C) 1991, 1992 Linus Torvalds
  *   Copyright 2007 rPath, Inc. - All Rights Reserved
+ *   Copyright 2009 Intel Corporation; author H. Peter Anvin
  *
  *   This file is part of the Linux kernel, and is made available under
  *   the terms of the GNU General Public License version 2.
@@ -16,6 +17,11 @@
 
 #define SMAP	0x534d4150	/* ASCII "SMAP" */
 
+struct e820_ext_entry {
+	struct e820entry std;
+	u32 ext_flags;
+} __attribute__((packed));
+
 static int detect_memory_e820(void)
 {
 	int count = 0;
@@ -23,9 +29,10 @@ static int detect_memory_e820(void)
 	u32 size, id, edi;
 	u8 err;
 	struct e820entry *desc = boot_params.e820_map;
+	static struct e820_ext_entry buf; /* static so it is zeroed */
 
 	do {
-		size = sizeof(struct e820entry);
+		size = sizeof buf;
 
 		/* Important: %edx and %esi are clobbered by some BIOSes,
 		   so they must be either used for the error output
@@ -33,8 +40,8 @@ static int detect_memory_e820(void)
 		   is something out there clobbering %ebp and %edi, too. */
 		asm("pushl %%ebp; int $0x15; popl %%ebp; setc %0"
 		    : "=d" (err), "+b" (next), "=a" (id), "+c" (size),
-		      "=D" (edi), "=m" (*desc)
-		    : "D" (desc), "d" (SMAP), "a" (0xe820)
+		      "=D" (edi), "+m" (buf)
+		    : "D" (&buf), "d" (SMAP), "a" (0xe820)
 		    : "esi");
 
 		/* BIOSes which terminate the chain with CF = 1 as opposed
@@ -53,8 +60,14 @@ static int detect_memory_e820(void)
 			break;
 		}
 
+		/* ACPI 3.0 added the extended flags support.  If bit 0
+		   in the extended flags is zero, we're supposed to simply
+		   ignore the entry -- a backwards incompatible change! */
+		if (size > 20 && !(buf.ext_flags & 1))
+			continue;
+
+		*desc++ = buf.std;
 		count++;
-		desc++;
 	} while (next && count < ARRAY_SIZE(boot_params.e820_map));
 
 	return boot_params.e820_entries = count;

linux-2.6-e820-guard-against-pre-acpi3.patch:

--- NEW FILE linux-2.6-e820-guard-against-pre-acpi3.patch ---
From: H. Peter Anvin <hpa at zytor.com>
Date: Wed, 1 Apr 2009 18:35:00 +0000 (-0700)
Subject: x86, setup: guard against pre-ACPI 3 e820 code not updating %ecx
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=cd670599b7b00d9263f6f11a05c0edeb9cbedaf3

x86, setup: guard against pre-ACPI 3 e820 code not updating %ecx

Impact: BIOS bug safety

For pre-ACPI 3 BIOSes, pre-initialize the end of the e820 buffer just
in case the BIOS returns an unchanged %ecx but without actually
touching the ACPI 3 extended flags field.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>
---

diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c
index d5d2360..5054c2d 100644
--- a/arch/x86/boot/memory.c
+++ b/arch/x86/boot/memory.c
@@ -31,6 +31,12 @@ static int detect_memory_e820(void)
 	struct e820entry *desc = boot_params.e820_map;
 	static struct e820_ext_entry buf; /* static so it is zeroed */
 
+	/*
+	 * Set this here so that if the BIOS doesn't change this field
+	 * but still doesn't change %ecx, we're still okay...
+	 */
+	buf.ext_flags = 1;
+
 	do {
 		size = sizeof buf;
 

linux-2.6-e820-mark-esi-clobbered.patch:

--- NEW FILE linux-2.6-e820-mark-esi-clobbered.patch ---
From: Michael K. Johnson <johnsonm at rpath.com>
Date: Fri, 27 Mar 2009 17:14:41 +0000 (-0400)
Subject: x86, setup: mark %esi as clobbered in E820 BIOS call
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=01522df346f846906eaf6ca57148641476209909

x86, setup: mark %esi as clobbered in E820 BIOS call

Jordan Hargrave diagnosed a BIOS clobbering %esi in the E820 call.
That particular BIOS has been fixed, but there is a possibility that
this is responsible for other occasional reports of early boot
failure, and it does not hurt to add %esi to the clobbers.

-stable candidate patch.

Cc: Justin Forbes <jmforbes at linuxtx.org>
Signed-off-by: Michael K Johnson <johnsonm at rpath.com>
Signed-off-by: H. Peter Anvin <hpa at zytor.com>
Cc: stable at kernel.org
---

diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c
index 8c3c25f..a99dbbe 100644
--- a/arch/x86/boot/memory.c
+++ b/arch/x86/boot/memory.c
@@ -27,13 +27,14 @@ static int detect_memory_e820(void)
 	do {
 		size = sizeof(struct e820entry);
 
-		/* Important: %edx is clobbered by some BIOSes,
-		   so it must be either used for the error output
+		/* Important: %edx and %esi are clobbered by some BIOSes,
+		   so they must be either used for the error output
 		   or explicitly marked clobbered. */
 		asm("int $0x15; setc %0"
 		    : "=d" (err), "+b" (next), "=a" (id), "+c" (size),
 		      "=m" (*desc)
-		    : "D" (desc), "d" (SMAP), "a" (0xe820));
+		    : "D" (desc), "d" (SMAP), "a" (0xe820)
+		    : "esi");
 
 		/* BIOSes which terminate the chain with CF = 1 as opposed
 		   to %ebx = 0 don't always report the SMAP signature on

linux-2.6-e820-save-restore-edi-ebp.patch:

--- NEW FILE linux-2.6-e820-save-restore-edi-ebp.patch ---
From: H. Peter Anvin <hpa at zytor.com>
Date: Sat, 28 Mar 2009 20:53:26 +0000 (-0700)
Subject: x86, setup: preemptively save/restore edi and ebp around INT 15 E820
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=32ec7fd08b597586774b92ac1cd2678021ccac1b

x86, setup: preemptively save/restore edi and ebp around INT 15 E820

Impact: BIOS bugproofing

Since there are BIOSes known to clobber %ebx and %esi for INT 15 E820,
assume there is something out there clobbering %edi and/or %ebp too,
and don't wait for it to fail.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>
---

diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c
index a99dbbe..fcdb10a 100644
--- a/arch/x86/boot/memory.c
+++ b/arch/x86/boot/memory.c
@@ -20,7 +20,7 @@ static int detect_memory_e820(void)
 {
 	int count = 0;
 	u32 next = 0;
-	u32 size, id;
+	u32 size, id, edi;
 	u8 err;
 	struct e820entry *desc = boot_params.e820_map;
 
@@ -29,10 +29,11 @@ static int detect_memory_e820(void)
 
 		/* Important: %edx and %esi are clobbered by some BIOSes,
 		   so they must be either used for the error output
-		   or explicitly marked clobbered. */
-		asm("int $0x15; setc %0"
+		   or explicitly marked clobbered.  Given that, assume there
+		   is something out there clobbering %ebp and %edi, too. */
+		asm("pushl %%ebp; int $0x15; popl %%ebp; setc %0"
 		    : "=d" (err), "+b" (next), "=a" (id), "+c" (size),
-		      "=m" (*desc)
+		      "=D" (edi), "=m" (*desc)
 		    : "D" (desc), "d" (SMAP), "a" (0xe820)
 		    : "esi");
 

linux-2.6-ext4-really-print-warning-once.patch:

--- NEW FILE linux-2.6-ext4-really-print-warning-once.patch ---
ext4: really print the find_group_flex fallback warning only once

Missing braces caused the warning to print more than once.

Signed-Off-By: Chuck Ebbert <cebbert at redhat.com>

--- linux-2.6.27.noarch.orig/fs/ext4/ialloc.c
+++ linux-2.6.27.noarch/fs/ext4/ialloc.c
@@ -705,11 +705,12 @@ struct inode *ext4_new_inode(handle_t *h
 		ret2 = find_group_flex(sb, dir, &group);
 		if (ret2 == -1) {
 			ret2 = find_group_other(sb, dir, &group);
-			if (ret2 == 0 && once)
+			if (ret2 == 0 && once) {
 				once = 0;
 				printk(KERN_NOTICE "ext4: find_group_flex "
 				       "failed, fallback succeeded dir %lu\n",
 				       dir->i_ino);
+			}
 		}
 		goto got_group;
 	}

linux-2.6-fiemap-header-install.patch:

--- NEW FILE linux-2.6-fiemap-header-install.patch ---
Index: linux-2.6.29.noarch/include/linux/Kbuild
===================================================================
--- linux-2.6.29.noarch.orig/include/linux/Kbuild
+++ linux-2.6.29.noarch/include/linux/Kbuild
@@ -67,6 +67,7 @@ header-y += falloc.h
 header-y += fd.h
 header-y += fdreg.h
 header-y += fib_rules.h
+header-y += fiemap.h
 header-y += firewire-cdev.h
 header-y += firewire-constants.h
 header-y += fuse.h

linux-2.6-input-wacom-bluetooth.patch:

--- NEW FILE linux-2.6-input-wacom-bluetooth.patch ---
>From 99074a7cf9622837af84d330e07bdb46307c254f Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Mon, 16 Mar 2009 23:36:54 +0000
Subject: [PATCH] Wacom Graphire Bluetooth driver

Signed-off-by: Bastien Nocera <hadess at hadess.net>

Based on the work by Andrew Zabolotny, an HID driver for the Bluetooth
Wacom tablet. This is required as it uses a slightly different
protocols from what's currently support by the drivers/input/wacom*
driver, and those only support USB.

A user-space patch is required to activate mode 2 of the Wacom tablet,
as hidp does not support hid_output_raw_report.
---
 drivers/hid/Kconfig     |    7 ++
 drivers/hid/Makefile    |    1 +
 drivers/hid/hid-core.c  |    1 +
 drivers/hid/hid-ids.h   |    1 +
 drivers/hid/hid-wacom.c |  260 +++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 270 insertions(+), 0 deletions(-)
 create mode 100644 drivers/hid/hid-wacom.c

diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index e85c8fe..f3244e3 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -261,6 +261,13 @@ config THRUSTMASTER_FF
 	  Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or
 	  a THRUSTMASTER Ferrari GT Rumble Force or Force Feedback Wheel.
 
+config HID_WACOM
+	tristate "Wacom Bluetooth devices support" if EMBEDDED
+	depends on BT_HIDP
+	default !EMBEDDED
+	---help---
+	Support for Wacom Graphire Bluetooth tablet.
+
 config ZEROPLUS_FF
 	tristate "Zeroplus based game controller support"
 	depends on USB_HID
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index fbd021f..410b302 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -41,6 +41,7 @@ obj-$(CONFIG_GREENASIA_FF)	+= hid-gaff.o
 obj-$(CONFIG_THRUSTMASTER_FF)	+= hid-tmff.o
 obj-$(CONFIG_HID_TOPSEED)	+= hid-topseed.o
 obj-$(CONFIG_ZEROPLUS_FF)	+= hid-zpff.o
+obj-$(CONFIG_HID_WACOM)		+= hid-wacom.o
 
 obj-$(CONFIG_USB_HID)		+= usbhid/
 obj-$(CONFIG_USB_MOUSE)		+= usbhid/
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 1cc9674..d134f5d 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1305,6 +1305,7 @@ static const struct hid_device_id hid_blacklist[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb651) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) },
+	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0005) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0030) },
 
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 8851197..e8f96c2 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -400,6 +400,7 @@
 #define USB_DEVICE_ID_VERNIER_LCSPEC	0x0006
 
 #define USB_VENDOR_ID_WACOM		0x056a
+#define USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH	0x81
 
 #define USB_VENDOR_ID_WISEGROUP		0x0925
 #define USB_DEVICE_ID_1_PHIDGETSERVO_20	0x8101
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
new file mode 100644
index 0000000..67c8c3a
--- /dev/null
+++ b/drivers/hid/hid-wacom.c
@@ -0,0 +1,260 @@
+/*
+ *  Bluetooth Wacom Tablet support
+ *
+ *  Copyright (c) 1999 Andreas Gal
+ *  Copyright (c) 2000-2005 Vojtech Pavlik <vojtech at suse.cz>
+ *  Copyright (c) 2005 Michael Haboustak <mike- at cinci.rr.com> for Concept2, Inc
+ *  Copyright (c) 2006-2007 Jiri Kosina
+ *  Copyright (c) 2007 Paul Walmsley
+ *  Copyright (c) 2008 Jiri Slaby <jirislaby at gmail.com>
+ *  Copyright (c) 2006 Andrew Zabolotny <zap at homelink.ru>
+ *  Copyright (c) 2009 Bastien Nocera <hadess at hadess.net>
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ */
+
+#include <linux/device.h>
+#include <linux/hid.h>
+#include <linux/module.h>
+
+#include "hid-ids.h"
+
+struct wacom_data {
+	__u16 tool;
+	unsigned char butstate;
+};
+
+static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report,
+		u8 *raw_data, int size)
+{
+	struct wacom_data *wdata = hid_get_drvdata(hdev);
+	struct hid_input *hidinput;
+	struct input_dev *input;
+	unsigned char *data = (unsigned char *) raw_data;
+	int tool, x, y, rw;
+
+	if (!(hdev->claimed & HID_CLAIMED_INPUT))
+		return 0;
+
+	tool = 0;
+	hidinput = list_entry(hdev->inputs.next, struct hid_input, list);
+	input = hidinput->input;
+
+	/* Check if this is a tablet report */
+	if (data[0] != 0x03)
+		return 0;
+
+	/* Get X & Y positions */
+	x = le16_to_cpu(*(__le16 *) &data[2]);
+	y = le16_to_cpu(*(__le16 *) &data[4]);
+
+	/* Get current tool identifier */
+	if (data[1] & 0x90) { /* If pen is in the in/active area */
+		switch ((data[1] >> 5) & 3) {
+		case 0:	/* Pen */
+			tool = BTN_TOOL_PEN;
+			break;
+
+		case 1: /* Rubber */
+			tool = BTN_TOOL_RUBBER;
+			break;
+
+		case 2: /* Mouse with wheel */
+		case 3: /* Mouse without wheel */
+			tool = BTN_TOOL_MOUSE;
+			break;
+		}
+
+		/* Reset tool if out of active tablet area */
+		if (!(data[1] & 0x10))
+			tool = 0;
+	}
+
+	/* If tool changed, notify input subsystem */
+	if (wdata->tool != tool) {
+		if (wdata->tool) {
+			/* Completely reset old tool state */
+			if (wdata->tool == BTN_TOOL_MOUSE) {
+				input_report_key(input, BTN_LEFT, 0);
+				input_report_key(input, BTN_RIGHT, 0);
+				input_report_key(input, BTN_MIDDLE, 0);
+				input_report_abs(input, ABS_DISTANCE,
+						input->absmax[ABS_DISTANCE]);
+			} else {
+				input_report_key(input, BTN_TOUCH, 0);
+				input_report_key(input, BTN_STYLUS, 0);
+				input_report_key(input, BTN_STYLUS2, 0);
+				input_report_abs(input, ABS_PRESSURE, 0);
+			}
+			input_report_key(input, wdata->tool, 0);
+			input_sync(input);
+		}
+		wdata->tool = tool;
+		if (tool)
+			input_report_key(input, tool, 1);
+	}
+
+	if (tool) {
+		input_report_abs(input, ABS_X, x);
+		input_report_abs(input, ABS_Y, y);
+
+		switch ((data[1] >> 5) & 3) {
+		case 2: /* Mouse with wheel */
+			input_report_key(input, BTN_MIDDLE, data[1] & 0x04);
+			rw = (data[6] & 0x01) ? -1 :
+				(data[6] & 0x02) ? 1 : 0;
+			input_report_rel(input, REL_WHEEL, rw);
+			/* fall through */
+
+		case 3: /* Mouse without wheel */
+			input_report_key(input, BTN_LEFT, data[1] & 0x01);
+			input_report_key(input, BTN_RIGHT, data[1] & 0x02);
+			/* Compute distance between mouse and tablet */
+			rw = 44 - (data[6] >> 2);
+			if (rw < 0)
+				rw = 0;
+			else if (rw > 31)
+				rw = 31;
+			input_report_abs(input, ABS_DISTANCE, rw);
+			break;
+
+		default:
+			input_report_abs(input, ABS_PRESSURE,
+					data[6] | (((__u16) (data[1] & 0x08)) << 5));
+			input_report_key(input, BTN_TOUCH, data[1] & 0x01);
+			input_report_key(input, BTN_STYLUS, data[1] & 0x02);
+			input_report_key(input, BTN_STYLUS2, (tool == BTN_TOOL_PEN) && data[1] & 0x04);
+			break;
+		}
+
+		input_sync(input);
+	}
+
+	/* Report the state of the two buttons at the top of the tablet
+	 * as two extra fingerpad keys (buttons 4 & 5). */
+	rw = data[7] & 0x03;
+	if (rw != wdata->butstate) {
+		wdata->butstate = rw;
+		input_report_key(input, BTN_0, rw & 0x02);
+		input_report_key(input, BTN_1, rw & 0x01);
+		input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
+		input_sync(input);
+	}
+
+	return 1;
+}
+
+static int wacom_probe(struct hid_device *hdev,
+		const struct hid_device_id *id)
+{
+	struct hid_input *hidinput;
+	struct input_dev *input;
+	struct wacom_data *wdata;
+	int ret;
+
+	wdata = kzalloc(sizeof(*wdata), GFP_KERNEL);
+	if (wdata == NULL) {
+		dev_err(&hdev->dev, "can't alloc wacom descriptor\n");
+		return -ENOMEM;
+	}
+
+	hid_set_drvdata(hdev, wdata);
+
+	ret = hid_parse(hdev);
+	if (ret) {
+		dev_err(&hdev->dev, "parse failed\n");
+		goto err_free;
+	}
+
+	ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
+	if (ret) {
+		dev_err(&hdev->dev, "hw start failed\n");
+		goto err_free;
+	}
+
+	hidinput = list_entry(hdev->inputs.next, struct hid_input, list);
+	input = hidinput->input;
+
+	/* Basics */
+	input->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_REL);
+	input->absbit[0] |= BIT(ABS_X) | BIT(ABS_Y) |
+		BIT(ABS_PRESSURE) | BIT(ABS_DISTANCE);
+	input->relbit[0] |= BIT(REL_WHEEL);
+	set_bit(BTN_TOOL_PEN, input->keybit);
+	set_bit(BTN_TOUCH, input->keybit);
+	set_bit(BTN_STYLUS, input->keybit);
+	set_bit(BTN_STYLUS2, input->keybit);
+	set_bit(BTN_LEFT, input->keybit);
+	set_bit(BTN_RIGHT, input->keybit);
+	set_bit(BTN_MIDDLE, input->keybit);
+
+	/* Pad */
+	input->evbit[0] |= BIT(EV_MSC);
+	input->mscbit[0] |= BIT(MSC_SERIAL);
+
+	/* Distance, rubber and mouse */
+	input->absbit[0] |= BIT(ABS_DISTANCE);
+	set_bit(BTN_TOOL_RUBBER, input->keybit);
+	set_bit(BTN_TOOL_MOUSE, input->keybit);
+
+	input->absmax[ABS_PRESSURE] = 511;
+	input->absmax[ABS_DISTANCE] = 32;
+
+	input->absmax[ABS_X] = 16704;
+	input->absmax[ABS_Y] = 12064;
+	input->absfuzz[ABS_X] = 4;
+	input->absfuzz[ABS_Y] = 4;
+
+	return 0;
+err_free:
+	kfree(wdata);
+	return ret;
+}
+
+static void wacom_remove(struct hid_device *hdev)
+{
+	hid_hw_stop(hdev);
+	kfree(hid_get_drvdata(hdev));
+}
+
+static const struct hid_device_id wacom_devices[] = {
+	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH) },
+
+	{ }
+};
+MODULE_DEVICE_TABLE(hid, wacom_devices);
+
+static struct hid_driver wacom_driver = {
+	.name = "wacom",
+	.id_table = wacom_devices,
+	.probe = wacom_probe,
+	.remove = wacom_remove,
+	.raw_event = wacom_raw_event,
+};
+
+static int wacom_init(void)
+{
+	int ret;
+
+	ret = hid_register_driver(&wacom_driver);
+	if (ret)
+		printk(KERN_ERR "can't register wacom driver\n");
+	printk(KERN_ERR "wacom driver registered\n");
+	return ret;
+}
+
+static void wacom_exit(void)
+{
+	hid_unregister_driver(&wacom_driver);
+}
+
+module_init(wacom_init);
+module_exit(wacom_exit);
+MODULE_LICENSE("GPL");
+
+HID_COMPAT_LOAD_DRIVER(wacom);
-- 
1.6.2




linux-2.6-iommu-fixes.patch:

--- NEW FILE linux-2.6-iommu-fixes.patch ---
commit c065567f392e05f0fda406369e1c8969c4411c68
Author: David Woodhouse <David.Woodhouse at intel.com>
Date:   Fri Apr 10 22:27:48 2009 -0700

    intel-iommu: Avoid panic() for DRHD at address zero.
    
    If the BIOS does something obviously stupid, like claiming that the
    registers for the IOMMU are at physical address zero, then print a nasty
    message and abort, rather than trying to set up the IOMMU and then later
    panicking.
    
    It's becoming more and more obvious that trusting this stuff to the BIOS
    was a mistake.
    
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
    (cherry picked from commit e523b38e2f568af58baa13120a994cbf24e6dee0)

commit 1d748e6cec8936af4c7044bdb51593a3f3904239
Author: David Woodhouse <David.Woodhouse at intel.com>
Date:   Mon Apr 6 13:30:01 2009 -0700

    intel-iommu: Fix oops in device_to_iommu() when devices not found.
    
    It's possible for a device in the drhd->devices[] array to be NULL if
    it wasn't found at boot time, which means we have to check for that
    case.
    
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
    (cherry picked from commit 4958c5dc7bcb2e42d985cd26aeafd8a7eca9ab1e)

commit 3bf17fdaaadea04d4d82be5930dff93ec737aeed
Author: David Woodhouse <David.Woodhouse at intel.com>
Date:   Sat Apr 4 00:39:25 2009 +0100

    intel-iommu: Fix device-to-iommu mapping for PCI-PCI bridges.
    
    When the DMAR table identifies that a PCI-PCI bridge belongs to a given
    IOMMU, that means that the bridge and all devices behind it should be
    associated with the IOMMU. Not just the bridge itself.
    
    This fixes the device_to_iommu() function accordingly.
    
    (It's broken if you have the same PCI bus numbers in multiple domains,
    but this function was always broken in that way; I'll be dealing with
    that later).
    
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
    (cherry picked from commit 924b6231edfaf1e764ffb4f97ea382bf4facff58)

commit 948852c81654aa8572a2bac1d2dfb1abfcc76ab2
Author: Linus Torvalds <torvalds at linux-foundation.org>
Date:   Tue Apr 7 07:59:41 2009 -0700

    Fix build errors due to CONFIG_BRANCH_TRACER=y
    
    The code that enables branch tracing for all (non-constant) branches
    plays games with the preprocessor and #define's the C 'if ()' construct
    to do tracing.
    
    That's all fine, but it fails for some unusual but valid C code that is
    sometimes used in macros, notably by the intel-iommu code:
    
    	if (i=drhd->iommu, drhd->ignored) ..
    
    because now the preprocessor complains about multiple arguments to the
    'if' macro.
    
    So make the macro expansion of this particularly horrid trick use
    varargs, and handle the case of comma-expressions in if-statements.  Use
    another macro to do it cleanly in just one place.
    
    This replaces a patch by David (and acked by Steven) that did this all
    inside that one already-too-horrid macro.
    
    Tested-by: Ingo Molnar <mingo at elte.hu>
    Cc: David Woodhouse <dwmw2 at infradead.org>
    Cc: Steven Rostedt <rostedt at goodmis.org>
    Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
    (cherry picked from commit aeeae86859f4319de0a4946b44771d9926eeed54)

commit 484abc37905056cc7b90a51311e6589bacd9ed65
Author: Fenghua Yu <fenghua.yu at intel.com>
Date:   Fri Mar 27 14:22:42 2009 -0700

    Intel IOMMU Suspend/Resume Support - DMAR
    
    This patch implements the suspend and resume feature for Intel IOMMU
    DMAR. It hooks to kernel suspend and resume interface. When suspend happens, it
    saves necessary hardware registers. When resume happens, it restores the
    registers and restarts IOMMU by enabling translation, setting up root entry, and
    re-enabling queued invalidation.
    
    Signed-off-by: Fenghua Yu <fenghua.yu at intel.com>
    Acked-by: Ingo Molnar <mingo at elte.hu>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>

commit 85e4b00c9d0378d7c19510d7bac8d5834b58edea
Author: David Woodhouse <David.Woodhouse at intel.com>
Date:   Fri Apr 10 15:15:05 2009 -0700

    Intel IOMMU Suspend/Resume Support - Queued Invalidation
    
    This patch supports queued invalidation suspend/resume.
    
    Signed-off-by: Fenghua Yu <fenghua.yu at intel.com>
    Acked-by: Ingo Molnar <mingo at elte.hu>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
    (cherry picked from commit eb4a52bc660ea835482c582eaaf4893742cbd160)

commit 28dde4ade0c005b78f0cd0bda03ed20fcdfc11ae
Author: David Woodhouse <David.Woodhouse at intel.com>
Date:   Fri Apr 3 15:19:32 2009 +0100

    intel-iommu: Add for_each_iommu() and for_each_active_iommu() macros
    
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
    Acked-by: Ingo Molnar <mingo at elte.hu>
    (cherry picked from commit 8f912ba4d7cdaf7d31cf39fe5a9b7732308a256d)

commit b35948e3225618ab7c1c7700eae0c9f4565f9199
Author: Suresh Siddha <suresh.b.siddha at intel.com>
Date:   Mon Mar 16 17:04:57 2009 -0700

    x86, dmar: start with sane state while enabling dma and interrupt-remapping
    
    Impact: cleanup/sanitization
    
    Start from a sane state while enabling dma and interrupt-remapping, by
    clearing the previous recorded faults and disabling previously
    enabled queued invalidation and interrupt-remapping.
    
    Signed-off-by: Suresh Siddha <suresh.b.siddha at intel.com>
    Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>
    (cherry picked from commit 1531a6a6b81a4e6f9eec9a5608758a6ea14b96e0)

commit 26c3c4ad26414ea9f66c56a27e394fc7ae937231
Author: Suresh Siddha <suresh.b.siddha at intel.com>
Date:   Mon Mar 16 17:04:56 2009 -0700

    x86, dmar: routines for disabling queued invalidation and intr remapping
    
    Impact: new interfaces (not yet used)
    
    Routines for disabling queued invalidation and interrupt remapping.
    
    Signed-off-by: Suresh Siddha <suresh.b.siddha at intel.com>
    Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>
    (cherry picked from commit eba67e5da6e971993b2899d2cdf459ce77d3dbc5)

commit 1c2f1031da6024fee999d2b115e31b40ff449405
Author: Suresh Siddha <suresh.b.siddha at intel.com>
Date:   Mon Mar 16 17:04:54 2009 -0700

    x86, dmar: move page fault handling code to dmar.c
    
    Impact: code movement
    
    Move page fault handling code to dmar.c
    This will be shared both by DMA-remapping and Intr-remapping code.
    
    Signed-off-by: Suresh Siddha <suresh.b.siddha at intel.com>
    Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>
    (cherry picked from commit 0ac2491f57af5644f88383d28809760902d6f4d7)
diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
index 26c536b..e095037 100644
--- a/drivers/pci/dmar.c
+++ b/drivers/pci/dmar.c
@@ -31,6 +31,8 @@
 #include <linux/iova.h>
 #include <linux/intel-iommu.h>
 #include <linux/timer.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
 
 #undef PREFIX
 #define PREFIX "DMAR:"
@@ -170,12 +172,21 @@ dmar_parse_one_drhd(struct acpi_dmar_header *header)
 	struct dmar_drhd_unit *dmaru;
 	int ret = 0;
 
+	drhd = (struct acpi_dmar_hardware_unit *)header;
+	if (!drhd->address) {
+		/* Promote an attitude of violence to a BIOS engineer today */
+		WARN(1, "Your BIOS is broken; DMAR reported at address zero!\n"
+		     "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
+		     dmi_get_system_info(DMI_BIOS_VENDOR),
+		     dmi_get_system_info(DMI_BIOS_VERSION),
+		     dmi_get_system_info(DMI_PRODUCT_VERSION));
+		return -ENODEV;
+	}
 	dmaru = kzalloc(sizeof(*dmaru), GFP_KERNEL);
 	if (!dmaru)
 		return -ENOMEM;
 
 	dmaru->hdr = header;
-	drhd = (struct acpi_dmar_hardware_unit *)header;
 	dmaru->reg_base_addr = drhd->address;
 	dmaru->include_all = drhd->flags & 0x1; /* BIT0: INCLUDE_ALL */
 
@@ -748,14 +759,77 @@ int qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr,
 }
 
 /*
+ * Disable Queued Invalidation interface.
+ */
+void dmar_disable_qi(struct intel_iommu *iommu)
+{
+	unsigned long flags;
+	u32 sts;
+	cycles_t start_time = get_cycles();
+
+	if (!ecap_qis(iommu->ecap))
+		return;
+
+	spin_lock_irqsave(&iommu->register_lock, flags);
+
+	sts =  dmar_readq(iommu->reg + DMAR_GSTS_REG);
+	if (!(sts & DMA_GSTS_QIES))
+		goto end;
+
+	/*
+	 * Give a chance to HW to complete the pending invalidation requests.
+	 */
+	while ((readl(iommu->reg + DMAR_IQT_REG) !=
+		readl(iommu->reg + DMAR_IQH_REG)) &&
+		(DMAR_OPERATION_TIMEOUT > (get_cycles() - start_time)))
+		cpu_relax();
+
+	iommu->gcmd &= ~DMA_GCMD_QIE;
+
+	writel(iommu->gcmd, iommu->reg + DMAR_GCMD_REG);
+
+	IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG, readl,
+		      !(sts & DMA_GSTS_QIES), sts);
+end:
+	spin_unlock_irqrestore(&iommu->register_lock, flags);
+}
+
+/*
+ * Enable queued invalidation.
+ */
+static void __dmar_enable_qi(struct intel_iommu *iommu)
+{
+	u32 cmd, sts;
+	unsigned long flags;
+	struct q_inval *qi = iommu->qi;
+
+	qi->free_head = qi->free_tail = 0;
+	qi->free_cnt = QI_LENGTH;
+
+	spin_lock_irqsave(&iommu->register_lock, flags);
+
+	/* write zero to the tail reg */
+	writel(0, iommu->reg + DMAR_IQT_REG);
+
+	dmar_writeq(iommu->reg + DMAR_IQA_REG, virt_to_phys(qi->desc));
+
+	cmd = iommu->gcmd | DMA_GCMD_QIE;
+	iommu->gcmd |= DMA_GCMD_QIE;
+	writel(cmd, iommu->reg + DMAR_GCMD_REG);
+
+	/* Make sure hardware complete it */
+	IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG, readl, (sts & DMA_GSTS_QIES), sts);
+
+	spin_unlock_irqrestore(&iommu->register_lock, flags);
+}
+
+/*
  * Enable Queued Invalidation interface. This is a must to support
  * interrupt-remapping. Also used by DMA-remapping, which replaces
  * register based IOTLB invalidation.
  */
 int dmar_enable_qi(struct intel_iommu *iommu)
 {
-	u32 cmd, sts;
-	unsigned long flags;
 	struct q_inval *qi;
 
 	if (!ecap_qis(iommu->ecap))
@@ -793,19 +867,218 @@ int dmar_enable_qi(struct intel_iommu *iommu)
 
 	spin_lock_init(&qi->q_lock);
 
-	spin_lock_irqsave(&iommu->register_lock, flags);
-	/* write zero to the tail reg */
-	writel(0, iommu->reg + DMAR_IQT_REG);
+	__dmar_enable_qi(iommu);
 
-	dmar_writeq(iommu->reg + DMAR_IQA_REG, virt_to_phys(qi->desc));
+	return 0;
+}
 
-	cmd = iommu->gcmd | DMA_GCMD_QIE;
-	iommu->gcmd |= DMA_GCMD_QIE;
-	writel(cmd, iommu->reg + DMAR_GCMD_REG);
+/* iommu interrupt handling. Most stuff are MSI-like. */
 
-	/* Make sure hardware complete it */
-	IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG, readl, (sts & DMA_GSTS_QIES), sts);
-	spin_unlock_irqrestore(&iommu->register_lock, flags);
+static const char *fault_reason_strings[] =
+{
+	"Software",
+	"Present bit in root entry is clear",
+	"Present bit in context entry is clear",
+	"Invalid context entry",
+	"Access beyond MGAW",
+	"PTE Write access is not set",
+	"PTE Read access is not set",
+	"Next page table ptr is invalid",
+	"Root table address invalid",
+	"Context table ptr is invalid",
+	"non-zero reserved fields in RTP",
+	"non-zero reserved fields in CTP",
+	"non-zero reserved fields in PTE",
+};
+#define MAX_FAULT_REASON_IDX 	(ARRAY_SIZE(fault_reason_strings) - 1)
+
+const char *dmar_get_fault_reason(u8 fault_reason)
+{
+	if (fault_reason > MAX_FAULT_REASON_IDX)
+		return "Unknown";
+	else
+		return fault_reason_strings[fault_reason];
+}
+
+void dmar_msi_unmask(unsigned int irq)
+{
+	struct intel_iommu *iommu = get_irq_data(irq);
+	unsigned long flag;
+
+	/* unmask it */
+	spin_lock_irqsave(&iommu->register_lock, flag);
+	writel(0, iommu->reg + DMAR_FECTL_REG);
+	/* Read a reg to force flush the post write */
+	readl(iommu->reg + DMAR_FECTL_REG);
+	spin_unlock_irqrestore(&iommu->register_lock, flag);
+}
+
+void dmar_msi_mask(unsigned int irq)
+{
+	unsigned long flag;
+	struct intel_iommu *iommu = get_irq_data(irq);
+
+	/* mask it */
+	spin_lock_irqsave(&iommu->register_lock, flag);
+	writel(DMA_FECTL_IM, iommu->reg + DMAR_FECTL_REG);
+	/* Read a reg to force flush the post write */
+	readl(iommu->reg + DMAR_FECTL_REG);
+	spin_unlock_irqrestore(&iommu->register_lock, flag);
+}
+
+void dmar_msi_write(int irq, struct msi_msg *msg)
+{
+	struct intel_iommu *iommu = get_irq_data(irq);
+	unsigned long flag;
+
+	spin_lock_irqsave(&iommu->register_lock, flag);
+	writel(msg->data, iommu->reg + DMAR_FEDATA_REG);
+	writel(msg->address_lo, iommu->reg + DMAR_FEADDR_REG);
+	writel(msg->address_hi, iommu->reg + DMAR_FEUADDR_REG);
+	spin_unlock_irqrestore(&iommu->register_lock, flag);
+}
+
+void dmar_msi_read(int irq, struct msi_msg *msg)
+{
+	struct intel_iommu *iommu = get_irq_data(irq);
+	unsigned long flag;
+
+	spin_lock_irqsave(&iommu->register_lock, flag);
+	msg->data = readl(iommu->reg + DMAR_FEDATA_REG);
+	msg->address_lo = readl(iommu->reg + DMAR_FEADDR_REG);
+	msg->address_hi = readl(iommu->reg + DMAR_FEUADDR_REG);
+	spin_unlock_irqrestore(&iommu->register_lock, flag);
+}
+
+static int dmar_fault_do_one(struct intel_iommu *iommu, int type,
+		u8 fault_reason, u16 source_id, unsigned long long addr)
+{
+	const char *reason;
+
+	reason = dmar_get_fault_reason(fault_reason);
+
+	printk(KERN_ERR
+		"DMAR:[%s] Request device [%02x:%02x.%d] "
+		"fault addr %llx \n"
+		"DMAR:[fault reason %02d] %s\n",
+		(type ? "DMA Read" : "DMA Write"),
+		(source_id >> 8), PCI_SLOT(source_id & 0xFF),
+		PCI_FUNC(source_id & 0xFF), addr, fault_reason, reason);
+	return 0;
+}
+
+#define PRIMARY_FAULT_REG_LEN (16)
+irqreturn_t dmar_fault(int irq, void *dev_id)
+{
+	struct intel_iommu *iommu = dev_id;
+	int reg, fault_index;
+	u32 fault_status;
+	unsigned long flag;
+
+	spin_lock_irqsave(&iommu->register_lock, flag);
+	fault_status = readl(iommu->reg + DMAR_FSTS_REG);
+
+	/* TBD: ignore advanced fault log currently */
+	if (!(fault_status & DMA_FSTS_PPF))
+		goto clear_overflow;
+
+	fault_index = dma_fsts_fault_record_index(fault_status);
+	reg = cap_fault_reg_offset(iommu->cap);
+	while (1) {
+		u8 fault_reason;
+		u16 source_id;
+		u64 guest_addr;
+		int type;
+		u32 data;
+
+		/* highest 32 bits */
+		data = readl(iommu->reg + reg +
+				fault_index * PRIMARY_FAULT_REG_LEN + 12);
+		if (!(data & DMA_FRCD_F))
+			break;
+
+		fault_reason = dma_frcd_fault_reason(data);
+		type = dma_frcd_type(data);
+
+		data = readl(iommu->reg + reg +
+				fault_index * PRIMARY_FAULT_REG_LEN + 8);
+		source_id = dma_frcd_source_id(data);
+
+		guest_addr = dmar_readq(iommu->reg + reg +
+				fault_index * PRIMARY_FAULT_REG_LEN);
+		guest_addr = dma_frcd_page_addr(guest_addr);
+		/* clear the fault */
+		writel(DMA_FRCD_F, iommu->reg + reg +
+			fault_index * PRIMARY_FAULT_REG_LEN + 12);
+
+		spin_unlock_irqrestore(&iommu->register_lock, flag);
+
+		dmar_fault_do_one(iommu, type, fault_reason,
+				source_id, guest_addr);
+
+		fault_index++;
+		if (fault_index > cap_num_fault_regs(iommu->cap))
+			fault_index = 0;
+		spin_lock_irqsave(&iommu->register_lock, flag);
+	}
+clear_overflow:
+	/* clear primary fault overflow */
+	fault_status = readl(iommu->reg + DMAR_FSTS_REG);
+	if (fault_status & DMA_FSTS_PFO)
+		writel(DMA_FSTS_PFO, iommu->reg + DMAR_FSTS_REG);
+
+	spin_unlock_irqrestore(&iommu->register_lock, flag);
+	return IRQ_HANDLED;
+}
+
+int dmar_set_interrupt(struct intel_iommu *iommu)
+{
+	int irq, ret;
+
+	irq = create_irq();
+	if (!irq) {
+		printk(KERN_ERR "IOMMU: no free vectors\n");
+		return -EINVAL;
+	}
+
+	set_irq_data(irq, iommu);
+	iommu->irq = irq;
+
+	ret = arch_setup_dmar_msi(irq);
+	if (ret) {
+		set_irq_data(irq, NULL);
+		iommu->irq = 0;
+		destroy_irq(irq);
+		return 0;
+	}
+
+	ret = request_irq(irq, dmar_fault, 0, iommu->name, iommu);
+	if (ret)
+		printk(KERN_ERR "IOMMU: can't request irq\n");
+	return ret;
+}
+
+/*
+ * Re-enable Queued Invalidation interface.
+ */
+int dmar_reenable_qi(struct intel_iommu *iommu)
+{
+	if (!ecap_qis(iommu->ecap))
+		return -ENOENT;
+
+	if (!iommu->qi)
+		return -ENOENT;
+
+	/*
+	 * First disable queued invalidation.
+	 */
+	dmar_disable_qi(iommu);
+	/*
+	 * Then enable queued invalidation again. Since there is no pending
+	 * invalidation requests now, it's safe to re-enable queued
+	 * invalidation.
+	 */
+	__dmar_enable_qi(iommu);
 
 	return 0;
 }
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index f3f6865..8e4ac13 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -36,6 +36,7 @@
 #include <linux/iova.h>
 #include <linux/iommu.h>
 #include <linux/intel-iommu.h>
+#include <linux/sysdev.h>
 #include <asm/cacheflush.h>
 #include <asm/iommu.h>
 #include "pci.h"
@@ -447,11 +448,17 @@ static struct intel_iommu *device_to_iommu(u8 bus, u8 devfn)
 		if (drhd->ignored)
 			continue;
 
-		for (i = 0; i < drhd->devices_cnt; i++)
+		for (i = 0; i < drhd->devices_cnt; i++) {
 			if (drhd->devices[i] &&
 			    drhd->devices[i]->bus->number == bus &&
 			    drhd->devices[i]->devfn == devfn)
 				return drhd->iommu;
+			if (drhd->devices[i] &&
+			    drhd->devices[i]->subordinate &&
+			    drhd->devices[i]->subordinate->number <= bus &&
+			    drhd->devices[i]->subordinate->subordinate >= bus)
+				return drhd->iommu;
+		}
 
 		if (drhd->include_all)
 			return drhd->iommu;
@@ -1004,194 +1011,6 @@ static int iommu_disable_translation(struct intel_iommu *iommu)
 	return 0;
 }
 
-/* iommu interrupt handling. Most stuff are MSI-like. */
-
-static const char *fault_reason_strings[] =
-{
-	"Software",
-	"Present bit in root entry is clear",
-	"Present bit in context entry is clear",
-	"Invalid context entry",
-	"Access beyond MGAW",
-	"PTE Write access is not set",
-	"PTE Read access is not set",
-	"Next page table ptr is invalid",
-	"Root table address invalid",
-	"Context table ptr is invalid",
-	"non-zero reserved fields in RTP",
-	"non-zero reserved fields in CTP",
-	"non-zero reserved fields in PTE",
-};
-#define MAX_FAULT_REASON_IDX 	(ARRAY_SIZE(fault_reason_strings) - 1)
-
-const char *dmar_get_fault_reason(u8 fault_reason)
-{
-	if (fault_reason > MAX_FAULT_REASON_IDX)
-		return "Unknown";
-	else
-		return fault_reason_strings[fault_reason];
-}
-
-void dmar_msi_unmask(unsigned int irq)
-{
-	struct intel_iommu *iommu = get_irq_data(irq);
-	unsigned long flag;
-
-	/* unmask it */
-	spin_lock_irqsave(&iommu->register_lock, flag);
-	writel(0, iommu->reg + DMAR_FECTL_REG);
-	/* Read a reg to force flush the post write */
-	readl(iommu->reg + DMAR_FECTL_REG);
-	spin_unlock_irqrestore(&iommu->register_lock, flag);
-}
-
-void dmar_msi_mask(unsigned int irq)
-{
-	unsigned long flag;
-	struct intel_iommu *iommu = get_irq_data(irq);
-
-	/* mask it */
-	spin_lock_irqsave(&iommu->register_lock, flag);
-	writel(DMA_FECTL_IM, iommu->reg + DMAR_FECTL_REG);
-	/* Read a reg to force flush the post write */
-	readl(iommu->reg + DMAR_FECTL_REG);
-	spin_unlock_irqrestore(&iommu->register_lock, flag);
-}
-
-void dmar_msi_write(int irq, struct msi_msg *msg)
-{
-	struct intel_iommu *iommu = get_irq_data(irq);
-	unsigned long flag;
-
-	spin_lock_irqsave(&iommu->register_lock, flag);
-	writel(msg->data, iommu->reg + DMAR_FEDATA_REG);
-	writel(msg->address_lo, iommu->reg + DMAR_FEADDR_REG);
-	writel(msg->address_hi, iommu->reg + DMAR_FEUADDR_REG);
-	spin_unlock_irqrestore(&iommu->register_lock, flag);
-}
-
-void dmar_msi_read(int irq, struct msi_msg *msg)
-{
-	struct intel_iommu *iommu = get_irq_data(irq);
-	unsigned long flag;
-
-	spin_lock_irqsave(&iommu->register_lock, flag);
-	msg->data = readl(iommu->reg + DMAR_FEDATA_REG);
-	msg->address_lo = readl(iommu->reg + DMAR_FEADDR_REG);
-	msg->address_hi = readl(iommu->reg + DMAR_FEUADDR_REG);
-	spin_unlock_irqrestore(&iommu->register_lock, flag);
-}
-
-static int iommu_page_fault_do_one(struct intel_iommu *iommu, int type,
-		u8 fault_reason, u16 source_id, unsigned long long addr)
-{
-	const char *reason;
-
-	reason = dmar_get_fault_reason(fault_reason);
-
-	printk(KERN_ERR
-		"DMAR:[%s] Request device [%02x:%02x.%d] "
-		"fault addr %llx \n"
-		"DMAR:[fault reason %02d] %s\n",
-		(type ? "DMA Read" : "DMA Write"),
-		(source_id >> 8), PCI_SLOT(source_id & 0xFF),
-		PCI_FUNC(source_id & 0xFF), addr, fault_reason, reason);
-	return 0;
-}
-
-#define PRIMARY_FAULT_REG_LEN (16)
-static irqreturn_t iommu_page_fault(int irq, void *dev_id)
-{
-	struct intel_iommu *iommu = dev_id;
-	int reg, fault_index;
-	u32 fault_status;
-	unsigned long flag;
-
-	spin_lock_irqsave(&iommu->register_lock, flag);
-	fault_status = readl(iommu->reg + DMAR_FSTS_REG);
-
-	/* TBD: ignore advanced fault log currently */
-	if (!(fault_status & DMA_FSTS_PPF))
-		goto clear_overflow;
-
-	fault_index = dma_fsts_fault_record_index(fault_status);
-	reg = cap_fault_reg_offset(iommu->cap);
-	while (1) {
-		u8 fault_reason;
-		u16 source_id;
-		u64 guest_addr;
-		int type;
-		u32 data;
-
-		/* highest 32 bits */
-		data = readl(iommu->reg + reg +
-				fault_index * PRIMARY_FAULT_REG_LEN + 12);
-		if (!(data & DMA_FRCD_F))
-			break;
-
-		fault_reason = dma_frcd_fault_reason(data);
-		type = dma_frcd_type(data);
-
-		data = readl(iommu->reg + reg +
-				fault_index * PRIMARY_FAULT_REG_LEN + 8);
-		source_id = dma_frcd_source_id(data);
-
-		guest_addr = dmar_readq(iommu->reg + reg +
-				fault_index * PRIMARY_FAULT_REG_LEN);
-		guest_addr = dma_frcd_page_addr(guest_addr);
-		/* clear the fault */
-		writel(DMA_FRCD_F, iommu->reg + reg +
-			fault_index * PRIMARY_FAULT_REG_LEN + 12);
-
-		spin_unlock_irqrestore(&iommu->register_lock, flag);
-
-		iommu_page_fault_do_one(iommu, type, fault_reason,
-				source_id, guest_addr);
-
-		fault_index++;
-		if (fault_index > cap_num_fault_regs(iommu->cap))
-			fault_index = 0;
-		spin_lock_irqsave(&iommu->register_lock, flag);
-	}
-clear_overflow:
-	/* clear primary fault overflow */
-	fault_status = readl(iommu->reg + DMAR_FSTS_REG);
-	if (fault_status & DMA_FSTS_PFO)
-		writel(DMA_FSTS_PFO, iommu->reg + DMAR_FSTS_REG);
-
-	spin_unlock_irqrestore(&iommu->register_lock, flag);
-	return IRQ_HANDLED;
-}
-
-int dmar_set_interrupt(struct intel_iommu *iommu)
-{
-	int irq, ret;
-
-	irq = create_irq();
-	if (!irq) {
-		printk(KERN_ERR "IOMMU: no free vectors\n");
-		return -EINVAL;
-	}
-
-	set_irq_data(irq, iommu);
-	iommu->irq = irq;
-
-	ret = arch_setup_dmar_msi(irq);
-	if (ret) {
-		set_irq_data(irq, NULL);
-		iommu->irq = 0;
-		destroy_irq(irq);
-		return 0;
-	}
-
-	/* Force fault register is cleared */
-	iommu_page_fault(irq, iommu);
-
-	ret = request_irq(irq, iommu_page_fault, 0, iommu->name, iommu);
-	if (ret)
-		printk(KERN_ERR "IOMMU: can't request irq\n");
-	return ret;
-}
 
 static int iommu_init_domains(struct intel_iommu *iommu)
 {
@@ -2043,11 +1862,40 @@ static int __init init_dmars(void)
 		}
 	}
 
+	/*
+	 * Start from the sane iommu hardware state.
+	 */
 	for_each_drhd_unit(drhd) {
 		if (drhd->ignored)
 			continue;
 
 		iommu = drhd->iommu;
+
+		/*
+		 * If the queued invalidation is already initialized by us
+		 * (for example, while enabling interrupt-remapping) then
+		 * we got the things already rolling from a sane state.
+		 */
+		if (iommu->qi)
+			continue;
+
+		/*
+		 * Clear any previous faults.
+		 */
+		dmar_fault(-1, iommu);
+		/*
+		 * Disable queued invalidation if supported and already enabled
+		 * before OS handover.
+		 */
+		dmar_disable_qi(iommu);
+	}
+
+	for_each_drhd_unit(drhd) {
+		if (drhd->ignored)
+			continue;
+
+		iommu = drhd->iommu;
+
 		if (dmar_enable_qi(iommu)) {
 			/*
 			 * Queued Invalidate not enabled, use Register Based
@@ -2707,6 +2555,150 @@ static void __init init_no_remapping_devices(void)
 	}
 }
 
+#ifdef CONFIG_SUSPEND
+static int init_iommu_hw(void)
+{
+	struct dmar_drhd_unit *drhd;
+	struct intel_iommu *iommu = NULL;
+
+	for_each_active_iommu(iommu, drhd)
+		if (iommu->qi)
+			dmar_reenable_qi(iommu);
+
+	for_each_active_iommu(iommu, drhd) {
+		iommu_flush_write_buffer(iommu);
+
+		iommu_set_root_entry(iommu);
+
+		iommu->flush.flush_context(iommu, 0, 0, 0,
+						DMA_CCMD_GLOBAL_INVL, 0);
+		iommu->flush.flush_iotlb(iommu, 0, 0, 0,
+						DMA_TLB_GLOBAL_FLUSH, 0);
+		iommu_disable_protect_mem_regions(iommu);
+		iommu_enable_translation(iommu);
+	}
+
+	return 0;
+}
+
+static void iommu_flush_all(void)
+{
+	struct dmar_drhd_unit *drhd;
+	struct intel_iommu *iommu;
+
+	for_each_active_iommu(iommu, drhd) {
+		iommu->flush.flush_context(iommu, 0, 0, 0,
+						DMA_CCMD_GLOBAL_INVL, 0);
+		iommu->flush.flush_iotlb(iommu, 0, 0, 0,
+						DMA_TLB_GLOBAL_FLUSH, 0);
+	}
+}
+
+static int iommu_suspend(struct sys_device *dev, pm_message_t state)
+{
+	struct dmar_drhd_unit *drhd;
+	struct intel_iommu *iommu = NULL;
+	unsigned long flag;
+
+	for_each_active_iommu(iommu, drhd) {
+		iommu->iommu_state = kzalloc(sizeof(u32) * MAX_SR_DMAR_REGS,
+						 GFP_ATOMIC);
+		if (!iommu->iommu_state)
+			goto nomem;
+	}
+
+	iommu_flush_all();
+
+	for_each_active_iommu(iommu, drhd) {
+		iommu_disable_translation(iommu);
+
+		spin_lock_irqsave(&iommu->register_lock, flag);
+
+		iommu->iommu_state[SR_DMAR_FECTL_REG] =
+			readl(iommu->reg + DMAR_FECTL_REG);
+		iommu->iommu_state[SR_DMAR_FEDATA_REG] =
+			readl(iommu->reg + DMAR_FEDATA_REG);
+		iommu->iommu_state[SR_DMAR_FEADDR_REG] =
+			readl(iommu->reg + DMAR_FEADDR_REG);
+		iommu->iommu_state[SR_DMAR_FEUADDR_REG] =
+			readl(iommu->reg + DMAR_FEUADDR_REG);
+
+		spin_unlock_irqrestore(&iommu->register_lock, flag);
+	}
+	return 0;
+
+nomem:
+	for_each_active_iommu(iommu, drhd)
+		kfree(iommu->iommu_state);
+
+	return -ENOMEM;
+}
+
+static int iommu_resume(struct sys_device *dev)
+{
+	struct dmar_drhd_unit *drhd;
+	struct intel_iommu *iommu = NULL;
+	unsigned long flag;
+
+	if (init_iommu_hw()) {
+		WARN(1, "IOMMU setup failed, DMAR can not resume!\n");
+		return -EIO;
+	}
+
+	for_each_active_iommu(iommu, drhd) {
+
+		spin_lock_irqsave(&iommu->register_lock, flag);
+
+		writel(iommu->iommu_state[SR_DMAR_FECTL_REG],
+			iommu->reg + DMAR_FECTL_REG);
+		writel(iommu->iommu_state[SR_DMAR_FEDATA_REG],
+			iommu->reg + DMAR_FEDATA_REG);
+		writel(iommu->iommu_state[SR_DMAR_FEADDR_REG],
+			iommu->reg + DMAR_FEADDR_REG);
+		writel(iommu->iommu_state[SR_DMAR_FEUADDR_REG],
+			iommu->reg + DMAR_FEUADDR_REG);
+
+		spin_unlock_irqrestore(&iommu->register_lock, flag);
+	}
+
+	for_each_active_iommu(iommu, drhd)
+		kfree(iommu->iommu_state);
+
+	return 0;
+}
+
+static struct sysdev_class iommu_sysclass = {
+	.name		= "iommu",
+	.resume		= iommu_resume,
+	.suspend	= iommu_suspend,
+};
+
+static struct sys_device device_iommu = {
+	.cls	= &iommu_sysclass,
+};
+
+static int __init init_iommu_sysfs(void)
+{
+	int error;
+
+	error = sysdev_class_register(&iommu_sysclass);
+	if (error)
+		return error;
+
+	error = sysdev_register(&device_iommu);
+	if (error)
+		sysdev_class_unregister(&iommu_sysclass);
+
+	return error;
+}
+
+#else
+static int __init init_iommu_sysfs(void)
+{
+	return 0;
+}
+#endif	/* CONFIG_PM */
+
 int __init intel_iommu_init(void)
 {
 	int ret = 0;
@@ -2742,6 +2734,7 @@ int __init intel_iommu_init(void)
 	init_timer(&unmap_timer);
 	force_iommu = 1;
 	dma_ops = &intel_dma_ops;
+	init_iommu_sysfs();
 
 	register_iommu(&intel_iommu_ops);
 
diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
index 45effc5..0a490fe 100644
--- a/drivers/pci/intr_remapping.c
+++ b/drivers/pci/intr_remapping.c
@@ -458,11 +458,55 @@ static int setup_intr_remapping(struct intel_iommu *iommu, int mode)
 	return 0;
 }
 
+/*
+ * Disable Interrupt Remapping.
+ */
+static void disable_intr_remapping(struct intel_iommu *iommu)
+{
+	unsigned long flags;
+	u32 sts;
+
+	if (!ecap_ir_support(iommu->ecap))
+		return;
+
+	spin_lock_irqsave(&iommu->register_lock, flags);
+
+	sts = dmar_readq(iommu->reg + DMAR_GSTS_REG);
+	if (!(sts & DMA_GSTS_IRES))
+		goto end;
+
+	iommu->gcmd &= ~DMA_GCMD_IRE;
+	writel(iommu->gcmd, iommu->reg + DMAR_GCMD_REG);
+
+	IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG,
+		      readl, !(sts & DMA_GSTS_IRES), sts);
+
+end:
+	spin_unlock_irqrestore(&iommu->register_lock, flags);
+}
+
 int __init enable_intr_remapping(int eim)
 {
 	struct dmar_drhd_unit *drhd;
 	int setup = 0;
 
+	for_each_drhd_unit(drhd) {
+		struct intel_iommu *iommu = drhd->iommu;
+
+		/*
+		 * Clear previous faults.
+		 */
+		dmar_fault(-1, iommu);
+
+		/*
+		 * Disable intr remapping and queued invalidation, if already
+		 * enabled prior to OS handover.
+		 */
+		disable_intr_remapping(iommu);
+
+		dmar_disable_qi(iommu);
+	}
+
 	/*
 	 * check for the Interrupt-remapping support
 	 */
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index d95da10..fd4b619 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -113,7 +113,9 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
  * "Define 'is'", Bill Clinton
  * "Define 'if'", Steven Rostedt
  */
-#define if(cond) if (__builtin_constant_p((cond)) ? !!(cond) :		\
+#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
+#define __trace_if(cond) \
+	if (__builtin_constant_p((cond)) ? !!(cond) :			\
 	({								\
 		int ______r;						\
 		static struct ftrace_branch_data			\
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index f284407..b967e93 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -24,6 +24,7 @@
 #include <linux/acpi.h>
 #include <linux/types.h>
 #include <linux/msi.h>
+#include <linux/irqreturn.h>
 
 #if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP)
 struct intel_iommu;
@@ -44,6 +45,14 @@ extern struct list_head dmar_drhd_units;
 #define for_each_drhd_unit(drhd) \
 	list_for_each_entry(drhd, &dmar_drhd_units, list)
 
+#define for_each_active_iommu(i, drhd)					\
+	list_for_each_entry(drhd, &dmar_drhd_units, list)		\
+		if (i=drhd->iommu, drhd->ignored) {} else
+
+#define for_each_iommu(i, drhd)						\
+	list_for_each_entry(drhd, &dmar_drhd_units, list)		\
+		if (i=drhd->iommu, 0) {} else 
+
 extern int dmar_table_init(void);
 extern int dmar_dev_scope_init(void);
 
@@ -127,6 +136,7 @@ extern void dmar_msi_mask(unsigned int irq);
 extern void dmar_msi_read(int irq, struct msi_msg *msg);
 extern void dmar_msi_write(int irq, struct msi_msg *msg);
 extern int dmar_set_interrupt(struct intel_iommu *iommu);
+extern irqreturn_t dmar_fault(int irq, void *dev_id);
 extern int arch_setup_dmar_msi(unsigned int irq);
 
 extern int iommu_detected, no_iommu;
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index d2e3cbf..6520e07 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -284,6 +284,14 @@ struct iommu_flush {
 		unsigned int size_order, u64 type, int non_present_entry_flush);
 };
 
+enum {
+	SR_DMAR_FECTL_REG,
+	SR_DMAR_FEDATA_REG,
+	SR_DMAR_FEADDR_REG,
+	SR_DMAR_FEUADDR_REG,
+	MAX_SR_DMAR_REGS
+};
+
 struct intel_iommu {
 	void __iomem	*reg; /* Pointer to hardware regs, virtual addr */
 	u64		cap;
@@ -304,6 +312,8 @@ struct intel_iommu {
 	struct iommu_flush flush;
 #endif
 	struct q_inval  *qi;            /* Queued invalidation info */
+	u32 *iommu_state; /* Store iommu states between suspend and resume.*/
+
 #ifdef CONFIG_INTR_REMAP
 	struct ir_table *ir_table;	/* Interrupt remapping info */
 #endif
@@ -321,6 +331,8 @@ extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev);
 extern int alloc_iommu(struct dmar_drhd_unit *drhd);
 extern void free_iommu(struct intel_iommu *iommu);
 extern int dmar_enable_qi(struct intel_iommu *iommu);
+extern void dmar_disable_qi(struct intel_iommu *iommu);
+extern int dmar_reenable_qi(struct intel_iommu *iommu);
 extern void qi_global_iec(struct intel_iommu *iommu);
 
 extern int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid,

linux-2.6-iwl3945-report-killswitch-changes-even-if-the-interface-is-down.patch:

--- NEW FILE linux-2.6-iwl3945-report-killswitch-changes-even-if-the-interface-is-down.patch ---
Back-port of commit pending for 2.6.30...

commit 9a454abf066ab588ef28ff9d2c04cc480d13c040
Author: Helmut Schaa <helmut.schaa at googlemail.com>
Date:   Thu Jan 15 09:38:44 2009 +0100

    iwl3945: report killswitch changes even if the interface is down

    Currently iwl3945 is not able to report hw-killswitch events while the
    interface is down. This has implications on user space tools (like
    NetworkManager) relying on rfkill notifications to bring the interface
    up once the wireless gets enabled through a hw killswitch.

    Thus, enable the device already in iwl3945_pci_probe instead of iwl3945_up
    and poll the CSR_GP_CNTRL register to update the killswitch state every
    two seconds. The polling is only needed on 3945 hardware as this adapter
    does not use interrupts to signal rfkill changes to the driver (in case no
    firmware is loaded). The firmware loading is still done in iwl3945_up.

    Signed-off-by: Helmut Schaa <helmut.schaa at googlemail.com>
    Acked-by: Samuel Ortiz <samuel.ortiz at intel.com>
    Signed-off-by: John W. Linville <linville at tuxdriver.com>

diff -up linux-2.6.29.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c.orig linux-2.6.29.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c
--- linux-2.6.29.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c.orig	2009-04-02 14:21:18.000000000 -0400
+++ linux-2.6.29.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c	2009-04-02 14:21:22.000000000 -0400
@@ -6001,7 +6001,8 @@ static void iwl3945_bg_rf_kill(struct wo
 		IWL_DEBUG(IWL_DL_INFO | IWL_DL_RF_KILL,
 			  "HW and/or SW RF Kill no longer active, restarting "
 			  "device\n");
-		if (!test_bit(STATUS_EXIT_PENDING, &priv->status))
+		if (!test_bit(STATUS_EXIT_PENDING, &priv->status) &&
+		     test_bit(STATUS_ALIVE, &priv->status))
 			queue_work(priv->workqueue, &priv->restart);
 	} else {
 
@@ -6018,6 +6019,25 @@ static void iwl3945_bg_rf_kill(struct wo
 	iwl3945_rfkill_set_hw_state(priv);
 }
 
+static void iwl3945_rfkill_poll(struct work_struct *data)
+{
+	struct iwl3945_priv *priv =
+	    container_of(data, struct iwl3945_priv, rfkill_poll.work);
+	unsigned long status = priv->status;
+
+	if (iwl3945_read32(priv, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
+		clear_bit(STATUS_RF_KILL_HW, &priv->status);
+	else
+		set_bit(STATUS_RF_KILL_HW, &priv->status);
+
+	if (test_bit(STATUS_RF_KILL_HW, &status) != test_bit(STATUS_RF_KILL_HW, &priv->status))
+		queue_work(priv->workqueue, &priv->rf_kill);
+
+	queue_delayed_work(priv->workqueue, &priv->rfkill_poll,
+			   round_jiffies_relative(2 * HZ));
+
+}
+
 #define IWL_SCAN_CHECK_WATCHDOG (7 * HZ)
 
 static void iwl3945_bg_scan_check(struct work_struct *data)
@@ -6420,20 +6440,6 @@ static int iwl3945_mac_start(struct ieee
 
 	IWL_DEBUG_MAC80211("enter\n");
 
-	if (pci_enable_device(priv->pci_dev)) {
-		IWL_ERROR("Fail to pci_enable_device\n");
-		return -ENODEV;
-	}
-	pci_restore_state(priv->pci_dev);
-	pci_enable_msi(priv->pci_dev);
-
-	ret = request_irq(priv->pci_dev->irq, iwl3945_isr, IRQF_SHARED,
-			  DRV_NAME, priv);
-	if (ret) {
-		IWL_ERROR("Error allocating IRQ %d\n", priv->pci_dev->irq);
-		goto out_disable_msi;
-	}
-
 	/* we should be verifying the device is ready to be opened */
 	mutex_lock(&priv->mutex);
 
@@ -6478,15 +6484,15 @@ static int iwl3945_mac_start(struct ieee
 		}
 	}
 
+	/* ucode is running and will send rfkill notifications,
+	 * no need to poll the killswitch state anymore */
+	cancel_delayed_work(&priv->rfkill_poll);
+
 	priv->is_open = 1;
 	IWL_DEBUG_MAC80211("leave\n");
 	return 0;
 
 out_release_irq:
-	free_irq(priv->pci_dev->irq, priv);
-out_disable_msi:
-	pci_disable_msi(priv->pci_dev);
-	pci_disable_device(priv->pci_dev);
 	priv->is_open = 0;
 	IWL_DEBUG_MAC80211("leave - failed\n");
 	return ret;
@@ -6517,10 +6523,10 @@ static void iwl3945_mac_stop(struct ieee
 	iwl3945_down(priv);
 
 	flush_workqueue(priv->workqueue);
-	free_irq(priv->pci_dev->irq, priv);
-	pci_disable_msi(priv->pci_dev);
-	pci_save_state(priv->pci_dev);
-	pci_disable_device(priv->pci_dev);
+
+	/* start polling the killswitch state again */
+	queue_delayed_work(priv->workqueue, &priv->rfkill_poll,
+			   round_jiffies_relative(2 * HZ));
 
 	IWL_DEBUG_MAC80211("leave\n");
 }
@@ -7735,6 +7741,7 @@ static void iwl3945_setup_deferred_work(
 	INIT_DELAYED_WORK(&priv->init_alive_start, iwl3945_bg_init_alive_start);
 	INIT_DELAYED_WORK(&priv->alive_start, iwl3945_bg_alive_start);
 	INIT_DELAYED_WORK(&priv->scan_check, iwl3945_bg_scan_check);
+	INIT_DELAYED_WORK(&priv->rfkill_poll, iwl3945_rfkill_poll);
 
 	iwl3945_hw_setup_deferred_work(priv);
 
@@ -8007,24 +8014,27 @@ static int iwl3945_pci_probe(struct pci_
 	iwl3945_disable_interrupts(priv);
 	spin_unlock_irqrestore(&priv->lock, flags);
 
+	pci_enable_msi(priv->pci_dev);
+
+	err = request_irq(priv->pci_dev->irq, iwl3945_isr, IRQF_SHARED,
+			  DRV_NAME, priv);
+	if (err) {
+		IWL_ERROR("Error allocating IRQ %d\n", priv->pci_dev->irq);
+		goto out_disable_msi;
+	}
+
 	err = sysfs_create_group(&pdev->dev.kobj, &iwl3945_attribute_group);
 	if (err) {
 		IWL_ERROR("failed to create sysfs device attributes\n");
-		goto out_free_geos;
+		goto out_release_irq;
 	}
 
 	iwl3945_set_rxon_channel(priv, IEEE80211_BAND_2GHZ, 6);
 	iwl3945_setup_deferred_work(priv);
 	iwl3945_setup_rx_handlers(priv);
 
-	/***********************
-	 * 9. Conclude
-	 * ********************/
-	pci_save_state(pdev);
-	pci_disable_device(pdev);
-
 	/*********************************
-	 * 10. Setup and Register mac80211
+	 * 9. Setup and Register mac80211
 	 * *******************************/
 
 	err = ieee80211_register_hw(priv->hw);
@@ -8042,13 +8052,20 @@ static int iwl3945_pci_probe(struct pci_
 		IWL_ERROR("Unable to initialize RFKILL system. "
 				  "Ignoring error: %d\n", err);
 
+	/* Start monitoring the killswitch */
+	queue_delayed_work(priv->workqueue, &priv->rfkill_poll,
+			   2 * HZ);
+
 	return 0;
 
  out_remove_sysfs:
 	destroy_workqueue(priv->workqueue);
 	priv->workqueue = NULL;
 	sysfs_remove_group(&pdev->dev.kobj, &iwl3945_attribute_group);
- out_free_geos:
+ out_release_irq:
+	free_irq(priv->pci_dev->irq, priv);
+ out_disable_msi:
+	pci_disable_msi(priv->pci_dev);
 	iwl3945_free_geos(priv);
  out_free_channel_map:
 	iwl3945_free_channel_map(priv);
@@ -8093,6 +8110,8 @@ static void __devexit iwl3945_pci_remove
 	sysfs_remove_group(&pdev->dev.kobj, &iwl3945_attribute_group);
 
 	iwl3945_rfkill_unregister(priv);
+	cancel_delayed_work(&priv->rfkill_poll);
+
 	iwl3945_dealloc_ucode_pci(priv);
 
 	if (priv->rxq.bd)
@@ -8114,6 +8133,9 @@ static void __devexit iwl3945_pci_remove
 	destroy_workqueue(priv->workqueue);
 	priv->workqueue = NULL;
 
+	free_irq(pdev->irq, priv);
+	pci_disable_msi(pdev);
+
 	pci_iounmap(pdev, priv->hw_base);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
@@ -8140,19 +8162,8 @@ static int iwl3945_pci_suspend(struct pc
 		priv->is_open = 1;
 	}
 
-	/* pci driver assumes state will be saved in this function.
-	 * pci state is saved and device disabled when interface is
-	 * stopped, so at this time pci device will always be disabled -
-	 * whether interface was started or not. saving pci state now will
-	 * cause saved state be that of a disabled device, which will cause
-	 * problems during resume in that we will end up with a disabled device.
-	 *
-	 * indicate that the current saved state (from when interface was
-	 * stopped) is valid. if interface was never up at time of suspend
-	 * then the saved state will still be valid as it was saved during
-	 * .probe. */
-	pdev->state_saved = true;
-
+	pci_save_state(pdev);
+	pci_disable_device(pdev);
 	pci_set_power_state(pdev, PCI_D3hot);
 
 	return 0;
@@ -8163,6 +8174,8 @@ static int iwl3945_pci_resume(struct pci
 	struct iwl3945_priv *priv = pci_get_drvdata(pdev);
 
 	pci_set_power_state(pdev, PCI_D0);
+	pci_enable_device(pdev);
+	pci_restore_state(pdev);
 
 	if (priv->is_open)
 		iwl3945_mac_start(priv->hw);
diff -up linux-2.6.29.noarch/drivers/net/wireless/iwlwifi/iwl-3945.h.orig linux-2.6.29.noarch/drivers/net/wireless/iwlwifi/iwl-3945.h
--- linux-2.6.29.noarch/drivers/net/wireless/iwlwifi/iwl-3945.h.orig	2009-04-02 14:21:36.000000000 -0400
+++ linux-2.6.29.noarch/drivers/net/wireless/iwlwifi/iwl-3945.h	2009-04-02 14:21:45.000000000 -0400
@@ -895,6 +895,7 @@ struct iwl3945_priv {
 	struct delayed_work thermal_periodic;
 	struct delayed_work gather_stats;
 	struct delayed_work scan_check;
+	struct delayed_work rfkill_poll;
 
 #define IWL_DEFAULT_TX_POWER 0x0F
 	s8 user_txpower_limit;

linux-2.6-iwlagn-fix-hw-rfkill-while-the-interface-is-down.patch:

--- NEW FILE linux-2.6-iwlagn-fix-hw-rfkill-while-the-interface-is-down.patch ---
Back-port of commit pending for 2.6.30...

commit f44035116d6ab7d0677874709fb864b2dc75a996
Author: Helmut Schaa <helmut.schaa at googlemail.com>
Date:   Mon Jan 19 13:10:07 2009 +0100

    iwlagn: fix hw-rfkill while the interface is down
    
    Currently iwlagn is not able to report hw-killswitch events while the
    interface is down. This has implications on user space tools (like
    NetworkManager) relying on rfkill notifications to bring the interface
    up once the wireless gets enabled through a hw killswitch.
    
    Thus, enable the device already in iwl_pci_probe instead of iwl_up
    and enable interrups while the interface is down in order to get
    notified about killswitch state changes. The firmware loading is still
    done in iwl_up.
    
    Signed-off-by: Helmut Schaa <helmut.schaa at googlemail.com>
    Acked-by: Reinette Chatre <reinette.chatre at intel.com>
    Signed-off-by: John W. Linville <linville at tuxdriver.com>

diff -up linux-2.6.29.noarch/drivers/net/wireless/iwlwifi/iwl-agn.c.orig linux-2.6.29.noarch/drivers/net/wireless/iwlwifi/iwl-agn.c
--- linux-2.6.29.noarch/drivers/net/wireless/iwlwifi/iwl-agn.c.orig	2009-03-23 19:12:14.000000000 -0400
+++ linux-2.6.29.noarch/drivers/net/wireless/iwlwifi/iwl-agn.c	2009-04-02 14:15:36.000000000 -0400
@@ -1397,13 +1397,16 @@ static void iwl_irq_tasklet(struct iwl_p
 				hw_rf_kill ? "disable radio" : "enable radio");
 
 		/* driver only loads ucode once setting the interface up.
-		 * the driver as well won't allow loading if RFKILL is set
-		 * therefore no need to restart the driver from this handler
+		 * the driver allows loading the ucode even if the radio
+		 * is killed. Hence update the killswitch state here. The
+		 * rfkill handler will care about restarting if needed.
 		 */
-		if (!hw_rf_kill && !test_bit(STATUS_ALIVE, &priv->status)) {
-			clear_bit(STATUS_RF_KILL_HW, &priv->status);
-			if (priv->is_open && !iwl_is_rfkill(priv))
-				queue_work(priv->workqueue, &priv->up);
+		if (!test_bit(STATUS_ALIVE, &priv->status)) {
+			if (hw_rf_kill)
+				set_bit(STATUS_RF_KILL_HW, &priv->status);
+			else
+				clear_bit(STATUS_RF_KILL_HW, &priv->status);
+			queue_work(priv->workqueue, &priv->rf_kill);
 		}
 
 		handled |= CSR_INT_BIT_RF_KILL;
@@ -2156,7 +2159,8 @@ static void iwl_bg_rf_kill(struct work_s
 		IWL_DEBUG(IWL_DL_RF_KILL,
 			  "HW and/or SW RF Kill no longer active, restarting "
 			  "device\n");
-		if (!test_bit(STATUS_EXIT_PENDING, &priv->status))
+		if (!test_bit(STATUS_EXIT_PENDING, &priv->status) &&
+		     test_bit(STATUS_ALIVE, &priv->status))
 			queue_work(priv->workqueue, &priv->restart);
 	} else {
 		/* make sure mac80211 stop sending Tx frame */
@@ -2353,31 +2357,9 @@ static int iwl_mac_start(struct ieee8021
 {
 	struct iwl_priv *priv = hw->priv;
 	int ret;
-	u16 pci_cmd;
 
 	IWL_DEBUG_MAC80211("enter\n");
 
-	if (pci_enable_device(priv->pci_dev)) {
-		IWL_ERROR("Fail to pci_enable_device\n");
-		return -ENODEV;
-	}
-	pci_restore_state(priv->pci_dev);
-	pci_enable_msi(priv->pci_dev);
-
-	/* enable interrupts if needed: hw bug w/a */
-	pci_read_config_word(priv->pci_dev, PCI_COMMAND, &pci_cmd);
-	if (pci_cmd & PCI_COMMAND_INTX_DISABLE) {
-		pci_cmd &= ~PCI_COMMAND_INTX_DISABLE;
-		pci_write_config_word(priv->pci_dev, PCI_COMMAND, pci_cmd);
-	}
-
-	ret = request_irq(priv->pci_dev->irq, iwl_isr, IRQF_SHARED,
-			  DRV_NAME, priv);
-	if (ret) {
-		IWL_ERROR("Error allocating IRQ %d\n", priv->pci_dev->irq);
-		goto out_disable_msi;
-	}
-
 	/* we should be verifying the device is ready to be opened */
 	mutex_lock(&priv->mutex);
 
@@ -2390,7 +2372,7 @@ static int iwl_mac_start(struct ieee8021
 		if (ret) {
 			IWL_ERROR("Could not read microcode: %d\n", ret);
 			mutex_unlock(&priv->mutex);
-			goto out_release_irq;
+			return ret;
 		}
 	}
 
@@ -2401,7 +2383,7 @@ static int iwl_mac_start(struct ieee8021
 	iwl_rfkill_set_hw_state(priv);
 
 	if (ret)
-		goto out_release_irq;
+		return ret;
 
 	if (iwl_is_rfkill(priv))
 		goto out;
@@ -2420,8 +2402,7 @@ static int iwl_mac_start(struct ieee8021
 		if (!test_bit(STATUS_READY, &priv->status)) {
 			IWL_ERROR("START_ALIVE timeout after %dms.\n",
 				jiffies_to_msecs(UCODE_READY_TIMEOUT));
-			ret = -ETIMEDOUT;
-			goto out_release_irq;
+			return -ETIMEDOUT;
 		}
 	}
 
@@ -2429,15 +2410,6 @@ out:
 	priv->is_open = 1;
 	IWL_DEBUG_MAC80211("leave\n");
 	return 0;
-
-out_release_irq:
-	free_irq(priv->pci_dev->irq, priv);
-out_disable_msi:
-	pci_disable_msi(priv->pci_dev);
-	pci_disable_device(priv->pci_dev);
-	priv->is_open = 0;
-	IWL_DEBUG_MAC80211("leave - failed\n");
-	return ret;
 }
 
 static void iwl_mac_stop(struct ieee80211_hw *hw)
@@ -2465,10 +2437,10 @@ static void iwl_mac_stop(struct ieee8021
 	iwl_down(priv);
 
 	flush_workqueue(priv->workqueue);
-	free_irq(priv->pci_dev->irq, priv);
-	pci_disable_msi(priv->pci_dev);
-	pci_save_state(priv->pci_dev);
-	pci_disable_device(priv->pci_dev);
+
+	/* enable interrupts again in order to receive rfkill changes */
+	iwl_write32(priv, CSR_INT, 0xFFFFFFFF);
+	iwl_enable_interrupts(priv);
 
 	IWL_DEBUG_MAC80211("leave\n");
 }
@@ -3764,6 +3736,7 @@ static int iwl_pci_probe(struct pci_dev 
 	struct ieee80211_hw *hw;
 	struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data);
 	unsigned long flags;
+	u16 pci_cmd;
 
 	/************************
 	 * 1. Allocating HW data
@@ -3909,26 +3882,36 @@ static int iwl_pci_probe(struct pci_dev 
 	iwl_disable_interrupts(priv);
 	spin_unlock_irqrestore(&priv->lock, flags);
 
+	pci_enable_msi(priv->pci_dev);
+
+	err = request_irq(priv->pci_dev->irq, iwl_isr, IRQF_SHARED,
+			  DRV_NAME, priv);
+	if (err) {
+		IWL_ERROR("Error allocating IRQ %d\n", priv->pci_dev->irq);
+		goto out_disable_msi;
+	}
 	err = sysfs_create_group(&pdev->dev.kobj, &iwl_attribute_group);
 	if (err) {
 		IWL_ERROR("failed to create sysfs device attributes\n");
 		goto out_uninit_drv;
 	}
 
-
 	iwl_setup_deferred_work(priv);
 	iwl_setup_rx_handlers(priv);
 
-	/********************
-	 * 9. Conclude
-	 ********************/
-	pci_save_state(pdev);
-	pci_disable_device(pdev);
-
 	/**********************************
-	 * 10. Setup and register mac80211
+	 * 9. Setup and register mac80211
 	 **********************************/
 
+	/* enable interrupts if needed: hw bug w/a */
+	pci_read_config_word(priv->pci_dev, PCI_COMMAND, &pci_cmd);
+	if (pci_cmd & PCI_COMMAND_INTX_DISABLE) {
+		pci_cmd &= ~PCI_COMMAND_INTX_DISABLE;
+		pci_write_config_word(priv->pci_dev, PCI_COMMAND, pci_cmd);
+	}
+
+	iwl_enable_interrupts(priv);
+
 	err = iwl_setup_mac(priv);
 	if (err)
 		goto out_remove_sysfs;
@@ -3937,10 +3920,19 @@ static int iwl_pci_probe(struct pci_dev 
 	if (err)
 		IWL_ERROR("failed to create debugfs files\n");
 
+	/* If platform's RF_KILL switch is NOT set to KILL */
+	if (iwl_read32(priv, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
+		clear_bit(STATUS_RF_KILL_HW, &priv->status);
+	else
+		set_bit(STATUS_RF_KILL_HW, &priv->status);
+
 	err = iwl_rfkill_init(priv);
 	if (err)
 		IWL_ERROR("Unable to initialize RFKILL system. "
 				  "Ignoring error: %d\n", err);
+	else
+		iwl_rfkill_set_hw_state(priv);
+
 	iwl_power_initialize(priv);
 	return 0;
 
@@ -3948,6 +3940,9 @@ static int iwl_pci_probe(struct pci_dev 
 	destroy_workqueue(priv->workqueue);
 	priv->workqueue = NULL;
 	sysfs_remove_group(&pdev->dev.kobj, &iwl_attribute_group);
+ out_disable_msi:
+	pci_disable_msi(priv->pci_dev);
+	pci_disable_device(priv->pci_dev);
  out_uninit_drv:
 	iwl_uninit_drv(priv);
  out_free_eeprom:
@@ -4019,6 +4014,8 @@ static void __devexit iwl_pci_remove(str
 	destroy_workqueue(priv->workqueue);
 	priv->workqueue = NULL;
 
+	free_irq(priv->pci_dev->irq, priv);
+	pci_disable_msi(priv->pci_dev);
 	pci_iounmap(pdev, priv->hw_base);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
@@ -4044,19 +4041,8 @@ static int iwl_pci_suspend(struct pci_de
 		priv->is_open = 1;
 	}
 
-	/* pci driver assumes state will be saved in this function.
-	 * pci state is saved and device disabled when interface is
-	 * stopped, so at this time pci device will always be disabled -
-	 * whether interface was started or not. saving pci state now will
-	 * cause saved state be that of a disabled device, which will cause
-	 * problems during resume in that we will end up with a disabled device.
-	 *
-	 * indicate that the current saved state (from when interface was
-	 * stopped) is valid. if interface was never up at time of suspend
-	 * then the saved state will still be valid as it was saved during
-	 * .probe. */
-	pdev->state_saved = true;
-
+	pci_save_state(pdev);
+	pci_disable_device(pdev);
 	pci_set_power_state(pdev, PCI_D3hot);
 
 	return 0;
@@ -4067,6 +4053,9 @@ static int iwl_pci_resume(struct pci_dev
 	struct iwl_priv *priv = pci_get_drvdata(pdev);
 
 	pci_set_power_state(pdev, PCI_D0);
+	pci_enable_device(pdev);
+	pci_restore_state(pdev);
+	iwl_enable_interrupts(priv);
 
 	if (priv->is_open)
 		iwl_mac_start(priv->hw);

linux-2.6-kvm-kconfig-irqchip.patch:

--- NEW FILE linux-2.6-kvm-kconfig-irqchip.patch ---
commit 1dae8e15bb85de0116ed43cd3d798a035044954c
Author: Avi Kivity <avi at redhat.com>
Date:   Sun Jan 4 18:04:18 2009 +0200

    KVM: Add CONFIG_HAVE_KVM_IRQCHIP
    
    Two KVM archs support irqchips and two don't.  Add a Kconfig item to
    make selecting between the two models easier.
    
    Signed-off-by: Avi Kivity <avi at redhat.com>

diff --git a/arch/ia64/kvm/Kconfig b/arch/ia64/kvm/Kconfig
index f833a0b..0a2d6b8 100644
--- a/arch/ia64/kvm/Kconfig
+++ b/arch/ia64/kvm/Kconfig
@@ -4,6 +4,10 @@
 config HAVE_KVM
 	bool
 
+config HAVE_KVM_IRQCHIP
+       bool
+       default y
+
 menuconfig VIRTUALIZATION
 	bool "Virtualization"
 	depends on HAVE_KVM || IA64
diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig
index 1465705..5a152a5 100644
--- a/arch/powerpc/kvm/Kconfig
+++ b/arch/powerpc/kvm/Kconfig
@@ -2,6 +2,9 @@
 # KVM configuration
 #
 
+config HAVE_KVM_IRQCHIP
+       bool
+
 menuconfig VIRTUALIZATION
 	bool "Virtualization"
 	---help---
diff --git a/arch/s390/kvm/Kconfig b/arch/s390/kvm/Kconfig
index e051cad..3e260b7 100644
--- a/arch/s390/kvm/Kconfig
+++ b/arch/s390/kvm/Kconfig
@@ -4,6 +4,9 @@
 config HAVE_KVM
        bool
 
+config HAVE_KVM_IRQCHIP
+       bool
+
 menuconfig VIRTUALIZATION
 	bool "Virtualization"
 	default y
diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
index b81125f..0a303c3 100644
--- a/arch/x86/kvm/Kconfig
+++ b/arch/x86/kvm/Kconfig
@@ -4,6 +4,10 @@
 config HAVE_KVM
        bool
 
+config HAVE_KVM_IRQCHIP
+       bool
+       default y
+
 menuconfig VIRTUALIZATION
 	bool "Virtualization"
 	depends on HAVE_KVM || X86

linux-2.6-kvm-mask-notifiers.patch:

--- NEW FILE linux-2.6-kvm-mask-notifiers.patch ---
b018d32632d3c59d3618e23128e4312fe8e48d64
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 3cf0ede..99963f3 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -127,6 +127,10 @@ struct kvm {
 	struct kvm_coalesced_mmio_ring *coalesced_mmio_ring;
 #endif
 
+#ifdef CONFIG_HAVE_KVM_IRQCHIP
+	struct hlist_head mask_notifier_list;
+#endif
+
 #ifdef KVM_ARCH_WANT_MMU_NOTIFIER
 	struct mmu_notifier mmu_notifier;
 	unsigned long mmu_notifier_seq;
@@ -320,6 +324,19 @@ struct kvm_assigned_dev_kernel {
 	struct pci_dev *dev;
 	struct kvm *kvm;
 };
+
+struct kvm_irq_mask_notifier {
+	void (*func)(struct kvm_irq_mask_notifier *kimn, bool masked);
+	int irq;
+	struct hlist_node link;
+};
+
+void kvm_register_irq_mask_notifier(struct kvm *kvm, int irq,
+				    struct kvm_irq_mask_notifier *kimn);
+void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq,
+				      struct kvm_irq_mask_notifier *kimn);
+void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask);
+
 void kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level);
 void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi);
 void kvm_register_irq_ack_notifier(struct kvm *kvm,
diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
index 23b81cf..e85a2bc 100644
--- a/virt/kvm/ioapic.c
+++ b/virt/kvm/ioapic.c
@@ -101,6 +101,7 @@ static void ioapic_service(struct kvm_ioapic *ioapic, unsigned int idx)
 static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
 {
 	unsigned index;
+	bool mask_before, mask_after;
 
 	switch (ioapic->ioregsel) {
 	case IOAPIC_REG_VERSION:
@@ -120,6 +121,7 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
 		ioapic_debug("change redir index %x val %x\n", index, val);
 		if (index >= IOAPIC_NUM_PINS)
 			return;
+		mask_before = ioapic->redirtbl[index].fields.mask;
 		if (ioapic->ioregsel & 1) {
 			ioapic->redirtbl[index].bits &= 0xffffffff;
 			ioapic->redirtbl[index].bits |= (u64) val << 32;
@@ -128,6 +130,9 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
 			ioapic->redirtbl[index].bits |= (u32) val;
 			ioapic->redirtbl[index].fields.remote_irr = 0;
 		}
+		mask_after = ioapic->redirtbl[index].fields.mask;
+		if (mask_before != mask_after)
+			kvm_fire_mask_notifiers(ioapic->kvm, index, mask_after);
 		if (ioapic->irr & (1 << index))
 			ioapic_service(ioapic, index);
 		break;
@@ -426,3 +431,4 @@ int kvm_ioapic_init(struct kvm *kvm)
 	kvm_io_bus_register_dev(&kvm->mmio_bus, &ioapic->dev);
 	return 0;
 }
+
diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c
index aa5d1e5..5162a41 100644
--- a/virt/kvm/irq_comm.c
+++ b/virt/kvm/irq_comm.c
@@ -99,3 +99,27 @@ void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id)
 		clear_bit(irq_source_id, &kvm->arch.irq_states[i]);
 	clear_bit(irq_source_id, &kvm->arch.irq_sources_bitmap);
 }
+
+void kvm_register_irq_mask_notifier(struct kvm *kvm, int irq,
+				    struct kvm_irq_mask_notifier *kimn)
+{
+	kimn->irq = irq;
+	hlist_add_head(&kimn->link, &kvm->mask_notifier_list);
+}
+
+void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq,
+				      struct kvm_irq_mask_notifier *kimn)
+{
+	hlist_del(&kimn->link);
+}
+
+void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask)
+{
+	struct kvm_irq_mask_notifier *kimn;
+	struct hlist_node *n;
+
+	hlist_for_each_entry(kimn, n, &kvm->mask_notifier_list, link)
+		if (kimn->irq == irq)
+			kimn->func(kimn, mask);
+}
+
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index dcbfc68..785c1e3 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -831,6 +831,9 @@ static struct kvm *kvm_create_vm(void)
 
 	if (IS_ERR(kvm))
 		goto out;
+#ifdef CONFIG_HAVE_KVM_IRQCHIP
+	INIT_HLIST_HEAD(&kvm->mask_notifier_list);
+#endif
 
 #ifdef KVM_COALESCED_MMIO_PAGE_OFFSET
 	page = alloc_page(GFP_KERNEL | __GFP_ZERO);

linux-2.6-kvm-reset-pit-irq-on-unmask.patch:

--- NEW FILE linux-2.6-kvm-reset-pit-irq-on-unmask.patch ---
commit 4780c65904f0fc4e312ee2da9383eacbe04e61ea
Author: Avi Kivity <avi at redhat.com>
Date:   Sun Jan 4 18:06:06 2009 +0200

    KVM: Reset PIT irq injection logic when the PIT IRQ is unmasked
    
    While the PIT is masked the guest cannot ack the irq, so the reinject logic
    will never allow the interrupt to be injected.
    
    Fix by resetting the reinjection counters on unmask.
    
    Unbreaks Xen.
    
    Signed-off-by: Avi Kivity <avi at redhat.com>

diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
index 69d1bbf..c13bb92 100644
--- a/arch/x86/kvm/i8254.c
+++ b/arch/x86/kvm/i8254.c
@@ -539,6 +539,16 @@ void kvm_pit_reset(struct kvm_pit *pit)
 	pit->pit_state.irq_ack = 1;
 }
 
+static void pit_mask_notifer(struct kvm_irq_mask_notifier *kimn, bool mask)
+{
+	struct kvm_pit *pit = container_of(kimn, struct kvm_pit, mask_notifier);
+
+	if (!mask) {
+		atomic_set(&pit->pit_state.pit_timer.pending, 0);
+		pit->pit_state.irq_ack = 1;
+	}
+}
+
 struct kvm_pit *kvm_create_pit(struct kvm *kvm)
 {
 	struct kvm_pit *pit;
@@ -586,6 +596,9 @@ struct kvm_pit *kvm_create_pit(struct kvm *kvm)
 
 	kvm_pit_reset(pit);
 
+	pit->mask_notifier.func = pit_mask_notifer;
+	kvm_register_irq_mask_notifier(kvm, 0, &pit->mask_notifier);
+
 	return pit;
 }
 
@@ -594,6 +607,8 @@ void kvm_free_pit(struct kvm *kvm)
 	struct hrtimer *timer;
 
 	if (kvm->arch.vpit) {
+		kvm_unregister_irq_mask_notifier(kvm, 0,
+					       &kvm->arch.vpit->mask_notifier);
 		mutex_lock(&kvm->arch.vpit->pit_state.lock);
 		timer = &kvm->arch.vpit->pit_state.pit_timer.timer;
 		hrtimer_cancel(timer);
diff --git a/arch/x86/kvm/i8254.h b/arch/x86/kvm/i8254.h
index 76959c4..6acbe4b 100644
--- a/arch/x86/kvm/i8254.h
+++ b/arch/x86/kvm/i8254.h
@@ -46,6 +46,7 @@ struct kvm_pit {
 	struct kvm *kvm;
 	struct kvm_kpit_state pit_state;
 	int irq_source_id;
+	struct kvm_irq_mask_notifier mask_notifier;
 };
 
 #define KVM_PIT_BASE_ADDRESS	    0x40

linux-2.6-md-raid1-dont-assume-new-bvecs-are-init.patch:

--- NEW FILE linux-2.6-md-raid1-dont-assume-new-bvecs-are-init.patch ---
From: NeilBrown <neilb at suse.de>
Date: Mon, 6 Apr 2009 04:40:38 +0000 (+1000)
Subject: md/raid1 - don't assume newly allocated bvecs are initialised.
X-Git-Tag: v2.6.30-rc1~176^2
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=303a0e11d0ee136ad8f53f747f3c377daece763b

md/raid1 - don't assume newly allocated bvecs are initialised.

Since commit d3f761104b097738932afcc310fbbbbfb007ef92
newly allocated bvecs aren't initialised to NULL, so we have
to be more careful about freeing a bio which only managed
to get a few pages allocated to it.  Otherwise the resync
process crashes.

This patch is appropriate for 2.6.29-stable.

Cc: stable at kernel.org
Cc: "Jens Axboe" <jens.axboe at oracle.com>
Reported-by: Gabriele Tozzi <gabriele at tozzi.eu>
Signed-off-by: NeilBrown <neilb at suse.de>
---

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index b4f4bad..f2247b0 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -123,6 +123,7 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data)
 				goto out_free_pages;
 
 			bio->bi_io_vec[i].bv_page = page;
+			bio->bi_vcnt = i+1;
 		}
 	}
 	/* If not user-requests, copy the page pointers to all bios */
@@ -138,9 +139,9 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data)
 	return r1_bio;
 
 out_free_pages:
-	for (i=0; i < RESYNC_PAGES ; i++)
-		for (j=0 ; j < pi->raid_disks; j++)
-			safe_put_page(r1_bio->bios[j]->bi_io_vec[i].bv_page);
+	for (j=0 ; j < pi->raid_disks; j++)
+		for (i=0; i < r1_bio->bios[j]->bi_vcnt ; i++)
+			put_page(r1_bio->bios[j]->bi_io_vec[i].bv_page);
 	j = -1;
 out_free_bio:
 	while ( ++j < pi->raid_disks )

linux-2.6-mm-define-unique-value-for-as_unevictable.patch:

--- NEW FILE linux-2.6-mm-define-unique-value-for-as_unevictable.patch ---
From: Lee Schermerhorn <Lee.Schermerhorn at hp.com>
Date: Thu, 2 Apr 2009 23:56:45 +0000 (-0700)
Subject: mm: define a UNIQUE value for AS_UNEVICTABLE flag
X-Git-Tag: v2.6.30-rc1~398
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=9a896c9a48ac6704c0ce8ee081b836644d0afe40

mm: define a UNIQUE value for AS_UNEVICTABLE flag

A new "address_space flag"--AS_MM_ALL_LOCKS--was defined to use the next
available AS flag while the Unevictable LRU was under development.  The
Unevictable LRU was using the same flag and "no one" noticed.  Current
mainline, since 2.6.28, has same value for two symbolic flag names.

So, define a unique flag value for AS_UNEVICTABLE--up close to the other
flags, [at the cost of an additional #ifdef] so we'll notice next time.
Note that #ifdef is not actually required, if we don't mind having the
unused flag value defined.

Replace #defines with an enum.

Signed-off-by: Lee Schermerhorn <lee.schermerhorn at hp.com>
Cc: <stable at kernel.org>		[2.6.28.x, 2.6.29.x]
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---

diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 01ca085..076a7dc 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -18,9 +18,14 @@
  * Bits in mapping->flags.  The lower __GFP_BITS_SHIFT bits are the page
  * allocation mode flags.
  */
-#define	AS_EIO		(__GFP_BITS_SHIFT + 0)	/* IO error on async write */
-#define AS_ENOSPC	(__GFP_BITS_SHIFT + 1)	/* ENOSPC on async write */
-#define AS_MM_ALL_LOCKS	(__GFP_BITS_SHIFT + 2)	/* under mm_take_all_locks() */
+enum mapping_flags {
+	AS_EIO		= __GFP_BITS_SHIFT + 0,	/* IO error on async write */
+	AS_ENOSPC	= __GFP_BITS_SHIFT + 1,	/* ENOSPC on async write */
+	AS_MM_ALL_LOCKS	= __GFP_BITS_SHIFT + 2,	/* under mm_take_all_locks() */
+#ifdef CONFIG_UNEVICTABLE_LRU
+	AS_UNEVICTABLE	= __GFP_BITS_SHIFT + 3,	/* e.g., ramdisk, SHM_LOCK */
+#endif
+};
 
 static inline void mapping_set_error(struct address_space *mapping, int error)
 {
@@ -33,7 +38,6 @@ static inline void mapping_set_error(struct address_space *mapping, int error)
 }
 
 #ifdef CONFIG_UNEVICTABLE_LRU
-#define AS_UNEVICTABLE	(__GFP_BITS_SHIFT + 2)	/* e.g., ramdisk, SHM_LOCK */
 
 static inline void mapping_set_unevictable(struct address_space *mapping)
 {

linux-2.6-posix-timers-fix-clock-monotonicity.patch:

--- NEW FILE linux-2.6-posix-timers-fix-clock-monotonicity.patch ---
From: Hidetoshi Seto <seto.hidetoshi at jp.fujitsu.com>
Date: Tue, 31 Mar 2009 07:56:03 +0000 (+0900)
Subject: posixtimers, sched: Fix posix clock monotonicity
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=c5f8d99585d7b5b7e857fabf8aefd0174903a98c

posixtimers, sched: Fix posix clock monotonicity

Impact: Regression fix (against clock_gettime() backwarding bug)

This patch re-introduces a couple of functions, task_sched_runtime
and thread_group_sched_runtime, which was once removed at the
time of 2.6.28-rc1.

These functions protect the sampling of thread/process clock with
rq lock.  This rq lock is required not to update rq->clock during
the sampling.

i.e.
  The clock_gettime() may return
   ((accounted runtime before update) + (delta after update))
  that is less than what it should be.

v2 -> v3:
	- Rename static helper function __task_delta_exec()
	  to do_task_delta_exec() since -tip tree already has
	  a __task_delta_exec() of different version.

v1 -> v2:
	- Revises comments of function and patch description.
	- Add note about accuracy of thread group's runtime.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi at jp.fujitsu.com>
Acked-by: Peter Zijlstra <a.p.zijlstra at chello.nl>
Cc: stable at kernel.org	[2.6.28.x][2.6.29.x]
LKML-Reference: <49D1CC93.4080401 at jp.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo at elte.hu>
---

diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
index fa07da9..4318c30 100644
--- a/kernel/posix-cpu-timers.c
+++ b/kernel/posix-cpu-timers.c
@@ -224,7 +224,7 @@ static int cpu_clock_sample(const clockid_t which_clock, struct task_struct *p,
 		cpu->cpu = virt_ticks(p);
 		break;
 	case CPUCLOCK_SCHED:
-		cpu->sched = p->se.sum_exec_runtime + task_delta_exec(p);
+		cpu->sched = task_sched_runtime(p);
 		break;
 	}
 	return 0;
@@ -240,18 +240,19 @@ static int cpu_clock_sample_group(const clockid_t which_clock,
 {
 	struct task_cputime cputime;
 
-	thread_group_cputime(p, &cputime);
 	switch (CPUCLOCK_WHICH(which_clock)) {
 	default:
 		return -EINVAL;
 	case CPUCLOCK_PROF:
+		thread_group_cputime(p, &cputime);
 		cpu->cpu = cputime_add(cputime.utime, cputime.stime);
 		break;
 	case CPUCLOCK_VIRT:
+		thread_group_cputime(p, &cputime);
 		cpu->cpu = cputime.utime;
 		break;
 	case CPUCLOCK_SCHED:
-		cpu->sched = cputime.sum_exec_runtime + task_delta_exec(p);
+		cpu->sched = thread_group_sched_runtime(p);
 		break;
 	}
 	return 0;
diff --git a/kernel/sched.c b/kernel/sched.c
index cc397aa..c8d7f17 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4139,9 +4139,25 @@ DEFINE_PER_CPU(struct kernel_stat, kstat);
 EXPORT_PER_CPU_SYMBOL(kstat);
 
 /*
- * Return any ns on the sched_clock that have not yet been banked in
+ * Return any ns on the sched_clock that have not yet been accounted in
  * @p in case that task is currently running.
+ *
+ * Called with task_rq_lock() held on @rq.
  */
+static u64 do_task_delta_exec(struct task_struct *p, struct rq *rq)
+{
+	u64 ns = 0;
+
+	if (task_current(rq, p)) {
+		update_rq_clock(rq);
+		ns = rq->clock - p->se.exec_start;
+		if ((s64)ns < 0)
+			ns = 0;
+	}
+
+	return ns;
+}
+
 unsigned long long task_delta_exec(struct task_struct *p)
 {
 	unsigned long flags;
@@ -4149,16 +4165,49 @@ unsigned long long task_delta_exec(struct task_struct *p)
 	u64 ns = 0;
 
 	rq = task_rq_lock(p, &flags);
+	ns = do_task_delta_exec(p, rq);
+	task_rq_unlock(rq, &flags);
 
-	if (task_current(rq, p)) {
-		u64 delta_exec;
+	return ns;
+}
 
-		update_rq_clock(rq);
-		delta_exec = rq->clock - p->se.exec_start;
-		if ((s64)delta_exec > 0)
-			ns = delta_exec;
-	}
+/*
+ * Return accounted runtime for the task.
+ * In case the task is currently running, return the runtime plus current's
+ * pending runtime that have not been accounted yet.
+ */
+unsigned long long task_sched_runtime(struct task_struct *p)
+{
+	unsigned long flags;
+	struct rq *rq;
+	u64 ns = 0;
+
+	rq = task_rq_lock(p, &flags);
+	ns = p->se.sum_exec_runtime + do_task_delta_exec(p, rq);
+	task_rq_unlock(rq, &flags);
+
+	return ns;
+}
 
+/*
+ * Return sum_exec_runtime for the thread group.
+ * In case the task is currently running, return the sum plus current's
+ * pending runtime that have not been accounted yet.
+ *
+ * Note that the thread group might have other running tasks as well,
+ * so the return value not includes other pending runtime that other
+ * running tasks might have.
+ */
+unsigned long long thread_group_sched_runtime(struct task_struct *p)
+{
+	struct task_cputime totals;
+	unsigned long flags;
+	struct rq *rq;
+	u64 ns;
+
+	rq = task_rq_lock(p, &flags);
+	thread_group_cputime(p, &totals);
+	ns = totals.sum_exec_runtime + do_task_delta_exec(p, rq);
 	task_rq_unlock(rq, &flags);
 
 	return ns;

linux-2.6-posix-timers-fix-rlimit_cpu-fork-2.patch:

--- NEW FILE linux-2.6-posix-timers-fix-rlimit_cpu-fork-2.patch ---
From: Oleg Nesterov <oleg at redhat.com>
Date: Fri, 27 Mar 2009 00:06:07 +0000 (+0100)
Subject: posix-timers: fix RLIMIT_CPU && fork()
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=6279a751fe096a21dc7704e918d570d3ff06e769

posix-timers: fix RLIMIT_CPU && fork()

See http://bugzilla.kernel.org/show_bug.cgi?id=12911

copy_signal() copies signal->rlim, but RLIMIT_CPU is "lost". Because
posix_cpu_timers_init_group() sets cputime_expires.prof_exp = 0 and thus
fastpath_timer_check() returns false unless we have other expired cpu timers.

Change copy_signal() to set cputime_expires.prof_exp if we have RLIMIT_CPU.
Also, set cputimer.running = 1 in that case. This is not strictly necessary,
but imho makes sense.

Reported-by: Peter Lojkin <ia6432 at inbox.ru>
Signed-off-by: Oleg Nesterov <oleg at redhat.com>
Acked-by: Peter Zijlstra <peterz at infradead.org>
Cc: Peter Lojkin <ia6432 at inbox.ru>
Cc: Roland McGrath <roland at redhat.com>
Cc: stable at kernel.org
LKML-Reference: <20090327000607.GA10104 at redhat.com>
Signed-off-by: Ingo Molnar <mingo at elte.hu>
---

diff --git a/kernel/fork.c b/kernel/fork.c
index 4854c2c..9b51a1b 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -808,6 +808,12 @@ static void posix_cpu_timers_init_group(struct signal_struct *sig)
 	sig->cputime_expires.virt_exp = cputime_zero;
 	sig->cputime_expires.sched_exp = 0;
 
+	if (sig->rlim[RLIMIT_CPU].rlim_cur != RLIM_INFINITY) {
+		sig->cputime_expires.prof_exp =
+			secs_to_cputime(sig->rlim[RLIMIT_CPU].rlim_cur);
+		sig->cputimer.running = 1;
+	}
+
 	/* The timer lists. */
 	INIT_LIST_HEAD(&sig->cpu_timers[0]);
 	INIT_LIST_HEAD(&sig->cpu_timers[1]);
@@ -823,11 +829,8 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
 		atomic_inc(&current->signal->live);
 		return 0;
 	}
-	sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL);
-
-	if (sig)
-		posix_cpu_timers_init_group(sig);
 
+	sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL);
 	tsk->signal = sig;
 	if (!sig)
 		return -ENOMEM;
@@ -865,6 +868,8 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
 	memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim);
 	task_unlock(current->group_leader);
 
+	posix_cpu_timers_init_group(sig);
+
 	acct_init_pacct(&sig->pacct);
 
 	tty_audit_fork(sig);

linux-2.6-posix-timers-fix-rlimit_cpu-fork.patch:

--- NEW FILE linux-2.6-posix-timers-fix-rlimit_cpu-fork.patch ---
From: Oleg Nesterov <oleg at redhat.com>
Date: Mon, 23 Mar 2009 19:34:11 +0000 (+0100)
Subject: posix timers: fix RLIMIT_CPU && fork()
X-Git-Tag: v2.6.30-rc1~657^2^4
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=37bebc70d7ad4144c571d74500db3bb26ec0c0eb

posix timers: fix RLIMIT_CPU && fork()

See http://bugzilla.kernel.org/show_bug.cgi?id=12911

copy_signal() copies signal->rlim, but RLIMIT_CPU is "lost". Because
posix_cpu_timers_init_group() sets cputime_expires.prof_exp = 0 and thus
fastpath_timer_check() returns false unless we have other cpu timers.

This is the minimal fix for 2.6.29 (tested) and 2.6.28. The patch is not
optimal, we need further cleanups here. With this patch update_rlimit_cpu()
is not really needed, but I don't think it should be removed.

The proper fix (I think) is:

	- set_process_cpu_timer() should just start the cputimer->running
	  logic (it does), no need to change cputime_expires.xxx_exp

	- posix_cpu_timers_init_group() should set ->running when needed

	- fastpath_timer_check() can check ->running instead of
	  task_cputime_zero(signal->cputime_expires)

Reported-by: Peter Lojkin <ia6432 at inbox.ru>
Signed-off-by: Oleg Nesterov <oleg at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Roland McGrath <roland at redhat.com>
Cc: <stable at kernel.org> [for 2.6.29.x]
LKML-Reference: <20090323193411.GA17514 at redhat.com>
Signed-off-by: Ingo Molnar <mingo at elte.hu>
---

diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
index e976e50..8e5d9a6 100644
--- a/kernel/posix-cpu-timers.c
+++ b/kernel/posix-cpu-timers.c
@@ -1370,7 +1370,8 @@ static inline int fastpath_timer_check(struct task_struct *tsk)
 		if (task_cputime_expired(&group_sample, &sig->cputime_expires))
 			return 1;
 	}
-	return 0;
+
+	return sig->rlim[RLIMIT_CPU].rlim_cur != RLIM_INFINITY;
 }
 
 /*

linux-2.6-posix-timers-fix-rlimit_cpu-setitimer.patch:

--- NEW FILE linux-2.6-posix-timers-fix-rlimit_cpu-setitimer.patch ---
From: Oleg Nesterov <oleg at redhat.com>
Date: Fri, 27 Mar 2009 00:06:10 +0000 (+0100)
Subject: posix-timers: fix RLIMIT_CPU && setitimer(CPUCLOCK_PROF)
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=8f2e586567b1bad72dac7c3810fe9a2ef7117506

posix-timers: fix RLIMIT_CPU && setitimer(CPUCLOCK_PROF)

update_rlimit_cpu() tries to optimize out set_process_cpu_timer() in case
when we already have CPUCLOCK_PROF timer which should expire first. But it
uses cputime_lt() instead of cputime_gt().

Test case:

	int main(void)
	{
		struct itimerval it = {
			.it_value = { .tv_sec = 1000 },
		};

		assert(!setitimer(ITIMER_PROF, &it, NULL));

		struct rlimit rl = {
			.rlim_cur = 1,
			.rlim_max = 1,
		};

		assert(!setrlimit(RLIMIT_CPU, &rl));

		for (;;)
			;

		return 0;
	}

Without this patch, the task is not killed as RLIMIT_CPU demands.

Signed-off-by: Oleg Nesterov <oleg at redhat.com>
Acked-by: Peter Zijlstra <peterz at infradead.org>
Cc: Peter Lojkin <ia6432 at inbox.ru>
Cc: Roland McGrath <roland at redhat.com>
Cc: stable at kernel.org
LKML-Reference: <20090327000610.GA10108 at redhat.com>
Signed-off-by: Ingo Molnar <mingo at elte.hu>
---

diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
index 8e5d9a6..bb53185 100644
--- a/kernel/posix-cpu-timers.c
+++ b/kernel/posix-cpu-timers.c
@@ -18,7 +18,7 @@ void update_rlimit_cpu(unsigned long rlim_new)
 
 	cputime = secs_to_cputime(rlim_new);
 	if (cputime_eq(current->signal->it_prof_expires, cputime_zero) ||
-	    cputime_lt(current->signal->it_prof_expires, cputime)) {
+	    cputime_gt(current->signal->it_prof_expires, cputime)) {
 		spin_lock_irq(&current->sighand->siglock);
 		set_process_cpu_timer(current, CPUCLOCK_PROF, &cputime, NULL);
 		spin_unlock_irq(&current->sighand->siglock);

linux-2.6-shut-up-efifb.patch:

--- NEW FILE linux-2.6-shut-up-efifb.patch ---
--- vanilla-2.6.29/drivers/video/efifb.c	2009-03-23 23:12:14.000000000 +0000
+++ linux-2.6.29.noarch/drivers/video/efifb.c	2009-04-01 19:24:01.000000000 +0100
@@ -208,12 +208,15 @@
 	unsigned int size_total;
 	int request_succeeded = 0;
 
-	printk(KERN_INFO "efifb: probing for efifb\n");
-
 	if (!screen_info.lfb_depth)
 		screen_info.lfb_depth = 32;
 	if (!screen_info.pages)
 		screen_info.pages = 1;
+	if (!screen_info.lfb_base) {
+		printk(KERN_DEBUG "efifb: invalid framebuffer address\n");
+		return -ENODEV;
+	}
+	printk(KERN_INFO "efifb: probing for efifb\n");
 
 	/* just assume they're all unset if any are */
 	if (!screen_info.blue_size) {

linux-2.6-usb-cdc-acm-remove-low-latency-flag.patch:

--- NEW FILE linux-2.6-usb-cdc-acm-remove-low-latency-flag.patch ---
USB: cdc-acm: don't set tty low_latency flag

"The hack setting of it for high data rate devices was obsolete when the
tty buffer changes went in so it can definitely go in those cases."
  --Alan Cox

Signed-off-by: Chuck Ebbert <cebbert at redhat.com>

Index: linux-2.6.29.noarch/drivers/usb/class/cdc-acm.c
===================================================================
--- linux-2.6.29.noarch.orig/drivers/usb/class/cdc-acm.c
+++ linux-2.6.29.noarch/drivers/usb/class/cdc-acm.c
@@ -546,10 +546,6 @@ static int acm_tty_open(struct tty_struc
 	tty->driver_data = acm;
 	acm->tty = tty;
 
-	/* force low_latency on so that our tty_push actually forces the data through,
-	   otherwise it is scheduled, and with high data rates data can get lost. */
-	tty->low_latency = 1;
-
 	if (usb_autopm_get_interface(acm->control) < 0)
 		goto early_bail;
 	else

linux-2.6-v4l-dvb-fix-uint16_t-audio-h.patch:

--- NEW FILE linux-2.6-v4l-dvb-fix-uint16_t-audio-h.patch ---
--- a/include/linux/dvb/audio.h
+++ b/include/linux/dvb/audio.h
@@ -76,7 +76,7 @@ struct audio_karaoke{  /* if Vocal1 or Vocal2 are non-zero, they get mixed  */
 } audio_karaoke_t;     /* into left and right  */
 
 
-typedef uint16_t audio_attributes_t;
+typedef __u16 audio_attributes_t;
 /*   bits: descr. */
 /*   15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */
 /*   12    multichannel extension */

linux-2.6.29-alsa-update-quirks.patch:

--- NEW FILE linux-2.6.29-alsa-update-quirks.patch ---
diff -up linux-2.6.29.noarch/include/sound/core.h.alsa linux-2.6.29.noarch/include/sound/core.h
--- linux-2.6.29.noarch/include/sound/core.h.alsa	2009-04-01 04:21:47.000000000 +0100
+++ linux-2.6.29.noarch/include/sound/core.h	2009-04-01 04:22:00.000000000 +0100
@@ -446,21 +446,33 @@ static inline int __snd_bug_on(int cond)
 struct snd_pci_quirk {
 	unsigned short subvendor;	/* PCI subvendor ID */
 	unsigned short subdevice;	/* PCI subdevice ID */
+	unsigned short subdevice_mask;	/* bitmask to match */
 	int value;			/* value */
 #ifdef CONFIG_SND_DEBUG_VERBOSE
 	const char *name;		/* name of the device (optional) */
 #endif
 };
 
-#define _SND_PCI_QUIRK_ID(vend,dev) \
-	.subvendor = (vend), .subdevice = (dev)
+#define _SND_PCI_QUIRK_ID_MASK(vend, mask, dev)	\
+	.subvendor = (vend), .subdevice = (dev), .subdevice_mask = (mask)
+#define _SND_PCI_QUIRK_ID(vend, dev) \
+	_SND_PCI_QUIRK_ID_MASK(vend, 0xffff, dev)
 #define SND_PCI_QUIRK_ID(vend,dev) {_SND_PCI_QUIRK_ID(vend, dev)}
 #ifdef CONFIG_SND_DEBUG_VERBOSE
 #define SND_PCI_QUIRK(vend,dev,xname,val) \
 	{_SND_PCI_QUIRK_ID(vend, dev), .value = (val), .name = (xname)}
+#define SND_PCI_QUIRK_VENDOR(vend, xname, val)			\
+	{_SND_PCI_QUIRK_ID_MASK(vend, 0, 0), .value = (val), .name = (xname)}
+#define SND_PCI_QUIRK_MASK(vend, mask, dev, xname, val)			\
+	{_SND_PCI_QUIRK_ID_MASK(vend, mask, dev),			\
+			.value = (val), .name = (xname)}
 #else
 #define SND_PCI_QUIRK(vend,dev,xname,val) \
 	{_SND_PCI_QUIRK_ID(vend, dev), .value = (val)}
+#define SND_PCI_QUIRK_MASK(vend, mask, dev, xname, val)			\
+	{_SND_PCI_QUIRK_ID_MASK(vend, mask, dev), .value = (val)}
+#define SND_PCI_QUIRK_VENDOR(vend, xname, val)			\
+	{_SND_PCI_QUIRK_ID_MASK(vend, 0, 0), .value = (val)}
 #endif
 
 const struct snd_pci_quirk *
diff -up linux-2.6.29.noarch/sound/core/misc.c.alsa linux-2.6.29.noarch/sound/core/misc.c
--- linux-2.6.29.noarch/sound/core/misc.c.alsa	2009-04-01 04:21:47.000000000 +0100
+++ linux-2.6.29.noarch/sound/core/misc.c	2009-04-01 04:22:00.000000000 +0100
@@ -95,12 +95,14 @@ snd_pci_quirk_lookup(struct pci_dev *pci
 {
 	const struct snd_pci_quirk *q;
 
-	for (q = list; q->subvendor; q++)
-		if (q->subvendor == pci->subsystem_vendor &&
-		    (!q->subdevice || q->subdevice == pci->subsystem_device))
+	for (q = list; q->subvendor; q++) {
+		if (q->subvendor != pci->subsystem_vendor)
+			continue;
+		if (!q->subdevice ||
+		    (pci->subsystem_device & q->subdevice_mask) == q->subdevice)
 			return q;
+	}
 	return NULL;
 }
-
 EXPORT_SYMBOL(snd_pci_quirk_lookup);
 #endif
diff -up linux-2.6.29.noarch/sound/pci/hda/patch_analog.c.alsa linux-2.6.29.noarch/sound/pci/hda/patch_analog.c
--- linux-2.6.29.noarch/sound/pci/hda/patch_analog.c.alsa	2009-04-01 04:21:47.000000000 +0100
+++ linux-2.6.29.noarch/sound/pci/hda/patch_analog.c	2009-04-01 04:22:00.000000000 +0100
@@ -1002,11 +1002,9 @@ static struct snd_pci_quirk ad1986a_cfg_
 	SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba", AD1986A_LAPTOP_EAPD),
 	SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK),
 	SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP),
-	SND_PCI_QUIRK(0x144d, 0xc023, "Samsung X60", AD1986A_SAMSUNG),
-	SND_PCI_QUIRK(0x144d, 0xc024, "Samsung R65", AD1986A_SAMSUNG),
-	SND_PCI_QUIRK(0x144d, 0xc026, "Samsung X11", AD1986A_SAMSUNG),
 	SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA),
-	SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK),
+        SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc000, "Samsung", AD1986A_SAMSUNG),
+        SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK),
 	SND_PCI_QUIRK(0x17aa, 0x1011, "Lenovo M55", AD1986A_LAPTOP),
 	SND_PCI_QUIRK(0x17aa, 0x1017, "Lenovo A60", AD1986A_3STACK),
 	SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo N100", AD1986A_LAPTOP_AUTOMUTE),
@@ -3911,8 +3909,10 @@ static struct snd_pci_quirk ad1884a_cfg_
 	SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE),
 	SND_PCI_QUIRK(0x103c, 0x3037, "HP 2230s", AD1884A_LAPTOP),
 	SND_PCI_QUIRK(0x103c, 0x3056, "HP", AD1884A_MOBILE),
-	SND_PCI_QUIRK(0x103c, 0x30e6, "HP 6730b", AD1884A_LAPTOP),
-	SND_PCI_QUIRK(0x103c, 0x30e7, "HP EliteBook 8530p", AD1884A_LAPTOP),
+        SND_PCI_QUIRK_MASK(0x103c, 0xfff0, 0x3070, "HP", AD1884A_MOBILE),
+        SND_PCI_QUIRK_MASK(0x103c, 0xfff0, 0x30e0, "HP laptop", AD1884A_LAPTOP),
+        SND_PCI_QUIRK_MASK(0x103c, 0xfff0, 0x30e1, "HP laptop", AD1884A_LAPTOP),
+        SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x3600, "HP laptop", AD1884A_LAPTOP),
 	SND_PCI_QUIRK(0x103c, 0x3614, "HP 6730s", AD1884A_LAPTOP),
 	SND_PCI_QUIRK(0x17aa, 0x20ac, "Thinkpad X300", AD1884A_THINKPAD),
 	{}
diff -up linux-2.6.29.noarch/sound/pci/hda/patch_conexant.c.alsa linux-2.6.29.noarch/sound/pci/hda/patch_conexant.c
--- linux-2.6.29.noarch/sound/pci/hda/patch_conexant.c.alsa	2009-04-01 04:21:47.000000000 +0100
+++ linux-2.6.29.noarch/sound/pci/hda/patch_conexant.c	2009-04-01 04:22:00.000000000 +0100
@@ -1002,15 +1002,9 @@ static const char *cxt5045_models[CXT504
 };
 
 static struct snd_pci_quirk cxt5045_cfg_tbl[] = {
-	SND_PCI_QUIRK(0x103c, 0x30a5, "HP", CXT5045_LAPTOP_HPSENSE),
-	SND_PCI_QUIRK(0x103c, 0x30b2, "HP DV Series", CXT5045_LAPTOP_HPSENSE),
-	SND_PCI_QUIRK(0x103c, 0x30b5, "HP DV2120", CXT5045_LAPTOP_HPSENSE),
-	SND_PCI_QUIRK(0x103c, 0x30b7, "HP DV6000Z", CXT5045_LAPTOP_HPSENSE),
-	SND_PCI_QUIRK(0x103c, 0x30bb, "HP DV8000", CXT5045_LAPTOP_HPSENSE),
-	SND_PCI_QUIRK(0x103c, 0x30cd, "HP DV Series", CXT5045_LAPTOP_HPSENSE),
-	SND_PCI_QUIRK(0x103c, 0x30cf, "HP DV9533EG", CXT5045_LAPTOP_HPSENSE),
 	SND_PCI_QUIRK(0x103c, 0x30d5, "HP 530", CXT5045_LAPTOP_HP530),
-	SND_PCI_QUIRK(0x103c, 0x30d9, "HP Spartan", CXT5045_LAPTOP_HPSENSE),
+	SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x3000, "HP DV Series",
+                           CXT5045_LAPTOP_HPSENSE),
 	SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba P105", CXT5045_LAPTOP_MICSENSE),
 	SND_PCI_QUIRK(0x152d, 0x0753, "Benq R55E", CXT5045_BENQ),
 	SND_PCI_QUIRK(0x1734, 0x10ad, "Fujitsu Si1520", CXT5045_LAPTOP_MICSENSE),
@@ -1020,8 +1014,8 @@ static struct snd_pci_quirk cxt5045_cfg_
 	SND_PCI_QUIRK(0x1509, 0x1e40, "FIC", CXT5045_LAPTOP_HPMICSENSE),
 	SND_PCI_QUIRK(0x1509, 0x2f05, "FIC", CXT5045_LAPTOP_HPMICSENSE),
 	SND_PCI_QUIRK(0x1509, 0x2f06, "FIC", CXT5045_LAPTOP_HPMICSENSE),
-	SND_PCI_QUIRK(0x1631, 0xc106, "Packard Bell", CXT5045_LAPTOP_HPMICSENSE),
-	SND_PCI_QUIRK(0x1631, 0xc107, "Packard Bell", CXT5045_LAPTOP_HPMICSENSE),
+        SND_PCI_QUIRK_MASK(0x1631, 0xff00, 0xc100, "Packard Bell",
+                           CXT5045_LAPTOP_HPMICSENSE),
 	SND_PCI_QUIRK(0x8086, 0x2111, "Conexant Reference board", CXT5045_LAPTOP_HPSENSE),
 	{}
 };
diff -up linux-2.6.29.noarch/sound/pci/hda/patch_realtek.c.alsa linux-2.6.29.noarch/sound/pci/hda/patch_realtek.c
--- linux-2.6.29.noarch/sound/pci/hda/patch_realtek.c.alsa	2009-04-01 04:21:47.000000000 +0100
+++ linux-2.6.29.noarch/sound/pci/hda/patch_realtek.c	2009-04-01 04:22:13.000000000 +0100
@@ -10549,15 +10549,12 @@ static const char *alc262_models[ALC262_
 static struct snd_pci_quirk alc262_cfg_tbl[] = {
 	SND_PCI_QUIRK(0x1002, 0x437b, "Hippo", ALC262_HIPPO),
 	SND_PCI_QUIRK(0x1033, 0x8895, "NEC Versa S9100", ALC262_NEC),
-	SND_PCI_QUIRK(0x103c, 0x12fe, "HP xw9400", ALC262_HP_BPC),
-	SND_PCI_QUIRK(0x103c, 0x12ff, "HP xw4550", ALC262_HP_BPC),
-	SND_PCI_QUIRK(0x103c, 0x1306, "HP xw8600", ALC262_HP_BPC),
-	SND_PCI_QUIRK(0x103c, 0x1307, "HP xw6600", ALC262_HP_BPC),
-	SND_PCI_QUIRK(0x103c, 0x1308, "HP xw4600", ALC262_HP_BPC),
-	SND_PCI_QUIRK(0x103c, 0x1309, "HP xw4*00", ALC262_HP_BPC),
-	SND_PCI_QUIRK(0x103c, 0x130a, "HP xw6*00", ALC262_HP_BPC),
-	SND_PCI_QUIRK(0x103c, 0x130b, "HP xw8*00", ALC262_HP_BPC),
-	SND_PCI_QUIRK(0x103c, 0x170b, "HP xw*", ALC262_HP_BPC),
+	SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1200, "HP xw series",
+			   ALC262_HP_BPC),
+        SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1300, "HP xw series",
+			   ALC262_HP_BPC),
+        SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1700, "HP xw series",
+			   ALC262_HP_BPC),
 	SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL),
 	SND_PCI_QUIRK(0x103c, 0x2801, "HP D7000", ALC262_HP_BPC_D7000_WF),
 	SND_PCI_QUIRK(0x103c, 0x2802, "HP D7000", ALC262_HP_BPC_D7000_WL),
@@ -10575,17 +10572,16 @@ static struct snd_pci_quirk alc262_cfg_t
 	SND_PCI_QUIRK(0x104d, 0x1f00, "Sony ASSAMD", ALC262_SONY_ASSAMD),
 	SND_PCI_QUIRK(0x104d, 0x8203, "Sony UX-90", ALC262_HIPPO),
 	SND_PCI_QUIRK(0x104d, 0x820f, "Sony ASSAMD", ALC262_SONY_ASSAMD),
-	SND_PCI_QUIRK(0x104d, 0x900e, "Sony ASSAMD", ALC262_SONY_ASSAMD),
-	SND_PCI_QUIRK(0x104d, 0x9015, "Sony 0x9015", ALC262_SONY_ASSAMD),
-	SND_PCI_QUIRK(0x104d, 0x9033, "Sony VAIO VGN-SR19XN",
-		      ALC262_SONY_ASSAMD),
+        SND_PCI_QUIRK(0x104d, 0x9016, "Sony VAIO", ALC262_AUTO), /* dig-only */
+        SND_PCI_QUIRK_MASK(0x104d, 0xff00, 0x9000, "Sony VAIO",
+			   ALC262_SONY_ASSAMD),
 	SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1",
 		      ALC262_TOSHIBA_RX1),
 	SND_PCI_QUIRK(0x1179, 0xff7b, "Toshiba S06", ALC262_TOSHIBA_S06),
 	SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU),
 	SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU),
-	SND_PCI_QUIRK(0x144d, 0xc032, "Samsung Q1 Ultra", ALC262_ULTRA),
-	SND_PCI_QUIRK(0x144d, 0xc039, "Samsung Q1U EL", ALC262_ULTRA),
+        SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc032, "Samsung Q1",
+			   ALC262_ULTRA),
 	SND_PCI_QUIRK(0x144d, 0xc510, "Samsung Q45", ALC262_HIPPO),
 	SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000 y410", ALC262_LENOVO_3000),
 	SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8),
@@ -16039,9 +16035,8 @@ static struct snd_pci_quirk alc662_cfg_t
 	SND_PCI_QUIRK(0x1565, 0x820f, "Biostar TA780G M2+", ALC662_3ST_6ch_DIG),
 	SND_PCI_QUIRK(0x1849, 0x3662, "ASROCK K10N78FullHD-hSLI R3.0",
 					ALC662_3ST_6ch_DIG),
-	SND_PCI_QUIRK(0x1854, 0x2000, "ASUS H13-2000", ALC663_ASUS_H13),
-	SND_PCI_QUIRK(0x1854, 0x2001, "ASUS H13-2001", ALC663_ASUS_H13),
-	SND_PCI_QUIRK(0x1854, 0x2002, "ASUS H13-2002", ALC663_ASUS_H13),
+        SND_PCI_QUIRK_MASK(0x1854, 0xf000, 0x2000, "ASUS H13-200x",
+			   ALC663_ASUS_H13),
 	{}
 };
 
diff -up linux-2.6.29.noarch/sound/pci/hda/patch_sigmatel.c.alsa linux-2.6.29.noarch/sound/pci/hda/patch_sigmatel.c
--- linux-2.6.29.noarch/sound/pci/hda/patch_sigmatel.c.alsa	2009-04-01 04:21:47.000000000 +0100
+++ linux-2.6.29.noarch/sound/pci/hda/patch_sigmatel.c	2009-04-01 04:22:00.000000000 +0100
@@ -1796,18 +1796,12 @@ static struct snd_pci_quirk stac92hd71bx
 	/* SigmaTel reference board */
 	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
 		      "DFI LanParty", STAC_92HD71BXX_REF),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f2,
-		      "HP dv5", STAC_HP_M4),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f4,
-		      "HP dv7", STAC_HP_DV5),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f7,
-		      "HP dv4", STAC_HP_DV5),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fc,
-		      "HP dv7", STAC_HP_M4),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3600,
-		      "HP dv5", STAC_HP_DV5),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3603,
-		      "HP dv5", STAC_HP_DV5),
+        SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3080,
+			   "HP", STAC_HP_DV5),
+        SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x30f0,
+			   "HP dv4-7", STAC_HP_DV5),
+        SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3600,
+			   "HP dv4-7", STAC_HP_DV5),
 	SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a,
 				"unknown HP", STAC_HP_M4),
 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,
@@ -2065,32 +2059,8 @@ static struct snd_pci_quirk stac922x_cfg
 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d7,
 		      "Dell XPS M1210", STAC_922X_DELL_M82),
 	/* ECS/PC Chips boards */
-	SND_PCI_QUIRK(0x1019, 0x2144,
-		      "ECS/PC chips", STAC_ECS_202),
-	SND_PCI_QUIRK(0x1019, 0x2608,
-		      "ECS/PC chips", STAC_ECS_202),
-	SND_PCI_QUIRK(0x1019, 0x2633,
-		      "ECS/PC chips P17G/1333", STAC_ECS_202),
-	SND_PCI_QUIRK(0x1019, 0x2811,
-		      "ECS/PC chips", STAC_ECS_202),
-	SND_PCI_QUIRK(0x1019, 0x2812,
-		      "ECS/PC chips", STAC_ECS_202),
-	SND_PCI_QUIRK(0x1019, 0x2813,
-		      "ECS/PC chips", STAC_ECS_202),
-	SND_PCI_QUIRK(0x1019, 0x2814,
-		      "ECS/PC chips", STAC_ECS_202),
-	SND_PCI_QUIRK(0x1019, 0x2815,
-		      "ECS/PC chips", STAC_ECS_202),
-	SND_PCI_QUIRK(0x1019, 0x2816,
-		      "ECS/PC chips", STAC_ECS_202),
-	SND_PCI_QUIRK(0x1019, 0x2817,
-		      "ECS/PC chips", STAC_ECS_202),
-	SND_PCI_QUIRK(0x1019, 0x2818,
-		      "ECS/PC chips", STAC_ECS_202),
-	SND_PCI_QUIRK(0x1019, 0x2819,
-		      "ECS/PC chips", STAC_ECS_202),
-	SND_PCI_QUIRK(0x1019, 0x2820,
-		      "ECS/PC chips", STAC_ECS_202),
+        SND_PCI_QUIRK_MASK(0x1019, 0xf000, 0x2000,
+			   "ECS/PC chips", STAC_ECS_202),
 	{} /* terminator */
 };
 
@@ -2148,22 +2118,10 @@ static struct snd_pci_quirk stac927x_cfg
 	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x3d01, "Intel D946", STAC_D965_3ST),
 	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0xa301, "Intel D946", STAC_D965_3ST),
 	/* 965 based 3 stack systems */
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2116, "Intel D965", STAC_D965_3ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2115, "Intel D965", STAC_D965_3ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2114, "Intel D965", STAC_D965_3ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2113, "Intel D965", STAC_D965_3ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2112, "Intel D965", STAC_D965_3ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2111, "Intel D965", STAC_D965_3ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2110, "Intel D965", STAC_D965_3ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2009, "Intel D965", STAC_D965_3ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2008, "Intel D965", STAC_D965_3ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2007, "Intel D965", STAC_D965_3ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2006, "Intel D965", STAC_D965_3ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2005, "Intel D965", STAC_D965_3ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2004, "Intel D965", STAC_D965_3ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2003, "Intel D965", STAC_D965_3ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2002, "Intel D965", STAC_D965_3ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2001, "Intel D965", STAC_D965_3ST),
+        SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2100,
+			   "Intel D965", STAC_D965_3ST),
+        SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2000,
+			   "Intel D965", STAC_D965_3ST),
 	/* Dell 3 stack systems */
 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x01f7, "Dell XPS M1730", STAC_DELL_3ST),
 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x01dd, "Dell Dimension E520", STAC_DELL_3ST),
@@ -2179,15 +2137,10 @@ static struct snd_pci_quirk stac927x_cfg
 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x02ff, "Dell     ", STAC_DELL_BIOS),
 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x0209, "Dell XPS 1330", STAC_DELL_BIOS),
 	/* 965 based 5 stack systems */
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2301, "Intel D965", STAC_D965_5ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2302, "Intel D965", STAC_D965_5ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2303, "Intel D965", STAC_D965_5ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2304, "Intel D965", STAC_D965_5ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2305, "Intel D965", STAC_D965_5ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2501, "Intel D965", STAC_D965_5ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2502, "Intel D965", STAC_D965_5ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2503, "Intel D965", STAC_D965_5ST),
-	SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2504, "Intel D965", STAC_D965_5ST),
+        SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2300,
+			   "Intel D965", STAC_D965_5ST),
+        SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2500,
+			   "Intel D965", STAC_D965_5ST),
 	{} /* terminator */
 };
 

linux-2.6.29.1-sparc-regression.patch:

--- NEW FILE linux-2.6.29.1-sparc-regression.patch ---
>From davem at davemloft.net Tue Apr  7 17:24:11 2009
Return-Path: <davem at davemloft.net>
X-Original-To: dennis at ausil.us
Delivered-To: dennis at ausil.us
Received: from localhost (unknown [127.0.0.1])
	by mail.ausil.us (Postfix) with ESMTP id 8067B158003
	for <dennis at ausil.us>; Tue,  7 Apr 2009 22:24:22 +0000 (UTC)
X-Virus-Scanned: amavisd-new at example.com
Received: from mail.ausil.us ([127.0.0.1])
	by localhost (anubis.ausil.us [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id Wtdx2a8O54+g for <dennis at ausil.us>;
	Tue,  7 Apr 2009 17:24:21 -0500 (CDT)
X-Greylist: from auto-whitelisted by SQLgrey-1.7.5
Received: from sunset.davemloft.net (unknown [74.93.104.97])
	by mail.ausil.us (Postfix) with ESMTP id 7A828158001
	for <dennis at ausil.us>; Tue,  7 Apr 2009 17:24:21 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
	by sunset.davemloft.net (Postfix) with ESMTP id CA9B8C8D935;
	Tue,  7 Apr 2009 15:24:11 -0700 (PDT)
Date: Tue, 07 Apr 2009 15:24:11 -0700 (PDT)
Message-Id: <20090407.152411.198483029.davem at davemloft.net>
To: dennis at ausil.us
Cc: sparclinux at vger.kernel.org
Subject: Re: kernel bug with CONFIG_KEYBOARD_ATKBD=y
From: David Miller <davem at davemloft.net>
In-Reply-To: <20090407.151638.93201206.davem at davemloft.net>
References: <20090407.145755.213806619.davem at davemloft.net>
	<200904071710.09685.dennis at ausil.us>
	<20090407.151638.93201206.davem at davemloft.net>
X-Mailer: Mew version 6.2.51 on Emacs 22.1 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain;
  charset=us-ascii
Content-Transfer-Encoding: 7bit
X-UID: 4807
X-Length: 3606
Status: R
X-Status: N
X-KMail-EncryptionState:  
X-KMail-SignatureState:  
X-KMail-MDN-Sent:  

From: David Miller <davem at davemloft.net>
Date: Tue, 07 Apr 2009 15:16:38 -0700 (PDT)

> From: Dennis Gilmore <dennis at ausil.us>
> Date: Tue, 7 Apr 2009 17:10:08 -0500
> 
>> On Tuesday 07 April 2009 04:57:55 pm David Miller wrote:
>>> From: Dennis Gilmore <dennis at ausil.us>
>>> Date: Tue, 7 Apr 2009 10:01:17 -0500
>>>
>>> > Initalizing network drop monitor service
>>> > kernel BUG at
>>> > /builddir/build/BUILD/kernel-2.6.29/linux-2.6.29.sparc64/arch/sparc/inclu
>>> >de/asm/tlb_64.h:48!
>>>
>>> What kernel is this tree based upon?  2.6.29.1?
>> yeah 2.6.29.1
> 
> A sparc64 fix I put into 2.6.29.1 is likely the cause.  It's possible
> I put in a version without a particular issue cured.

Indeed, here is the fix, I'll push it to -stable.  Thanks for your
report:

sparc64: Fix bug in ("sparc64: Flush TLB before releasing pages.")

[ No upstream commit, this regression was added only to 2.6.29.1 ]

Unfortunately I merged an earlier version of commit
b6816b706138c3870f03115071872cad824f90b4 ("sparc64: Flush TLB before
releasing pages.") than what I actually tested and merged upstream.

Simply diffing asm/tlb_64.h in Linus's tree vs. what ended up in
2.6.29.1 confirms this.

Sync things up to fix BUG() triggers some users are seeing.

Reported-by: Dennis Gilmore <dennis at ausil.us>
Signed-off-by: David S. Miller <davem at davemloft.net>
---
 arch/sparc/include/asm/tlb_64.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/include/asm/tlb_64.h b/arch/sparc/include/asm/tlb_64.h
index 0aaa086..ee38e73 100644
--- a/arch/sparc/include/asm/tlb_64.h
+++ b/arch/sparc/include/asm/tlb_64.h
@@ -57,9 +57,9 @@ static inline struct mmu_gather *tlb_gather_mmu(struct mm_struct *mm, unsigned i
 
 static inline void tlb_flush_mmu(struct mmu_gather *mp)
 {
+	if (!mp->fullmm)
+		flush_tlb_pending();
 	if (mp->need_flush) {
-		if (!mp->fullmm)
-			flush_tlb_pending();
 		free_pages_and_swap_cache(mp->pages, mp->pages_nr);
 		mp->pages_nr = 0;
 		mp->need_flush = 0;
-- 
1.6.2.2



--- NEW FILE patch-2.6.29.1.bz2.sign ---
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: See http://www.kernel.org/signature.html for info

iD8DBQBJ1UWtyGugalF9Dw4RAkuGAJ4sDs0OM/1EKkycBDFYGk6E7l0UrgCghiIF
A7VtJ1agWJvh0s6+3jIaXSs=
=Wnzk
-----END PGP SIGNATURE-----

squashfs-broken-when-pagesize-greater-than-blocksize.patch:

--- NEW FILE squashfs-broken-when-pagesize-greater-than-blocksize.patch ---
From: Doug Chapman <doug.chapman at hp.com>
To: fedora-kernel-list at redhat.com
Subject: [PATCH] squashfs broken when pageszie > blocksize

Not sure if we are too late for F11 on this or not but this patch
is needed to be able to mount squashfs (as used by anaconda) on
ia64.  Our goal is to be able to build Fedora on ia64 with no
custom SRPMs so it would be appreciated if this could be pulled
in.

--------------------

Squashfs is broken on any system where the pageszie is larger than either
the block size of the squashfs image or larger than the metadata size (8192).
This is easily fixed by ensuring cache->pages is always > 0.

Signed-off-by: Doug Chapman <doug.chapman at hp.com>
Cc: Phillip Lougher <phillip at lougher.demon.co.uk>

---
diff --git a/fs/squashfs/cache.c b/fs/squashfs/cache.c
index 1c4739e..40c98fa 100644
--- a/fs/squashfs/cache.c
+++ b/fs/squashfs/cache.c
@@ -252,6 +252,7 @@ struct squashfs_cache *squashfs_cache_init(char *name, int entries,
 	cache->entries = entries;
 	cache->block_size = block_size;
 	cache->pages = block_size >> PAGE_CACHE_SHIFT;
+	cache->pages = cache->pages ? cache->pages : 1;
 	cache->name = name;
 	cache->num_waiters = 0;
 	spin_lock_init(&cache->lock);


_______________________________________________
Fedora-kernel-list mailing list
Fedora-kernel-list at redhat.com
https://www.redhat.com/mailman/listinfo/fedora-kernel-list


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/.cvsignore,v
retrieving revision 1.1014.2.8
retrieving revision 1.1014.2.9
diff -u -r1.1014.2.8 -r1.1014.2.9
--- .cvsignore	24 Mar 2009 22:57:41 -0000	1.1014.2.8
+++ .cvsignore	14 Apr 2009 22:09:05 -0000	1.1014.2.9
@@ -5,3 +5,4 @@
 temp-*
 kernel-2.6.29
 linux-2.6.29.tar.bz2
+patch-2.6.29.1.bz2


Index: Makefile
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/Makefile,v
retrieving revision 1.97.6.2
retrieving revision 1.97.6.3
diff -u -r1.97.6.2 -r1.97.6.3
--- Makefile	24 Mar 2009 22:57:41 -0000	1.97.6.2
+++ Makefile	14 Apr 2009 22:09:05 -0000	1.97.6.3
@@ -70,6 +70,7 @@
 	@perl -pi -e 's/# CONFIG_PCI_MSI_DEFAULT_ON is not set/CONFIG_PCI_MSI_DEFAULT_ON=y/' config-generic
 	@perl -pi -e 's/# CONFIG_B43_DEBUG is not set/CONFIG_B43_DEBUG=y/' config-generic
 	@perl -pi -e 's/# CONFIG_B43LEGACY_DEBUG is not set/CONFIG_B43LEGACY_DEBUG=y/' config-generic
+	@perl -pi -e 's/# CONFIG_MMIOTRACE is not set/CONFIG_MMIOTRACE=y/' config-nodebug
 
 	@# just in case we're going from extremedebug -> debug
 	@perl -pi -e 's/CONFIG_DEBUG_PAGEALLOC=y/# CONFIG_DEBUG_PAGEALLOC is not set/' config-nodebug
@@ -114,6 +115,7 @@
 	@perl -pi -e 's/CONFIG_PCI_MSI_DEFAULT_ON=y/# CONFIG_PCI_MSI_DEFAULT_ON is not set/' config-generic
 	@perl -pi -e 's/CONFIG_B43_DEBUG=y/# CONFIG_B43_DEBUG is not set/' config-generic
 	@perl -pi -e 's/CONFIG_B43LEGACY_DEBUG=y/# CONFIG_B43LEGACY_DEBUG is not set/' config-generic
+	@perl -pi -e 's/CONFIG_MMIOTRACE=y/# CONFIG_MMIOTRACE is not set/' config-nodebug
 
 	@perl -pi -e 's/CONFIG_NR_CPUS=512/CONFIG_NR_CPUS=64/' config-x86_64-generic
 


Index: TODO
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/TODO,v
retrieving revision 1.54.6.4
retrieving revision 1.54.6.5
diff -u -r1.54.6.4 -r1.54.6.5
--- TODO	30 Mar 2009 19:45:43 -0000	1.54.6.4
+++ TODO	14 Apr 2009 22:09:06 -0000	1.54.6.5
@@ -66,8 +66,13 @@
 * linux-2.6.29-lirc.patch
 * linux-2.6-sysrq-c.patch
 	jarod working on upstreaming
-* linux-2.6-hdpvr.patch
-	jarod added, should be in upstream v4l-dvb by .28, linus' tree by .29
+
+* drm-intel-lying-systems-without-lvds.patch
+	will be used as a fallback for 2.6.30 if vbios probing doesn't
+	pan out in time, may go to 2.6.29.x at some point (jarod's doing)
+* linux-2.6-acer-wmi-bail-on-aao.patch
+	suck. something similar-but-less-pretty merged upstream on 20090304,
+	a day after I (jarod) wrote my version... Headed to stable too.
 
 * linux-2.6-silence-acpi-blacklist.patch
 * linux-2.6-silence-fbcon-logo.patch
@@ -97,6 +102,11 @@
         https://bugzilla.redhat.com/490266
         Should be in 2.6.29.1
 
-* linux-2.6.29-pat-fixes.patch:
-	http://bugs.freedesktop.org/show_bug.cgi?id=20803
-	ajax to follow up with jbarnes
+* linux-2.6-kvm-kconfig-irqchip.patch
+  linux-2.6-kvm-mask-notifiers.patch
+  linux-2.6-kvm-reset-pit-irq-on-unmask.patch
+	Unable to run RHEL-5 Xen within KVM guest
+	https://bugzilla.redhat.com/show_bug.cgi?id=491625
+	Should be in 2.6.29.2
+
+


Index: branch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/Attic/branch,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- branch	21 Feb 2009 16:05:54 -0000	1.1.2.1
+++ branch	14 Apr 2009 22:09:07 -0000	1.1.2.2
@@ -1 +1 @@
-devel
+F-11


Index: config-debug
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-debug,v
retrieving revision 1.23
retrieving revision 1.23.6.1
diff -u -r1.23 -r1.23.6.1
--- config-debug	5 Feb 2009 19:02:18 -0000	1.23
+++ config-debug	14 Apr 2009 22:09:07 -0000	1.23.6.1
@@ -48,3 +48,5 @@
 CONFIG_DEBUG_NOTIFIERS=y
 
 CONFIG_DMA_API_DEBUG=y
+
+CONFIG_MMIOTRACE=y


Index: config-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-generic,v
retrieving revision 1.238.6.15
retrieving revision 1.238.6.16
diff -u -r1.238.6.15 -r1.238.6.16
--- config-generic	30 Mar 2009 20:19:11 -0000	1.238.6.15
+++ config-generic	14 Apr 2009 22:09:07 -0000	1.238.6.16
@@ -5,7 +5,7 @@
 CONFIG_SMP=y
 CONFIG_HOTPLUG_CPU=y
 CONFIG_LOCALVERSION=""
-# CONFIG_CRASH_DUMP is not set
+
 #
 # Code maturity level options
 #
@@ -40,8 +40,8 @@
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=m
-CONFIG_IOSCHED_DEADLINE=m
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
 CONFIG_IOSCHED_CFQ=y
 CONFIG_DEFAULT_CFQ=y
 CONFIG_USER_NS=y
@@ -1366,10 +1366,10 @@
 # CONFIG_BCM43XX is not set
 CONFIG_B43=m
 CONFIG_B43_PCMCIA=y
-CONFIG_B43_DEBUG=y
+# CONFIG_B43_DEBUG is not set
 # CONFIG_B43_FORCE_PIO is not set
 CONFIG_B43LEGACY=m
-CONFIG_B43LEGACY_DEBUG=y
+# CONFIG_B43LEGACY_DEBUG is not set
 CONFIG_B43LEGACY_DMA=y
 CONFIG_B43LEGACY_PIO=y
 CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
@@ -2300,6 +2300,7 @@
 CONFIG_DVB_USB_ANYSEE=m
 CONFIG_DVB_USB_DW2102=m
 CONFIG_DVB_DM1105=m
+CONFIG_DVB_DYNAMIC_MINORS=y
 
 #
 # Supported SAA7146 based PCI Adapters
@@ -2559,7 +2560,7 @@
 CONFIG_SND_HDA_CODEC_NVHDMI=y
 CONFIG_SND_HDA_GENERIC=y
 CONFIG_SND_HDA_POWER_SAVE=y
-CONFIG_SND_HDA_POWER_SAVE_DEFAULT=5
+CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
 CONFIG_SND_HDA_RECONFIG=y
 CONFIG_SND_HDSPM=m
 CONFIG_SND_HIFIER=m
@@ -2694,6 +2695,7 @@
 CONFIG_LOGIRUMBLEPAD2_FF=y
 CONFIG_PANTHERLORD_FF=y
 CONFIG_THRUSTMASTER_FF=y
+CONFIG_HID_WACOM=y
 CONFIG_ZEROPLUS_FF=y
 CONFIG_USB_HIDDEV=y
 CONFIG_USB_IDMOUSE=m
@@ -2853,6 +2855,7 @@
 CONFIG_USB_SERIAL_SAFE_PADDED=y
 CONFIG_USB_SERIAL_SIERRAWIRELESS=m
 CONFIG_USB_SERIAL_SIEMENS_MPI=m
+CONFIG_USB_SERIAL_QUALCOMM=m
 CONFIG_USB_SERIAL_SPCP8X5=m
 CONFIG_USB_SERIAL_TI=m
 CONFIG_USB_SERIAL_VISOR=m
@@ -2969,11 +2972,12 @@
 CONFIG_EXT3_FS_SECURITY=y
 CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
-CONFIG_EXT4_FS=m
+CONFIG_EXT4_FS=y
 CONFIG_EXT4_FS_XATTR=y
 CONFIG_EXT4_FS_POSIX_ACL=y
 CONFIG_EXT4_FS_SECURITY=y
 CONFIG_EXT4DEV_COMPAT=y
+CONFIG_JBD2=y
 CONFIG_JBD2_DEBUG=y
 CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=m
@@ -3098,7 +3102,8 @@
 # CONFIG_SMB_FS is not set
 # CONFIG_SMB_NLS_DEFAULT is not set
 CONFIG_CIFS=m
-# CONFIG_CIFS_STATS is not set
+CONFIG_CIFS_STATS=y
+# CONFIG_CIFS_STATS2 is not set
 CONFIG_CIFS_EXPERIMENTAL=y
 CONFIG_CIFS_UPCALL=y
 CONFIG_CIFS_XATTR=y
@@ -3289,6 +3294,7 @@
 CONFIG_CRYPTO_HW=y
 CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_MANAGER=m
+CONFIG_CRYPTO_MANAGER2=m
 # CONFIG_CRYPTO_CRYPTD is not set
 CONFIG_CRYPTO_AES=m
 CONFIG_CRYPTO_ARC4=m
@@ -3349,7 +3355,7 @@
 #
 # Library routines
 #
-CONFIG_CRC16=m
+CONFIG_CRC16=y
 CONFIG_CRC32=m
 CONFIG_CRC_CCITT=m
 CONFIG_CRC_ITU_T=m
@@ -3425,7 +3431,7 @@
 CONFIG_PM_DEBUG=y
 CONFIG_PM_TRACE=y
 # CONFIG_PM_VERBOSE is not set
-CONFIG_PM_TEST_SUSPEND=y
+# CONFIG_PM_TEST_SUSPEND is not set
 
 ## BEGIN ISA Junk.
 
@@ -3436,7 +3442,7 @@
 # CONFIG_COPS is not set
 
 CONFIG_SCSI_AHA152X=m
-# CONFIG_SCSI_AHA1542 is not set
+CONFIG_SCSI_AHA1542=m
 # CONFIG_SCSI_IN2000 is not set
 CONFIG_SCSI_ARCMSR=m
 CONFIG_SCSI_ARCMSR_AER=y
@@ -3841,7 +3847,7 @@
 # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
 CONFIG_FUNCTION_TRACER=y
 # CONFIG_FUNCTION_GRAPH_TRACER is not set
-CONFIG_BOOT_TRACER=y
+# CONFIG_BOOT_TRACER is not set
 CONFIG_STACK_TRACER=y
 # CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 CONFIG_EARLY_PRINTK_DBGP=y
@@ -3853,7 +3859,8 @@
 CONFIG_FCOE=m
 # CONFIG_SCSI_LPFC_DEBUG_FS is not set
 
-CONFIG_DVB_DYNAMIC_MINORS=y
+# CONFIG_CRASH_DUMP is not set
+# CONFIG_CRASH is not set
 
 #
 # added for xen pvops patch
@@ -3883,5 +3890,3 @@
 # CONFIG_X86_CPU_DEBUG is not set
 # CONFIG_KEXEC_JUMP is not set
 # CONFIG_FTRACE_SYSCALLS is not set
-# CONFIG_SQUASHFS3 is not set
-# CONFIG_SQUASHFS3_EMBEDDED is not set


Index: config-nodebug
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-nodebug,v
retrieving revision 1.31
retrieving revision 1.31.6.1
diff -u -r1.31 -r1.31.6.1
--- config-nodebug	5 Feb 2009 21:11:18 -0000	1.31
+++ config-nodebug	14 Apr 2009 22:09:07 -0000	1.31.6.1
@@ -2,48 +2,50 @@
 CONFIG_SND_DEBUG=y
 CONFIG_SND_PCM_XRUN_DEBUG=y
 
-CONFIG_DEBUG_MUTEXES=y
-CONFIG_DEBUG_RT_MUTEXES=y
-CONFIG_DEBUG_LOCK_ALLOC=y
-CONFIG_PROVE_LOCKING=y
-CONFIG_DEBUG_VM=y
-CONFIG_DEBUG_SPINLOCK=y
-
-CONFIG_FAULT_INJECTION=y
-CONFIG_FAILSLAB=y
-CONFIG_FAIL_PAGE_ALLOC=y
-CONFIG_FAIL_MAKE_REQUEST=y
-CONFIG_FAULT_INJECTION_DEBUG_FS=y
-CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_FAILSLAB is not set
+# CONFIG_FAIL_PAGE_ALLOC is not set
+# CONFIG_FAIL_MAKE_REQUEST is not set
+# CONFIG_FAULT_INJECTION_DEBUG_FS is not set
+# CONFIG_FAULT_INJECTION_STACKTRACE_FILTER is not set
 # CONFIG_FAIL_IO_TIMEOUT is not set
 
-CONFIG_SLUB_DEBUG_ON=y
+# CONFIG_SLUB_DEBUG_ON is not set
 
-CONFIG_LOCK_STAT=y
+# CONFIG_LOCK_STAT is not set
 
-CONFIG_DEBUG_STACK_USAGE=y
+# CONFIG_DEBUG_STACK_USAGE is not set
 
 # CONFIG_ACPI_DEBUG is not set
 
-CONFIG_DEBUG_SG=y
+# CONFIG_DEBUG_SG is not set
 
 # CONFIG_DEBUG_PAGEALLOC is not set
 
-CONFIG_DEBUG_WRITECOUNT=y
-CONFIG_DEBUG_OBJECTS=y
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_OBJECTS is not set
 # CONFIG_DEBUG_OBJECTS_SELFTEST is not set
-CONFIG_DEBUG_OBJECTS_FREE=y
-CONFIG_DEBUG_OBJECTS_TIMERS=y
+# CONFIG_DEBUG_OBJECTS_FREE is not set
+# CONFIG_DEBUG_OBJECTS_TIMERS is not set
 CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
 
-CONFIG_X86_PTDUMP=y
+# CONFIG_X86_PTDUMP is not set
 
-CONFIG_CAN_DEBUG_DEVICES=y
+# CONFIG_CAN_DEBUG_DEVICES is not set
 
-CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
 
-CONFIG_SYSCTL_SYSCALL_CHECK=y
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
 
-CONFIG_DEBUG_NOTIFIERS=y
+# CONFIG_DEBUG_NOTIFIERS is not set
 
-CONFIG_DMA_API_DEBUG=y
+# CONFIG_DMA_API_DEBUG is not set
+
+# CONFIG_MMIOTRACE is not set


Index: config-sparc64-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-sparc64-generic,v
retrieving revision 1.21.6.1
retrieving revision 1.21.6.2
diff -u -r1.21.6.1 -r1.21.6.2
--- config-sparc64-generic	12 Mar 2009 20:38:56 -0000	1.21.6.1
+++ config-sparc64-generic	14 Apr 2009 22:09:07 -0000	1.21.6.2
@@ -151,7 +151,7 @@
 CONFIG_ATM_FORE200E_DEBUG=0
 CONFIG_ATM_FORE200E_TX_RETRY=16
 # CONFIG_DRM_TDFX is not set
-# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_ATKBD=y
 CONFIG_KEYBOARD_SUNKBD=y
 # CONFIG_INPUT_PCSPKR is not set
 CONFIG_INPUT_SPARCSPKR=m
@@ -197,3 +197,5 @@
 CONFIG_SENSORS_ULTRA45=m
 CONFIG_LEDS_SUNFIRE=m
 CONFIG_TADPOLE_TS102_UCTRL=m
+
+# CONFIG_KGDB is not set


Index: config-sparc64-smp
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-sparc64-smp,v
retrieving revision 1.2
retrieving revision 1.2.16.1
diff -u -r1.2 -r1.2.16.1
--- config-sparc64-smp	16 Jul 2008 21:29:33 -0000	1.2
+++ config-sparc64-smp	14 Apr 2009 22:09:07 -0000	1.2.16.1
@@ -1 +1,2 @@
 CONFIG_SMP=y
+CONFIG_KGDB=y


Index: config-x86-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-x86-generic,v
retrieving revision 1.68.6.5
retrieving revision 1.68.6.6
diff -u -r1.68.6.5 -r1.68.6.6
--- config-x86-generic	30 Mar 2009 19:45:43 -0000	1.68.6.5
+++ config-x86-generic	14 Apr 2009 22:09:07 -0000	1.68.6.6
@@ -98,7 +98,7 @@
 #
 CONFIG_PCMCIA_FDOMAIN=m
 CONFIG_SCSI_FUTURE_DOMAIN=m
-# CONFIG_SCSI_ADVANSYS is not set
+CONFIG_SCSI_ADVANSYS=m
 
 CONFIG_SECCOMP=y
 
@@ -333,6 +333,7 @@
 CONFIG_CRASH_DUMP=y
 # CONFIG_KEXEC_JUMP is not set
 CONFIG_PROC_VMCORE=y
+CONFIG_CRASH=m
 
 CONFIG_CRYPTO_DEV_GEODE=m
 
@@ -363,7 +364,7 @@
 CONFIG_XEN_KBDDEV_FRONTEND=m
 CONFIG_XEN_BLKDEV_FRONTEND=m
 CONFIG_XEN_NETDEV_FRONTEND=m
-CONFIG_XENFS=y
+CONFIG_XENFS=m
 CONFIG_XEN_COMPAT_XENFS=y
 
 CONFIG_MTD_ESB2ROM=m
@@ -413,7 +414,6 @@
 CONFIG_SYSPROF_TRACER=y
 
 # CONFIG_X86_VERBOSE_BOOTUP is not set
-CONFIG_MMIOTRACE=y
 # CONFIG_MMIOTRACE_TEST is not set
 
 # CONFIG_DEBUG_PER_CPU_MAPS is not set


Index: config-x86_64-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-x86_64-generic,v
retrieving revision 1.68.2.5
retrieving revision 1.68.2.6
diff -u -r1.68.2.5 -r1.68.2.6
--- config-x86_64-generic	26 Mar 2009 00:02:12 -0000	1.68.2.5
+++ config-x86_64-generic	14 Apr 2009 22:09:07 -0000	1.68.2.6
@@ -10,7 +10,7 @@
 CONFIG_K8_NUMA=y
 CONFIG_X86_64_ACPI_NUMA=y
 # CONFIG_NUMA_EMU is not set
-CONFIG_NR_CPUS=512
+CONFIG_NR_CPUS=64
 CONFIG_X86_POWERNOW_K8=m
 CONFIG_X86_POWERNOW_K8_ACPI=y
 CONFIG_X86_P4_CLOCKMOD=m 
@@ -247,6 +247,7 @@
 CONFIG_CRASH_DUMP=y
 CONFIG_PHYSICAL_START=0x1000000
 CONFIG_PROC_VMCORE=y
+CONFIG_CRASH=m
 
 CONFIG_DMIID=y
 CONFIG_ISCSI_IBFT_FIND=y
@@ -281,7 +282,7 @@
 CONFIG_XEN_KBDDEV_FRONTEND=m
 CONFIG_XEN_BLKDEV_FRONTEND=m
 CONFIG_XEN_NETDEV_FRONTEND=m
-CONFIG_XENFS=y
+CONFIG_XENFS=m
 CONFIG_XEN_COMPAT_XENFS=y
 
 CONFIG_DMADEVICES=y
@@ -317,7 +318,6 @@
 CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
 CONFIG_SYSPROF_TRACER=y
 # CONFIG_X86_VERBOSE_BOOTUP is not set
-CONFIG_MMIOTRACE=y
 # CONFIG_MMIOTRACE_TEST is not set
 
 CONFIG_X86_MPPARSE=y

drm-modesetting-radeon.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.54.6.7 -r 1.54.6.8 drm-modesetting-radeon.patch
Index: drm-modesetting-radeon.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/drm-modesetting-radeon.patch,v
retrieving revision 1.54.6.7
retrieving revision 1.54.6.8
diff -u -r1.54.6.7 -r1.54.6.8
--- drm-modesetting-radeon.patch	24 Mar 2009 22:57:41 -0000	1.54.6.7
+++ drm-modesetting-radeon.patch	14 Apr 2009 22:09:08 -0000	1.54.6.8
@@ -1,3 +1,184 @@
+commit 02b2eac96ef3cd6a59bf2a13c9ae104f855ff582
+Merge: 1076a8a 24eacd0
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Tue Apr 14 15:55:42 2009 +1000
+
+    Merge branch 'drm-rawhide' into drm-f11
+
+commit 24eacd0cf8cb65a038934c11ef8ae5da348f1365
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Tue Apr 14 15:52:28 2009 +1000
+
+    radeon: add another debugging hook to gem code
+
+commit e612721b43a6fb107aa74a41e9438f23bc833051
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Tue Apr 14 15:32:08 2009 +1000
+
+    radeon: add M7 thinkpad quirk
+
+commit 6a166a2d7b4a4d9ba8ee1535f5ab1d156df6743d
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Tue Apr 14 13:59:29 2009 +1000
+
+    radeon: IGPs enable snooping in theory
+
+commit b954fe6e4c28e92e636afac1110c203148899129
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Tue Apr 14 13:19:32 2009 +1000
+
+    radeon: ack irqs before suspend in case any are pending
+
+commit 7ac7ebfef2088c943d20f683a7da1a5dcfe1bce3
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Tue Apr 14 13:18:37 2009 +1000
+
+    radeon: add initial fixed point bandwidth calcs for legacy chips.
+    
+    This does the bandwidth calcs using a 20/12 fixed point representation,
+    and ports all the code from userspace, it needs testing, but it also
+    ICEs gcc so can't really test until that is fixed.
+
+commit 7db0b18f5cbc62b89f904b5f18d046e7bcac83cc
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Mon Apr 13 15:49:34 2009 +1000
+
+    radeon: feed back updated limits to userspace
+
+commit ca7f16ed835965f0f29f38958fa8547331eeba67
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Mon Apr 13 15:45:14 2009 +1000
+
+    radeon: sync atom quirks
+
+commit 173bbeca616f4ffff4d8205f86bfb79c35151de1
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Mon Apr 13 15:35:12 2009 +1000
+
+    radeon: agp mode quirks ported from userspace
+
+commit 1076a8a749c46b964ee49f5d4dc42070b1905e26
+Merge: e94c6e1 8765b83
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Thu Apr 9 20:04:30 2009 +1000
+
+    Merge branch 'drm-rawhide' into drm-f11
+
+commit 8765b83462d03fcbd2b9d2eab647d7c2d362b12a
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Thu Apr 9 20:02:43 2009 +1000
+
+    radeon: commit missed change
+
+commit c6714d8fcdecbba304eb9e0745a4d8b6d0fb54b7
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Thu Apr 9 20:01:12 2009 +1000
+
+    radeon: temporary dac detection fix
+
+commit d96029a52d92bd307e93e4d917c9befff246f196
+Author: Alex Deucher <alexdeucher at gmail.com>
+Date:   Thu Apr 9 20:00:49 2009 +1000
+
+    radeon: fixups ported from userspace tree
+
+commit f9db70a117cc498c20e567cf53b75ccb5ad79927
+Author: Alex Deucher <alexdeucher at gmail.com>
+Date:   Mon Apr 6 13:32:03 2009 -0400
+
+    radeon: fix default sclk/mclk from combios
+    
+    Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
+
+commit 28c6f86ef07c8f0067ece9d7fe40718854b19422
+Author: Alex Deucher <alexdeucher at gmail.com>
+Date:   Mon Apr 6 13:29:56 2009 -0400
+
+    radeon: fix crtc routing for CRT1 on r4xx ATOM
+    
+    Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
+
+commit 78bf4641b234a99deb3820b8d7baece35a54dce6
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Thu Apr 9 18:41:47 2009 +1000
+
+    radeon: reset edid if none found
+
+commit a6fe700b5e32fd4db97fda76cb32977b5f381ebd
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Thu Apr 9 18:40:57 2009 +1000
+
+    radeon: fix up dual head screens on atombios
+
+commit a6dd68b3a5dee15f59bdaabf37b6a36da18a03f4
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Tue Apr 7 17:25:13 2009 +1000
+
+    radeon: fix pinning/unpinning for frontbuffer
+
+commit 828d4bc8e75d8e8ac532269521d2aeb3b50ee529
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Tue Apr 7 16:58:35 2009 +1000
+
+    radeon: actually unpin cursor on freeing
+
+commit 70c85b35945d11fae318957c7fbc52ce566a6f03
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Mon Apr 6 20:33:56 2009 +1000
+
+    radeon: add info ioctl
+
+commit e94c6e10efb4dec58e4c0ab419050b11a913eaf9
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Mon Apr 6 15:01:00 2009 +1000
+
+    drop initial config args
+
+commit 280d9ff29dead8e85ed603110ed431d99f07fb99
+Merge: 0221c81 54ed280
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Mon Apr 6 14:35:32 2009 +1000
+
+    Merge branch 'drm-rawhide' into drm-f11
+    
+    Conflicts:
+    	drivers/gpu/drm/radeon/r300_cmdbuf.c
+    	drivers/gpu/drm/radeon/radeon_cp.c
+
+commit 54ed2800977d314d8af6c1c47cd718d82f734cb6
+Author: Jerome Glisse <glisse at freedesktop.org>
+Date:   Fri Apr 3 15:01:31 2009 +0200
+
+    radeon: cleanup userspace API
+    
+    Remove old userspace API we don't want to use and
+    rename wait_rendering to wait_idle
+    change mmap to using userspace mmap call
+
+commit 71c5ad46842fcd214a8e926eb9528e084622d488
+Author: Jerome Glisse <glisse at freedesktop.org>
+Date:   Fri Apr 3 13:48:20 2009 +0200
+
+    radeon: remove pin/unpin userspace ioctl
+
+commit 7628d2d9b66fc891fc0b030772a0ebae8e695561
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Fri Apr 3 14:56:19 2009 +1000
+
+    radeon: fix two issues with uncached allocs on PCIE systems
+
+commit 79a5ca0c53c2a149f51f71352a6bbf73bcdc40df
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Wed Apr 1 22:34:53 2009 +1000
+
+    radeon: reorder bm enable vs mode set
+
+commit c9e19d53bafaacd883ad9eafd3090eb6bc4e4837
+Author: Dave Airlie <airlied at redhat.com>
+Date:   Wed Mar 25 21:49:49 2009 +1000
+
+    radeon: add vram limit for testing lower vram
+
 commit dea27f6e83efabdc3e37bc5a91d29d6dab893853
 Author: Dave Airlie <airlied at redhat.com>
 Date:   Wed Mar 18 17:07:07 2009 +1000
@@ -1749,7 +1930,7 @@
 
     drm: import TTM basic objects
 diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
-index e0ab173..69de2db 100644
+index 640339e..fdc60ea 100644
 --- a/arch/x86/mm/pat.c
[...3122 lines suppressed...]
-+#define DRM_IOCTL_RADEON_GEM_PWRITE   DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_PWRITE, struct drm_radeon_gem_pwrite)
-+#define DRM_IOCTL_RADEON_GEM_SET_DOMAIN  DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_DOMAIN, struct drm_radeon_gem_set_domain)
-+#define DRM_IOCTL_RADEON_GEM_WAIT_RENDERING DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_RENDERING, struct drm_radeon_gem_wait_rendering) 
-+#define DRM_IOCTL_RADEON_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_CS, struct drm_radeon_cs)
-+
++/* KMS */
++#define DRM_IOCTL_RADEON_GEM_INFO	DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_INFO, struct drm_radeon_gem_info)
++#define DRM_IOCTL_RADEON_GEM_CREATE	DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_CREATE, struct drm_radeon_gem_create)
++#define DRM_IOCTL_RADEON_GEM_MMAP	DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_MMAP, struct drm_radeon_gem_mmap)
++#define DRM_IOCTL_RADEON_GEM_PREAD	DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_PREAD, struct drm_radeon_gem_pread)
++#define DRM_IOCTL_RADEON_GEM_PWRITE	DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_PWRITE, struct drm_radeon_gem_pwrite)
++#define DRM_IOCTL_RADEON_GEM_SET_DOMAIN	DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_DOMAIN, struct drm_radeon_gem_set_domain)
++#define DRM_IOCTL_RADEON_GEM_WAIT_IDLE	DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_IDLE, struct drm_radeon_gem_wait_idle) 
++#define DRM_IOCTL_RADEON_CS		DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_CS, struct drm_radeon_cs)
++#define DRM_IOCTL_RADEON_INFO		DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info)
 +
+ 
  typedef struct drm_radeon_init {
  	enum {
- 		RADEON_INIT_CP = 0x01,
-@@ -680,6 +713,8 @@ typedef struct drm_radeon_indirect {
+@@ -682,6 +703,7 @@ typedef struct drm_radeon_indirect {
  #define RADEON_PARAM_VBLANK_CRTC           13   /* VBLANK CRTC */
  #define RADEON_PARAM_FB_LOCATION           14   /* FB location */
  #define RADEON_PARAM_NUM_GB_PIPES          15   /* num GB pipes */
-+#define RADEON_PARAM_KERNEL_MM             16
-+#define RADEON_PARAM_DEVICE_ID		   17
++#define RADEON_PARAM_DEVICE_ID             16
  
  typedef struct drm_radeon_getparam {
  	int param;
-@@ -734,6 +769,7 @@ typedef struct drm_radeon_setparam {
- #define RADEON_SETPARAM_NEW_MEMMAP 4		/* Use new memory map */
- #define RADEON_SETPARAM_PCIGART_TABLE_SIZE 5    /* PCI GART Table Size */
- #define RADEON_SETPARAM_VBLANK_CRTC 6           /* VBLANK CRTC */
-+#define RADEON_SETPARAM_MM_INIT 7               /* DDX wants memory manager but has no modesetting */
- /* 1.14: Clients can allocate/free a surface
-  */
- typedef struct drm_radeon_surface_alloc {
-@@ -749,4 +785,106 @@ typedef struct drm_radeon_surface_free {
+@@ -751,4 +773,112 @@ typedef struct drm_radeon_surface_free {
  #define	DRM_RADEON_VBLANK_CRTC1		1
  #define	DRM_RADEON_VBLANK_CRTC2		2
  
-+#define RADEON_GEM_DOMAIN_CPU 0x1   // Cached CPU domain
-+#define RADEON_GEM_DOMAIN_GTT 0x2   // GTT or cache flushed
-+#define RADEON_GEM_DOMAIN_VRAM 0x4  // VRAM domain
++/*
++ * Kernel modesetting world below.
++ */
++#define RADEON_GEM_DOMAIN_CPU		0x1
++#define RADEON_GEM_DOMAIN_GTT		0x2
++#define RADEON_GEM_DOMAIN_VRAM		0x4
 +
-+/* return to userspace start/size of gtt and vram apertures */
 +struct drm_radeon_gem_info {
-+	uint64_t gart_start;
-+	uint64_t gart_size;
-+	uint64_t vram_start;
-+	uint64_t vram_size;
-+	uint64_t vram_visible;
++	uint64_t	gart_size;
++	uint64_t	vram_size;
++	uint64_t	vram_visible;
 +};
 +
++#define RADEON_GEM_NO_BACKING_STORE 1
++
 +struct drm_radeon_gem_create {
-+	uint64_t size;
-+	uint64_t alignment;
-+	uint32_t handle;
-+	uint32_t initial_domain; // to allow VRAM to be created
-+	uint32_t no_backing_store; // for VRAM objects - select whether they need backing store
-+	// pretty much front/back/depth don't need it - other things do
++	uint64_t	size;
++	uint64_t	alignment;
++	uint32_t	handle;
++	uint32_t	initial_domain;
++	uint32_t	flags;
 +};
 +
 +struct drm_radeon_gem_mmap {
-+	uint32_t handle;
-+	uint32_t pad;
-+	uint64_t offset;
-+	uint64_t size;
-+	uint64_t addr_ptr;
++	uint32_t	handle;
++	uint32_t	pad;
++	uint64_t	offset;
++	uint64_t	size;
++	uint64_t	addr_ptr;
 +};
 +
 +struct drm_radeon_gem_set_domain {
-+	uint32_t handle;
-+	uint32_t read_domains;
-+	uint32_t write_domain;
-+};
-+
-+struct drm_radeon_gem_wait_rendering {
-+	uint32_t handle;
-+};
-+
-+struct drm_radeon_gem_pin {
-+	uint32_t handle;
-+	uint32_t pin_domain;
-+	uint64_t alignment;
-+	uint64_t offset;
++	uint32_t	handle;
++	uint32_t		read_domains;
++	uint32_t		write_domain;
 +};
 +
-+struct drm_radeon_gem_unpin {
-+	uint32_t handle;
-+	uint32_t pad;
++struct drm_radeon_gem_wait_idle {
++	uint32_t	handle;
++	uint32_t	pad;
 +};
 +
 +struct drm_radeon_gem_busy {
-+	uint32_t handle;
-+	uint32_t busy;
++	uint32_t	handle;
++	uint32_t	busy;
 +};
 +
 +struct drm_radeon_gem_pread {
@@ -38670,7 +39383,8 @@
 +	/** Length of data to read */
 +	uint64_t size;
 +	/** Pointer to write the data into. */
-+	uint64_t data_ptr;	/* void *, but pointers are not 32/64 compatible */
++	/* void *, but pointers are not 32/64 compatible */
++	uint64_t data_ptr;
 +};
 +
 +struct drm_radeon_gem_pwrite {
@@ -38682,28 +39396,43 @@
 +	/** Length of data to write */
 +	uint64_t size;
 +	/** Pointer to read the data from. */
-+	uint64_t data_ptr;	/* void *, but pointers are not 32/64 compatible */
++	/* void *, but pointers are not 32/64 compatible */
++	uint64_t data_ptr;
 +};
 +
-+
-+/* New interface which obsolete all previous interface.
-+ */
-+#define RADEON_CHUNK_ID_RELOCS 0x01
-+#define RADEON_CHUNK_ID_IB     0x02
-+#define RADEON_CHUNK_ID_OLD 0xff
++#define RADEON_CHUNK_ID_RELOCS	0x01
++#define RADEON_CHUNK_ID_IB	0x02
 +
 +struct drm_radeon_cs_chunk {
-+	uint32_t chunk_id;
-+	uint32_t length_dw;
-+	uint64_t chunk_data;
++	uint32_t		chunk_id;
++	uint32_t		length_dw;
++	uint64_t		chunk_data;
 +};
 +
-+struct drm_radeon_cs {
-+	uint32_t	num_chunks;
-+	uint32_t        cs_id;
-+	uint64_t	chunks; /* this points to uint64_t * which point to
-+				   cs chunks */
++struct drm_radeon_cs_reloc {
++	uint32_t		handle;
++	uint32_t		read_domains;
++	uint32_t		write_domain;
++	uint32_t		flags;
 +};
 +
++struct drm_radeon_cs {
++	uint32_t		num_chunks;
++	uint32_t		cs_id;
++	/* this points to uint64_t * which point to cs chunks */
++	uint64_t		chunks;
++	/* updates to the limits after this CS ioctl */
++	uint64_t		gart_limit;
++	uint64_t		vram_limit;
++};
++
++#define RADEON_INFO_DEVICE_ID		0x00
++#define RADEON_INFO_NUM_GB_PIPES	0x01
++
++struct drm_radeon_info {
++	uint32_t		request;
++	uint32_t		pad;
++	uint64_t		value;
++};
 +
  #endif

drm-next.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.6.6.5 -r 1.6.6.6 drm-next.patch
Index: drm-next.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/drm-next.patch,v
retrieving revision 1.6.6.5
retrieving revision 1.6.6.6
diff -u -r1.6.6.5 -r1.6.6.6
--- drm-next.patch	24 Mar 2009 22:57:42 -0000	1.6.6.5
+++ drm-next.patch	14 Apr 2009 22:09:11 -0000	1.6.6.6
@@ -1,659 +1,3 @@
-commit 41f13fe81dd1b08723ab9f3fc3c7f29cfa81f1a5
-Author: Alex Deucher <alexdeucher at gmail.com>
-Date:   Mon Mar 16 15:37:02 2009 -0400
-
-    drm/radeon: fix logic in r600_page_table_init() to match ati_gart
-    
-    This fixes page table init on rs600.
-    
-    Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
-    Signed-off-by: Dave Airlie <airlied at redhat.com>
-
-commit 06f0a488c1b642d3cd7769da66600e5148c3fad8
-Author: Dave Airlie <airlied at redhat.com>
-Date:   Fri Mar 13 09:35:32 2009 +1000
-
-    drm/radeon: r600 ptes are 64-bit, cleanup cleanup function.
-    
-    Signed-off-by: Dave Airlie <airlied at redhat.com>
-
-commit 03efb8853c35aff51c7b901bf412f32765fe0fd9
-Author: Dave Airlie <airlied at redhat.com>
-Date:   Tue Mar 10 18:36:38 2009 +1000
-
-    drm/radeon: don't call irq changes on r600 suspend/resume
-    
-    Until we sort out r600 IRQs don't do this.
-    
-    Signed-off-by: Dave Airlie <airlied at redhat.com>
-
-commit d02f7fa77d97a28a4276939f35e44ae995ad13d7
-Author: Dave Airlie <airlied at redhat.com>
-Date:   Tue Mar 10 18:34:23 2009 +1000
-
-    drm/radeon: fix r600 writeback across suspend/resume
-    
-    This update was done in mainline radeon, but not in the r600.
-    
-    Signed-off-by: Dave Airlie <airlied at redhat.com>
-
-commit 6546bf6d6cbf1f9ac350fd278a1d937d4bb9ad06
-Author: Dave Airlie <airlied at redhat.com>
-Date:   Mon Mar 9 15:31:20 2009 +1000
-
-    drm/radeon: fix r600 writeback setup.
-    
-    This fixes 2 bugs:
-    1. the AGP calculation wasn't consistent with the PCI(E) calc for the
-    RPTR_ADDR registers. This consolidates the writes and fixes it up.
-    
-    2. The scratch address was being incorrectly calculated, this breaks
-    it out into a lot more linear steps.
-    
-    Signed-off-by: Dave Airlie <airlied at redhat.com>
-
-commit 1847a549ac4db1272dea13d86331c492a2640b3b
-Author: Dave Airlie <airlied at redhat.com>
-Date:   Mon Mar 9 12:47:18 2009 +1000
-
-    drm: fix warnings about new mappings in info code.
-    
-    This fixes up the warnings in the debugfs code that conflicted
-    with the mapping fixups.
-    
-    Signed-off-by: Dave Airlie <airlied at redhat.com>
-
-commit 8f497aade8df2a619eacda927a43ebe82167a84c
-Author: Hannes Eder <hannes at hanneseder.net>
-Date:   Thu Mar 5 20:14:18 2009 +0100
-
-    drm/radeon: NULL noise: drivers/gpu/drm/radeon/radeon_*.c
-    
-    Fix this sparse warning:
-      drivers/gpu/drm/radeon/r600_cp.c:1811:52: warning: Using plain integer as NULL pointer
-      drivers/gpu/drm/radeon/radeon_cp.c:1363:52: warning: Using plain integer as NULL pointer
-      drivers/gpu/drm/radeon/radeon_state.c:1983:61: warning: Using plain integer as NULL pointer
-    
-    Signed-off-by: Hannes Eder <hannes at hanneseder.net>
-    Signed-off-by: Dave Airlie <airlied at redhat.com>
-
-commit a763d7dc0adb1159c1a52d43e566409da9fa59f0
-Author: Dave Airlie <airlied at redhat.com>
-Date:   Mon Mar 9 12:17:08 2009 +1000
-
-    drm/radeon: fix r600 pci mapping calls.
-    
-    This realigns the r600 pci mapping calls with the ati pcigart ones,
-    fixing the direction and using the correct interface.
-    
-    Suggested by Jerome Glisse.
-    
-    Signed-off-by: Dave Airlie <airlied at redhat.com>
-
-commit 08932156cc2d4f8807dc5ca5c3d6ccd85080610a
-Author: Alex Deucher <alexdeucher at gmail.com>
-Date:   Sat Mar 7 18:21:21 2009 -0500
-
-    drm/radeon: r6xx/r7xx: fix possible oops in r600_page_table_cleanup()
-    
-    Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
-    Signed-off-by: Dave Airlie <airlied at redhat.com>
-
-commit 53c379e9462b59d4e166429ff064aaf0e7743795
-Author: Dave Airlie <airlied at redhat.com>
-Date:   Mon Mar 9 12:12:28 2009 +1000
-
-    radeon: call the correct idle function, logic got inverted.
-    
-    This calls the correct idle function for the R600 and previous chips.
-    
-    Signed-off-by: Dave Airlie <airlied at redhat.com>
-
-commit 800b69951174f7de294da575d7e7921041a7e783
-Author: Alex Deucher <alexdeucher at gmail.com>
-Date:   Fri Mar 6 11:47:54 2009 -0500
-
-    drm/radeon: RS600: fix interrupt handling
-    
-    the checks weren't updated when RS600 support
-    was added.
-    
-    Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
-    Signed-off-by: Dave Airlie <airlied at linux.ie>
-
-commit a7d13ad0e2c1b0572492fd53ca1a090794e2f8e2
-Author: Dave Airlie <airlied at redhat.com>
-Date:   Thu Feb 26 10:15:24 2009 +1000
-
-    drm/r600: fix rptr address along lines of previous fixes to radeon.
-    
-    Signed-off-by: Dave Airlie <airlied at redhat.com>
-
-commit eb1d91954ededc00ddcfb51e2626f114ff351524
-Author: Dave Airlie <airlied at redhat.com>
-Date:   Thu Feb 26 10:14:40 2009 +1000
-
-    drm/r600: fixup r600 gart table accessor like ati_pcigart.c
-    
-    This attempts to fixup the r600 GART accessors so they work on other arches.
-    
-    Signed-off-by: Dave Airlie <airlied at redhat.com>
-
-commit 6abf66018f7fe231720e50f9a47b142182388869
-Author: Dave Airlie <airlied at redhat.com>
-Date:   Thu Feb 26 10:13:47 2009 +1000
-
-    drm/ati_pcigart: use memset_io to reset the memory
-    
-    Also don't setup pci_gart if we aren't going to need it.
-    
-    Signed-off-by: Dave Airlie <airlied at redhat.com>
-
-commit 87f0da55353e23826a54bff57c457a13b97d18f1
-Author: Dave Airlie <airlied at redhat.com>
-Date:   Thu Feb 26 10:12:10 2009 +1000
-
-    drm: add DRM_READ/WRITE64 wrappers around readq/writeq.
-    
-    The readq/writeq stuff is from Dave Miller, and he
-    warns users to be careful about using these. Plans are only
-    r600 to use it so far.
-    
-    Signed-off-by: Dave Airlie <airlied at redhat.com>
-
-commit 8ced9c75160947d2235fba75de9413e087e1171a
-Author: Alex Deucher <alexdeucher at gmail.com>
-Date:   Wed Feb 25 17:02:19 2009 -0500
-
-    radeon: add RS600 pci ids
-    
-    Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
-    Signed-off-by: Dave Airlie <airlied at redhat.com>
-
-commit c1556f71513f2e660fb2bbdc29344361b1ebff35
-Author: Alex Deucher <alexdeucher at gmail.com>
-Date:   Wed Feb 25 16:57:49 2009 -0500
-
-    radeon: add support for rs600 GPUs
-    
-    RS600s are an AMD IGP for Intel CPUs, that look like RS690s from
-    a lot of perspectives but look like r600s from a memory controller
-    point of view.
-    
-    Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
-    Signed-off-by: Dave Airlie <airlied at redhat.com>
-
-commit 7659e9804b7a66047433182d86393d38ba4eff79
-Author: Alex Deucher <alexdeucher at gmail.com>
-Date:   Wed Feb 25 15:55:01 2009 -0500
-
-    radeon: fix r600 AGP support
-    
[...6070 lines suppressed...]
+ #define DRM_IOCTL_MGA_DMA_BOOTSTRAP DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_DMA_BOOTSTRAP, drm_mga_dma_bootstrap_t)
+ 
+ typedef struct _drm_mga_warp_index {
+@@ -310,7 +312,7 @@ typedef struct drm_mga_dma_bootstrap {
+ 	 */
+ 	/*@{ */
+ 	unsigned long texture_handle; /**< Handle used to map AGP textures. */
+-	uint32_t texture_size;	      /**< Size of the AGP texture region. */
++	__u32 texture_size;	      /**< Size of the AGP texture region. */
+ 	/*@} */
+ 
+ 	/**
+@@ -319,7 +321,7 @@ typedef struct drm_mga_dma_bootstrap {
+ 	 * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be
+ 	 * filled in with the actual AGP mode.  If AGP was not available
+ 	 */
+-	uint32_t primary_size;
++	__u32 primary_size;
+ 
+ 	/**
+ 	 * Requested number of secondary DMA buffers.
+@@ -329,7 +331,7 @@ typedef struct drm_mga_dma_bootstrap {
+ 	 * allocated.  Particularly when PCI DMA is used, this may be
+ 	 * (subtantially) less than the number requested.
+ 	 */
+-	uint32_t secondary_bin_count;
++	__u32 secondary_bin_count;
+ 
+ 	/**
+ 	 * Requested size of each secondary DMA buffer.
+@@ -338,7 +340,7 @@ typedef struct drm_mga_dma_bootstrap {
+ 	 * dma_mga_dma_bootstrap::secondary_bin_count, it is \b not allowed
+ 	 * to reduce dma_mga_dma_bootstrap::secondary_bin_size.
+ 	 */
+-	uint32_t secondary_bin_size;
++	__u32 secondary_bin_size;
+ 
+ 	/**
+ 	 * Bit-wise mask of AGPSTAT2_* values.  Currently only \c AGPSTAT2_1X,
+@@ -350,12 +352,12 @@ typedef struct drm_mga_dma_bootstrap {
+ 	 * filled in with the actual AGP mode.  If AGP was not available
+ 	 * (i.e., PCI DMA was used), this value will be zero.
+ 	 */
+-	uint32_t agp_mode;
++	__u32 agp_mode;
+ 
+ 	/**
+ 	 * Desired AGP GART size, measured in megabytes.
+ 	 */
+-	uint8_t agp_size;
++	__u8 agp_size;
+ } drm_mga_dma_bootstrap_t;
+ 
+ typedef struct drm_mga_clear {
 diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h
-index 73ff51f..937a275 100644
+index 73ff51f..fe3e3a4 100644
 --- a/include/drm/radeon_drm.h
 +++ b/include/drm/radeon_drm.h
-@@ -304,6 +304,8 @@ typedef union {
+@@ -33,6 +33,8 @@
+ #ifndef __RADEON_DRM_H__
+ #define __RADEON_DRM_H__
+ 
++#include <linux/types.h>
++
+ /* WARNING: If you change any of these defines, make sure to change the
+  * defines in the X server file (radeon_sarea.h)
+  */
+@@ -304,6 +306,8 @@ typedef union {
  
  #define RADEON_SCRATCH_REG_OFFSET	32
  
@@ -31890,7 +36314,7 @@
  #define RADEON_NR_SAREA_CLIPRECTS	12
  
  /* There are 2 heaps (local/GART).  Each region within a heap is a
-@@ -526,7 +528,8 @@ typedef struct drm_radeon_init {
+@@ -526,7 +530,8 @@ typedef struct drm_radeon_init {
  		RADEON_INIT_CP = 0x01,
  		RADEON_CLEANUP_CP = 0x02,
  		RADEON_INIT_R200_CP = 0x03,
@@ -31900,3 +36324,117 @@
  	} func;
  	unsigned long sarea_priv_offset;
  	int is_pci;
+@@ -722,7 +727,7 @@ typedef struct drm_radeon_irq_wait {
+ 
+ typedef struct drm_radeon_setparam {
+ 	unsigned int param;
+-	int64_t value;
++	__s64 value;
+ } drm_radeon_setparam_t;
+ 
+ #define RADEON_SETPARAM_FB_LOCATION    1	/* determined framebuffer location */
+diff --git a/include/drm/via_drm.h b/include/drm/via_drm.h
+index a3b5c10..170786e 100644
+--- a/include/drm/via_drm.h
++++ b/include/drm/via_drm.h
+@@ -24,6 +24,8 @@
+ #ifndef _VIA_DRM_H_
+ #define _VIA_DRM_H_
+ 
++#include <linux/types.h>
++
+ /* WARNING: These defines must be the same as what the Xserver uses.
+  * if you change them, you must change the defines in the Xserver.
+  */
+@@ -114,19 +116,19 @@
+ #define VIA_MEM_UNKNOWN 4
+ 
+ typedef struct {
+-	uint32_t offset;
+-	uint32_t size;
++	__u32 offset;
++	__u32 size;
+ } drm_via_agp_t;
+ 
+ typedef struct {
+-	uint32_t offset;
+-	uint32_t size;
++	__u32 offset;
++	__u32 size;
+ } drm_via_fb_t;
+ 
+ typedef struct {
+-	uint32_t context;
+-	uint32_t type;
+-	uint32_t size;
++	__u32 context;
++	__u32 type;
++	__u32 size;
+ 	unsigned long index;
+ 	unsigned long offset;
+ } drm_via_mem_t;
+@@ -148,9 +150,9 @@ typedef struct _drm_via_futex {
+ 		VIA_FUTEX_WAIT = 0x00,
+ 		VIA_FUTEX_WAKE = 0X01
+ 	} func;
+-	uint32_t ms;
+-	uint32_t lock;
+-	uint32_t val;
++	__u32 ms;
++	__u32 lock;
++	__u32 val;
+ } drm_via_futex_t;
+ 
+ typedef struct _drm_via_dma_init {
+@@ -211,7 +213,7 @@ typedef struct _drm_via_cmdbuf_size {
+ 		VIA_CMDBUF_LAG = 0x02
+ 	} func;
+ 	int wait;
+-	uint32_t size;
++	__u32 size;
+ } drm_via_cmdbuf_size_t;
+ 
+ typedef enum {
+@@ -236,8 +238,8 @@ enum drm_via_irqs {
+ struct drm_via_wait_irq_request {
+ 	unsigned irq;
+ 	via_irq_seq_type_t type;
+-	uint32_t sequence;
+-	uint32_t signal;
++	__u32 sequence;
++	__u32 signal;
+ };
+ 
+ typedef union drm_via_irqwait {
+@@ -246,7 +248,7 @@ typedef union drm_via_irqwait {
+ } drm_via_irqwait_t;
+ 
+ typedef struct drm_via_blitsync {
+-	uint32_t sync_handle;
++	__u32 sync_handle;
+ 	unsigned engine;
+ } drm_via_blitsync_t;
+ 
+@@ -257,16 +259,16 @@ typedef struct drm_via_blitsync {
+  */
+ 
+ typedef struct drm_via_dmablit {
+-	uint32_t num_lines;
+-	uint32_t line_length;
++	__u32 num_lines;
++	__u32 line_length;
+ 
+-	uint32_t fb_addr;
+-	uint32_t fb_stride;
++	__u32 fb_addr;
++	__u32 fb_stride;
+ 
+ 	unsigned char *mem_addr;
+-	uint32_t mem_stride;
++	__u32 mem_stride;
+ 
+-	uint32_t flags;
++	__u32 flags;
+ 	int to_fb;
+ 
+ 	drm_via_blitsync_t sync;

drm-nouveau.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.8.6.8 -r 1.8.6.9 drm-nouveau.patch
Index: drm-nouveau.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/drm-nouveau.patch,v
retrieving revision 1.8.6.8
retrieving revision 1.8.6.9
diff -u -r1.8.6.8 -r1.8.6.9
--- drm-nouveau.patch	30 Mar 2009 19:45:44 -0000	1.8.6.8
+++ drm-nouveau.patch	14 Apr 2009 22:09:12 -0000	1.8.6.9
@@ -103,7 +103,7 @@
  	if (mask & ~fence->type) {
  		DRM_ERROR("Wait trying to extend fence type"
 diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
-index c1173d8..2e4e667 100644
+index 4984aa8..dee9b40 100644
 --- a/drivers/gpu/drm/drm_gem.c
 +++ b/drivers/gpu/drm/drm_gem.c
 @@ -280,48 +280,58 @@ drm_gem_close_ioctl(struct drm_device *dev, void *data,
@@ -236,7 +236,7 @@
  		drm_put_minor(&dev->control);
 diff --git a/drivers/gpu/drm/nouveau/Makefile b/drivers/gpu/drm/nouveau/Makefile
 new file mode 100644
-index 0000000..12af41b
+index 0000000..06483d0
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/Makefile
 @@ -0,0 +1,24 @@
@@ -249,8 +249,8 @@
 +             nouveau_object.o nouveau_irq.o nouveau_notifier.o \
 +             nouveau_swmthd.o nouveau_sgdma.o nouveau_dma.o \
 +             nouveau_bo.o nouveau_fence.o nouveau_gem.o \
-+             nouveau_bios.o nouveau_display.o nouveau_fbcon.o \
-+	     nouveau_backlight.o \
++             nouveau_hw.o nouveau_calc.o nouveau_bios.o nouveau_i2c.o \
++	     nouveau_display.o nouveau_fbcon.o nouveau_backlight.o \
 +             nv04_timer.o \
 +             nv04_mc.o nv40_mc.o nv50_mc.o \
 +             nv04_fb.o nv10_fb.o nv40_fb.o \
@@ -259,17 +259,17 @@
 +             nv40_graph.o nv50_graph.o \
 +             nv04_instmem.o nv50_instmem.o \
 +             nv50_crtc.o nv50_dac.o nv50_sor.o nv50_connector.o \
-+             nv50_cursor.o nv50_i2c.o nv50_display.o nv50_fbcon.o
++             nv50_cursor.o nv50_display.o nv50_fbcon.o
 +
 +nouveau-$(CONFIG_COMPAT) += nouveau_ioc32.o
 +
 +obj-$(CONFIG_DRM_NOUVEAU)+= nouveau.o
 diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
 new file mode 100644
-index 0000000..3fc521e
+index 0000000..e3d354f
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
-@@ -0,0 +1,156 @@
+@@ -0,0 +1,152 @@
 +/*
 + * Copyright (C) 2009 Red Hat <mjg at redhat.com>
 + *
@@ -312,7 +312,6 @@
 +static int nv40_get_intensity(struct backlight_device *bd)
 +{
 +	struct drm_device *dev = bl_get_data(bd);
-+	struct drm_nouveau_private *dev_priv = dev->dev_private;
 +	int val = (nv_rd32(NV40_PMC_BACKLIGHT) & NV40_PMC_BACKLIGHT_MASK) >> 16;
 +
 +	return val;
@@ -321,7 +320,6 @@
 +static int nv40_set_intensity(struct backlight_device *bd)
 +{
 +	struct drm_device *dev = bl_get_data(bd);
-+	struct drm_nouveau_private *dev_priv = dev->dev_private;
 +	int val = bd->props.brightness;
 +	int reg = nv_rd32(NV40_PMC_BACKLIGHT);
 +
@@ -340,7 +338,6 @@
 +static int nv50_get_intensity(struct backlight_device *bd)
 +{
 +	struct drm_device *dev = bl_get_data(bd);
-+	struct drm_nouveau_private *dev_priv = dev->dev_private;
 +
 +	return nv_rd32(NV50_PDISPLAY_BACKLIGHT);
 +}
@@ -348,7 +345,6 @@
 +static int nv50_set_intensity(struct backlight_device *bd)
 +{
 +	struct drm_device *dev = bl_get_data(bd);
-+	struct drm_nouveau_private *dev_priv = dev->dev_private;
 +	int val = bd->props.brightness;
 +
 +	nv_wr32(NV50_PDISPLAY_BACKLIGHT, val | NV50_PDISPLAY_BACKLIGHT_ENABLE);
@@ -428,45 +424,65 @@
 +}	
 diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
 new file mode 100644
-index 0000000..bcbedb7
+index 0000000..fd3e08a
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
-@@ -0,0 +1,854 @@
+@@ -0,0 +1,4577 @@
 +/*
-+ * Copyright (C) 2005-2006 Erik Waling
-+ * Copyright (C) 2006 Stephane Marchesin
-+ * Copyright (C) 2007-2008 Stuart Bennett
-+ * Copyright (C) 2008 Maarten Maathuis.
-+ * All Rights Reserved.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining
-+ * a copy of this software and associated documentation files (the
-+ * "Software"), to deal in the Software without restriction, including
-+ * without limitation the rights to use, copy, modify, merge, publish,
-+ * distribute, sublicense, and/or sell copies of the Software, and to
-+ * permit persons to whom the Software is furnished to do so, subject to
-+ * the following conditions:
++ * Copyright 2005-2006 Erik Waling
++ * Copyright 2006 Stephane Marchesin
++ * Copyright 2007-2009 Stuart Bennett
 + *
-+ * The above copyright notice and this permission notice (including the
-+ * next paragraph) shall be included in all copies or substantial
-+ * portions of the Software.
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
 + *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-+ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
-+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
 + *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
++ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
++ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
++ * SOFTWARE.
 + */
 +
-+#include <asm/byteorder.h>
-+#include "nouveau_bios.h"
++#include "drmP.h"
 +#include "nouveau_drv.h"
++#include "nouveau_hw.h"
++
++/* these defines are made up */
++#define NV_CIO_CRE_44_HEADA 0x0
++#define NV_CIO_CRE_44_HEADB 0x3
++#define FEATURE_MOBILE 0x10	/* also FEATURE_QUADRO for BMP */
++#define LEGACY_I2C_CRT 0x80
++
++#define EDID1_LEN 128
++
++#define BIOSLOG(sip, fmt, arg...) NV_DEBUG(sip, fmt, ##arg)
++#define LOG_OLD_VALUE(x) //x
++
++#define BIOS_USLEEP(n) msleep((n)/1000)
++
++#define ROM16(x) le16_to_cpu(*(uint16_t *)&(x))
++#define ROM32(x) le32_to_cpu(*(uint32_t *)&(x))
 +
-+/* returns true if it mismatches */
-+static bool nv_checksum(const uint8_t *data, unsigned int length)
++static int crtchead = 0;
++
++/* this will need remembering across a suspend */
++static uint32_t saved_nv_pfb_cfg0;
++
++typedef struct {
++	bool execute;
++	bool repeat;
++} init_exec_t;
++
++static bool nv_cksum(const uint8_t *data, unsigned int length)
 +{
 +	/* there's a few checksums in the BIOS, so here's a generic checking function */
 +	int i;
@@ -481,51 +497,74 @@
 +	return false;
 +}
 +
-+static int nv_valid_bios(struct drm_device *dev, uint8_t *data)
++static int
++score_vbios(struct drm_device *dev, const uint8_t *data, const bool writeable)
 +{
-+	/* check for BIOS signature */
 +	if (!(data[0] == 0x55 && data[1] == 0xAA)) {
-+		DRM_ERROR("BIOS signature not found.\n");
++		NV_TRACEWARN(dev, "... BIOS signature not found\n");
 +		return 0;
 +	}
 +
[...20884 lines suppressed...]
++#define NV_PRAMDAC_NVPLL_COEFF				0x00680500
++#define NV_PRAMDAC_MPLL_COEFF				0x00680504
++#define NV_PRAMDAC_VPLL_COEFF				0x00680508
++#	define NV30_RAMDAC_ENABLE_VCO2				(8 << 4)
++
++#define NV_PRAMDAC_PLL_COEFF_SELECT			0x0068050c
++#	define NV_RAMDAC_PLL_SELECT_USE_VPLL2_TRUE		(4 << 0)
++#	define NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_MPLL	(1 << 8)
++#	define NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_VPLL	(2 << 8)
++#	define NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_NVPLL	(4 << 8)
++#	define NV_RAMDAC_PLL_SELECT_PLL_SOURCE_VPLL2		(8 << 8)
++#	define NV_PRAMDAC_PLL_COEFF_SELECT_VCLK_RATIO_DB2	(1 << 28)
++#	define NV_RAMDAC_PLL_SELECT_VCLK2_RATIO_DB2		(2 << 28)
++
++#define NV_PRAMDAC_PLL_SETUP_CONTROL			0x00680510
++#define NV_RAMDAC_VPLL2					0x00680520
++#define NV_PRAMDAC_SEL_CLK				0x00680524
++#define NV_RAMDAC_DITHER_NV11				0x00680528
++#define NV_PRAMDAC_DACCLK				0x0068052c
++#	define NV_PRAMDAC_DACCLK_SEL_DACCLK			(1 << 0)
++
++#define NV_RAMDAC_NVPLL_B				0x00680570
++#define NV_RAMDAC_MPLL_B				0x00680574
++#define NV_RAMDAC_VPLL_B				0x00680578
++#define NV_RAMDAC_VPLL2_B				0x0068057c
++#	define NV31_RAMDAC_ENABLE_VCO2				(8 << 28)
++#define NV_PRAMDAC_580					0x00680580
++#	define NV_RAMDAC_580_VPLL1_ACTIVE			(1 << 8)
++#	define NV_RAMDAC_580_VPLL2_ACTIVE			(1 << 28)
++
++#define NV_PRAMDAC_GENERAL_CONTROL			0x00680600
++#define NV_PRAMDAC_TEST_CONTROL				0x00680608
++#	define NV_PRAMDAC_TEST_CONTROL_TP_INS_EN_ASSERTED	(1 << 12)
++#	define NV_PRAMDAC_TEST_CONTROL_PWRDWN_DAC_OFF		(1 << 16)
++#	define NV_PRAMDAC_TEST_CONTROL_SENSEB_ALLHI		(1 << 28)
++#define NV_PRAMDAC_TESTPOINT_DATA			0x00680610
++#	define NV_PRAMDAC_TESTPOINT_DATA_NOTBLANK		(8 << 28)
++#define NV_PRAMDAC_630					0x00680630
++#define NV_PRAMDAC_634					0x00680634
++
++#define NV_PRAMDAC_FP_VDISPLAY_END			0x00680800
++#define NV_PRAMDAC_FP_VTOTAL				0x00680804
++#define NV_PRAMDAC_FP_VCRTC				0x00680808
++#define NV_PRAMDAC_FP_VSYNC_START			0x0068080c
++#define NV_PRAMDAC_FP_VSYNC_END				0x00680810
++#define NV_PRAMDAC_FP_VVALID_START			0x00680814
++#define NV_PRAMDAC_FP_VVALID_END			0x00680818
++#define NV_PRAMDAC_FP_HDISPLAY_END			0x00680820
++#define NV_PRAMDAC_FP_HTOTAL				0x00680824
++#define NV_PRAMDAC_FP_HCRTC				0x00680828
++#define NV_PRAMDAC_FP_HSYNC_START			0x0068082c
++#define NV_PRAMDAC_FP_HSYNC_END				0x00680830
++#define NV_PRAMDAC_FP_HVALID_START			0x00680834
++#define NV_PRAMDAC_FP_HVALID_END			0x00680838
++
++#define NV_RAMDAC_FP_DITHER				0x0068083c
++#define NV_PRAMDAC_FP_TG_CONTROL			0x00680848
++#	define NV_PRAMDAC_FP_TG_CONTROL_VSYNC_POS		(1 << 0)
++#	define NV_PRAMDAC_FP_TG_CONTROL_VSYNC_DISABLE		(2 << 0)
++#	define NV_PRAMDAC_FP_TG_CONTROL_HSYNC_POS		(1 << 4)
++#	define NV_PRAMDAC_FP_TG_CONTROL_HSYNC_DISABLE		(2 << 4)
++#	define NV_PRAMDAC_FP_TG_CONTROL_MODE_SCALE		(0 << 8)
++#	define NV_PRAMDAC_FP_TG_CONTROL_MODE_CENTER		(1 << 8)
++#	define NV_PRAMDAC_FP_TG_CONTROL_MODE_NATIVE		(2 << 8)
++#	define NV_PRAMDAC_FP_TG_CONTROL_READ_PROG		(1 << 20)
++#	define NV_PRAMDAC_FP_TG_CONTROL_WIDTH_12		(1 << 24)
++#	define NV_PRAMDAC_FP_TG_CONTROL_DISPEN_POS		(1 << 28)
++#	define NV_PRAMDAC_FP_TG_CONTROL_DISPEN_DISABLE		(2 << 28)
++#define NV_PRAMDAC_850					0x00680850
++#define NV_PRAMDAC_85C					0x0068085c
++#define NV_PRAMDAC_FP_DEBUG_0				0x00680880
++#	define NV_PRAMDAC_FP_DEBUG_0_XSCALE_ENABLE		(1 << 0)
++#	define NV_PRAMDAC_FP_DEBUG_0_YSCALE_ENABLE		(1 << 4)
++/* This doesn't seem to be essential for tmds, but still often set */
++#	define NV_RAMDAC_FP_DEBUG_0_TMDS_ENABLED		(8 << 4)
++#	define NV_PRAMDAC_FP_DEBUG_0_XINTERP_BILINEAR		(1 << 8)
++#	define NV_PRAMDAC_FP_DEBUG_0_YINTERP_BILINEAR		(1 << 12)
++#	define NV_PRAMDAC_FP_DEBUG_0_XWEIGHT_ROUND		(1 << 20)
++#	define NV_PRAMDAC_FP_DEBUG_0_YWEIGHT_ROUND		(1 << 24)
++#define NV_PRAMDAC_FP_DEBUG_1				0x00680884
++#	define NV_PRAMDAC_FP_DEBUG_1_XSCALE_VALUE		11:0
++#	define NV_PRAMDAC_FP_DEBUG_1_XSCALE_TESTMODE_ENABLE	(1 << 12)
++#	define NV_PRAMDAC_FP_DEBUG_1_YSCALE_VALUE		27:16
++#	define NV_PRAMDAC_FP_DEBUG_1_YSCALE_TESTMODE_ENABLE	(1 << 28)
++#define NV_PRAMDAC_FP_DEBUG_2				0x00680888
++#define NV_PRAMDAC_FP_DEBUG_3				0x0068088C
++
++/* Some unknown regs, purely for NV30 it seems. */
++#define NV_PRAMDAC_890					0x00680890
++#define NV_PRAMDAC_89C					0x0068089C
++
++/* see NV_PRAMDAC_INDIR_TMDS in rules.xml */
++#define NV_PRAMDAC_FP_TMDS_CONTROL			0x006808b0
++#	define NV_PRAMDAC_FP_TMDS_CONTROL_WRITE_DISABLE		(1 << 16)
++#define NV_PRAMDAC_FP_TMDS_DATA				0x006808b4
++
++/* Some kind of switch */
++#define NV_PRAMDAC_900					0x00680900
++#define NV_PRAMDAC_A20					0x00680A20
++#define NV_PRAMDAC_A24					0x00680A24
++#define NV_PRAMDAC_A34					0x00680A34
++
++/* names fabricated from NV_USER_DAC info */
++#define NV_PRMDIO_PIXEL_MASK		0x006813c6
++#	define NV_PRMDIO_PIXEL_MASK_MASK	0xff
++#define NV_PRMDIO_READ_MODE_ADDRESS	0x006813c7
++#define NV_PRMDIO_WRITE_MODE_ADDRESS	0x006813c8
++#define NV_PRMDIO_PALETTE_DATA		0x006813c9
++
++#define NV_PGRAPH_DEBUG_0		0x00400080
++#define NV_PGRAPH_DEBUG_1		0x00400084
++#define NV_PGRAPH_DEBUG_2_NV04		0x00400088
++#define NV_PGRAPH_DEBUG_2		0x00400620
++#define NV_PGRAPH_DEBUG_3		0x0040008c
++#define NV_PGRAPH_DEBUG_4		0x00400090
++#define NV_PGRAPH_INTR			0x00400100
++#define NV_PGRAPH_INTR_EN		0x00400140
++#define NV_PGRAPH_CTX_CONTROL		0x00400144
++#define NV_PGRAPH_CTX_CONTROL_NV04	0x00400170
++#define NV_PGRAPH_ABS_UCLIP_XMIN	0x0040053C
++#define NV_PGRAPH_ABS_UCLIP_YMIN	0x00400540
++#define NV_PGRAPH_ABS_UCLIP_XMAX	0x00400544
++#define NV_PGRAPH_ABS_UCLIP_YMAX	0x00400548
++#define NV_PGRAPH_BETA_AND		0x00400608
++#define NV_PGRAPH_LIMIT_VIOL_PIX	0x00400610
++#define NV_PGRAPH_BOFFSET0		0x00400640
++#define NV_PGRAPH_BOFFSET1		0x00400644
++#define NV_PGRAPH_BOFFSET2		0x00400648
++#define NV_PGRAPH_BLIMIT0		0x00400684
++#define NV_PGRAPH_BLIMIT1		0x00400688
++#define NV_PGRAPH_BLIMIT2		0x0040068c
++#define NV_PGRAPH_STATUS		0x00400700
++#define NV_PGRAPH_SURFACE		0x00400710
++#define NV_PGRAPH_STATE			0x00400714
++#define NV_PGRAPH_FIFO			0x00400720
++#define NV_PGRAPH_PATTERN_SHAPE		0x00400810
++#define NV_PGRAPH_TILE			0x00400b00
++
++#define NV_PVIDEO_INTR_EN		0x00008140
++#define NV_PVIDEO_BUFFER		0x00008700
++#define NV_PVIDEO_STOP			0x00008704
++#define NV_PVIDEO_UVPLANE_BASE(buff)	(0x00008800+(buff)*4)
++#define NV_PVIDEO_UVPLANE_LIMIT(buff)	(0x00008808+(buff)*4)
++#define NV_PVIDEO_UVPLANE_OFFSET_BUFF(buff)	(0x00008820+(buff)*4)
++#define NV_PVIDEO_BASE(buff)		(0x00008900+(buff)*4)
++#define NV_PVIDEO_LIMIT(buff)		(0x00008908+(buff)*4)
++#define NV_PVIDEO_LUMINANCE(buff)	(0x00008910+(buff)*4)
++#define NV_PVIDEO_CHROMINANCE(buff)	(0x00008918+(buff)*4)
++#define NV_PVIDEO_OFFSET_BUFF(buff)	(0x00008920+(buff)*4)
++#define NV_PVIDEO_SIZE_IN(buff)		(0x00008928+(buff)*4)
++#define NV_PVIDEO_POINT_IN(buff)	(0x00008930+(buff)*4)
++#define NV_PVIDEO_DS_DX(buff)		(0x00008938+(buff)*4)
++#define NV_PVIDEO_DT_DY(buff)		(0x00008940+(buff)*4)
++#define NV_PVIDEO_POINT_OUT(buff)	(0x00008948+(buff)*4)
++#define NV_PVIDEO_SIZE_OUT(buff)	(0x00008950+(buff)*4)
++#define NV_PVIDEO_FORMAT(buff)		(0x00008958+(buff)*4)
++#	define NV_PVIDEO_FORMAT_PLANAR			(1 << 0)
++#	define NV_PVIDEO_FORMAT_COLOR_LE_CR8YB8CB8YA8	(1 << 16)
++#	define NV_PVIDEO_FORMAT_DISPLAY_COLOR_KEY	(1 << 20)
++#	define NV_PVIDEO_FORMAT_MATRIX_ITURBT709	(1 << 24)
++#define NV_PVIDEO_COLOR_KEY		0x00008B00
++
++/* NV04 overlay defines from VIDIX & Haiku */
++#define NV_PVIDEO_INTR_EN_0		0x00680140
++#define NV_PVIDEO_STEP_SIZE		0x00680200
++#define NV_PVIDEO_CONTROL_Y		0x00680204
++#define NV_PVIDEO_CONTROL_X		0x00680208
++#define NV_PVIDEO_BUFF0_START_ADDRESS	0x0068020c
++#define NV_PVIDEO_BUFF0_PITCH_LENGTH	0x00680214
++#define NV_PVIDEO_BUFF0_OFFSET		0x0068021c
++#define NV_PVIDEO_BUFF1_START_ADDRESS	0x00680210
++#define NV_PVIDEO_BUFF1_PITCH_LENGTH	0x00680218
++#define NV_PVIDEO_BUFF1_OFFSET		0x00680220
++#define NV_PVIDEO_OE_STATE		0x00680224
++#define NV_PVIDEO_SU_STATE		0x00680228
++#define NV_PVIDEO_RM_STATE		0x0068022c
++#define NV_PVIDEO_WINDOW_START		0x00680230
++#define NV_PVIDEO_WINDOW_SIZE		0x00680234
++#define NV_PVIDEO_FIFO_THRES_SIZE	0x00680238
++#define NV_PVIDEO_FIFO_BURST_LENGTH	0x0068023c
++#define NV_PVIDEO_KEY			0x00680240
++#define NV_PVIDEO_OVERLAY		0x00680244
++#define NV_PVIDEO_RED_CSC_OFFSET	0x00680280
++#define NV_PVIDEO_GREEN_CSC_OFFSET	0x00680284
++#define NV_PVIDEO_BLUE_CSC_OFFSET	0x00680288
++#define NV_PVIDEO_CSC_ADJUST		0x0068028c
++
++#endif
 diff --git a/include/drm/Kbuild b/include/drm/Kbuild
 index b940fdf..cfa6af4 100644
 --- a/include/drm/Kbuild
@@ -42929,7 +49125,7 @@
  unifdef-y += via_drm.h
 +unifdef-y += nouveau_drm.h
 diff --git a/include/drm/drmP.h b/include/drm/drmP.h
-index b61b0c6..5b7ce2d 100644
+index 04fbd1e..f2a6bff 100644
 --- a/include/drm/drmP.h
 +++ b/include/drm/drmP.h
 @@ -1267,6 +1267,8 @@ extern void drm_idlelock_release(struct drm_lock_data *lock_data);


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1294.2.18
retrieving revision 1.1294.2.19
diff -u -r1.1294.2.18 -r1.1294.2.19
--- kernel.spec	30 Mar 2009 20:19:11 -0000	1.1294.2.18
+++ kernel.spec	14 Apr 2009 22:09:14 -0000	1.1294.2.19
@@ -13,6 +13,7 @@
 # by setting the define to ".local" or ".bz123456"
 #
 # % define buildid .local
+%define buildid .xendom0
 
 # fedora_build defines which build revision of this kernel version we're
 # building. Rather than incrementing forever, as with the prior versioning
@@ -37,7 +38,7 @@
 %if 0%{?released_kernel}
 
 # Do we have a -stable update to apply?
-%define stable_update 0
+%define stable_update 1
 # Is it a -stable RC?
 %define stable_rc 0
 # Set rpm version accordingly
@@ -102,7 +103,7 @@
 %define doc_build_fail true
 %endif
 
-%define rawhide_skip_docs 1
+%define rawhide_skip_docs 0
 %if 0%{?rawhide_skip_docs}
 %define with_doc 0
 %endif
@@ -120,7 +121,7 @@
 # Set debugbuildsenabled to 1 for production (build separate debug kernels)
 #  and 0 for rawhide (all kernels are debug kernels).
 # See also 'make debug' and 'make release'.
-%define debugbuildsenabled 0
+%define debugbuildsenabled 1
 
 # Want to build a vanilla kernel build without any non-upstream patches?
 # (well, almost none, we need nonintconfig for build purposes). Default to 0 (off).
@@ -402,7 +403,7 @@
 # problems with the newer kernel or lack certain things that make
 # integration in the distro harder than needed.
 #
-%define package_conflicts initscripts < 7.23, udev < 063-6, iptables < 1.3.2-1, ipw2200-firmware < 2.4, iwl4965-firmware < 228.57.2, selinux-policy-targeted < 1.25.3-14, squashfs-tools < 3.4, wireless-tools < 29-3
+%define package_conflicts initscripts < 7.23, udev < 063-6, iptables < 1.3.2-1, ipw2200-firmware < 2.4, iwl4965-firmware < 228.57.2, selinux-policy-targeted < 1.25.3-14, squashfs-tools < 4.0, wireless-tools < 29-3
 
 #
 # The ld.so.conf.d file we install uses syntax older ldconfig's don't grok.
@@ -594,10 +595,16 @@
 Patch22: linux-2.6-utrace.patch
 Patch23: linux-2.6-utrace-ftrace.patch
 
-Patch30: linux-2.6-debug-dma-api.patch
-Patch31: dma-api-debug-fixes.patch
+# Support suspend/resume, other crash fixes
+Patch30: linux-2.6-iommu-fixes.patch
+
 Patch41: linux-2.6-sysrq-c.patch
 
+Patch100: linux-2.6-e820-mark-esi-clobbered.patch
+Patch101: linux-2.6-e820-save-restore-edi-ebp.patch
+Patch102: linux-2.6-e820-acpi3-bios-workaround.patch
+Patch103: linux-2.6-e820-guard-against-pre-acpi3.patch
+
 Patch141: linux-2.6-ps3-storage-alias.patch
 Patch143: linux-2.6-g5-therm-shutdown.patch
 Patch144: linux-2.6-vio-modalias.patch
@@ -622,10 +629,12 @@
 Patch393: linux-2.6-hwmon-atk0110.patch
 Patch394: linux-2.6-acpi-video-didl-intel-outputs.patch
 Patch395: linux-2.6-sony-laptop-rfkill.patch
+Patch396: linux-2.6-acer-wmi-bail-on-aao.patch
 Patch400: linux-2.6-scsi-cpqarray-set-master.patch
 Patch450: linux-2.6-input-kill-stupid-messages.patch
 Patch451: linux-2.6-input-fix-toshiba-hotkeys.patch
 Patch452: linux-2.6-input-hid-extra-gamepad.patch
+Patch453: linux-2.6-input-wacom-bluetooth.patch
 
 Patch460: linux-2.6-serial-460800.patch
 
@@ -633,22 +642,34 @@
 Patch480: increase-MAX_LOCKDEP_ENTRIES.patch
 
 Patch510: linux-2.6-silence-noise.patch
+Patch511: linux-2.6-shut-up-efifb.patch
 Patch530: linux-2.6-silence-fbcon-logo.patch
 Patch570: linux-2.6-selinux-mprotect-checks.patch
 Patch580: linux-2.6-sparc-selinux-mprotect-checks.patch
-
+Patch590: linux-2.6.29.1-sparc-regression.patch
 Patch600: linux-2.6-defaults-alsa-hda-beep-off.patch
 Patch601: alsa-rewrite-hw_ptr-updaters.patch
 Patch602: alsa-pcm-always-reset-invalid-position.patch
 Patch603: alsa-pcm-fix-delta-calc-at-overlap.patch
 Patch604: alsa-pcm-safer-boundary-checks.patch
+Patch605: alsa-hda-dont-reset-BDL-unnecessarily.patch
+Patch606: alsa-dont-reset-stream-at-each-prepare-callb.patch
+Patch607: alsa-hda_intel-fix-unexpected-ring-buffer-positio.patch
+Patch608: alsa-pcm-midlevel-add-more-strict-buffer-position.patch
 Patch610: hda_intel-prealloc-4mb-dmabuffer.patch
+Patch611: linux-2.6.29-alsa-update-quirks.patch
 
 Patch670: linux-2.6-ata-quirk.patch
 
 Patch680: linux-2.6-rt2x00-asus-leds.patch
 Patch681: linux-2.6-mac80211-age-scan-results-on-resume.patch
 Patch682: linux-2.6-ipw2x00-age-scan-results-on-resume.patch
+Patch683: linux-2.6-iwl3945-report-killswitch-changes-even-if-the-interface-is-down.patch
+Patch684: linux-2.6-iwlagn-fix-hw-rfkill-while-the-interface-is-down.patch
+
+Patch700: linux-2.6-dma-debug-fixes.patch
+
+Patch800: linux-2.6-crash-driver.patch
 
 Patch1515: linux-2.6.29-lirc.patch
 
@@ -665,6 +686,8 @@
 Patch1816: drm-no-gem-on-i8xx.patch
 Patch1818: drm-i915-resume-force-mode.patch
 Patch1819: drm-intel-big-hammer.patch
+Patch1821: drm-intel-lying-systems-without-lvds.patch
+Patch1822: drm-intel-gen3-fb-hack.patch
 
 # kludge to make ich9 e1000 work
 Patch2000: linux-2.6-e1000-ich9.patch
@@ -680,12 +703,35 @@
 Patch2899: linux-2.6-v4l-dvb-fixes.patch
 Patch2900: linux-2.6-v4l-dvb-update.patch
 Patch2901: linux-2.6-v4l-dvb-experimental.patch
+Patch2902: linux-2.6-v4l-dvb-fix-uint16_t-audio-h.patch
 Patch2903: linux-2.6-revert-dvb-net-kabi-change.patch
 
 # fs fixes
 Patch2920: linux-2.6-ext4-flush-on-close.patch
+Patch2921: linux-2.6-ext4-really-print-warning-once.patch
+
 Patch3000: linux-2.6-btrfs-experimental-branch.patch
+Patch3001: linux-2.6-btrfs-fix-umount-hang.patch
 Patch3010: linux-2.6-relatime-by-default.patch
+Patch3020: linux-2.6-fiemap-header-install.patch
+
+Patch4000: linux-2.6-usb-cdc-acm-remove-low-latency-flag.patch
+
+Patch5000: linux-2.6-add-qcserial.patch
+
+# patches headed for -stable
+# fix oops in md raid1 (#495550)
+Patch6000: linux-2.6-md-raid1-dont-assume-new-bvecs-are-init.patch
+# fix squashfs on systems where pagesize > blocksize (ia64, ppc64 w/64k pages)
+Patch6010: squashfs-broken-when-pagesize-greater-than-blocksize.patch
+# fix duplicated flags value
+Patch7000: linux-2.6-mm-define-unique-value-for-as_unevictable.patch
+# fix posix clock monotonicity
+Patch7001: linux-2.6-posix-timers-fix-clock-monotonicity.patch
+# make RLIMIT_CPU work again
+Patch7002: linux-2.6-posix-timers-fix-rlimit_cpu-fork.patch
+Patch7003: linux-2.6-posix-timers-fix-rlimit_cpu-fork-2.patch
+Patch7004: linux-2.6-posix-timers-fix-rlimit_cpu-setitimer.patch
 
 Patch9001: revert-fix-modules_install-via-nfs.patch
 
@@ -695,17 +741,13 @@
 Patch9003: linux-2.6-dropwatch-protocol.patch
 
 # fix for net lockups, will be in 2.6.29.1
-Patch9100: linux-2.6-net-fix-gro-bug.patch
 Patch9101: linux-2.6-net-fix-another-gro-bug.patch
 
-# fix locking in ipsec (#489764)
-Patch9200: linux-2.6-net-xfrm-fix-spin-unlock.patch
-
-# http://bugs.freedesktop.org/show_bug.cgi?id=20803
-Patch9210: linux-2.6.29-pat-fixes.patch
+# kvm fixes
+Patch9300: linux-2.6-kvm-kconfig-irqchip.patch
+Patch9301: linux-2.6-kvm-mask-notifiers.patch
+Patch9302: linux-2.6-kvm-reset-pit-irq-on-unmask.patch
 
-Patch9995: squashfs3.patch
-Patch9996: squashfs-fixups.patch
 Patch9997: xen.pvops.pre.patch
 Patch9998: xen.pvops.patch
 Patch9999: xen.pvops.post.patch
@@ -902,14 +944,30 @@
 %endif
 %endif
 
+# more sanity checking; do it quietly
+if [ "%{patches}" != "%%{patches}" ] ; then
+  for patch in %{patches} ; do
+    if [ ! -f $patch ] ; then
+      echo "ERROR: Patch  ${patch##/*/}  listed in specfile but is missing"
+      exit 1
+    fi
+  done
+fi 2>/dev/null
+
 patch_command='patch -p1 -F1 -s'
 ApplyPatch()
 {
   local patch=$1
   shift
   if [ ! -f $RPM_SOURCE_DIR/$patch ]; then
-    exit 1;
+    exit 1
   fi
+  if ! egrep "^Patch[0-9]+: $patch\$" %{_specdir}/%{name}.spec ; then
+    if [ "${patch:0:10}" != "patch-2.6." ] ; then
+      echo "ERROR: Patch  $patch  not listed as a source patch in specfile"
+      exit 1
+    fi
+  fi 2>/dev/null
   case "$patch" in
   *.bz2) bunzip2 < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;;
   *.gz) gunzip < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;;
@@ -939,10 +997,10 @@
 %endif
 %endif
 
-# We can share hardlinked source trees by putting the
-# directory name of the CVS checkout that we want to share
-# with in .shared-srctree. (Full pathname is required.)
-[ -f .shared-srctree ] && sharedir=$(cat .shared-srctree)
+# We can share hardlinked source trees by putting a list of
+# directory names of the CVS checkouts that we want to share
+# with in .shared-srctree. (Full pathnames are required.)
+[ -f .shared-srctree ] && sharedirs=$(cat .shared-srctree)
 
 if [ ! -d kernel-%{kversion}/vanilla-%{vanillaversion} ]; then
 
@@ -959,6 +1017,11 @@
 
     # Ok, first time we do a make prep.
     rm -f pax_global_header
+    for sharedir in $sharedirs ; do
+      if [[ ! -z $sharedir  &&  -d $sharedir/kernel-%{kversion}/vanilla-%{kversion} ]] ; then
+        break
+      fi
+    done
     if [[ ! -z $sharedir  &&  -d $sharedir/kernel-%{kversion}/vanilla-%{kversion} ]] ; then
 %setup -q -n kernel-%{kversion} -c -T
       cp -rl $sharedir/kernel-%{kversion}/vanilla-%{kversion} .
@@ -971,6 +1034,11 @@
 
 %if "%{kversion}" != "%{vanillaversion}"
 
+  for sharedir in $sharedirs ; do
+    if [[ ! -z $sharedir  &&  -d $sharedir/kernel-%{kversion}/vanilla-%{vanillaversion} ]] ; then
+      break
+    fi
+  done
   if [[ ! -z $sharedir  &&  -d $sharedir/kernel-%{kversion}/vanilla-%{vanillaversion} ]] ; then
 
     cp -rl $sharedir/kernel-%{kversion}/vanilla-%{vanillaversion} .
@@ -1081,15 +1149,18 @@
 ApplyPatch linux-2.6-utrace.patch
 #ApplyPatch linux-2.6-utrace-ftrace.patch
 
-# DMA API debugging
-#ApplyPatch linux-2.6-debug-dma-api.patch
-#ApplyPatch dma-api-debug-fixes.patch
+# IOMMU fixes backported to 2.6.29
+ApplyPatch linux-2.6-iommu-fixes.patch
 
 # enable sysrq-c on all kernels, not only kexec
 ApplyPatch linux-2.6-sysrq-c.patch
 
 # Architecture patches
 # x86(-64)
+ApplyPatch linux-2.6-e820-mark-esi-clobbered.patch
+ApplyPatch linux-2.6-e820-save-restore-edi-ebp.patch
+ApplyPatch linux-2.6-e820-acpi3-bios-workaround.patch
+ApplyPatch linux-2.6-e820-guard-against-pre-acpi3.patch
 
 #
 # PowerPC
@@ -1111,7 +1182,7 @@
 #
 
 ApplyPatch linux-2.6.29-sparc-IOC_TYPECHECK.patch
-
+ApplyPatch linux-2.6.29.1-sparc-regression.patch
 #
 # Exec shield
 #
@@ -1123,16 +1194,23 @@
 
 # ext4
 ApplyPatch linux-2.6-ext4-flush-on-close.patch
+ApplyPatch linux-2.6-ext4-really-print-warning-once.patch
 
 # xfs
 
 # btrfs
 ApplyPatch linux-2.6-btrfs-experimental-branch.patch
+ApplyPatch linux-2.6-btrfs-fix-umount-hang.patch
 
 # relatime
 ApplyPatch linux-2.6-relatime-by-default.patch
 
+# put fiemap.h into kernel-headers
+ApplyPatch linux-2.6-fiemap-header-install.patch
+
 # USB
+ApplyPatch linux-2.6-add-qcserial.patch
+ApplyPatch linux-2.6-usb-cdc-acm-remove-low-latency-flag.patch
 
 # ACPI
 ApplyPatch linux-2.6-defaults-acpi-video.patch
@@ -1141,6 +1219,7 @@
 ApplyPatch linux-2.6-hwmon-atk0110.patch
 ApplyPatch linux-2.6-acpi-video-didl-intel-outputs.patch
 ApplyPatch linux-2.6-sony-laptop-rfkill.patch
+ApplyPatch linux-2.6-acer-wmi-bail-on-aao.patch
 
 # Various low-impact patches to aid debugging.
 ApplyPatch linux-2.6-debug-sizeof-structs.patch
@@ -1171,13 +1250,17 @@
 # ALSA
 # squelch hda_beep by default
 ApplyPatch linux-2.6-defaults-alsa-hda-beep-off.patch
+ApplyPatch linux-2.6.29-alsa-update-quirks.patch
 
 # fix alsa for pulseaudio
 ApplyPatch alsa-rewrite-hw_ptr-updaters.patch
 ApplyPatch alsa-pcm-always-reset-invalid-position.patch
 ApplyPatch alsa-pcm-fix-delta-calc-at-overlap.patch
 ApplyPatch alsa-pcm-safer-boundary-checks.patch
-
+ApplyPatch alsa-hda-dont-reset-BDL-unnecessarily.patch
+ApplyPatch alsa-dont-reset-stream-at-each-prepare-callb.patch
+ApplyPatch alsa-hda_intel-fix-unexpected-ring-buffer-positio.patch
+ApplyPatch alsa-pcm-midlevel-add-more-strict-buffer-position.patch
 ApplyPatch hda_intel-prealloc-4mb-dmabuffer.patch
 
 # Networking
@@ -1192,6 +1275,9 @@
 # HID: add support for another version of 0e8f:0003 device in hid-pl
 ApplyPatch linux-2.6-input-hid-extra-gamepad.patch
 
+# HID: add support for Bluetooth Wacom pads
+ApplyPatch linux-2.6-input-wacom-bluetooth.patch
+
 # Allow to use 480600 baud on 16C950 UARTs
 ApplyPatch linux-2.6-serial-460800.patch
 
@@ -1200,6 +1286,9 @@
 # Silence some useless messages that still get printed with 'quiet'
 ApplyPatch linux-2.6-silence-noise.patch
 
+# Avoid efifb spew
+ApplyPatch linux-2.6-shut-up-efifb.patch
+
 # Make fbcon not show the penguins with 'quiet'
 ApplyPatch linux-2.6-silence-fbcon-logo.patch
 
@@ -1210,6 +1299,7 @@
 
 # Changes to upstream defaults.
 
+
 # ia64 ata quirk
 ApplyPatch linux-2.6-ata-quirk.patch
 
@@ -1220,6 +1310,16 @@
 ApplyPatch linux-2.6-mac80211-age-scan-results-on-resume.patch
 ApplyPatch linux-2.6-ipw2x00-age-scan-results-on-resume.patch
 
+# back-port iwlwifi rfkill while device down patches
+ApplyPatch linux-2.6-iwl3945-report-killswitch-changes-even-if-the-interface-is-down.patch
+ApplyPatch linux-2.6-iwlagn-fix-hw-rfkill-while-the-interface-is-down.patch
+
+# Fix up DMA debug code
+ApplyPatch linux-2.6-dma-debug-fixes.patch
+
+# /dev/crash driver.
+ApplyPatch linux-2.6-crash-driver.patch
+
 # http://www.lirc.org/
 ApplyPatch linux-2.6.29-lirc.patch
 
@@ -1239,6 +1339,8 @@
 ApplyPatch drm-no-gem-on-i8xx.patch
 ApplyPatch drm-i915-resume-force-mode.patch
 ApplyPatch drm-intel-big-hammer.patch
+ApplyPatch drm-intel-lying-systems-without-lvds.patch
+ApplyPatch drm-intel-gen3-fb-hack.patch
 
 # linux1394 git patches
 ApplyPatch linux-2.6-firewire-git-update.patch
@@ -1254,8 +1356,18 @@
 ApplyPatch linux-2.6-v4l-dvb-fixes.patch
 ApplyPatch linux-2.6-v4l-dvb-update.patch
 ApplyPatch linux-2.6-v4l-dvb-experimental.patch
+ApplyPatch linux-2.6-v4l-dvb-fix-uint16_t-audio-h.patch
 ApplyPatch linux-2.6-revert-dvb-net-kabi-change.patch
 
+# patches headed for -stable
+ApplyPatch linux-2.6-md-raid1-dont-assume-new-bvecs-are-init.patch
+ApplyPatch squashfs-broken-when-pagesize-greater-than-blocksize.patch
+ApplyPatch linux-2.6-mm-define-unique-value-for-as_unevictable.patch
+ApplyPatch linux-2.6-posix-timers-fix-clock-monotonicity.patch
+#ApplyPatch linux-2.6-posix-timers-fix-rlimit_cpu-fork.patch
+ApplyPatch linux-2.6-posix-timers-fix-rlimit_cpu-fork-2.patch
+ApplyPatch linux-2.6-posix-timers-fix-rlimit_cpu-setitimer.patch
+
 # revert 8b249b6856f16f09b0e5b79ce5f4d435e439b9d6
 ApplyPatch revert-fix-modules_install-via-nfs.patch
 
@@ -1263,15 +1375,12 @@
 
 #ApplyPatch linux-2.6-dropwatch-protocol.patch
 
-#ApplyPatch linux-2.6-net-fix-gro-bug.patch
 ApplyPatch linux-2.6-net-fix-another-gro-bug.patch
 
-ApplyPatch linux-2.6-net-xfrm-fix-spin-unlock.patch
-
-ApplyPatch linux-2.6.29-pat-fixes.patch
-
-ApplyPatch squashfs3.patch
-ApplyPatch squashfs-fixups.patch
+# kvm fixes
+ApplyPatch linux-2.6-kvm-kconfig-irqchip.patch
+ApplyPatch linux-2.6-kvm-mask-notifiers.patch
+ApplyPatch linux-2.6-kvm-reset-pit-irq-on-unmask.patch
 
 ApplyPatch xen.pvops.pre.patch
 ApplyPatch xen.pvops.patch
@@ -1552,7 +1661,7 @@
 cd linux-%{kversion}.%{_target_cpu}
 
 %if %{with_debug}
-%if !%{with_up}
+%if %{with_up}
 BuildKernel %make_target %kernel_image debug
 %endif
 %if %{with_pae}
@@ -1850,7 +1959,9 @@
 
 %kernel_variant_files %{with_up}
 %kernel_variant_files %{with_smp} smp
+%if %{with_up}
 %kernel_variant_files %{with_debug} debug
+%endif
 %kernel_variant_files %{with_pae} PAE
 %kernel_variant_files %{with_pae_debug} PAEdebug
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
@@ -1859,6 +1970,189 @@
 # and build.
 
 %changelog
+* Tue Apr 14 2009 Michael Young <m.a.young at durham.ac.uk>
+- follow the 2.6.29.1 stable branch for the moment
+- reset a few config settings to Fedora defaults
+- drop the squashfs 3 patches as we can't build both
+
+* Tue Apr 14 2009 Marcelo Tosatti <mtosatti at redhat.com>
+- kvm fixes for bz#491625
+
+* Tue Apr 14 2009 Jarod Wilson <jarod at redhat.com>
+- Make squashfs behave on systems where pagesize > blocksize (Doug Chapman)
+
+* Tue Apr 14 2009 Chuck Ebbert <cebbert at redhat.com>
+- Add missing patch for broken RLIMIT_CPU
+
+* Tue Apr 14 2009 Chuck Ebbert <cebbert at redhat.com>
+- Fix warnings/errors in USB cdc-acm modem driver (#495446)
+
+* Tue Apr 14 2009 Chuck Ebbert <cebbert at redhat.com>
+- Timer fixes headed for -stable
+
+* Tue Apr 14 2009 Chuck Ebbert <cebbert at redhat.com>
+- Fix duplicated flag value in pagemap.h (-stable patch)
+
+* Tue Apr 14 2009 Chuck Ebbert <cebbert at redhat.com>
+- acer-wmi: use upstream code to blacklist an additional model
+- Trivial fix to drm-modesetting-radeon to fix failure to apply
+
+* Tue Apr 14 2009 Dave Airlie <airlied at redhat.com> 2.6.29.1-73
+- drm-modesetting-radeon.patch: more bug fixes
+
+* Mon Apr 13 2009 Chuck Ebbert <cebbert at redhat.com>
+- Fix oops in md raid1 resync (#495550)
+
+* Mon Apr 13 2009 Eric Sandeen <sandeen at redhat.com>
+- Turn of CONFIG_SND_HDA_POWER_SAVE_DEFAULT again (#493972)
+
+* Mon Apr 13 2009 Kyle McMartin <kyle at redhat.com> 2.6.29.1-70
+- merge alsa fixes from wwoods:
+  alsa-hda-dont-reset-BDL-unnecessarily.patch
+  alsa-dont-reset-stream-at-each-prepare-callb.patch
+  alsa-hda_intel-fix-unexpected-ring-buffer-positio.patch
+  alsa-pcm-midlevel-add-more-strict-buffer-position.patch
+    bbf6ad13, fa00e046 from alsa-kernel/master (and deps)
+
+* Mon Apr 13 2009 John W. Linville <linville at redhat.com>
+- Remove back-port iwlwifi rfkill while device down patches (#495003)
+
+* Fri Apr 10 2009 David Woodhouse <David.Woodhouse at intel.com>
+- Fix suspend/resume with Intel IOMMU, handle devices behind PCI-PCI
+  bridges, cope with BIOS claiming IOMMU is at address zero.
+
+* Thu Apr 09 2009 Chuck Ebbert <cebbert at redhat.com>
+- Only print ext4 allocator fallback warning once.
+
+* Thu Apr 09 2009 Dennis Gilmore <dennis at ausil.us> 2.6.29.1-59
+- add patch to fix regression on sparc
+
+* Thu Apr 09 2009 Adam Jackson <ajax at redhat.com>
+- drm-intel-gen3-fb-hack.patch: Allow up to 4k framebuffers on 9[14]5.  3D
+  will be broken if you do that, but at least dualhead will be less broken.
+
+* Thu Apr 09 2009 Dave Jones <davej at redhat.com>
+- Bring back the /dev/crash driver. (#492803)
+
+* Thu Apr 09 2009 Dave Airlie <airlied at redhat.com>
+- radeon: fix some kms bugs, dac detect + screen resize
+
+* Wed Apr 08 2009 Adam Jackson <ajax at redhat.com>
+- Drop the PAT patch, sufficiently upstreamed now.
+
+* Wed Apr 08 2009 Dave Jones <davej at redhat.com> 2.6.29.1-58
+- disable MMIOTRACE in non-debug builds (#494584)
+
+* Wed Apr 08 2009 Ben Skeggs <bskeggs at redhat.com>
+- drm-nouveau.patch: nv50 kms fixes (PROM access, i2c, clean some warnings)
+
+* Tue Apr 07 2009 Kyle McMartin <kyle at redhat.com>
+- linux-2.6-v4l-dvb-fix-uint16_t-audio-h.patch (#493053)
+
+* Tue Apr 07 2009 Dave Jones <davej at redhat.com>
+- Enable CONFIG_CIFS_STATS (#494545)
+
+* Tue Apr 07 2009 Dave Airlie <airlied at redhat.com>
+- drm-modesetting-radeon: repair vt switch
+
+* Mon Apr 06 2009 Ben Skeggs <bskeggs at redhat.com>
+- drm-nouveau.patch: rebase on drm-f11
+
+* Mon Apr 06 2009 Dave Airlie <airlied at redhat.com>
+- radeon: bust APIs and move to what we want in the end.
+
+* Sun Apr 05 2009 Ben Skeggs <bskeggs at redhat.com>
+- drm-nouveau.patch: big update.  mostly cleanups, few functional changes
+    Big code cleanup (the scary looking, but hopefully harmless part)
+    Now using "full-featured" VBIOS parser from DDX
+    Remove custom i2c code in favour of i2c_algo_bit
+    Refuse to suspend, we can't possibly resume just yet
+    Fix ramht insertions when a collision happens (rh#492427)
+    No kms warning on pre-nv50 when kms not acutally enabled (rh#493222)
+
+* Sat Apr 04 2009 Matthew Garrett <mjg at redhat.com>
+- linux-2.6-add-qcserial.patch: Add the qcserial driver for Qualcomm modems
+
+* Fri Apr 03 2009 Jarod Wilson <jarod at redhat.com>
+- Don't set up non-existent LVDS on systems with mobile Intel graphics chips
+  that lie about having LVDS (like my Dell Studio Hybrid). Makes plymouth
+  graphical boot function properly.
+- Don't let acer-wmi do stupid things on unsupported systems (like, create
+  a bogus rfkill entry in sysfs that effectively neuters wireless in
+  NetworkManager on the Aspire One)
+
+* Fri Apr 03 2009 Chuck Ebbert <cebbert at redhat.com>
+- x86 E820 fixes from 2.6.30
+
+* Fri Apr 03 2009 Dave Jones <davej at redhat.com>
+- x86/dma: unify definition of pci_unmap_addr* and pci_unmap_len macros
+
+* Thu Apr 02 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.29.1-46
+- Enable debug builds and turn of debugging in the regular kernel.
+- Remove dma-debug patches.
+- Leave CONFIG_PCI_MSI_DEFAULT_ON set.
+
+* Thu Apr 02 2009 Chuck Ebbert <cebbert at redhat.com>
+- Linux 2.6.29.1
+- Removed upstream commit d64260d58865004c6354e024da3450fdd607ea07
+  from v4l-dvb-fixes: merged in 2.6.29.1
+
+* Thu Apr 02 2009 John W. Linville <linville at redhat.com>
+- iwl3945: rely on priv->lock to protect priv access
+
+* Thu Apr 02 2009 John W. Linville <linville at redhat.com>
+- back-port iwlwifi rfkill while device down patches
+
+* Thu Apr 02 2009 Josef Bacik <josef at toxicpanda.com>
+- linux-2.6-btrfs-fix-umount-hang.patch: fix hang on umount
+
+* Wed Apr 01 2009 Matthew Garrett <mjg at redhat.com>
+- linux-2.6-shut-up-efifb.patch: avoid efifb errors on unsupported hardware
+
+* Wed Apr 01 2009 Matthew Garrett <mjg at redhat.com>
+- linux-2.6-acpi-video-didl-intel-outputs.patch: fix enabling of asle
+
+* Wed Apr 01 2009 Dave Airlie <airlied at redhat.com>
+- drm-radeon-reorder-bm.patch: attempt PM fix for PCI/AGP cards
+
+* Tue Mar 31 2009 Matthew Garrett <mjg at redhat.com> 2.6.29.1-35.rc1
+- linux-2.6.29-alsa-update-quirks.patch: Backport some HDA quirk support
+
+* Tue Mar 31 2009 Chuck Ebbert <cebbert at redhat.com>
+- Linux 2.6.29.1-rc1
+- Dropped patches, merged upstream:
+    linux-2.6-net-fix-gro-bug.patch
+    linux-2.6-net-xfrm-fix-spin-unlock.patch
+    linux-2.6.29-pat-change-is_linear_pfn_mapping-to-not-use-vm_pgoff.patch
+    linux-2.6.29-pat-pci-change-prot-for-inherit.patch
+
+* Tue Mar 31 2009 Eric Sandeen <sandeen at redhat.com>
+- add fiemap.h to kernel-headers
+- build ext4 (and jbd2 and crc16) into the kernel
+
+* Tue Mar 31 2009 Matthew Garrett <mjg at redhat.com>
+- update the sony laptop code
+
+* Tue Mar 31 2009 Ben Skeggs <bskeggs at redhat.com>
+- drm-nouveau.patch: support version 3.0 pll limits table
+  may help with rh#492575
+
+* Mon Mar 30 2009 Matthew Garrett <mjg at redhat.com>
+- linux-2.6-input-wacom-bluetooth.patch: Add support for Bluetooth wacom pads
+
+* Mon Mar 30 2009 Chuck Ebbert <cebbert at redhat.com>
+- Make the .shared-srctree file a list so more than two checkouts
+  can share source files.
+
+* Mon Mar 30 2009 Chuck Ebbert <cebbert at redhat.com>
+- Separate PAT fixes that are headed for -stable from our out-of-tree ones.
+
+* Mon Mar 30 2009 Dave Jones <davej at redhat.com>
+- Make io schedulers selectable at boot time again. (#492817)
+
+* Mon Mar 30 2009 Dave Jones <davej at redhat.com>
+- Add a strict-devmem=0 boot argument (#492803)
+
 * Mon Mar 30 2009 Michael Young <m.a.young at durham.ac.uk>
 - pvops update and merging of patches
 - disable squashfs 3 again since we can't build both versions at the same time

linux-2.6-acpi-video-didl-intel-outputs.patch:

Index: linux-2.6-acpi-video-didl-intel-outputs.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/Attic/linux-2.6-acpi-video-didl-intel-outputs.patch,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- linux-2.6-acpi-video-didl-intel-outputs.patch	24 Mar 2009 22:57:43 -0000	1.1.2.3
+++ linux-2.6-acpi-video-didl-intel-outputs.patch	14 Apr 2009 22:09:15 -0000	1.1.2.4
@@ -240,3 +240,14 @@
 +
 +#endif
 +
+diff -up linux-2.6.29.noarch/drivers/gpu/drm/i915/i915_opregion.c~ linux-2.6.29.noarch/drivers/gpu/drm/i915/i915_opregion.c
+--- linux-2.6.29.noarch/drivers/gpu/drm/i915/i915_opregion.c~	2009-04-01 18:57:47.000000000 +0100
++++ linux-2.6.29.noarch/drivers/gpu/drm/i915/i915_opregion.c	2009-04-01 18:59:49.000000000 +0100
+@@ -389,6 +389,7 @@ int intel_opregion_init(struct drm_devic
+ 	if (mboxes & MBOX_ASLE) {
+ 		DRM_DEBUG("ASLE supported\n");
+ 		opregion->asle = base + OPREGION_ASLE_OFFSET;
++		opregion_enable_asle(dev);
+ 	}
+ 
+ 	/* Notify BIOS we are ready to handle ACPI video ext notifs.

linux-2.6-sony-laptop-rfkill.patch:

Index: linux-2.6-sony-laptop-rfkill.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/Attic/linux-2.6-sony-laptop-rfkill.patch,v
retrieving revision 1.2.6.2
retrieving revision 1.2.6.3
diff -u -r1.2.6.2 -r1.2.6.3
--- linux-2.6-sony-laptop-rfkill.patch	24 Mar 2009 22:57:43 -0000	1.2.6.2
+++ linux-2.6-sony-laptop-rfkill.patch	14 Apr 2009 22:09:17 -0000	1.2.6.3
@@ -1,8 +1,23 @@
-diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
-index 537959d..2d142d3 100644
---- a/drivers/platform/x86/sony-laptop.c
-+++ b/drivers/platform/x86/sony-laptop.c
-@@ -64,6 +64,7 @@
+--- vanilla-2.6.29/drivers/platform/x86/sony-laptop.c	2009-03-23 23:12:14.000000000 +0000
++++ linux-2.6.29.noarch/drivers/platform/x86/sony-laptop.c	2009-03-31 16:37:25.000000000 +0100
+@@ -2,7 +2,7 @@
+  * ACPI Sony Notebook Control Driver (SNC and SPIC)
+  *
+  * Copyright (C) 2004-2005 Stelian Pop <stelian at popies.net>
+- * Copyright (C) 2007 Mattia Dongili <malattia at linux.it>
++ * Copyright (C) 2007-2009 Mattia Dongili <malattia at linux.it>
+  *
+  * Parts of this driver inspired from asus_acpi.c and ibm_acpi.c
+  * which are copyrighted by their respective authors.
+@@ -46,7 +46,6 @@
+ #include <linux/module.h>
+ #include <linux/moduleparam.h>
+ #include <linux/init.h>
+-#include <linux/smp_lock.h>
+ #include <linux/types.h>
+ #include <linux/backlight.h>
+ #include <linux/platform_device.h>
+@@ -64,6 +63,7 @@
  #include <asm/uaccess.h>
  #include <linux/sonypi.h>
  #include <linux/sony-laptop.h>
@@ -10,7 +25,7 @@
  #ifdef CONFIG_SONYPI_COMPAT
  #include <linux/poll.h>
  #include <linux/miscdevice.h>
-@@ -123,6 +124,18 @@ MODULE_PARM_DESC(minor,
+@@ -123,6 +123,18 @@
  		 "default is -1 (automatic)");
  #endif
  
@@ -29,7 +44,7 @@
  /*********** Input Devices ***********/
  
  #define SONY_LAPTOP_BUF_SIZE	128
-@@ -134,6 +147,7 @@ struct sony_laptop_input_s {
+@@ -134,6 +146,7 @@
  	spinlock_t		fifo_lock;
  	struct workqueue_struct	*wq;
  };
@@ -37,25 +52,38 @@
  static struct sony_laptop_input_s sony_laptop_input = {
  	.users = ATOMIC_INIT(0),
  };
-@@ -211,6 +225,7 @@ static int sony_laptop_input_index[] = {
+@@ -211,6 +224,14 @@
  	48,	/* 61 SONYPI_EVENT_WIRELESS_OFF */
  	49,	/* 62 SONYPI_EVENT_ZOOM_IN_PRESSED */
  	50,	/* 63 SONYPI_EVENT_ZOOM_OUT_PRESSED */
 +	51,	/* 64 SONYPI_EVENT_CD_EJECT_PRESSED */
++	52,	/* 65 SONYPI_EVENT_MODEKEY_PRESSED */
++	53,	/* 66 SONYPI_EVENT_PKEY_P4 */
++	54,	/* 67 SONYPI_EVENT_PKEY_P5 */
++	55,	/* 68 SONYPI_EVENT_SETTINGKEY_PRESSED */
++	56,	/* 69 SONYPI_EVENT_VOLUME_INC_PRESSED */
++	57,	/* 70 SONYPI_EVENT_VOLUME_DEC_PRESSED */
++	-1,	/* 71 SONYPI_EVENT_BRIGHTNESS_PRESSED */
  };
  
  static int sony_laptop_input_keycode_map[] = {
-@@ -264,7 +279,8 @@ static int sony_laptop_input_keycode_map[] = {
+@@ -264,7 +285,14 @@
  	KEY_WLAN,	/* 47 SONYPI_EVENT_WIRELESS_ON */
  	KEY_WLAN,	/* 48 SONYPI_EVENT_WIRELESS_OFF */
  	KEY_ZOOMIN,	/* 49 SONYPI_EVENT_ZOOM_IN_PRESSED */
 -	KEY_ZOOMOUT	/* 50 SONYPI_EVENT_ZOOM_OUT_PRESSED */
 +	KEY_ZOOMOUT,	/* 50 SONYPI_EVENT_ZOOM_OUT_PRESSED */
-+	KEY_EJECTCD	/* 51 SONYPI_EVENT_CD_EJECT_PRESSED */
++	KEY_EJECTCD,	/* 51 SONYPI_EVENT_CD_EJECT_PRESSED */
++	KEY_F13,	/* 52 SONYPI_EVENT_MODEKEY_PRESSED */
++	KEY_PROG4,	/* 53 SONYPI_EVENT_PKEY_P4 */
++	KEY_F14,	/* 54 SONYPI_EVENT_PKEY_P5 */
++	KEY_F15,	/* 55 SONYPI_EVENT_SETTINGKEY_PRESSED */
++	KEY_VOLUMEUP,	/* 56 SONYPI_EVENT_VOLUME_INC_PRESSED */
++	KEY_VOLUMEDOWN,	/* 57 SONYPI_EVENT_VOLUME_DEC_PRESSED */
  };
  
  /* release buttons after a short delay if pressed */
-@@ -689,6 +705,31 @@ static int acpi_callsetfunc(acpi_handle handle, char *name, int value,
+@@ -689,6 +717,31 @@
  	return -1;
  }
  
@@ -64,7 +92,7 @@
 +	int i;
 +	int result;
 +
-+	for (i=0x20; i<0x30; i++) {
++	for (i = 0x20; i < 0x30; i++) {
 +		acpi_callsetfunc(sony_nc_acpi_handle, "SN00", i, &result);
 +		if (result == handle)
 +			return i-0x20;
@@ -87,7 +115,7 @@
  /*
   * sony_nc_values input/output validate functions
   */
-@@ -809,33 +850,11 @@ struct sony_nc_event {
+@@ -809,87 +862,53 @@
  	u8	event;
  };
  
@@ -118,15 +146,22 @@
 -}
 -
 -static struct sony_nc_event sony_C_events[] = {
-+static struct sony_nc_event sony_nc_events[] = {
++static struct sony_nc_event sony_100_events[] = {
 +	{ 0x90, SONYPI_EVENT_PKEY_P1 },
 +	{ 0x10, SONYPI_EVENT_ANYBUTTON_RELEASED },
 +	{ 0x91, SONYPI_EVENT_PKEY_P1 },
 +	{ 0x11, SONYPI_EVENT_ANYBUTTON_RELEASED },
  	{ 0x81, SONYPI_EVENT_FNKEY_F1 },
  	{ 0x01, SONYPI_EVENT_FNKEY_RELEASED },
++	{ 0x82, SONYPI_EVENT_FNKEY_F2 },
++	{ 0x02, SONYPI_EVENT_FNKEY_RELEASED },
++	{ 0x83, SONYPI_EVENT_FNKEY_F3 },
++	{ 0x03, SONYPI_EVENT_FNKEY_RELEASED },
++	{ 0x84, SONYPI_EVENT_FNKEY_F4 },
++	{ 0x04, SONYPI_EVENT_FNKEY_RELEASED },
  	{ 0x85, SONYPI_EVENT_FNKEY_F5 },
-@@ -844,88 +863,53 @@ static struct sony_nc_event sony_C_events[] = {
+ 	{ 0x05, SONYPI_EVENT_FNKEY_RELEASED },
+ 	{ 0x86, SONYPI_EVENT_FNKEY_F6 },
  	{ 0x06, SONYPI_EVENT_FNKEY_RELEASED },
  	{ 0x87, SONYPI_EVENT_FNKEY_F7 },
  	{ 0x07, SONYPI_EVENT_FNKEY_RELEASED },
@@ -180,10 +215,27 @@
 -			},
 -		},
 -		{ }
--};
--
++static struct sony_nc_event sony_127_events[] = {
++	{ 0x81, SONYPI_EVENT_MODEKEY_PRESSED },
++	{ 0x01, SONYPI_EVENT_ANYBUTTON_RELEASED },
++	{ 0x82, SONYPI_EVENT_PKEY_P1 },
++	{ 0x02, SONYPI_EVENT_ANYBUTTON_RELEASED },
++	{ 0x83, SONYPI_EVENT_PKEY_P2 },
++	{ 0x03, SONYPI_EVENT_ANYBUTTON_RELEASED },
++	{ 0x84, SONYPI_EVENT_PKEY_P3 },
++	{ 0x04, SONYPI_EVENT_ANYBUTTON_RELEASED },
++	{ 0x85, SONYPI_EVENT_PKEY_P4 },
++	{ 0x05, SONYPI_EVENT_ANYBUTTON_RELEASED },
++	{ 0x86, SONYPI_EVENT_PKEY_P5 },
++	{ 0x06, SONYPI_EVENT_ANYBUTTON_RELEASED },
++	{ 0x06, SONYPI_EVENT_ANYBUTTON_RELEASED },
++	{ 0x87, SONYPI_EVENT_SETTINGKEY_PRESSED },
++	{ 0x07, SONYPI_EVENT_ANYBUTTON_RELEASED },
++	{ 0, 0 },
+ };
+ 
  /*
-  * ACPI callbacks
+@@ -897,35 +916,51 @@
   */
  static void sony_acpi_notify(acpi_handle handle, u32 event, void *data)
  {
@@ -210,32 +262,46 @@
 -	}
 +	if (ev >= 0x90) {
 +		/* New-style event */
-+		int origev = ev;
++		int key_handle = 0;
 +		ev -= 0x90;
- 
--	if (sony_nc_events)
--		for (evmap = sony_nc_events; evmap->event; evmap++) {
--			if (evmap->data == ev) {
--				ev = evmap->event;
--				break;
-+		if (sony_find_snc_handle(0x100) == ev) {
-+			int i;
 +
-+			if (sony_call_snc_handle(0x100, 0x200, &result))
-+				dprintk("sony_acpi_notify, unable to decode event 0x%.2x\n", ev);
++		if (sony_find_snc_handle(0x100) == ev)
++			key_handle = 0x100;
++		if (sony_find_snc_handle(0x127) == ev)
++			key_handle = 0x127;
++
++		if (handle) {
++			struct sony_nc_event *key_event;
++
++			if (sony_call_snc_handle(key_handle, 0x200, &result))
++				dprintk("sony_acpi_notify, unable to decode"
++					" event 0x%.2x 0x%.2x\n", key_handle,
++					ev);
 +			else
 +				ev = result & 0xFF;
 +
-+			for (i=0; sony_nc_events[i].event; i++) {
-+				if (sony_nc_events[i].data == ev) {
-+					ev = sony_nc_events[i].event;
++			if (key_handle == 0x100)
++				key_event = sony_100_events;
++			else
++				key_event = sony_127_events;
++
++			for (; key_event->data; key_event++) {
++				if (key_event->data == ev) {
++					ev = key_event->event;
 +					break;
 +				}
- 			}
-+
-+			if (!sony_nc_events[i].data)
++			}
+ 
+-	if (sony_nc_events)
+-		for (evmap = sony_nc_events; evmap->event; evmap++) {
+-			if (evmap->data == ev) {
+-				ev = evmap->event;
+-				break;
++			if (!key_event->data) {
 +				printk(KERN_INFO DRV_PFX
-+				       "Unknown event: %x %x\n", origev, ev);
++				       "Unknown event: 0x%x 0x%x\n", key_handle,
++				       ev);
+ 			}
 +		} else if (sony_find_snc_handle(0x124) == ev) {
 +			sony_nc_rfkill_update();
 +			return;
@@ -244,11 +310,12 @@
  
  	dprintk("sony_acpi_notify, event: 0x%.2x\n", ev);
  	sony_laptop_report_input_event(ev);
-@@ -953,9 +937,24 @@ static acpi_status sony_walk_callback(acpi_handle handle, u32 level,
+@@ -953,9 +988,25 @@
  /*
   * ACPI device
   */
-+static int sony_nc_function_setup(struct acpi_device *device) {
++static int sony_nc_function_setup(struct acpi_device *device)
++{
 +	int result;
 +
 +	/* Enable all events */
@@ -269,7 +336,7 @@
  
  	for (item = sony_nc_values; item->name; item++) {
  		int ret;
-@@ -970,13 +969,188 @@ static int sony_nc_resume(struct acpi_device *device)
+@@ -970,13 +1021,188 @@
  		}
  	}
  
@@ -299,7 +366,7 @@
 +{
 +	int i;
 +
-+	for (i=0; i<SONY_RFKILL_MAX; i++) {
++	for (i = 0; i < SONY_RFKILL_MAX; i++) {
 +		if (sony_rfkill_devices[i])
 +			rfkill_unregister(sony_rfkill_devices[i]);
 +	}
@@ -425,7 +492,7 @@
 +	int i;
 +	enum rfkill_state state;
 +
-+	for (i=0; i<SONY_RFKILL_MAX; i++) {
++	for (i = 0; i < SONY_RFKILL_MAX; i++) {
 +		if (sony_rfkill_devices[i]) {
 +			sony_rfkill_devices[i]->
 +				get_state(sony_rfkill_devices[i]->data,
@@ -460,7 +527,7 @@
  
  	return 0;
  }
-@@ -1024,6 +1198,19 @@ static int sony_nc_add(struct acpi_device *device)
+@@ -1024,6 +1250,19 @@
  			dprintk("_INI Method failed\n");
  	}
  
@@ -480,7 +547,7 @@
  	/* setup input devices and helper fifo */
  	result = sony_laptop_setup_input(device);
  	if (result) {
-@@ -1063,9 +1250,6 @@ static int sony_nc_add(struct acpi_device *device)
+@@ -1063,9 +1302,6 @@
  
  	}
  
@@ -490,7 +557,7 @@
  	result = sony_pf_add();
  	if (result)
  		goto outbacklight;
-@@ -1131,6 +1315,7 @@ static int sony_nc_add(struct acpi_device *device)
+@@ -1131,6 +1367,7 @@
  	sony_laptop_remove_input();
  
        outwalk:
@@ -498,7 +565,7 @@
  	return result;
  }
  
-@@ -1156,6 +1341,7 @@ static int sony_nc_remove(struct acpi_device *device, int type)
+@@ -1156,6 +1393,7 @@
  
  	sony_pf_remove();
  	sony_laptop_remove_input();
@@ -506,15 +573,269 @@
  	dprintk(SONY_NC_DRIVER_NAME " removed.\n");
  
  	return 0;
-diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h
-index f41ffd7..8458dbe 100644
---- a/include/linux/sonypi.h
-+++ b/include/linux/sonypi.h
-@@ -103,6 +103,7 @@
+@@ -1195,7 +1433,6 @@
+ #define SONYPI_TYPE1_OFFSET	0x04
+ #define SONYPI_TYPE2_OFFSET	0x12
+ #define SONYPI_TYPE3_OFFSET	0x12
+-#define SONYPI_TYPE4_OFFSET	0x12
+ 
+ struct sony_pic_ioport {
+ 	struct acpi_resource_io	io1;
+@@ -1328,6 +1565,7 @@
+ 	{ 0x01, SONYPI_EVENT_PKEY_P1 },
+ 	{ 0x02, SONYPI_EVENT_PKEY_P2 },
+ 	{ 0x04, SONYPI_EVENT_PKEY_P3 },
++	{ 0x20, SONYPI_EVENT_PKEY_P1 },
+ 	{ 0, 0 }
+ };
+ 
+@@ -1371,6 +1609,7 @@
+ 	{ 0x39, SONYPI_EVENT_ZOOM_PRESSED },
+ 	{ 0x10, SONYPI_EVENT_ZOOM_IN_PRESSED },
+ 	{ 0x20, SONYPI_EVENT_ZOOM_OUT_PRESSED },
++	{ 0x04, SONYPI_EVENT_ZOOM_PRESSED },
+ 	{ 0, 0 }
+ };
+ 
+@@ -1401,6 +1640,19 @@
+ 	{ 0, 0 }
+ };
+ 
++/* The set of possible volume events */
++static struct sonypi_event sonypi_volumeev[] = {
++	{ 0x01, SONYPI_EVENT_VOLUME_INC_PRESSED },
++	{ 0x02, SONYPI_EVENT_VOLUME_DEC_PRESSED },
++	{ 0, 0 }
++};
++
++/* The set of possible brightness events */
++static struct sonypi_event sonypi_brightnessev[] = {
++	{ 0x80, SONYPI_EVENT_BRIGHTNESS_PRESSED },
++	{ 0, 0 }
++};
++
+ static struct sonypi_eventtypes type1_events[] = {
+ 	{ 0, 0xffffffff, sonypi_releaseev },
+ 	{ 0x70, SONYPI_MEYE_MASK, sonypi_meyeev },
+@@ -1438,17 +1690,11 @@
+ 	{ 0x31, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev },
+ 	{ 0x41, SONYPI_BATTERY_MASK, sonypi_batteryev },
+ 	{ 0x31, SONYPI_PKEY_MASK, sonypi_pkeyev },
+-	{ 0 },
+-};
+-static struct sonypi_eventtypes type4_events[] = {
+-	{ 0, 0xffffffff, sonypi_releaseev },
+-	{ 0x21, SONYPI_FNKEY_MASK, sonypi_fnkeyev },
+-	{ 0x31, SONYPI_WIRELESS_MASK, sonypi_wlessev },
+-	{ 0x31, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev },
+-	{ 0x41, SONYPI_BATTERY_MASK, sonypi_batteryev },
+ 	{ 0x05, SONYPI_PKEY_MASK, sonypi_pkeyev },
+ 	{ 0x05, SONYPI_ZOOM_MASK, sonypi_zoomev },
+ 	{ 0x05, SONYPI_CAPTURE_MASK, sonypi_captureev },
++	{ 0x05, SONYPI_PKEY_MASK, sonypi_volumeev },
++	{ 0x05, SONYPI_PKEY_MASK, sonypi_brightnessev },
+ 	{ 0 },
+ };
+ 
+@@ -1511,11 +1757,11 @@
+ /*
+  * minidrivers for SPIC models
+  */
+-static int type4_handle_irq(const u8 data_mask, const u8 ev)
++static int type3_handle_irq(const u8 data_mask, const u8 ev)
+ {
+ 	/*
+ 	 * 0x31 could mean we have to take some extra action and wait for
+-	 * the next irq for some Type4 models, it will generate a new
++	 * the next irq for some Type3 models, it will generate a new
+ 	 * irq and we can read new data from the device:
+ 	 *  - 0x5c and 0x5f requires 0xA0
+ 	 *  - 0x61 requires 0xB3
+@@ -1545,16 +1791,10 @@
+ 	},
+ 	{
+ 		.model = SONYPI_DEVICE_TYPE3,
+-		.handle_irq = NULL,
++		.handle_irq = type3_handle_irq,
+ 		.evport_offset = SONYPI_TYPE3_OFFSET,
+ 		.event_types = type3_events,
+ 	},
+-	{
+-		.model = SONYPI_DEVICE_TYPE4,
+-		.handle_irq = type4_handle_irq,
+-		.evport_offset = SONYPI_TYPE4_OFFSET,
+-		.event_types = type4_events,
+-	},
+ };
+ 
+ static void sony_pic_detect_device_type(struct sony_pic_dev *dev)
+@@ -1578,14 +1818,21 @@
+ 	pcidev = pci_get_device(PCI_VENDOR_ID_INTEL,
+ 			PCI_DEVICE_ID_INTEL_ICH7_1, NULL);
+ 	if (pcidev) {
+-		dev->control = &spic_types[3];
++		dev->control = &spic_types[2];
+ 		goto out;
+ 	}
+ 
+ 	pcidev = pci_get_device(PCI_VENDOR_ID_INTEL,
+ 			PCI_DEVICE_ID_INTEL_ICH8_4, NULL);
+ 	if (pcidev) {
+-		dev->control = &spic_types[3];
++		dev->control = &spic_types[2];
++		goto out;
++	}
++
++	pcidev = pci_get_device(PCI_VENDOR_ID_INTEL,
++			PCI_DEVICE_ID_INTEL_ICH9_1, NULL);
++	if (pcidev) {
++		dev->control = &spic_types[2];
+ 		goto out;
+ 	}
+ 
+@@ -1598,8 +1845,7 @@
+ 
+ 	printk(KERN_INFO DRV_PFX "detected Type%d model\n",
+ 			dev->control->model == SONYPI_DEVICE_TYPE1 ? 1 :
+-			dev->control->model == SONYPI_DEVICE_TYPE2 ? 2 :
+-			dev->control->model == SONYPI_DEVICE_TYPE3 ? 3 : 4);
++			dev->control->model == SONYPI_DEVICE_TYPE2 ? 2 : 3);
+ }
+ 
+ /* camera tests and poweron/poweroff */
+@@ -1754,17 +2000,14 @@
+ EXPORT_SYMBOL(sony_pic_camera_command);
+ 
+ /* gprs/edge modem (SZ460N and SZ210P), thanks to Joshua Wise */
+-static void sony_pic_set_wwanpower(u8 state)
++static void __sony_pic_set_wwanpower(u8 state)
+ {
+ 	state = !!state;
+-	mutex_lock(&spic_dev.lock);
+-	if (spic_dev.wwan_power == state) {
+-		mutex_unlock(&spic_dev.lock);
++	if (spic_dev.wwan_power == state)
+ 		return;
+-	}
+ 	sony_pic_call2(0xB0, state);
++	sony_pic_call1(0x82);
+ 	spic_dev.wwan_power = state;
+-	mutex_unlock(&spic_dev.lock);
+ }
+ 
+ static ssize_t sony_pic_wwanpower_store(struct device *dev,
+@@ -1776,7 +2019,9 @@
+ 		return -EINVAL;
+ 
+ 	value = simple_strtoul(buffer, NULL, 10);
+-	sony_pic_set_wwanpower(value);
++	mutex_lock(&spic_dev.lock);
++	__sony_pic_set_wwanpower(value);
++	mutex_unlock(&spic_dev.lock);
+ 
+ 	return count;
+ }
+@@ -1934,10 +2179,15 @@
+ static int sonypi_misc_open(struct inode *inode, struct file *file)
+ {
+ 	/* Flush input queue on first open */
+-	lock_kernel();
++	unsigned long flags;
++
++	spin_lock_irqsave(sonypi_compat.fifo->lock, flags);
++
+ 	if (atomic_inc_return(&sonypi_compat.open_count) == 1)
+-		kfifo_reset(sonypi_compat.fifo);
+-	unlock_kernel();
++		__kfifo_reset(sonypi_compat.fifo);
++
++	spin_unlock_irqrestore(sonypi_compat.fifo->lock, flags);
++
+ 	return 0;
+ }
+ 
+@@ -1990,8 +2240,8 @@
+ 	return 0;
+ }
+ 
+-static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
+-			     unsigned int cmd, unsigned long arg)
++static long sonypi_misc_ioctl(struct file *fp, unsigned int cmd,
++							unsigned long arg)
+ {
+ 	int ret = 0;
+ 	void __user *argp = (void __user *)arg;
+@@ -2125,7 +2375,7 @@
+ 	.open		= sonypi_misc_open,
+ 	.release	= sonypi_misc_release,
+ 	.fasync		= sonypi_misc_fasync,
+-	.ioctl		= sonypi_misc_ioctl,
++	.unlocked_ioctl	= sonypi_misc_ioctl,
+ };
+ 
+ static struct miscdevice sonypi_misc_device = {
+--- vanilla-2.6.29/include/linux/sonypi.h	2009-03-23 23:12:14.000000000 +0000
++++ linux-2.6.29.noarch/include/linux/sonypi.h	2009-03-31 16:37:31.000000000 +0100
+@@ -103,6 +103,14 @@
  #define SONYPI_EVENT_WIRELESS_OFF		61
  #define SONYPI_EVENT_ZOOM_IN_PRESSED		62
  #define SONYPI_EVENT_ZOOM_OUT_PRESSED		63
 +#define SONYPI_EVENT_CD_EJECT_PRESSED		64
++#define SONYPI_EVENT_MODEKEY_PRESSED		65
++#define SONYPI_EVENT_PKEY_P4			66
++#define SONYPI_EVENT_PKEY_P5			67
++#define SONYPI_EVENT_SETTINGKEY_PRESSED		68
++#define SONYPI_EVENT_VOLUME_INC_PRESSED		69
++#define SONYPI_EVENT_VOLUME_DEC_PRESSED		70
++#define SONYPI_EVENT_BRIGHTNESS_PRESSED		71
  
  /* get/set brightness */
  #define SONYPI_IOCGBRT		_IOR('v', 0, __u8)
+--- sony-laptop.c.orig	2009-03-29 12:41:44.000000000 +0200
++++ a/drivers/platform/x86/sony-laptop.c	2009-03-31 00:04:23.000000000 +0200
+@@ -865,7 +865,7 @@
+ static struct sony_nc_event sony_100_events[] = {
+ 	{ 0x90, SONYPI_EVENT_PKEY_P1 },
+ 	{ 0x10, SONYPI_EVENT_ANYBUTTON_RELEASED },
+-	{ 0x91, SONYPI_EVENT_PKEY_P1 },
++	{ 0x91, SONYPI_EVENT_PKEY_P2 },
+ 	{ 0x11, SONYPI_EVENT_ANYBUTTON_RELEASED },
+ 	{ 0x81, SONYPI_EVENT_FNKEY_F1 },
+ 	{ 0x01, SONYPI_EVENT_FNKEY_RELEASED },
+@@ -929,7 +929,7 @@
+ 		if (sony_find_snc_handle(0x127) == ev)
+ 			key_handle = 0x127;
+ 
+-		if (handle) {
++		if (key_handle) {
+ 			struct sony_nc_event *key_event;
+ 
+ 			if (sony_call_snc_handle(key_handle, 0x200, &result))
+@@ -955,15 +955,22 @@
+ 				printk(KERN_INFO DRV_PFX
+ 				       "Unknown event: 0x%x 0x%x\n", key_handle,
+ 				       ev);
++				/* restore original event number */
++				ev = event;
++			} else {
++				sony_laptop_report_input_event(ev);
++				/* mark event as translated */
++				ev |= 0x8000;
+ 			}
+ 		} else if (sony_find_snc_handle(0x124) == ev) {
+ 			sony_nc_rfkill_update();
+-			return;
+-		}
+-	}
+-
++			/* restore original event number */
++			ev = event;
++		} 
++	} else
++		sony_laptop_report_input_event(ev);
++	
+ 	dprintk("sony_acpi_notify, event: 0x%.2x\n", ev);
+-	sony_laptop_report_input_event(ev);
+ 	acpi_bus_generate_proc_event(sony_nc_acpi_device, 1, ev);
+ }
+ 

linux-2.6-v4l-dvb-fixes.patch:

Index: linux-2.6-v4l-dvb-fixes.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-v4l-dvb-fixes.patch,v
retrieving revision 1.2.8.7
retrieving revision 1.2.8.8
diff -u -r1.2.8.7 -r1.2.8.8
--- linux-2.6-v4l-dvb-fixes.patch	30 Mar 2009 19:45:45 -0000	1.2.8.7
+++ linux-2.6-v4l-dvb-fixes.patch	14 Apr 2009 22:09:18 -0000	1.2.8.8
@@ -315,7 +315,6 @@
       V4L/DVB (11051): v4l-dvb: replace remaining references to the old mailinglist.
       V4L/DVB (11052): bt819: remove an unused header
       V4L/DVB (11053): saa7134: set v4l2_dev field of video_device
-      V4L/DVB (11098): v4l2-common: remove incorrect MODULE test
       V4L/DVB (11100): au8522: fix compilation warning.
       V4L/DVB (11112): v4l2-subdev: add support for TRY_FMT, ENUM_FMT and G/S_PARM.
       V4L/DVB (11113): ov7670: convert to v4l2_subdev
@@ -98395,19 +98394,6 @@
     to high class IDs.
  
     This function returns the first ID that follows after the given ID.
-@@ -910,10 +797,10 @@ struct v4l2_subdev *v4l2_i2c_new_subdev(struct i2c_adapter *adapter,
- 	struct i2c_board_info info;
- 
- 	BUG_ON(!dev);
--#ifdef MODULE
-+
- 	if (module_name)
- 		request_module(module_name);
--#endif
-+
- 	/* Setup the i2c board info with the device type and
- 	   the device address. */
- 	memset(&info, 0, sizeof(info));
 @@ -927,11 +814,11 @@ struct v4l2_subdev *v4l2_i2c_new_subdev(struct i2c_adapter *adapter,
  	   We need better support from the kernel so that we
  	   can easily wait for the load to finish. */
@@ -98437,19 +98423,6 @@
  }
  EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev);
  
-@@ -958,10 +850,10 @@ struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct i2c_adapter *adapter,
- 	struct i2c_board_info info;
- 
- 	BUG_ON(!dev);
--#ifdef MODULE
-+
- 	if (module_name)
- 		request_module(module_name);
--#endif
-+
- 	/* Setup the i2c board info with the device type and
- 	   the device address. */
- 	memset(&info, 0, sizeof(info));
 @@ -974,11 +866,11 @@ struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct i2c_adapter *adapter,
  	   We need better support from the kernel so that we
  	   can easily wait for the load to finish. */


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/sources,v
retrieving revision 1.976.2.9
retrieving revision 1.976.2.10
diff -u -r1.976.2.9 -r1.976.2.10
--- sources	24 Mar 2009 22:57:47 -0000	1.976.2.9
+++ sources	14 Apr 2009 22:09:21 -0000	1.976.2.10
@@ -1 +1,2 @@
 64921b5ff5cdadbccfcd3820f03be7d8  linux-2.6.29.tar.bz2
+87c6fbf4096b644d66d4da8bb00641a5  patch-2.6.29.1.bz2


Index: upstream
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/upstream,v
retrieving revision 1.888.2.8
retrieving revision 1.888.2.9
diff -u -r1.888.2.8 -r1.888.2.9
--- upstream	24 Mar 2009 22:57:47 -0000	1.888.2.8
+++ upstream	14 Apr 2009 22:09:22 -0000	1.888.2.9
@@ -1 +1,2 @@
 linux-2.6.29.tar.bz2
+patch-2.6.29.1.bz2

xen.pvops.patch:

Index: xen.pvops.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/Attic/xen.pvops.patch,v
retrieving revision 1.1.2.15
retrieving revision 1.1.2.16
diff -u -r1.1.2.15 -r1.1.2.16
--- xen.pvops.patch	30 Mar 2009 19:45:46 -0000	1.1.2.15
+++ xen.pvops.patch	14 Apr 2009 22:09:22 -0000	1.1.2.16
@@ -4134,7 +4134,7 @@
  P:	Ananth N Mavinakayanahalli
  M:	ananth at in.ibm.com
 diff --git a/Makefile b/Makefile
-index 1ab3ebf..43f52e2 100644
+index cdb1133..86361af 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -533,8 +533,9 @@ KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN})
@@ -45592,10 +45592,10 @@
  	BLANK();
  	OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled);
 diff --git a/arch/x86/kernel/check.c b/arch/x86/kernel/check.c
-index 2ac0ab7..fc999e6 100644
+index a7a50b2..ceecf8c 100644
 --- a/arch/x86/kernel/check.c
 +++ b/arch/x86/kernel/check.c
-@@ -83,15 +83,15 @@ void __init setup_bios_corruption_check(void)
+@@ -83,7 +83,10 @@ void __init setup_bios_corruption_check(void)
  		u64 size;
  		addr = find_e820_area_size(addr, &size, PAGE_SIZE);
  
@@ -45606,15 +45606,7 @@
 +		if (addr >= corruption_check_size)
  			break;
  
- 		if ((addr + size) > corruption_check_size)
- 			size = corruption_check_size - addr;
- 
--		if (size == 0)
--			break;
--
- 		e820_update_range(addr, size, E820_RAM, E820_RESERVED);
- 		scan_areas[num_scan_areas].addr = addr;
- 		scan_areas[num_scan_areas].size = size;
+ 		if (addr >= corruption_check_size)
 diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
 index 82db7f4..3efcb2b 100644
 --- a/arch/x86/kernel/cpu/Makefile
@@ -51220,7 +51212,7 @@
  
  int __init cyrix_init_mtrr(void)
 diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
-index 0c0a455..9fd8ebf 100644
+index 6f557e0..44e2289 100644
 --- a/arch/x86/kernel/cpu/mtrr/generic.c
 +++ b/arch/x86/kernel/cpu/mtrr/generic.c
 @@ -33,13 +33,31 @@ u64 mtrr_tom2;
@@ -51258,18 +51250,9 @@
  }
 -early_param("mtrr.show", mtrr_debug);
  
- /*
-  * Returns the effective MTRR type for the region
-@@ -174,6 +192,8 @@ get_fixed_ranges(mtrr_type * frs)
- 	unsigned int *p = (unsigned int *) frs;
- 	int i;
- 
-+	k8_check_syscfg_dram_mod_en();
-+
- 	rdmsr(MTRRfix64K_00000_MSR, p[0], p[1]);
- 
- 	for (i = 0; i < 2; i++)
-@@ -188,18 +208,94 @@ void mtrr_save_fixed_ranges(void *info)
+ /**
+  * BIOS is expected to clear MtrrFixDramModEn bit, see for example
+@@ -216,18 +234,94 @@ void mtrr_save_fixed_ranges(void *info)
  		get_fixed_ranges(mtrr_state.fixed_ranges);
  }
  
@@ -51368,7 +51351,7 @@
  /*  Grab all of the MTRR state for this CPU into *state  */
  void __init get_mtrr_state(void)
  {
-@@ -231,41 +327,9 @@ void __init get_mtrr_state(void)
+@@ -259,41 +353,9 @@ void __init get_mtrr_state(void)
  		mtrr_tom2 |= low;
  		mtrr_tom2 &= 0xffffff800000ULL;
  	}
@@ -51413,46 +51396,7 @@
  	mtrr_state_set = 1;
  
  	/* PAT setup for BP. We need to go through sync steps here */
-@@ -308,27 +372,10 @@ void mtrr_wrmsr(unsigned msr, unsigned a, unsigned b)
- }
- 
- /**
-- * Enable and allow read/write of extended fixed-range MTRR bits on K8 CPUs
-- * see AMD publication no. 24593, chapter 3.2.1 for more information
-- */
--static inline void k8_enable_fixed_iorrs(void)
--{
--	unsigned lo, hi;
--
--	rdmsr(MSR_K8_SYSCFG, lo, hi);
--	mtrr_wrmsr(MSR_K8_SYSCFG, lo
--				| K8_MTRRFIXRANGE_DRAM_ENABLE
--				| K8_MTRRFIXRANGE_DRAM_MODIFY, hi);
--}
--
--/**
-  * set_fixed_range - checks & updates a fixed-range MTRR if it differs from the value it should have
-  * @msr: MSR address of the MTTR which should be checked and updated
-  * @changed: pointer which indicates whether the MTRR needed to be changed
-  * @msrwords: pointer to the MSR values which the MSR should have
-- *
-- * If K8 extentions are wanted, update the K8 SYSCFG MSR also.
-- * See AMD publication no. 24593, chapter 7.8.1, page 233 for more information.
-  */
- static void set_fixed_range(int msr, bool *changed, unsigned int *msrwords)
- {
-@@ -337,10 +384,6 @@ static void set_fixed_range(int msr, bool *changed, unsigned int *msrwords)
- 	rdmsr(msr, lo, hi);
- 
- 	if (lo != msrwords[0] || hi != msrwords[1]) {
--		if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
--		    (boot_cpu_data.x86 >= 0x0f && boot_cpu_data.x86 <= 0x11) &&
--		    ((msrwords[0] | msrwords[1]) & K8_MTRR_RDMEM_WRMEM_MASK))
--			k8_enable_fixed_iorrs();
- 		mtrr_wrmsr(msr, msrwords[0], msrwords[1]);
- 		*changed = true;
- 	}
-@@ -376,22 +419,31 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
+@@ -383,22 +445,31 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
  {
  	unsigned int mask_lo, mask_hi, base_lo, base_hi;
  	unsigned int tmp, hi;
@@ -51487,7 +51431,7 @@
  	hi = fls(tmp);
  	if (hi > 0) {
  		tmp |= ~((1<<(hi - 1)) - 1);
-@@ -402,11 +454,19 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
+@@ -409,11 +480,19 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
  		}
  	}
  
@@ -51509,16 +51453,7 @@
  }
  
  /**
-@@ -419,6 +479,8 @@ static int set_fixed_ranges(mtrr_type * frs)
- 	bool changed = false;
- 	int block=-1, range;
- 
-+	k8_check_syscfg_dram_mod_en();
-+
- 	while (fixed_range_blocks[++block].ranges)
- 	    for (range=0; range < fixed_range_blocks[block].ranges; range++)
- 		set_fixed_range(fixed_range_blocks[block].base_msr + range,
-@@ -663,4 +725,5 @@ struct mtrr_ops generic_mtrr_ops = {
+@@ -672,4 +751,5 @@ struct mtrr_ops generic_mtrr_ops = {
  	.set               = generic_set_mtrr,
  	.validate_add_page = generic_validate_add_page,
  	.have_wrcomb       = generic_have_wrcomb,
@@ -68547,7 +68482,7 @@
  {
  	unsigned long stack;
 diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
-index 06ca07f..5c6e463 100644
+index f7d38d6..5c6e463 100644
 --- a/arch/x86/kernel/ptrace.c
 +++ b/arch/x86/kernel/ptrace.c
 @@ -21,6 +21,7 @@
@@ -68609,18 +68544,7 @@
  }
  
  #endif	/* CONFIG_X86_32 */
-@@ -690,9 +686,8 @@ static int ptrace_bts_config(struct task_struct *child,
- 		if (!cfg.signal)
- 			return -EINVAL;
- 
--		return -EOPNOTSUPP;
--
- 		child->thread.bts_ovfl_signal = cfg.signal;
-+		return -EOPNOTSUPP;
- 	}
- 
- 	if ((cfg.flags & PTRACE_BTS_O_ALLOC) &&
-@@ -1421,6 +1416,9 @@ asmregparm long syscall_trace_enter(struct pt_regs *regs)
+@@ -1420,6 +1416,9 @@ asmregparm long syscall_trace_enter(struct pt_regs *regs)
  	    tracehook_report_syscall_entry(regs))
  		ret = -1L;
  
@@ -68630,7 +68554,7 @@
  	if (unlikely(current->audit_context)) {
  		if (IS_IA32)
  			audit_syscall_entry(AUDIT_ARCH_I386,
-@@ -1444,6 +1442,9 @@ asmregparm void syscall_trace_leave(struct pt_regs *regs)
+@@ -1443,6 +1442,9 @@ asmregparm void syscall_trace_leave(struct pt_regs *regs)
  	if (unlikely(current->audit_context))
  		audit_syscall_exit(AUDITSC_RESULT(regs->ax), regs->ax);
  
@@ -72601,7 +72525,7 @@
 -	on_each_cpu(do_flush_tlb_all, NULL, 1);
 -}
 diff --git a/arch/x86/kernel/tlb_uv.c b/arch/x86/kernel/tlb_uv.c
-index 6812b82..deb5ebb 100644
+index 16e505a..deb5ebb 100644
 --- a/arch/x86/kernel/tlb_uv.c
 +++ b/arch/x86/kernel/tlb_uv.c
 @@ -11,16 +11,15 @@
@@ -72762,13 +72686,7 @@
  }
  
  /*
-@@ -742,16 +751,21 @@ static int __init uv_bau_init(void)
- 	int node;
- 	int nblades;
- 	int last_blade;
--	int cur_cpu = 0;
-+	int cur_cpu;
- 
+@@ -747,6 +756,10 @@ static int __init uv_bau_init(void)
  	if (!is_uv_system())
  		return 0;
  
@@ -72779,12 +72697,6 @@
  	uv_bau_retry_limit = 1;
  	uv_nshift = uv_hub_info->n_val;
  	uv_mmask = (1UL << uv_hub_info->n_val) - 1;
- 	nblades = 0;
- 	last_blade = -1;
-+	cur_cpu = 0;
- 	for_each_online_node(node) {
- 		blade = uv_node_to_blade_id(node);
- 		if (blade == last_blade)
 diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c
 index 0fcc95a..7e45159 100644
 --- a/arch/x86/kernel/topology.c
@@ -74246,7 +74158,7 @@
  	select VIRTIO_RING
  	select VIRTIO_CONSOLE
 diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
-index 960a8d9..25799f3 100644
+index 4175cb4..9265132 100644
 --- a/arch/x86/lguest/boot.c
 +++ b/arch/x86/lguest/boot.c
 @@ -147,10 +147,16 @@ static void lazy_hcall(unsigned long call,
@@ -74307,7 +74219,7 @@
  	lazy_hcall(LHCALL_LOAD_TLS, __pa(&t->tls_array), cpu, 0);
  }
  
-@@ -830,13 +841,14 @@ static u32 lguest_apic_safe_wait_icr_idle(void)
+@@ -836,13 +847,14 @@ static u32 lguest_apic_safe_wait_icr_idle(void)
  	return 0;
  }
  
@@ -74329,7 +74241,7 @@
  };
  #endif
  
-@@ -991,10 +1003,10 @@ __init void lguest_init(void)
+@@ -997,10 +1009,10 @@ __init void lguest_init(void)
  
  	/* interrupt-related operations */
  	pv_irq_ops.init_IRQ = lguest_init_IRQ;
@@ -74344,7 +74256,7 @@
  	pv_irq_ops.safe_halt = lguest_safe_halt;
  
  	/* init-time operations */
-@@ -1019,8 +1031,8 @@ __init void lguest_init(void)
+@@ -1025,8 +1037,8 @@ __init void lguest_init(void)
  	pv_cpu_ops.write_gdt_entry = lguest_write_gdt_entry;
  	pv_cpu_ops.write_idt_entry = lguest_write_idt_entry;
  	pv_cpu_ops.wbinvd = lguest_wbinvd;
@@ -74355,12 +74267,14 @@
  
  	/* pagetable management */
  	pv_mmu_ops.write_cr3 = lguest_write_cr3;
-@@ -1033,11 +1045,11 @@ __init void lguest_init(void)
+@@ -1039,13 +1051,13 @@ __init void lguest_init(void)
  	pv_mmu_ops.read_cr2 = lguest_read_cr2;
  	pv_mmu_ops.read_cr3 = lguest_read_cr3;
  	pv_mmu_ops.lazy_mode.enter = paravirt_enter_lazy_mmu;
 -	pv_mmu_ops.lazy_mode.leave = lguest_leave_lazy_mode;
 +	pv_mmu_ops.lazy_mode.leave = lguest_leave_lazy_mmu_mode;
+ 	pv_mmu_ops.pte_update = lguest_pte_update;
+ 	pv_mmu_ops.pte_update_defer = lguest_pte_update;
  
  #ifdef CONFIG_X86_LOCAL_APIC
  	/* apic read/write intercepts */
@@ -74369,7 +74283,7 @@
  #endif
  
  	/* time operations */
-@@ -1052,14 +1064,6 @@ __init void lguest_init(void)
+@@ -1060,14 +1072,6 @@ __init void lguest_init(void)
  	 * lguest_init() where the rest of the fairly chaotic boot setup
  	 * occurs. */
  
@@ -85269,7 +85183,7 @@
  {
  	unsigned long addr = (unsigned long)page_address(page);
 diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
-index e0ab173..56899ae 100644
+index 21bc1f7..56899ae 100644
 --- a/arch/x86/mm/pat.c
 +++ b/arch/x86/mm/pat.c
 @@ -31,7 +31,7 @@
@@ -85355,7 +85269,7 @@
   * Internal interface to reserve a range of physical memory with prot.
   * Reserved non RAM regions only and after successful reserve_memtype,
   * this func also keeps identity mapping (if any) in sync with this new prot.
-@@ -634,17 +665,18 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
+@@ -634,7 +665,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
  				int strict_prot)
  {
  	int is_ram = 0;
@@ -85364,20 +85278,7 @@
  	unsigned long flags;
  	unsigned long want_flags = (pgprot_val(*vma_prot) & _PAGE_CACHE_MASK);
  
- 	is_ram = pat_pagerange_is_ram(paddr, paddr + size);
- 
- 	/*
--	 * reserve_pfn_range() doesn't support RAM pages.
-+	 * reserve_pfn_range() doesn't support RAM pages. Maintain the current
-+	 * behavior with RAM pages by returning success.
- 	 */
- 	if (is_ram != 0)
--		return -EINVAL;
-+		return 0;
- 
- 	ret = reserve_memtype(paddr, paddr + size, want_flags, &flags);
- 	if (ret)
-@@ -671,23 +703,8 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
+@@ -672,23 +703,8 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
  				     flags);
  	}
  
@@ -86030,7 +85931,7 @@
  		.ident = "Toshiba PS5 based laptop",
  		.matches = {
 diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
-index 5ead808..f7133b5 100644
+index f234a37..f7133b5 100644
 --- a/arch/x86/pci/i386.c
 +++ b/arch/x86/pci/i386.c
 @@ -296,6 +296,9 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
@@ -86043,16 +85944,6 @@
  	if (pat_enabled && write_combine)
  		prot |= _PAGE_CACHE_WC;
  	else if (pat_enabled || boot_cpu_data.x86 > 3)
-@@ -319,6 +322,9 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
- 			return -EINVAL;
- 		}
- 		flags = new_flags;
-+		vma->vm_page_prot = __pgprot(
-+			(pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK) |
-+			flags);
- 	}
- 
- 	if (((vma->vm_pgoff < max_low_pfn_mapped) ||
 diff --git a/arch/x86/pci/init.c b/arch/x86/pci/init.c
 index 25a1f8e..4e2f90a 100644
 --- a/arch/x86/pci/init.c
@@ -106332,10 +106223,10 @@
  
  	befs_debug(sb, "---> befs_readdir() "
 diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
-index 939e2f7..c607744 100644
+index 71ae000..fbcbbf3 100644
 --- a/fs/cifs/cifssmb.c
 +++ b/fs/cifs/cifssmb.c
-@@ -3117,7 +3117,7 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
+@@ -3119,7 +3119,7 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
  		__u32 parm_len;
  		__u32 acl_len;
  		struct smb_com_ntransact_rsp *pSMBr;
@@ -111637,7 +111528,7 @@
 +
  #endif /* _LINUX_MEMORY_H_ */
 diff --git a/include/linux/mm.h b/include/linux/mm.h
-index 065cdf8..b1ea37f 100644
+index 3daa05f..03443ca 100644
 --- a/include/linux/mm.h
 +++ b/include/linux/mm.h
 @@ -104,6 +104,7 @@ extern unsigned int kobjsize(const void *objp);
@@ -111648,15 +111539,6 @@
  
  #ifndef VM_STACK_DEFAULT_FLAGS		/* arch can override this */
  #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
-@@ -145,7 +146,7 @@ extern pgprot_t protection_map[16];
-  */
- static inline int is_linear_pfn_mapping(struct vm_area_struct *vma)
- {
--	return ((vma->vm_flags & VM_PFNMAP) && vma->vm_pgoff);
-+	return (vma->vm_flags & VM_PFN_AT_MMAP);
- }
- 
- static inline int is_pfn_mapping(struct vm_area_struct *vma)
 diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
 index d84feb7..347e598 100644
 --- a/include/linux/mm_types.h
@@ -154385,7 +154267,7 @@
 +		kmemcheck_mark_uninitialized_pages(page, pages);
 +}
 diff --git a/mm/memory.c b/mm/memory.c
-index baa999e..ef11ac6 100644
+index d7df5ba..8bb20d4 100644
 --- a/mm/memory.c
 +++ b/mm/memory.c
 @@ -48,6 +48,8 @@
@@ -154397,27 +154279,6 @@
  #include <linux/init.h>
  #include <linux/writeback.h>
  #include <linux/memcontrol.h>
-@@ -1665,9 +1667,10 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr,
- 	 * behaviour that some programs depend on. We mark the "original"
- 	 * un-COW'ed pages by matching them up with "vma->vm_pgoff".
- 	 */
--	if (addr == vma->vm_start && end == vma->vm_end)
-+	if (addr == vma->vm_start && end == vma->vm_end) {
- 		vma->vm_pgoff = pfn;
--	else if (is_cow_mapping(vma->vm_flags))
-+		vma->vm_flags |= VM_PFN_AT_MMAP;
-+	} else if (is_cow_mapping(vma->vm_flags))
- 		return -EINVAL;
- 
- 	vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;
-@@ -1679,6 +1682,7 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr,
- 		 * needed from higher level routine calling unmap_vmas
- 		 */
- 		vma->vm_flags &= ~(VM_IO | VM_RESERVED | VM_PFNMAP);
-+		vma->vm_flags &= ~VM_PFN_AT_MMAP;
- 		return -EINVAL;
- 	}
- 
 diff --git a/mm/mempolicy.c b/mm/mempolicy.c
 index 3eb4a6f..636344d 100644
 --- a/mm/mempolicy.c
@@ -156912,30 +156773,6 @@
  	tristate "Plan 9 Resource Sharing Support (9P2000) (Experimental)"
  	help
  	  If you say Y here, you will get experimental support for
-diff --git a/net/core/dev.c b/net/core/dev.c
-index e3fe5c7..c1e9dc0 100644
---- a/net/core/dev.c
-+++ b/net/core/dev.c
-@@ -2588,9 +2588,9 @@ static int process_backlog(struct napi_struct *napi, int quota)
- 		local_irq_disable();
- 		skb = __skb_dequeue(&queue->input_pkt_queue);
- 		if (!skb) {
-+			__napi_complete(napi);
- 			local_irq_enable();
--			napi_complete(napi);
--			goto out;
-+			break;
- 		}
- 		local_irq_enable();
- 
-@@ -2599,7 +2599,6 @@ static int process_backlog(struct napi_struct *napi, int quota)
- 
- 	napi_gro_flush(napi);
- 
--out:
- 	return work;
- }
- 
 diff --git a/net/core/skbuff.c b/net/core/skbuff.c
 index c6a6b16..e83e994 100644
 --- a/net/core/skbuff.c

xen.pvops.post.patch:

Index: xen.pvops.post.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/Attic/xen.pvops.post.patch,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -u -r1.1.2.9 -r1.1.2.10
--- xen.pvops.post.patch	30 Mar 2009 19:45:49 -0000	1.1.2.9
+++ xen.pvops.post.patch	14 Apr 2009 22:09:26 -0000	1.1.2.10
@@ -1,4 +1,5 @@
 Reapply and merge in Fedora changes
+fix a mismerge in arch/x86/kernel/cpu/mtrr/generic.c
 remove localversion-tip file to avoid -tip being added to the kernel name
 
 --- a/arch/x86/mm/pat.c	2009-02-14 09:16:34.000000000 +0000
@@ -867,84 +868,298 @@
  	help
  	  Say Y here to support the Afatech AF9005 based DVB-T USB1.1 receiver
  	  and the TerraTec Cinergy T USB XE (Rev.1)
---- a/init/do_mounts_rd.c	2009-03-23 23:12:14.000000000 +0000
-+++ b/init/do_mounts_rd.c	2009-03-30 19:36:28.000000000 +0100
-@@ -9,7 +9,12 @@
- #include <linux/string.h>
+--- a/include/linux/intel-iommu.h	2009-03-23 23:12:14.000000000 +0000
++++ b/include/linux/intel-iommu.h	2009-04-11 17:05:51.000000000 +0100
+@@ -322,6 +332,7 @@
+ extern void free_iommu(struct intel_iommu *iommu);
+ extern int dmar_enable_qi(struct intel_iommu *iommu);
+ extern void dmar_disable_qi(struct intel_iommu *iommu);
++extern int dmar_reenable_qi(struct intel_iommu *iommu);
+ extern void qi_global_iec(struct intel_iommu *iommu);
+ 
+ extern int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid,
+--- a/arch/x86/kernel/cpu/mtrr/generic.c	2009-04-12 21:06:32.000000000 +0100
++++ b/arch/x86/kernel/cpu/mtrr/generic.c	2009-04-12 21:14:30.000000000 +0100
+@@ -59,32 +59,6 @@
+ 	}
+ }
  
- #include "do_mounts.h"
-+
-+#if defined(CONFIG_SQUASHFS3) || defined(CONFIG_SQUASHFS3_MODULE)
-+#include "../fs/squashfs3/squashfs3_fs.h"
-+#else
- #include "../fs/squashfs/squashfs_fs.h"
-+#endif
+-/**
+- * BIOS is expected to clear MtrrFixDramModEn bit, see for example
+- * "BIOS and Kernel Developer's Guide for the AMD Athlon 64 and AMD
+- * Opteron Processors" (26094 Rev. 3.30 February 2006), section
+- * "13.2.1.2 SYSCFG Register": "The MtrrFixDramModEn bit should be set
+- * to 1 during BIOS initalization of the fixed MTRRs, then cleared to
+- * 0 for operation."
+- */
+-static inline void k8_check_syscfg_dram_mod_en(void)
+-{
+-	u32 lo, hi;
+-
+-	if (!((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) &&
+-	      (boot_cpu_data.x86 >= 0x0f)))
+-		return;
+-
+-	rdmsr(MSR_K8_SYSCFG, lo, hi);
+-	if (lo & K8_MTRRFIXRANGE_DRAM_MODIFY) {
+-		printk(KERN_ERR FW_WARN "MTRR: CPU %u: SYSCFG[MtrrFixDramModEn]"
+-		       " not cleared by BIOS, clearing this bit\n",
+-		       smp_processor_id());
+-		lo &= ~K8_MTRRFIXRANGE_DRAM_MODIFY;
+-		mtrr_wrmsr(MSR_K8_SYSCFG, lo, hi);
+-	}
+-}
+-
+ /*
+  * Returns the effective MTRR type for the region
+  * Error returns:
+--- linux-2.6.29.x86_64/drivers/pci/dmar.c.orig	2009-04-12 21:24:15.000000000 +0100
++++ linux-2.6.29.x86_64/drivers/pci/dmar.c	2009-04-12 22:13:45.000000000 +0100
+@@ -763,42 +763,6 @@
+ }
  
- #include <linux/decompress/generic.h>
-
-@@ -38,6 +43,7 @@
-  * numbers could not be found.
-  *
-  * We currently check for the following magic numbers:
-+ *      squashfs
-  *	minix
-  *	ext2
-  *	romfs
---- a/arch/x86/mm/pat.c	2009-03-23 23:12:14.000000000 +0000
-+++ b/arch/x86/mm/pat.c	2009-03-30 19:36:52.000000000 +0100
-@@ -644,12 +647,18 @@
-	 * reserve_pfn_range() doesn't support RAM pages. Maintain the current
-	 * behavior with RAM pages by returning success.
- 	 */
--	if (is_ram != 0)
--		return 0;
-+	if (is_ram != 0) {
-+		printk(KERN_WARNING "reserve_pfn_range: is_ram is %d for 0x%llx!\n",
-+			is_ram, paddr);
-+		return 0;
-+	}
+ /*
+- * Disable Queued Invalidation interface.
+- */
+-void dmar_disable_qi(struct intel_iommu *iommu)
+-{
+-	unsigned long flags;
+-	u32 sts;
+-	cycles_t start_time = get_cycles();
+-
+-	if (!ecap_qis(iommu->ecap))
+-		return;
+-
+-	spin_lock_irqsave(&iommu->register_lock, flags);
+-
+-	sts =  dmar_readq(iommu->reg + DMAR_GSTS_REG);
+-	if (!(sts & DMA_GSTS_QIES))
+-		goto end;
+-
+-	/*
+-	 * Give a chance to HW to complete the pending invalidation requests.
+-	 */
+-	while ((readl(iommu->reg + DMAR_IQT_REG) !=
+-		readl(iommu->reg + DMAR_IQH_REG)) &&
+-		(DMAR_OPERATION_TIMEOUT > (get_cycles() - start_time)))
+-		cpu_relax();
+-
+-	iommu->gcmd &= ~DMA_GCMD_QIE;
+-
+-	writel(iommu->gcmd, iommu->reg + DMAR_GCMD_REG);
+-
+-	IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG, readl,
+-		      !(sts & DMA_GSTS_QIES), sts);
+-end:
+-	spin_unlock_irqrestore(&iommu->register_lock, flags);
+-}
+-
+-/*
+  * Enable queued invalidation.
+  */
+ static void __dmar_enable_qi(struct intel_iommu *iommu)
+@@ -932,172 +896,6 @@
+ };
+ #define MAX_FAULT_REASON_IDX 	(ARRAY_SIZE(fault_reason_strings) - 1)
  
- 	ret = reserve_memtype(paddr, paddr + size, want_flags, &flags);
+-const char *dmar_get_fault_reason(u8 fault_reason)
+-{
+-	if (fault_reason > MAX_FAULT_REASON_IDX)
+-		return "Unknown";
+-	else
+-		return fault_reason_strings[fault_reason];
+-}
+-
+-void dmar_msi_unmask(unsigned int irq)
+-{
+-	struct intel_iommu *iommu = get_irq_data(irq);
+-	unsigned long flag;
+-
+-	/* unmask it */
+-	spin_lock_irqsave(&iommu->register_lock, flag);
+-	writel(0, iommu->reg + DMAR_FECTL_REG);
+-	/* Read a reg to force flush the post write */
+-	readl(iommu->reg + DMAR_FECTL_REG);
+-	spin_unlock_irqrestore(&iommu->register_lock, flag);
+-}
+-
+-void dmar_msi_mask(unsigned int irq)
+-{
+-	unsigned long flag;
+-	struct intel_iommu *iommu = get_irq_data(irq);
+-
+-	/* mask it */
+-	spin_lock_irqsave(&iommu->register_lock, flag);
+-	writel(DMA_FECTL_IM, iommu->reg + DMAR_FECTL_REG);
+-	/* Read a reg to force flush the post write */
+-	readl(iommu->reg + DMAR_FECTL_REG);
+-	spin_unlock_irqrestore(&iommu->register_lock, flag);
+-}
+-
+-void dmar_msi_write(int irq, struct msi_msg *msg)
+-{
+-	struct intel_iommu *iommu = get_irq_data(irq);
+-	unsigned long flag;
+-
+-	spin_lock_irqsave(&iommu->register_lock, flag);
+-	writel(msg->data, iommu->reg + DMAR_FEDATA_REG);
+-	writel(msg->address_lo, iommu->reg + DMAR_FEADDR_REG);
+-	writel(msg->address_hi, iommu->reg + DMAR_FEUADDR_REG);
+-	spin_unlock_irqrestore(&iommu->register_lock, flag);
+-}
+-
+-void dmar_msi_read(int irq, struct msi_msg *msg)
+-{
+-	struct intel_iommu *iommu = get_irq_data(irq);
+-	unsigned long flag;
+-
+-	spin_lock_irqsave(&iommu->register_lock, flag);
+-	msg->data = readl(iommu->reg + DMAR_FEDATA_REG);
+-	msg->address_lo = readl(iommu->reg + DMAR_FEADDR_REG);
+-	msg->address_hi = readl(iommu->reg + DMAR_FEUADDR_REG);
+-	spin_unlock_irqrestore(&iommu->register_lock, flag);
+-}
+-
+-static int dmar_fault_do_one(struct intel_iommu *iommu, int type,
+-		u8 fault_reason, u16 source_id, unsigned long long addr)
+-{
+-	const char *reason;
+-
+-	reason = dmar_get_fault_reason(fault_reason);
+-
+-	printk(KERN_ERR
+-		"DMAR:[%s] Request device [%02x:%02x.%d] "
+-		"fault addr %llx \n"
+-		"DMAR:[fault reason %02d] %s\n",
+-		(type ? "DMA Read" : "DMA Write"),
+-		(source_id >> 8), PCI_SLOT(source_id & 0xFF),
+-		PCI_FUNC(source_id & 0xFF), addr, fault_reason, reason);
+-	return 0;
+-}
+-
+-#define PRIMARY_FAULT_REG_LEN (16)
+-irqreturn_t dmar_fault(int irq, void *dev_id)
+-{
+-	struct intel_iommu *iommu = dev_id;
+-	int reg, fault_index;
+-	u32 fault_status;
+-	unsigned long flag;
+-
+-	spin_lock_irqsave(&iommu->register_lock, flag);
+-	fault_status = readl(iommu->reg + DMAR_FSTS_REG);
+-
+-	/* TBD: ignore advanced fault log currently */
+-	if (!(fault_status & DMA_FSTS_PPF))
+-		goto clear_overflow;
+-
+-	fault_index = dma_fsts_fault_record_index(fault_status);
+-	reg = cap_fault_reg_offset(iommu->cap);
+-	while (1) {
+-		u8 fault_reason;
+-		u16 source_id;
+-		u64 guest_addr;
+-		int type;
+-		u32 data;
+-
+-		/* highest 32 bits */
+-		data = readl(iommu->reg + reg +
+-				fault_index * PRIMARY_FAULT_REG_LEN + 12);
+-		if (!(data & DMA_FRCD_F))
+-			break;
+-
+-		fault_reason = dma_frcd_fault_reason(data);
+-		type = dma_frcd_type(data);
+-
+-		data = readl(iommu->reg + reg +
+-				fault_index * PRIMARY_FAULT_REG_LEN + 8);
+-		source_id = dma_frcd_source_id(data);
+-
+-		guest_addr = dmar_readq(iommu->reg + reg +
+-				fault_index * PRIMARY_FAULT_REG_LEN);
+-		guest_addr = dma_frcd_page_addr(guest_addr);
+-		/* clear the fault */
+-		writel(DMA_FRCD_F, iommu->reg + reg +
+-			fault_index * PRIMARY_FAULT_REG_LEN + 12);
+-
+-		spin_unlock_irqrestore(&iommu->register_lock, flag);
+-
+-		dmar_fault_do_one(iommu, type, fault_reason,
+-				source_id, guest_addr);
+-
+-		fault_index++;
+-		if (fault_index > cap_num_fault_regs(iommu->cap))
+-			fault_index = 0;
+-		spin_lock_irqsave(&iommu->register_lock, flag);
+-	}
+-clear_overflow:
+-	/* clear primary fault overflow */
+-	fault_status = readl(iommu->reg + DMAR_FSTS_REG);
+-	if (fault_status & DMA_FSTS_PFO)
+-		writel(DMA_FSTS_PFO, iommu->reg + DMAR_FSTS_REG);
+-
+-	spin_unlock_irqrestore(&iommu->register_lock, flag);
+-	return IRQ_HANDLED;
+-}
+-
+-int dmar_set_interrupt(struct intel_iommu *iommu)
+-{
+-	int irq, ret;
+-
+-	irq = create_irq();
+-	if (!irq) {
+-		printk(KERN_ERR "IOMMU: no free vectors\n");
+-		return -EINVAL;
+-	}
+-
+-	set_irq_data(irq, iommu);
+-	iommu->irq = irq;
+-
+-	ret = arch_setup_dmar_msi(irq);
+-	if (ret) {
+-		set_irq_data(irq, NULL);
+-		iommu->irq = 0;
+-		destroy_irq(irq);
+-		return 0;
+-	}
+-
+-	ret = request_irq(irq, dmar_fault, 0, iommu->name, iommu);
 -	if (ret)
-+	if (ret) {
-+		printk(KERN_WARNING "reserve_pfn_range: reserve_memtype ret %d for 0x%llx 0x%lx 0x%lx\n",
-+			ret, paddr, size, want_flags);
- 		return ret;
-+	}
- 
- 	if (flags != want_flags) {
- 		if (strict_prot || !is_new_memtype_allowed(want_flags, flags)) {
---- a/include/linux/mm.h	2009-03-23 23:12:14.000000000 +0000
-+++ b/include/linux/mm.h	2009-03-30 19:36:52.000000000 +0100
-@@ -145,7 +156,7 @@
+-		printk(KERN_ERR "IOMMU: can't request irq\n");
+-	return ret;
+-}
+-
+ /*
+  * Re-enable Queued Invalidation interface.
+  */
+--- vanilla-2.6.29/kernel/sched.c	2009-03-23 23:12:14.000000000 +0000
++++ linux.temp/kernel/sched.c	2009-04-14 21:42:33.000000000 +0100
+@@ -4134,9 +4134,25 @@
+ EXPORT_PER_CPU_SYMBOL(kstat);
+ 
+ /*
+- * Return any ns on the sched_clock that have not yet been banked in
++ * Return any ns on the sched_clock that have not yet been accounted in
+  * @p in case that task is currently running.
++ *
++ * Called with task_rq_lock() held on @rq.
   */
- static inline int is_linear_pfn_mapping(struct vm_area_struct *vma)
++static u64 do_task_delta_exec(struct task_struct *p, struct rq *rq)
++{
++	u64 ns = 0;
++
++	if (task_current(rq, p)) {
++		update_rq_clock(rq);
++		ns = rq->clock - p->se.exec_start;
++		if ((s64)ns < 0)
++			ns = 0;
++	}
++
++	return ns;
++}
++
+ unsigned long long task_delta_exec(struct task_struct *p)
  {
--	return (vma->vm_flags & VM_PFN_AT_MMAP);
-+	return ((vma->vm_flags & VM_PFNMAP_AT_MMAP) == VM_PFNMAP_AT_MMAP);
- }
- 
- static inline int is_pfn_mapping(struct vm_area_struct *vma)
---- a/mm/memory.c	2009-03-23 23:12:14.000000000 +0000
-+++ b/mm/memory.c	2009-03-30 19:36:52.000000000 +0100
-@@ -1667,7 +1667,7 @@
- 	 */
-	if (addr == vma->vm_start && end == vma->vm_end) {
- 		vma->vm_pgoff = pfn;
--		vma->vm_flags |= VM_PFN_AT_MMAP;
-+		vma->vm_flags |= VM_PFNMAP_AT_MMAP;
-	} else if (is_cow_mapping(vma->vm_flags))
- 		return -EINVAL;
- 
-@@ -1679,7 +1679,7 @@
- 		 * needed from higher level routine calling unmap_vmas
- 		 */
- 		vma->vm_flags &= ~(VM_IO | VM_RESERVED | VM_PFNMAP);
--		vma->vm_flags &= ~VM_PFN_AT_MMAP;
-+		vma->vm_flags &= ~VM_PFNMAP_AT_MMAP;
- 		return -EINVAL;
- 	}
- 
+ 	unsigned long flags;
 --- a/localversion-tip	2009-02-17 19:49:34.000000000 +0000
 +++ /dev/null	2009-02-17 18:08:14.005240123 +0000
 @@ -1 +0,0 @@

xen.pvops.pre.patch:

Index: xen.pvops.pre.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/Attic/xen.pvops.pre.patch,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -r1.1.2.8 -r1.1.2.9
--- xen.pvops.pre.patch	30 Mar 2009 19:45:49 -0000	1.1.2.8
+++ xen.pvops.pre.patch	14 Apr 2009 22:09:26 -0000	1.1.2.9
@@ -6,8 +6,10 @@
 drm-next.patch - drivers/gpu/drm/drm_proc.c
 linux-2.6-debug-taint-vm.patch - kernel/panic.c
 linux-2.6-v4l-dvb-update.patch - drivers/media/dvb/dvb-usb/Kconfig
-squashfs3.patch squashfs-fixups.patch - init/do_mounts_rd.c
-linux-2.6.29-pat-fixes.patch - arch/x86/mm/pat.c arch/x86/pci/i386.c include/linux/mm.h mm/memory.c
+linux-2.6.29-pat-fixes.patch - arch/x86/pci/i386.c include/linux/mm.h mm/memory.c
+drm-next.patch - include/drm/drm.h include/drm/drm_mode.h include/drm/i915_drm.h include/drm/mga_drm.h include/drm/radeon_drm.h include/drm/via_drm.h include/linux/dvb/audio.h
+linux-2.6-iommu-fixes.patch - drivers/pci/dmar.c drivers/pci/intel-iommu.c drivers/pci/intr_remapping.c include/linux/dmar.h include/linux/intel-iommu.h
+linux-2.6-posix-timers-fix-clock-monotonicity.patch - kernel/sched.c
 
 --- a/arch/x86/mm/pat.c	2009-02-14 12:49:46.000000000 +0000
 +++ b/arch/x86/mm/pat.c	2009-02-14 09:16:34.000000000 +0000
@@ -876,57 +878,6 @@
  	help
  	  Say Y here to support the Afatech AF9005 based DVB-T USB1.1 receiver
  	  and the TerraTec Cinergy T USB XE (Rev.1)
---- a/init/do_mounts_rd.c	2009-03-30 19:36:28.000000000 +0100
-+++ b/init/do_mounts_rd.c	2009-03-23 23:12:14.000000000 +0000
-@@ -9,12 +9,7 @@
- #include <linux/string.h>
- 
- #include "do_mounts.h"
--
--#if defined(CONFIG_SQUASHFS3) || defined(CONFIG_SQUASHFS3_MODULE)
--#include "../fs/squashfs3/squashfs3_fs.h"
--#else
- #include "../fs/squashfs/squashfs_fs.h"
--#endif
- 
- int __initdata rd_prompt = 1;/* 1 = prompt for RAM disk, 0 = don't prompt */
- 
-@@ -43,7 +38,6 @@
-  * numbers could not be found.
-  *
-  * We currently check for the following magic numbers:
-- *      squashfs
-  * 	minix
-  * 	ext2
-  *	romfs
---- a/arch/x86/mm/pat.c	2009-03-30 19:36:52.000000000 +0100
-+++ b/arch/x86/mm/pat.c	2009-03-23 23:12:14.000000000 +0000
-@@ -644,21 +641,14 @@
- 	is_ram = pat_pagerange_is_ram(paddr, paddr + size);
- 
- 	/*
--	 * reserve_pfn_range() doesn't support RAM pages. Maintain the current
--	 * behavior with RAM pages by returning success.
-+	 * reserve_pfn_range() doesn't support RAM pages.
- 	 */
--	if (is_ram != 0) {
--		printk(KERN_WARNING "reserve_pfn_range: is_ram is %d for 0x%llx!\n",
--			is_ram, paddr);
--		return 0;
--	}
-+	if (is_ram != 0)
-+		return -EINVAL;
- 
- 	ret = reserve_memtype(paddr, paddr + size, want_flags, &flags);
--	if (ret) {
--		printk(KERN_WARNING "reserve_pfn_range: reserve_memtype ret %d for 0x%llx 0x%lx 0x%lx\n",
--			ret, paddr, size, want_flags);
-+	if (ret)
- 		return ret;
--	}
- 
- 	if (flags != want_flags) {
- 		if (strict_prot || !is_new_memtype_allowed(want_flags, flags)) {
 --- a/arch/x86/pci/i386.c	2009-03-30 19:36:52.000000000 +0100
 +++ b/arch/x86/pci/i386.c	2009-03-23 23:12:14.000000000 +0000
 @@ -319,9 +319,6 @@
@@ -973,3 +924,1261 @@
  		return -EINVAL;
  	}
  
+--- a/include/drm/drm.h	2009-04-10 22:58:41.000000000 +0100
++++ b/include/drm/drm.h	2009-03-23 23:12:14.000000000 +0000
+@@ -36,7 +36,8 @@
+ #ifndef _DRM_H_
+ #define _DRM_H_
+ 
+-#include <linux/types.h>
++#if defined(__KERNEL__)
++#endif
+ #include <asm/ioctl.h>		/* For _IO* macros */
+ #define DRM_IOCTL_NR(n)		_IOC_NR(n)
+ #define DRM_IOC_VOID		_IOC_NONE
+@@ -497,8 +497,8 @@
+  * \sa drmModesetCtl().
+  */
+ struct drm_modeset_ctl {
+-	__u32 crtc;
+-	__u32 cmd;
++	uint32_t crtc;
++	uint32_t cmd;
+ };
+ 
+ /**
+@@ -574,29 +574,29 @@
+ /** DRM_IOCTL_GEM_CLOSE ioctl argument type */
+ struct drm_gem_close {
+ 	/** Handle of the object to be closed. */
+-	__u32 handle;
+-	__u32 pad;
++	uint32_t handle;
++	uint32_t pad;
+ };
+ 
+ /** DRM_IOCTL_GEM_FLINK ioctl argument type */
+ struct drm_gem_flink {
+ 	/** Handle for the object being named */
+-	__u32 handle;
++	uint32_t handle;
+ 
+ 	/** Returned global name */
+-	__u32 name;
++	uint32_t name;
+ };
+ 
+ /** DRM_IOCTL_GEM_OPEN ioctl argument type */
+ struct drm_gem_open {
+ 	/** Name of object being opened */
+-	__u32 name;
++	uint32_t name;
+ 
+ 	/** Returned handle for the object */
+-	__u32 handle;
++	uint32_t handle;
+ 
+ 	/** Returned size of the object */
+-	__u64 size;
++	uint64_t size;
+ };
+ 
+ #include "drm_mode.h"
+--- a/include/drm/drm_mode.h	2009-04-10 22:58:41.000000000 +0100
++++ b/include/drm/drm_mode.h	2009-03-23 23:12:14.000000000 +0000
+@@ -27,8 +27,11 @@
+ #ifndef _DRM_MODE_H
+ #define _DRM_MODE_H
+ 
++#if !defined(__KERNEL__) && !defined(_KERNEL)
++#include <stdint.h>
++#else
+ #include <linux/kernel.h>
+-#include <linux/types.h>
++#endif
+ 
+ #define DRM_DISPLAY_INFO_LEN	32
+ #define DRM_CONNECTOR_NAME_LEN	32
+@@ -78,41 +81,41 @@
+ #define DRM_MODE_DITHERING_ON	1
+ 
+ struct drm_mode_modeinfo {
+-	__u32 clock;
+-	__u16 hdisplay, hsync_start, hsync_end, htotal, hskew;
+-	__u16 vdisplay, vsync_start, vsync_end, vtotal, vscan;
++	uint32_t clock;
++	uint16_t hdisplay, hsync_start, hsync_end, htotal, hskew;
++	uint16_t vdisplay, vsync_start, vsync_end, vtotal, vscan;
+ 
+-	__u32 vrefresh; /* vertical refresh * 1000 */
++	uint32_t vrefresh; /* vertical refresh * 1000 */
+ 
+-	__u32 flags;
+-	__u32 type;
++	uint32_t flags;
++	uint32_t type;
+ 	char name[DRM_DISPLAY_MODE_LEN];
+ };
+ 
+ struct drm_mode_card_res {
+-	__u64 fb_id_ptr;
+-	__u64 crtc_id_ptr;
+-	__u64 connector_id_ptr;
+-	__u64 encoder_id_ptr;
+-	__u32 count_fbs;
+-	__u32 count_crtcs;
+-	__u32 count_connectors;
+-	__u32 count_encoders;
+-	__u32 min_width, max_width;
+-	__u32 min_height, max_height;
++	uint64_t fb_id_ptr;
++	uint64_t crtc_id_ptr;
++	uint64_t connector_id_ptr;
++	uint64_t encoder_id_ptr;
++	uint32_t count_fbs;
++	uint32_t count_crtcs;
++	uint32_t count_connectors;
++	uint32_t count_encoders;
++	uint32_t min_width, max_width;
++	uint32_t min_height, max_height;
+ };
+ 
+ struct drm_mode_crtc {
+-	__u64 set_connectors_ptr;
+-	__u32 count_connectors;
++	uint64_t set_connectors_ptr;
++	uint32_t count_connectors;
+ 
+-	__u32 crtc_id; /**< Id */
+-	__u32 fb_id; /**< Id of framebuffer */
++	uint32_t crtc_id; /**< Id */
++	uint32_t fb_id; /**< Id of framebuffer */
+ 
+-	__u32 x, y; /**< Position on the frameuffer */
++	uint32_t x, y; /**< Position on the frameuffer */
+ 
+-	__u32 gamma_size;
+-	__u32 mode_valid;
++	uint32_t gamma_size;
++	uint32_t mode_valid;
+ 	struct drm_mode_modeinfo mode;
+ };
+ 
+@@ -123,13 +126,13 @@
+ #define DRM_MODE_ENCODER_TVDAC	4
+ 
+ struct drm_mode_get_encoder {
+-	__u32 encoder_id;
+-	__u32 encoder_type;
++	uint32_t encoder_id;
++	uint32_t encoder_type;
+ 
+-	__u32 crtc_id; /**< Id of crtc */
++	uint32_t crtc_id; /**< Id of crtc */
+ 
+-	__u32 possible_crtcs;
+-	__u32 possible_clones;
++	uint32_t possible_crtcs;
++	uint32_t possible_clones;
+ };
+ 
+ /* This is for connectors with multiple signal types. */
+@@ -158,23 +161,23 @@
+ 
+ struct drm_mode_get_connector {
+ 
+-	__u64 encoders_ptr;
+-	__u64 modes_ptr;
+-	__u64 props_ptr;
+-	__u64 prop_values_ptr;
+-
+-	__u32 count_modes;
+-	__u32 count_props;
+-	__u32 count_encoders;
+-
+-	__u32 encoder_id; /**< Current Encoder */
+-	__u32 connector_id; /**< Id */
+-	__u32 connector_type;
+-	__u32 connector_type_id;
+-
+-	__u32 connection;
+-	__u32 mm_width, mm_height; /**< HxW in millimeters */
+-	__u32 subpixel;
++	uint64_t encoders_ptr;
++	uint64_t modes_ptr;
++	uint64_t props_ptr;
++	uint64_t prop_values_ptr;
++
++	uint32_t count_modes;
++	uint32_t count_props;
++	uint32_t count_encoders;
++
++	uint32_t encoder_id; /**< Current Encoder */
++	uint32_t connector_id; /**< Id */
++	uint32_t connector_type;
++	uint32_t connector_type_id;
++
++	uint32_t connection;
++	uint32_t mm_width, mm_height; /**< HxW in millimeters */
++	uint32_t subpixel;
+ };
+ 
+ #define DRM_MODE_PROP_PENDING	(1<<0)
+@@ -184,46 +187,46 @@
+ #define DRM_MODE_PROP_BLOB	(1<<4)
+ 
+ struct drm_mode_property_enum {
+-	__u64 value;
++	uint64_t value;
+ 	char name[DRM_PROP_NAME_LEN];
+ };
+ 
+ struct drm_mode_get_property {
+-	__u64 values_ptr; /* values and blob lengths */
+-	__u64 enum_blob_ptr; /* enum and blob id ptrs */
++	uint64_t values_ptr; /* values and blob lengths */
++	uint64_t enum_blob_ptr; /* enum and blob id ptrs */
+ 
+-	__u32 prop_id;
+-	__u32 flags;
++	uint32_t prop_id;
++	uint32_t flags;
+ 	char name[DRM_PROP_NAME_LEN];
+ 
+-	__u32 count_values;
+-	__u32 count_enum_blobs;
++	uint32_t count_values;
++	uint32_t count_enum_blobs;
+ };
+ 
+ struct drm_mode_connector_set_property {
+-	__u64 value;
+-	__u32 prop_id;
+-	__u32 connector_id;
++	uint64_t value;
++	uint32_t prop_id;
++	uint32_t connector_id;
+ };
+ 
+ struct drm_mode_get_blob {
+-	__u32 blob_id;
+-	__u32 length;
+-	__u64 data;
++	uint32_t blob_id;
++	uint32_t length;
++	uint64_t data;
+ };
+ 
+ struct drm_mode_fb_cmd {
+-	__u32 fb_id;
+-	__u32 width, height;
+-	__u32 pitch;
+-	__u32 bpp;
+-	__u32 depth;
++	uint32_t fb_id;
++	uint32_t width, height;
++	uint32_t pitch;
++	uint32_t bpp;
++	uint32_t depth;
+ 	/* driver specific handle */
+-	__u32 handle;
++	uint32_t handle;
+ };
+ 
+ struct drm_mode_mode_cmd {
+-	__u32 connector_id;
++	uint32_t connector_id;
+ 	struct drm_mode_modeinfo mode;
+ };
+ 
+@@ -245,24 +248,24 @@
+  *    y
+  */
+ struct drm_mode_cursor {
+-	__u32 flags;
+-	__u32 crtc_id;
+-	__s32 x;
+-	__s32 y;
+-	__u32 width;
+-	__u32 height;
++	uint32_t flags;
++	uint32_t crtc_id;
++	int32_t x;
++	int32_t y;
++	uint32_t width;
++	uint32_t height;
+ 	/* driver specific handle */
+-	__u32 handle;
++	uint32_t handle;
+ };
+ 
+ struct drm_mode_crtc_lut {
+-	__u32 crtc_id;
+-	__u32 gamma_size;
++	uint32_t crtc_id;
++	uint32_t gamma_size;
+ 
+ 	/* pointers to arrays */
+-	__u64 red;
+-	__u64 green;
+-	__u64 blue;
++	uint64_t red;
++	uint64_t green;
++	uint64_t blue;
+ };
+ 
+ #endif
+--- a/include/drm/i915_drm.h	2009-04-10 22:58:41.000000000 +0100
++++ b/include/drm/i915_drm.h	2009-03-23 23:12:14.000000000 +0000
+@@ -30,7 +30,7 @@
+ /* Please note that modifications to all structs defined here are
+  * subject to backwards-compatibility constraints.
+  */
+-#include <linux/types.h>
++
+ #include "drm.h"
+ 
+ /* Each region is a minimum of 16k, and there are at most 255 of them.
+@@ -116,15 +116,15 @@
+ 
+ 	/* fill out some space for old userspace triple buffer */
+ 	drm_handle_t unused_handle;
+-	__u32 unused1, unused2, unused3;
++	uint32_t unused1, unused2, unused3;
+ 
+ 	/* buffer object handles for static buffers. May change
+ 	 * over the lifetime of the client.
+ 	 */
+-	__u32 front_bo_handle;
+-	__u32 back_bo_handle;
+-	__u32 unused_bo_handle;
+-	__u32 depth_bo_handle;
++	uint32_t front_bo_handle;
++	uint32_t back_bo_handle;
++	uint32_t unused_bo_handle;
++	uint32_t depth_bo_handle;
+ 
+ } drm_i915_sarea_t;
+ 
+@@ -327,7 +327,7 @@
+ } drm_i915_vblank_swap_t;
+ 
+ typedef struct drm_i915_hws_addr {
+-	__u64 addr;
++	uint64_t addr;
+ } drm_i915_hws_addr_t;
+ 
+ struct drm_i915_gem_init {
+@@ -335,12 +335,12 @@
+ 	 * Beginning offset in the GTT to be managed by the DRM memory
+ 	 * manager.
+ 	 */
+-	__u64 gtt_start;
++	uint64_t gtt_start;
+ 	/**
+ 	 * Ending offset in the GTT to be managed by the DRM memory
+ 	 * manager.
+ 	 */
+-	__u64 gtt_end;
++	uint64_t gtt_end;
+ };
+ 
+ struct drm_i915_gem_create {
+@@ -349,94 +349,94 @@
+ 	 *
+ 	 * The (page-aligned) allocated size for the object will be returned.
+ 	 */
+-	__u64 size;
++	uint64_t size;
+ 	/**
+ 	 * Returned handle for the object.
+ 	 *
+ 	 * Object handles are nonzero.
+ 	 */
+-	__u32 handle;
+-	__u32 pad;
++	uint32_t handle;
++	uint32_t pad;
+ };
+ 
+ struct drm_i915_gem_pread {
+ 	/** Handle for the object being read. */
+-	__u32 handle;
+-	__u32 pad;
++	uint32_t handle;
++	uint32_t pad;
+ 	/** Offset into the object to read from */
+-	__u64 offset;
++	uint64_t offset;
+ 	/** Length of data to read */
+-	__u64 size;
++	uint64_t size;
+ 	/**
+ 	 * Pointer to write the data into.
+ 	 *
+ 	 * This is a fixed-size type for 32/64 compatibility.
+ 	 */
+-	__u64 data_ptr;
++	uint64_t data_ptr;
+ };
+ 
+ struct drm_i915_gem_pwrite {
+ 	/** Handle for the object being written to. */
+-	__u32 handle;
+-	__u32 pad;
++	uint32_t handle;
++	uint32_t pad;
+ 	/** Offset into the object to write to */
+-	__u64 offset;
++	uint64_t offset;
+ 	/** Length of data to write */
+-	__u64 size;
++	uint64_t size;
+ 	/**
+ 	 * Pointer to read the data from.
+ 	 *
+ 	 * This is a fixed-size type for 32/64 compatibility.
+ 	 */
+-	__u64 data_ptr;
++	uint64_t data_ptr;
+ };
+ 
+ struct drm_i915_gem_mmap {
+ 	/** Handle for the object being mapped. */
+-	__u32 handle;
+-	__u32 pad;
++	uint32_t handle;
++	uint32_t pad;
+ 	/** Offset in the object to map. */
+-	__u64 offset;
++	uint64_t offset;
+ 	/**
+ 	 * Length of data to map.
+ 	 *
+ 	 * The value will be page-aligned.
+ 	 */
+-	__u64 size;
++	uint64_t size;
+ 	/**
+ 	 * Returned pointer the data was mapped at.
+ 	 *
+ 	 * This is a fixed-size type for 32/64 compatibility.
+ 	 */
+-	__u64 addr_ptr;
++	uint64_t addr_ptr;
+ };
+ 
+ struct drm_i915_gem_mmap_gtt {
+ 	/** Handle for the object being mapped. */
+-	__u32 handle;
+-	__u32 pad;
++	uint32_t handle;
++	uint32_t pad;
+ 	/**
+ 	 * Fake offset to use for subsequent mmap call
+ 	 *
+ 	 * This is a fixed-size type for 32/64 compatibility.
+ 	 */
+-	__u64 offset;
++	uint64_t offset;
+ };
+ 
+ struct drm_i915_gem_set_domain {
+ 	/** Handle for the object */
+-	__u32 handle;
++	uint32_t handle;
+ 
+ 	/** New read domains */
+-	__u32 read_domains;
++	uint32_t read_domains;
+ 
+ 	/** New write domain */
+-	__u32 write_domain;
++	uint32_t write_domain;
+ };
+ 
+ struct drm_i915_gem_sw_finish {
+ 	/** Handle for the object */
+-	__u32 handle;
++	uint32_t handle;
+ };
+ 
+ struct drm_i915_gem_relocation_entry {
+@@ -448,16 +448,16 @@
+ 	 * a relocation list for state buffers and not re-write it per
+ 	 * exec using the buffer.
+ 	 */
+-	__u32 target_handle;
++	uint32_t target_handle;
+ 
+ 	/**
+ 	 * Value to be added to the offset of the target buffer to make up
+ 	 * the relocation entry.
+ 	 */
+-	__u32 delta;
++	uint32_t delta;
+ 
+ 	/** Offset in the buffer the relocation entry will be written into */
+-	__u64 offset;
++	uint64_t offset;
+ 
+ 	/**
+ 	 * Offset value of the target buffer that the relocation entry was last
+@@ -467,12 +467,12 @@
+ 	 * and writing the relocation.  This value is written back out by
+ 	 * the execbuffer ioctl when the relocation is written.
+ 	 */
+-	__u64 presumed_offset;
++	uint64_t presumed_offset;
+ 
+ 	/**
+ 	 * Target memory domains read by this operation.
+ 	 */
+-	__u32 read_domains;
++	uint32_t read_domains;
+ 
+ 	/**
+ 	 * Target memory domains written by this operation.
+@@ -481,7 +481,7 @@
+ 	 * execbuffer operation, so that where there are conflicts,
+ 	 * the application will get -EINVAL back.
+ 	 */
+-	__u32 write_domain;
++	uint32_t write_domain;
+ };
+ 
+ /** @{
+@@ -512,24 +512,24 @@
+ 	 * User's handle for a buffer to be bound into the GTT for this
+ 	 * operation.
+ 	 */
+-	__u32 handle;
++	uint32_t handle;
+ 
+ 	/** Number of relocations to be performed on this buffer */
+-	__u32 relocation_count;
++	uint32_t relocation_count;
+ 	/**
+ 	 * Pointer to array of struct drm_i915_gem_relocation_entry containing
+ 	 * the relocations to be performed in this buffer.
+ 	 */
+-	__u64 relocs_ptr;
++	uint64_t relocs_ptr;
+ 
+ 	/** Required alignment in graphics aperture */
+-	__u64 alignment;
++	uint64_t alignment;
+ 
+ 	/**
+ 	 * Returned value of the updated offset of the object, for future
+ 	 * presumed_offset writes.
+ 	 */
+-	__u64 offset;
++	uint64_t offset;
+ };
+ 
+ struct drm_i915_gem_execbuffer {
+@@ -543,44 +543,44 @@
+ 	 * a buffer is performing refer to buffers that have already appeared
+ 	 * in the validate list.
+ 	 */
+-	__u64 buffers_ptr;
+-	__u32 buffer_count;
++	uint64_t buffers_ptr;
++	uint32_t buffer_count;
+ 
+ 	/** Offset in the batchbuffer to start execution from. */
+-	__u32 batch_start_offset;
++	uint32_t batch_start_offset;
+ 	/** Bytes used in batchbuffer from batch_start_offset */
+-	__u32 batch_len;
+-	__u32 DR1;
+-	__u32 DR4;
+-	__u32 num_cliprects;
++	uint32_t batch_len;
++	uint32_t DR1;
++	uint32_t DR4;
++	uint32_t num_cliprects;
+ 	/** This is a struct drm_clip_rect *cliprects */
+-	__u64 cliprects_ptr;
++	uint64_t cliprects_ptr;
+ };
+ 
+ struct drm_i915_gem_pin {
+ 	/** Handle of the buffer to be pinned. */
+-	__u32 handle;
+-	__u32 pad;
++	uint32_t handle;
++	uint32_t pad;
+ 
+ 	/** alignment required within the aperture */
+-	__u64 alignment;
++	uint64_t alignment;
+ 
+ 	/** Returned GTT offset of the buffer. */
+-	__u64 offset;
++	uint64_t offset;
+ };
+ 
+ struct drm_i915_gem_unpin {
+ 	/** Handle of the buffer to be unpinned. */
+-	__u32 handle;
+-	__u32 pad;
++	uint32_t handle;
++	uint32_t pad;
+ };
+ 
+ struct drm_i915_gem_busy {
+ 	/** Handle of the buffer to check for busy */
+-	__u32 handle;
++	uint32_t handle;
+ 
+ 	/** Return busy status (1 if busy, 0 if idle) */
+-	__u32 busy;
++	uint32_t busy;
+ };
+ 
+ #define I915_TILING_NONE	0
+@@ -597,7 +597,7 @@
+ 
+ struct drm_i915_gem_set_tiling {
+ 	/** Handle of the buffer to have its tiling state updated */
+-	__u32 handle;
++	uint32_t handle;
+ 
+ 	/**
+ 	 * Tiling mode for the object (I915_TILING_NONE, I915_TILING_X,
+@@ -611,47 +611,47 @@
+ 	 *
+ 	 * Buffer contents become undefined when changing tiling_mode.
+ 	 */
+-	__u32 tiling_mode;
++	uint32_t tiling_mode;
+ 
+ 	/**
+ 	 * Stride in bytes for the object when in I915_TILING_X or
+ 	 * I915_TILING_Y.
+ 	 */
+-	__u32 stride;
++	uint32_t stride;
+ 
+ 	/**
+ 	 * Returned address bit 6 swizzling required for CPU access through
+ 	 * mmap mapping.
+ 	 */
+-	__u32 swizzle_mode;
++	uint32_t swizzle_mode;
+ };
+ 
+ struct drm_i915_gem_get_tiling {
+ 	/** Handle of the buffer to get tiling state for. */
+-	__u32 handle;
++	uint32_t handle;
+ 
+ 	/**
+ 	 * Current tiling mode for the object (I915_TILING_NONE, I915_TILING_X,
+ 	 * I915_TILING_Y).
+ 	 */
+-	__u32 tiling_mode;
++	uint32_t tiling_mode;
+ 
+ 	/**
+ 	 * Returned address bit 6 swizzling required for CPU access through
+ 	 * mmap mapping.
+ 	 */
+-	__u32 swizzle_mode;
++	uint32_t swizzle_mode;
+ };
+ 
+ struct drm_i915_gem_get_aperture {
+ 	/** Total size of the aperture used by i915_gem_execbuffer, in bytes */
+-	__u64 aper_size;
++	uint64_t aper_size;
+ 
+ 	/**
+ 	 * Available space in the aperture used by i915_gem_execbuffer, in
+ 	 * bytes
+ 	 */
+-	__u64 aper_available_size;
++	uint64_t aper_available_size;
+ };
+ 
+ #endif				/* _I915_DRM_H_ */
+--- a/include/drm/mga_drm.h	2009-04-10 22:58:41.000000000 +0100
++++ b/include/drm/mga_drm.h	2009-03-23 23:12:14.000000000 +0000
+@@ -35,8 +35,6 @@
+ #ifndef __MGA_DRM_H__
+ #define __MGA_DRM_H__
+ 
+-#include <linux/types.h>
+-
+ /* WARNING: If you change any of these defines, make sure to change the
+  * defines in the Xserver file (mga_sarea.h)
+  */
+@@ -257,8 +255,8 @@
+ #define DRM_IOCTL_MGA_ILOAD    DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_ILOAD, drm_mga_iload_t)
+ #define DRM_IOCTL_MGA_BLIT     DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_BLIT, drm_mga_blit_t)
+ #define DRM_IOCTL_MGA_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_GETPARAM, drm_mga_getparam_t)
+-#define DRM_IOCTL_MGA_SET_FENCE     DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_SET_FENCE, __u32)
+-#define DRM_IOCTL_MGA_WAIT_FENCE    DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_WAIT_FENCE, __u32)
++#define DRM_IOCTL_MGA_SET_FENCE     DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_SET_FENCE, uint32_t)
++#define DRM_IOCTL_MGA_WAIT_FENCE    DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_WAIT_FENCE, uint32_t)
+ #define DRM_IOCTL_MGA_DMA_BOOTSTRAP DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_DMA_BOOTSTRAP, drm_mga_dma_bootstrap_t)
+ 
+ typedef struct _drm_mga_warp_index {
+@@ -312,7 +310,7 @@
+ 	 */
+ 	/*@{ */
+ 	unsigned long texture_handle; /**< Handle used to map AGP textures. */
+-	__u32 texture_size;	      /**< Size of the AGP texture region. */
++	uint32_t texture_size;	      /**< Size of the AGP texture region. */
+ 	/*@} */
+ 
+ 	/**
+@@ -321,7 +319,7 @@
+ 	 * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be
+ 	 * filled in with the actual AGP mode.  If AGP was not available
+ 	 */
+-	__u32 primary_size;
++	uint32_t primary_size;
+ 
+ 	/**
+ 	 * Requested number of secondary DMA buffers.
+@@ -331,7 +329,7 @@
+ 	 * allocated.  Particularly when PCI DMA is used, this may be
+ 	 * (subtantially) less than the number requested.
+ 	 */
+-	__u32 secondary_bin_count;
++	uint32_t secondary_bin_count;
+ 
+ 	/**
+ 	 * Requested size of each secondary DMA buffer.
+@@ -340,7 +338,7 @@
+ 	 * dma_mga_dma_bootstrap::secondary_bin_count, it is \b not allowed
+ 	 * to reduce dma_mga_dma_bootstrap::secondary_bin_size.
+ 	 */
+-	__u32 secondary_bin_size;
++	uint32_t secondary_bin_size;
+ 
+ 	/**
+ 	 * Bit-wise mask of AGPSTAT2_* values.  Currently only \c AGPSTAT2_1X,
+@@ -352,12 +350,12 @@
+ 	 * filled in with the actual AGP mode.  If AGP was not available
+ 	 * (i.e., PCI DMA was used), this value will be zero.
+ 	 */
+-	__u32 agp_mode;
++	uint32_t agp_mode;
+ 
+ 	/**
+ 	 * Desired AGP GART size, measured in megabytes.
+ 	 */
+-	__u8 agp_size;
++	uint8_t agp_size;
+ } drm_mga_dma_bootstrap_t;
+ 
+ typedef struct drm_mga_clear {
+--- a/include/drm/radeon_drm.h	2009-04-10 22:58:41.000000000 +0100
++++ b/include/drm/radeon_drm.h	2009-03-23 23:12:14.000000000 +0000
+@@ -33,8 +33,6 @@
+ #ifndef __RADEON_DRM_H__
+ #define __RADEON_DRM_H__
+ 
+-#include <linux/types.h>
+-
+ /* WARNING: If you change any of these defines, make sure to change the
+  * defines in the X server file (radeon_sarea.h)
+  */
+@@ -749,7 +722,7 @@
+ 
+ typedef struct drm_radeon_setparam {
+ 	unsigned int param;
+-	__s64 value;
++	int64_t value;
+ } drm_radeon_setparam_t;
+ 
+ #define RADEON_SETPARAM_FB_LOCATION    1	/* determined framebuffer location */
+--- a/include/drm/via_drm.h	2009-04-10 22:58:41.000000000 +0100
++++ b/include/drm/via_drm.h	2009-03-23 23:12:14.000000000 +0000
+@@ -24,8 +24,6 @@
+ #ifndef _VIA_DRM_H_
+ #define _VIA_DRM_H_
+ 
+-#include <linux/types.h>
+-
+ /* WARNING: These defines must be the same as what the Xserver uses.
+  * if you change them, you must change the defines in the Xserver.
+  */
+@@ -116,19 +114,19 @@
+ #define VIA_MEM_UNKNOWN 4
+ 
+ typedef struct {
+-	__u32 offset;
+-	__u32 size;
++	uint32_t offset;
++	uint32_t size;
+ } drm_via_agp_t;
+ 
+ typedef struct {
+-	__u32 offset;
+-	__u32 size;
++	uint32_t offset;
++	uint32_t size;
+ } drm_via_fb_t;
+ 
+ typedef struct {
+-	__u32 context;
+-	__u32 type;
+-	__u32 size;
++	uint32_t context;
++	uint32_t type;
++	uint32_t size;
+ 	unsigned long index;
+ 	unsigned long offset;
+ } drm_via_mem_t;
+@@ -150,9 +148,9 @@
+ 		VIA_FUTEX_WAIT = 0x00,
+ 		VIA_FUTEX_WAKE = 0X01
+ 	} func;
+-	__u32 ms;
+-	__u32 lock;
+-	__u32 val;
++	uint32_t ms;
++	uint32_t lock;
++	uint32_t val;
+ } drm_via_futex_t;
+ 
+ typedef struct _drm_via_dma_init {
+@@ -213,7 +211,7 @@
+ 		VIA_CMDBUF_LAG = 0x02
+ 	} func;
+ 	int wait;
+-	__u32 size;
++	uint32_t size;
+ } drm_via_cmdbuf_size_t;
+ 
+ typedef enum {
+@@ -238,8 +236,8 @@
+ struct drm_via_wait_irq_request {
+ 	unsigned irq;
+ 	via_irq_seq_type_t type;
+-	__u32 sequence;
+-	__u32 signal;
++	uint32_t sequence;
++	uint32_t signal;
+ };
+ 
+ typedef union drm_via_irqwait {
+@@ -248,7 +246,7 @@
+ } drm_via_irqwait_t;
+ 
+ typedef struct drm_via_blitsync {
+-	__u32 sync_handle;
++	uint32_t sync_handle;
+ 	unsigned engine;
+ } drm_via_blitsync_t;
+ 
+@@ -259,16 +257,16 @@
+  */
+ 
+ typedef struct drm_via_dmablit {
+-	__u32 num_lines;
+-	__u32 line_length;
++	uint32_t num_lines;
++	uint32_t line_length;
+ 
+-	__u32 fb_addr;
+-	__u32 fb_stride;
++	uint32_t fb_addr;
++	uint32_t fb_stride;
+ 
+ 	unsigned char *mem_addr;
+-	__u32 mem_stride;
++	uint32_t mem_stride;
+ 
+-	__u32 flags;
++	uint32_t flags;
+ 	int to_fb;
+ 
+ 	drm_via_blitsync_t sync;
+--- a/include/linux/dvb/audio.h	2009-04-10 22:58:42.000000000 +0100
++++ b/include/linux/dvb/audio.h	2009-03-23 23:12:14.000000000 +0000
+@@ -76,7 +76,7 @@
+ } audio_karaoke_t;     /* into left and right  */
+ 
+ 
+-typedef __u16 audio_attributes_t;
++typedef uint16_t audio_attributes_t;
+ /*   bits: descr. */
+ /*   15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */
+ /*   12    multichannel extension */
+diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
+index 26c536b..d313039 100644
+--- a/drivers/pci/dmar.c
++++ b/drivers/pci/dmar.c
+@@ -31,8 +31,6 @@
+ #include <linux/iova.h>
+ #include <linux/intel-iommu.h>
+ #include <linux/timer.h>
+-#include <linux/irq.h>
+-#include <linux/interrupt.h>
+ 
+ #undef PREFIX
+ #define PREFIX "DMAR:"
+diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
+index f3f6865..49402c3 100644
+--- a/drivers/pci/intel-iommu.c
++++ b/drivers/pci/intel-iommu.c
+@@ -1004,6 +1004,194 @@ static int iommu_disable_translation(struct intel_iommu *iommu)
+ 	return 0;
+ }
+ 
++/* iommu interrupt handling. Most stuff are MSI-like. */
++
++static const char *fault_reason_strings[] =
++{
++	"Software",
++	"Present bit in root entry is clear",
++	"Present bit in context entry is clear",
++	"Invalid context entry",
++	"Access beyond MGAW",
++	"PTE Write access is not set",
++	"PTE Read access is not set",
++	"Next page table ptr is invalid",
++	"Root table address invalid",
++	"Context table ptr is invalid",
++	"non-zero reserved fields in RTP",
++	"non-zero reserved fields in CTP",
++	"non-zero reserved fields in PTE",
++};
++#define MAX_FAULT_REASON_IDX 	(ARRAY_SIZE(fault_reason_strings) - 1)
++
++const char *dmar_get_fault_reason(u8 fault_reason)
++{
++	if (fault_reason > MAX_FAULT_REASON_IDX)
++		return "Unknown";
++	else
++		return fault_reason_strings[fault_reason];
++}
++
++void dmar_msi_unmask(unsigned int irq)
++{
++	struct intel_iommu *iommu = get_irq_data(irq);
++	unsigned long flag;
++
++	/* unmask it */
++	spin_lock_irqsave(&iommu->register_lock, flag);
++	writel(0, iommu->reg + DMAR_FECTL_REG);
++	/* Read a reg to force flush the post write */
++	readl(iommu->reg + DMAR_FECTL_REG);
++	spin_unlock_irqrestore(&iommu->register_lock, flag);
++}
++
++void dmar_msi_mask(unsigned int irq)
++{
++	unsigned long flag;
++	struct intel_iommu *iommu = get_irq_data(irq);
++
++	/* mask it */
++	spin_lock_irqsave(&iommu->register_lock, flag);
++	writel(DMA_FECTL_IM, iommu->reg + DMAR_FECTL_REG);
++	/* Read a reg to force flush the post write */
++	readl(iommu->reg + DMAR_FECTL_REG);
++	spin_unlock_irqrestore(&iommu->register_lock, flag);
++}
++
++void dmar_msi_write(int irq, struct msi_msg *msg)
++{
++	struct intel_iommu *iommu = get_irq_data(irq);
++	unsigned long flag;
++
++	spin_lock_irqsave(&iommu->register_lock, flag);
++	writel(msg->data, iommu->reg + DMAR_FEDATA_REG);
++	writel(msg->address_lo, iommu->reg + DMAR_FEADDR_REG);
++	writel(msg->address_hi, iommu->reg + DMAR_FEUADDR_REG);
++	spin_unlock_irqrestore(&iommu->register_lock, flag);
++}
++
++void dmar_msi_read(int irq, struct msi_msg *msg)
++{
++	struct intel_iommu *iommu = get_irq_data(irq);
++	unsigned long flag;
++
++	spin_lock_irqsave(&iommu->register_lock, flag);
++	msg->data = readl(iommu->reg + DMAR_FEDATA_REG);
++	msg->address_lo = readl(iommu->reg + DMAR_FEADDR_REG);
++	msg->address_hi = readl(iommu->reg + DMAR_FEUADDR_REG);
++	spin_unlock_irqrestore(&iommu->register_lock, flag);
++}
++
++static int iommu_page_fault_do_one(struct intel_iommu *iommu, int type,
++		u8 fault_reason, u16 source_id, unsigned long long addr)
++{
++	const char *reason;
++
++	reason = dmar_get_fault_reason(fault_reason);
++
++	printk(KERN_ERR
++		"DMAR:[%s] Request device [%02x:%02x.%d] "
++		"fault addr %llx \n"
++		"DMAR:[fault reason %02d] %s\n",
++		(type ? "DMA Read" : "DMA Write"),
++		(source_id >> 8), PCI_SLOT(source_id & 0xFF),
++		PCI_FUNC(source_id & 0xFF), addr, fault_reason, reason);
++	return 0;
++}
++
++#define PRIMARY_FAULT_REG_LEN (16)
++static irqreturn_t iommu_page_fault(int irq, void *dev_id)
++{
++	struct intel_iommu *iommu = dev_id;
++	int reg, fault_index;
++	u32 fault_status;
++	unsigned long flag;
++
++	spin_lock_irqsave(&iommu->register_lock, flag);
++	fault_status = readl(iommu->reg + DMAR_FSTS_REG);
++
++	/* TBD: ignore advanced fault log currently */
++	if (!(fault_status & DMA_FSTS_PPF))
++		goto clear_overflow;
++
++	fault_index = dma_fsts_fault_record_index(fault_status);
++	reg = cap_fault_reg_offset(iommu->cap);
++	while (1) {
++		u8 fault_reason;
++		u16 source_id;
++		u64 guest_addr;
++		int type;
++		u32 data;
++
++		/* highest 32 bits */
++		data = readl(iommu->reg + reg +
++				fault_index * PRIMARY_FAULT_REG_LEN + 12);
++		if (!(data & DMA_FRCD_F))
++			break;
++
++		fault_reason = dma_frcd_fault_reason(data);
++		type = dma_frcd_type(data);
++
++		data = readl(iommu->reg + reg +
++				fault_index * PRIMARY_FAULT_REG_LEN + 8);
++		source_id = dma_frcd_source_id(data);
++
++		guest_addr = dmar_readq(iommu->reg + reg +
++				fault_index * PRIMARY_FAULT_REG_LEN);
++		guest_addr = dma_frcd_page_addr(guest_addr);
++		/* clear the fault */
++		writel(DMA_FRCD_F, iommu->reg + reg +
++			fault_index * PRIMARY_FAULT_REG_LEN + 12);
++
++		spin_unlock_irqrestore(&iommu->register_lock, flag);
++
++		iommu_page_fault_do_one(iommu, type, fault_reason,
++				source_id, guest_addr);
++
++		fault_index++;
++		if (fault_index > cap_num_fault_regs(iommu->cap))
++			fault_index = 0;
++		spin_lock_irqsave(&iommu->register_lock, flag);
++	}
++clear_overflow:
++	/* clear primary fault overflow */
++	fault_status = readl(iommu->reg + DMAR_FSTS_REG);
++	if (fault_status & DMA_FSTS_PFO)
++		writel(DMA_FSTS_PFO, iommu->reg + DMAR_FSTS_REG);
++
++	spin_unlock_irqrestore(&iommu->register_lock, flag);
++	return IRQ_HANDLED;
++}
++
++int dmar_set_interrupt(struct intel_iommu *iommu)
++{
++	int irq, ret;
++
++	irq = create_irq();
++	if (!irq) {
++		printk(KERN_ERR "IOMMU: no free vectors\n");
++		return -EINVAL;
++	}
++
++	set_irq_data(irq, iommu);
++	iommu->irq = irq;
++
++	ret = arch_setup_dmar_msi(irq);
++	if (ret) {
++		set_irq_data(irq, NULL);
++		iommu->irq = 0;
++		destroy_irq(irq);
++		return 0;
++	}
++
++	/* Force fault register is cleared */
++	iommu_page_fault(irq, iommu);
++
++	ret = request_irq(irq, iommu_page_fault, 0, iommu->name, iommu);
++	if (ret)
++		printk(KERN_ERR "IOMMU: can't request irq\n");
++	return ret;
++}
+ 
+ static int iommu_init_domains(struct intel_iommu *iommu)
+ {
+@@ -1855,40 +2043,11 @@ static int __init init_dmars(void)
+ 		}
+ 	}
+ 
+-	/*
+-	 * Start from the sane iommu hardware state.
+-	 */
+ 	for_each_drhd_unit(drhd) {
+ 		if (drhd->ignored)
+ 			continue;
+ 
+ 		iommu = drhd->iommu;
+-
+-		/*
+-		 * If the queued invalidation is already initialized by us
+-		 * (for example, while enabling interrupt-remapping) then
+-		 * we got the things already rolling from a sane state.
+-		 */
+-		if (iommu->qi)
+-			continue;
+-
+-		/*
+-		 * Clear any previous faults.
+-		 */
+-		dmar_fault(-1, iommu);
+-		/*
+-		 * Disable queued invalidation if supported and already enabled
+-		 * before OS handover.
+-		 */
+-		dmar_disable_qi(iommu);
+-	}
+-
+-	for_each_drhd_unit(drhd) {
+-		if (drhd->ignored)
+-			continue;
+-
+-		iommu = drhd->iommu;
+-
+ 		if (dmar_enable_qi(iommu)) {
+ 			/*
+ 			 * Queued Invalidate not enabled, use Register Based
+diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
+index 45effc5..b041a40 100644
+--- a/drivers/pci/intr_remapping.c
++++ b/drivers/pci/intr_remapping.c
+@@ -467,55 +458,11 @@ static int setup_intr_remapping(struct intel_iommu *iommu, int mode)
+ 	return 0;
+ }
+ 
+-/*
+- * Disable Interrupt Remapping.
+- */
+-static void disable_intr_remapping(struct intel_iommu *iommu)
+-{
+-	unsigned long flags;
+-	u32 sts;
+-
+-	if (!ecap_ir_support(iommu->ecap))
+-		return;
+-
+-	spin_lock_irqsave(&iommu->register_lock, flags);
+-
+-	sts = dmar_readq(iommu->reg + DMAR_GSTS_REG);
+-	if (!(sts & DMA_GSTS_IRES))
+-		goto end;
+-
+-	iommu->gcmd &= ~DMA_GCMD_IRE;
+-	writel(iommu->gcmd, iommu->reg + DMAR_GCMD_REG);
+-
+-	IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG,
+-		      readl, !(sts & DMA_GSTS_IRES), sts);
+-
+-end:
+-	spin_unlock_irqrestore(&iommu->register_lock, flags);
+-}
+-
+ int __init enable_intr_remapping(int eim)
+ {
+ 	struct dmar_drhd_unit *drhd;
+ 	int setup = 0;
+ 
+-	for_each_drhd_unit(drhd) {
+-		struct intel_iommu *iommu = drhd->iommu;
+-
+-		/*
+-		 * Clear previous faults.
+-		 */
+-		dmar_fault(-1, iommu);
+-
+-		/*
+-		 * Disable intr remapping and queued invalidation, if already
+-		 * enabled prior to OS handover.
+-		 */
+-		disable_intr_remapping(iommu);
+-
+-		dmar_disable_qi(iommu);
+-	}
+-
+ 	/*
+ 	 * check for the Interrupt-remapping support
+ 	 */
+--- a/include/linux/dmar.h	2009-04-11 17:05:51.000000000 +0100
++++ b/include/linux/dmar.h	2009-03-23 23:12:14.000000000 +0000
+@@ -24,7 +24,6 @@
+ #include <linux/acpi.h>
+ #include <linux/types.h>
+ #include <linux/msi.h>
+-#include <linux/irqreturn.h>
+ 
+ #if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP)
+ struct intel_iommu;
+@@ -136,7 +127,6 @@
+ extern void dmar_msi_read(int irq, struct msi_msg *msg);
+ extern void dmar_msi_write(int irq, struct msi_msg *msg);
+ extern int dmar_set_interrupt(struct intel_iommu *iommu);
+-extern irqreturn_t dmar_fault(int irq, void *dev_id);
+ extern int arch_setup_dmar_msi(unsigned int irq);
+ 
+ extern int iommu_detected, no_iommu;
+--- a/include/linux/intel-iommu.h	2009-04-11 17:05:51.000000000 +0100
++++ b/include/linux/intel-iommu.h	2009-03-23 23:12:14.000000000 +0000
+@@ -331,8 +321,6 @@
+ extern int alloc_iommu(struct dmar_drhd_unit *drhd);
+ extern void free_iommu(struct intel_iommu *iommu);
+ extern int dmar_enable_qi(struct intel_iommu *iommu);
+-extern void dmar_disable_qi(struct intel_iommu *iommu);
+-extern int dmar_reenable_qi(struct intel_iommu *iommu);
+ extern void qi_global_iec(struct intel_iommu *iommu);
+ 
+ extern int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid,
+--- linux.temp/kernel/sched.c	2009-04-14 21:42:33.000000000 +0100
++++ vanilla-2.6.29/kernel/sched.c	2009-03-23 23:12:14.000000000 +0000
+@@ -4134,25 +4134,9 @@
+ EXPORT_PER_CPU_SYMBOL(kstat);
+ 
+ /*
+- * Return any ns on the sched_clock that have not yet been accounted in
++ * Return any ns on the sched_clock that have not yet been banked in
+  * @p in case that task is currently running.
+- *
+- * Called with task_rq_lock() held on @rq.
+  */
+-static u64 do_task_delta_exec(struct task_struct *p, struct rq *rq)
+-{
+-	u64 ns = 0;
+-
+-	if (task_current(rq, p)) {
+-		update_rq_clock(rq);
+-		ns = rq->clock - p->se.exec_start;
+-		if ((s64)ns < 0)
+-			ns = 0;
+-	}
+-
+-	return ns;
+-}
+-
+ unsigned long long task_delta_exec(struct task_struct *p)
+ {
+ 	unsigned long flags;


--- dma-api-debug-fixes.patch DELETED ---


--- linux-2.6-debug-dma-api.patch DELETED ---


--- linux-2.6-net-fix-gro-bug.patch DELETED ---


--- linux-2.6-net-xfrm-fix-spin-unlock.patch DELETED ---


--- linux-2.6.29-pat-fixes.patch DELETED ---


--- squashfs-fixups.patch DELETED ---


--- squashfs3.patch DELETED ---




More information about the fedora-extras-commits mailing list