--- /dev/null
+From 34fdeb2d07102e07ecafe79dec170bd6733f2e56 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 20 Jul 2009 15:42:51 +0200
+Subject: ALSA: ca0106 - Fix the max capture buffer size
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 34fdeb2d07102e07ecafe79dec170bd6733f2e56 upstream.
+
+The capture buffer size with 64kB seems broken with CA0106.
+At least, either the update timing or the DMA position is wrong,
+and this screws up pulseaudio badly.
+
+This patch restricts the max buffer size less than that to make life
+a bit easier.
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/ca0106/ca0106_main.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sound/pci/ca0106/ca0106_main.c
++++ b/sound/pci/ca0106/ca0106_main.c
+@@ -325,9 +325,9 @@ static struct snd_pcm_hardware snd_ca010
+ .rate_max = 192000,
+ .channels_min = 2,
+ .channels_max = 2,
+- .buffer_bytes_max = ((65536 - 64) * 8),
++ .buffer_bytes_max = 65536 - 128,
+ .period_bytes_min = 64,
+- .period_bytes_max = (65536 - 64),
++ .period_bytes_max = 32768 - 64,
+ .periods_min = 2,
+ .periods_max = 2,
+ .fifo_size = 0,
--- /dev/null
+From 42b95f0c6b524b5a670dd17533a3522db368f600 Mon Sep 17 00:00:00 2001
+From: Hao Song <baritono.tux@gmail.com>
+Date: Mon, 20 Jul 2009 15:01:16 +0800
+Subject: ALSA: hda - Add quirk for Gateway T6834c laptop
+
+From: Hao Song <baritono.tux@gmail.com>
+
+commit 42b95f0c6b524b5a670dd17533a3522db368f600 upstream.
+
+Gateway T6834c laptops need EAPD always on while the default behavior
+for the STAC9205 reference board is to turn it off upon every HP plug.
+By using the special "eapd" model, which is first introduced for Gateway
+T1616 laptops for this same reason, this peculiarity can be properly
+handled.
+
+Signed-off-by: Hao Song <baritono.tux@gmail.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/hda/patch_sigmatel.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_sigmatel.c
++++ b/sound/pci/hda/patch_sigmatel.c
+@@ -2325,6 +2325,7 @@ static struct snd_pci_quirk stac9205_cfg
+ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0228,
+ "Dell Vostro 1500", STAC_9205_DELL_M42),
+ /* Gateway */
++ SND_PCI_QUIRK(0x107b, 0x0560, "Gateway T6834c", STAC_9205_EAPD),
+ SND_PCI_QUIRK(0x107b, 0x0565, "Gateway T1616", STAC_9205_EAPD),
+ {} /* terminator */
+ };
--- /dev/null
+From 8de56b7deb2534a586839eda52843c1dae680dc5 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Fri, 24 Jul 2009 16:51:47 +0200
+Subject: ALSA: hda - Fix mute control with some ALC262 models
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 8de56b7deb2534a586839eda52843c1dae680dc5 upstream.
+
+The master mute switch is wrongly implemented as checking the pointer
+instead of its value, thus it can be never muted. This patch fixes
+the issue.
+
+Reference: Novell bnc#404873
+ https://bugzilla.novell.com/show_bug.cgi?id=404873
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/hda/patch_realtek.c | 33 ++++++++++++++++-----------------
+ 1 file changed, 16 insertions(+), 17 deletions(-)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -10204,6 +10204,18 @@ static void alc262_lenovo_3000_unsol_eve
+ alc262_lenovo_3000_automute(codec, 1);
+ }
+
++static int amp_stereo_mute_update(struct hda_codec *codec, hda_nid_t nid,
++ int dir, int idx, long *valp)
++{
++ int i, change = 0;
++
++ for (i = 0; i < 2; i++, valp++)
++ change |= snd_hda_codec_amp_update(codec, nid, i, dir, idx,
++ HDA_AMP_MUTE,
++ *valp ? 0 : HDA_AMP_MUTE);
++ return change;
++}
++
+ /* bind hp and internal speaker mute (with plug check) */
+ static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+@@ -10212,13 +10224,8 @@ static int alc262_fujitsu_master_sw_put(
+ long *valp = ucontrol->value.integer.value;
+ int change;
+
+- change = snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
+- HDA_AMP_MUTE,
+- valp ? 0 : HDA_AMP_MUTE);
+- change |= snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0,
+- HDA_AMP_MUTE,
+- valp ? 0 : HDA_AMP_MUTE);
+-
++ change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp);
++ change |= amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp);
+ if (change)
+ alc262_fujitsu_automute(codec, 0);
+ return change;
+@@ -10253,10 +10260,7 @@ static int alc262_lenovo_3000_master_sw_
+ long *valp = ucontrol->value.integer.value;
+ int change;
+
+- change = snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0,
+- HDA_AMP_MUTE,
+- valp ? 0 : HDA_AMP_MUTE);
+-
++ change = amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp);
+ if (change)
+ alc262_lenovo_3000_automute(codec, 0);
+ return change;
+@@ -11377,12 +11381,7 @@ static int alc268_acer_master_sw_put(str
+ long *valp = ucontrol->value.integer.value;
+ int change;
+
+- change = snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0,
+- HDA_AMP_MUTE,
+- valp[0] ? 0 : HDA_AMP_MUTE);
+- change |= snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0,
+- HDA_AMP_MUTE,
+- valp[1] ? 0 : HDA_AMP_MUTE);
++ change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp);
+ if (change)
+ alc268_acer_automute(codec, 0);
+ return change;
--- /dev/null
+From b04add956616b6d89ff21da749b46ad2bd58ef32 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 20 Jul 2009 08:01:36 +0200
+Subject: ALSA: hda - Fix pin-setup for Sony VAIO with STAC9872 codecs
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit b04add956616b6d89ff21da749b46ad2bd58ef32 upstream.
+
+The recent rewrite of the codec parser for STAC9872 caused a regression
+for some Sony VAIO models that don't give proper pin default configs
+by BIOS. Even using model=vaio doesn't work because the pin definitions
+are set after the pin overrides.
+
+This patch fixes the pin definitions in patch_stac9872() to be put
+in the right place before the pin overrides. Also the patch adds the
+new quirk entry for VAIO F/S to have the correct pin default configs.
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/hda/patch_sigmatel.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/sound/pci/hda/patch_sigmatel.c
++++ b/sound/pci/hda/patch_sigmatel.c
+@@ -5661,6 +5661,8 @@ static unsigned int *stac9872_brd_tbl[ST
+ };
+
+ static struct snd_pci_quirk stac9872_cfg_tbl[] = {
++ SND_PCI_QUIRK_MASK(0x104d, 0xfff0, 0x81e0,
++ "Sony VAIO F/S", STAC_9872_VAIO),
+ {} /* terminator */
+ };
+
+@@ -5673,6 +5675,8 @@ static int patch_stac9872(struct hda_cod
+ if (spec == NULL)
+ return -ENOMEM;
+ codec->spec = spec;
++ spec->num_pins = ARRAY_SIZE(stac9872_pin_nids);
++ spec->pin_nids = stac9872_pin_nids;
+
+ spec->board_config = snd_hda_check_board_config(codec, STAC_9872_MODELS,
+ stac9872_models,
+@@ -5684,8 +5688,6 @@ static int patch_stac9872(struct hda_cod
+ stac92xx_set_config_regs(codec,
+ stac9872_brd_tbl[spec->board_config]);
+
+- spec->num_pins = ARRAY_SIZE(stac9872_pin_nids);
+- spec->pin_nids = stac9872_pin_nids;
+ spec->multiout.dac_nids = spec->dac_nids;
+ spec->num_adcs = ARRAY_SIZE(stac9872_adc_nids);
+ spec->adc_nids = stac9872_adc_nids;
--- /dev/null
+From 1df892cba45f9856d369a6a317ad2d1e44bca423 Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Date: Fri, 3 Jul 2009 10:33:39 +0100
+Subject: ASoC: Fix register cache initialisation for WM8753
+
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+
+commit 1df892cba45f9856d369a6a317ad2d1e44bca423 upstream.
+
+The wrong register cache variable was being used to provide the size for
+the memcpy(), resulting in a copy of only a void * of data.
+
+Reported-by: Lars-Peter Clausen <lars@metafoo.de>
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/soc/codecs/wm8753.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/soc/codecs/wm8753.c
++++ b/sound/soc/codecs/wm8753.c
+@@ -1664,7 +1664,7 @@ static int wm8753_register(struct wm8753
+ codec->reg_cache = &wm8753->reg_cache;
+ codec->private_data = wm8753;
+
+- memcpy(codec->reg_cache, wm8753_reg, sizeof(codec->reg_cache));
++ memcpy(codec->reg_cache, wm8753_reg, sizeof(wm8753->reg_cache));
+ INIT_DELAYED_WORK(&codec->delayed_work, wm8753_work);
+
+ ret = wm8753_reset(codec);
--- /dev/null
+From ecb554a846f8e9d2a58f6d6c118168a63ac065aa Mon Sep 17 00:00:00 2001
+From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
+Date: Thu, 9 Jul 2009 14:46:53 +0200
+Subject: block: fix sg SG_DXFER_TO_FROM_DEV regression
+
+From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
+
+commit ecb554a846f8e9d2a58f6d6c118168a63ac065aa upstream.
+
+I overlooked SG_DXFER_TO_FROM_DEV support when I converted sg to use
+the block layer mapping API (2.6.28).
+
+Douglas Gilbert explained SG_DXFER_TO_FROM_DEV:
+
+http://www.spinics.net/lists/linux-scsi/msg37135.html
+
+=
+The semantics of SG_DXFER_TO_FROM_DEV were:
+ - copy user space buffer to kernel (LLD) buffer
+ - do SCSI command which is assumed to be of the DATA_IN
+ (data from device) variety. This would overwrite
+ some or all of the kernel buffer
+ - copy kernel (LLD) buffer back to the user space.
+
+The idea was to detect short reads by filling the original
+user space buffer with some marker bytes ("0xec" it would
+seem in this report). The "resid" value is a better way
+of detecting short reads but that was only added this century
+and requires co-operation from the LLD.
+=
+
+This patch changes the block layer mapping API to support this
+semantics. This simply adds another field to struct rq_map_data and
+enables __bio_copy_iov() to copy data from user space even with READ
+requests.
+
+It's better to add the flags field and kills null_mapped and the new
+from_user fields in struct rq_map_data but that approach makes it
+difficult to send this patch to stable trees because st and osst
+drivers use struct rq_map_data (they were converted to use the block
+layer in 2.6.29 and 2.6.30). Well, I should clean up the block layer
+mapping API.
+
+zhou sf reported this regiression and tested this patch:
+
+http://www.spinics.net/lists/linux-scsi/msg37128.html
+http://www.spinics.net/lists/linux-scsi/msg37168.html
+
+Reported-by: zhou sf <sxzzsf@gmail.com>
+Tested-by: zhou sf <sxzzsf@gmail.com>
+Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
+Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/scsi/sg.c | 4 ++++
+ fs/bio.c | 22 ++++++++++++----------
+ include/linux/blkdev.h | 1 +
+ 3 files changed, 17 insertions(+), 10 deletions(-)
+
+--- a/drivers/scsi/sg.c
++++ b/drivers/scsi/sg.c
+@@ -1656,6 +1656,10 @@ static int sg_start_req(Sg_request *srp,
+ md->nr_entries = req_schp->k_use_sg;
+ md->offset = 0;
+ md->null_mapped = hp->dxferp ? 0 : 1;
++ if (dxfer_dir == SG_DXFER_TO_FROM_DEV)
++ md->from_user = 1;
++ else
++ md->from_user = 0;
+ }
+
+ if (iov_count) {
+--- a/fs/bio.c
++++ b/fs/bio.c
+@@ -706,14 +706,13 @@ static struct bio_map_data *bio_alloc_ma
+ }
+
+ static int __bio_copy_iov(struct bio *bio, struct bio_vec *iovecs,
+- struct sg_iovec *iov, int iov_count, int uncopy,
+- int do_free_page)
++ struct sg_iovec *iov, int iov_count,
++ int to_user, int from_user, int do_free_page)
+ {
+ int ret = 0, i;
+ struct bio_vec *bvec;
+ int iov_idx = 0;
+ unsigned int iov_off = 0;
+- int read = bio_data_dir(bio) == READ;
+
+ __bio_for_each_segment(bvec, bio, i, 0) {
+ char *bv_addr = page_address(bvec->bv_page);
+@@ -728,13 +727,14 @@ static int __bio_copy_iov(struct bio *bi
+ iov_addr = iov[iov_idx].iov_base + iov_off;
+
+ if (!ret) {
+- if (!read && !uncopy)
+- ret = copy_from_user(bv_addr, iov_addr,
+- bytes);
+- if (read && uncopy)
++ if (to_user)
+ ret = copy_to_user(iov_addr, bv_addr,
+ bytes);
+
++ if (from_user)
++ ret = copy_from_user(bv_addr, iov_addr,
++ bytes);
++
+ if (ret)
+ ret = -EFAULT;
+ }
+@@ -771,7 +771,8 @@ int bio_uncopy_user(struct bio *bio)
+
+ if (!bio_flagged(bio, BIO_NULL_MAPPED))
+ ret = __bio_copy_iov(bio, bmd->iovecs, bmd->sgvecs,
+- bmd->nr_sgvecs, 1, bmd->is_our_pages);
++ bmd->nr_sgvecs, bio_data_dir(bio) == READ,
++ 0, bmd->is_our_pages);
+ bio_free_map_data(bmd);
+ bio_put(bio);
+ return ret;
+@@ -876,8 +877,9 @@ struct bio *bio_copy_user_iov(struct req
+ /*
+ * success
+ */
+- if (!write_to_vm && (!map_data || !map_data->null_mapped)) {
+- ret = __bio_copy_iov(bio, bio->bi_io_vec, iov, iov_count, 0, 0);
++ if ((!write_to_vm && (!map_data || !map_data->null_mapped)) ||
++ (map_data && map_data->from_user)) {
++ ret = __bio_copy_iov(bio, bio->bi_io_vec, iov, iov_count, 0, 1, 0);
+ if (ret)
+ goto cleanup;
+ }
+--- a/include/linux/blkdev.h
++++ b/include/linux/blkdev.h
+@@ -723,6 +723,7 @@ struct rq_map_data {
+ int nr_entries;
+ unsigned long offset;
+ int null_mapped;
++ int from_user;
+ };
+
+ struct req_iterator {
--- /dev/null
+From 5ddf1e0ff00fd808c048d0b920784828276cc516 Mon Sep 17 00:00:00 2001
+From: Jeff Layton <jlayton@redhat.com>
+Date: Sun, 5 Jul 2009 11:01:02 -0400
+Subject: cifs: fix regression with O_EXCL creates and optimize away lookup
+
+From: Jeff Layton <jlayton@redhat.com>
+
+commit 5ddf1e0ff00fd808c048d0b920784828276cc516 upstream.
+
+cifs: fix regression with O_EXCL creates and optimize away lookup
+
+Signed-off-by: Jeff Layton <jlayton@redhat.com>
+Tested-by: Shirish Pargaonkar <shirishp@gmail.com>
+Signed-off-by: Steve French <sfrench@us.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/cifs/dir.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/fs/cifs/dir.c
++++ b/fs/cifs/dir.c
+@@ -641,6 +641,15 @@ cifs_lookup(struct inode *parent_dir_ino
+ }
+ }
+
++ /*
++ * O_EXCL: optimize away the lookup, but don't hash the dentry. Let
++ * the VFS handle the create.
++ */
++ if (nd->flags & LOOKUP_EXCL) {
++ d_instantiate(direntry, NULL);
++ return 0;
++ }
++
+ /* can not grab the rename sem here since it would
+ deadlock in the cases (beginning of sys_rename itself)
+ in which we already have the sb rename sem */
--- /dev/null
+From 90a98b2f3f3647fb17667768a348b2b219f2a9f7 Mon Sep 17 00:00:00 2001
+From: Jeff Layton <jlayton@redhat.com>
+Date: Mon, 20 Jul 2009 13:40:52 -0400
+Subject: cifs: free nativeFileSystem field before allocating a new one
+
+From: Jeff Layton <jlayton@redhat.com>
+
+commit 90a98b2f3f3647fb17667768a348b2b219f2a9f7 upstream.
+
+...otherwise, we'll leak this memory if we have to reconnect (e.g. after
+network failure).
+
+Signed-off-by: Jeff Layton <jlayton@redhat.com>
+Signed-off-by: Steve French <sfrench@us.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/cifs/connect.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/fs/cifs/connect.c
++++ b/fs/cifs/connect.c
+@@ -2745,6 +2745,7 @@ CIFSTCon(unsigned int xid, struct cifsSe
+ strncpy(tcon->treeName, tree, MAX_TREE_SIZE);
+
+ /* mostly informational -- no need to fail on error here */
++ kfree(tcon->nativeFileSystem);
+ tcon->nativeFileSystem = cifs_strndup_from_ucs(bcc_ptr,
+ bytes_left, is_unicode,
+ nls_codepage);
--- /dev/null
+From 69885683d22d8c05910fd808c01fdce1322739b4 Mon Sep 17 00:00:00 2001
+From: Mikulas Patocka <mpatocka@redhat.com>
+Date: Thu, 23 Jul 2009 20:30:37 +0100
+Subject: dm raid1: wake kmirrord when requeueing delayed bios after remote recovery
+
+From: Mikulas Patocka <mpatocka@redhat.com>
+
+commit 69885683d22d8c05910fd808c01fdce1322739b4 upstream.
+
+The recent commit 7513c2a761d69d2a93f17146b3563527d3618ba0 (dm raid1:
+add is_remote_recovering hook for clusters) changed do_writes() to
+update the ms->writes list but forgot to wake up kmirrord to process it.
+
+The rule is that when anything is being added on ms->reads, ms->writes
+or ms->failures and the list was empty before we must call
+wakeup_mirrord (for immediate processing) or delayed_wake (for delayed
+processing). Otherwise the bios could sit on the list indefinitely.
+
+Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
+Signed-off-by: Alasdair G Kergon <agk@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/md/dm-raid1.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/md/dm-raid1.c
++++ b/drivers/md/dm-raid1.c
+@@ -638,6 +638,7 @@ static void do_writes(struct mirror_set
+ spin_lock_irq(&ms->lock);
+ bio_list_merge(&ms->writes, &requeue);
+ spin_unlock_irq(&ms->lock);
++ delayed_wake(ms);
+ }
+
+ /*
--- /dev/null
+From 4859484b0957ddc7fe3e0fa349d98b0f1c7876bd Mon Sep 17 00:00:00 2001
+From: Jiri Slaby <jirislaby@gmail.com>
+Date: Fri, 19 Jun 2009 23:24:11 +0200
+Subject: HID: hiddev, fix lock imbalance
+
+From: Jiri Slaby <jirislaby@gmail.com>
+
+commit 4859484b0957ddc7fe3e0fa349d98b0f1c7876bd upstream.
+
+Add omitted BKL to one switch/case.
+
+Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/hid/usbhid/hiddev.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/hid/usbhid/hiddev.c
++++ b/drivers/hid/usbhid/hiddev.c
+@@ -527,8 +527,10 @@ static noinline int hiddev_ioctl_usage(s
+ goto goodreturn;
+
+ case HIDIOCGCOLLECTIONINDEX:
++ i = field->usage[uref->usage_index].collection_index;
++ unlock_kernel();
+ kfree(uref_multi);
+- return field->usage[uref->usage_index].collection_index;
++ return i;
+ case HIDIOCGUSAGES:
+ for (i = 0; i < uref_multi->num_values; i++)
+ uref_multi->values[i] =
--- /dev/null
+From 6cdbf734493d6e8f5afc6f539b82897772809d43 Mon Sep 17 00:00:00 2001
+From: Nicolas Pitre <nico@cam.org>
+Date: Sat, 18 Jul 2009 20:34:37 -0400
+Subject: mvsdio: fix handling of partial word at the end of PIO transfer
+
+From: Nicolas Pitre <nico@cam.org>
+
+commit 6cdbf734493d6e8f5afc6f539b82897772809d43 upstream.
+
+Standard data flow for MMC/SD/SDIO cards requires that the mvsdio
+controller be set for big endian operation. This is causing problems
+with buffers which length is not a multiple of 4 bytes as the last
+partial word doesn't get shifted all the way and stored properly in
+memory. Let's compensate for this.
+
+Signed-off-by: Nicolas Pitre <nico@marvell.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/mmc/host/mvsdio.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/mmc/host/mvsdio.c
++++ b/drivers/mmc/host/mvsdio.c
+@@ -384,7 +384,7 @@ static irqreturn_t mvsd_irq(int irq, voi
+ u16 val[2] = {0, 0};
+ val[0] = mvsd_read(MVSD_FIFO);
+ val[1] = mvsd_read(MVSD_FIFO);
+- memcpy(p, &val, s);
++ memcpy(p, ((void *)&val) + 4 - s, s);
+ s = 0;
+ intr_status = mvsd_read(MVSD_NOR_INTR_STATUS);
+ }
+@@ -423,7 +423,7 @@ static irqreturn_t mvsd_irq(int irq, voi
+ if (s < 4) {
+ if (s && (intr_status & MVSD_NOR_TX_AVAIL)) {
+ u16 val[2] = {0, 0};
+- memcpy(&val, p, s);
++ memcpy(((void *)&val) + 4 - s, p, s);
+ mvsd_write(MVSD_FIFO, val[0]);
+ mvsd_write(MVSD_FIFO, val[1]);
+ s = 0;
--- /dev/null
+From d9a0a345ab7a58a30ec38e5bb7401a28714914d2 Mon Sep 17 00:00:00 2001
+From: Jiro SEKIBA <jir@unicus.jp>
+Date: Sat, 4 Jul 2009 23:00:53 +0900
+Subject: nilfs2: fix disorder in cp count on error during deleting checkpoints
+
+From: Jiro SEKIBA <jir@unicus.jp>
+
+commit d9a0a345ab7a58a30ec38e5bb7401a28714914d2 upstream.
+
+This fixes a bug that checkpoint count gets wrong on errors when
+deleting a series of checkpoints.
+
+The count error is persistent since the checkpoint count is stored on
+disk. Some userland programs refer to the count via ioctl, and this
+bugfix is needed to prevent malfunction of such programs.
+
+Signed-off-by: Jiro SEKIBA <jir@unicus.jp>
+Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/nilfs2/cpfile.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+--- a/fs/nilfs2/cpfile.c
++++ b/fs/nilfs2/cpfile.c
+@@ -311,7 +311,7 @@ int nilfs_cpfile_delete_checkpoints(stru
+ ret = nilfs_cpfile_get_checkpoint_block(cpfile, cno, 0, &cp_bh);
+ if (ret < 0) {
+ if (ret != -ENOENT)
+- goto out_header;
++ break;
+ /* skip hole */
+ ret = 0;
+ continue;
+@@ -344,7 +344,7 @@ int nilfs_cpfile_delete_checkpoints(stru
+ continue;
+ printk(KERN_ERR "%s: cannot delete block\n",
+ __func__);
+- goto out_header;
++ break;
+ }
+ }
+
+@@ -362,7 +362,6 @@ int nilfs_cpfile_delete_checkpoints(stru
+ kunmap_atomic(kaddr, KM_USER0);
+ }
+
+- out_header:
+ brelse(header_bh);
+
+ out_sem:
--- /dev/null
+From 8227b29722fdbac72357aae155d171a5c777670c Mon Sep 17 00:00:00 2001
+From: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
+Date: Thu, 18 Jun 2009 23:52:23 +0900
+Subject: nilfs2: fix hang problem of log writer which occurs after write failures
+
+From: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
+
+commit 8227b29722fdbac72357aae155d171a5c777670c upstream.
+
+Leandro Lucarella gave me a report that nilfs gets stuck after its
+write function fails.
+
+The problem turned out to be caused by bugs which leave writeback flag
+on pages. This fixes the problem by ensuring to clear the writeback
+flag in error path.
+
+Reported-by: Leandro Lucarella <llucax@gmail.com>
+Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/nilfs2/segment.c | 26 ++++++--------------------
+ 1 file changed, 6 insertions(+), 20 deletions(-)
+
+--- a/fs/nilfs2/segment.c
++++ b/fs/nilfs2/segment.c
+@@ -1853,19 +1853,6 @@ static int nilfs_segctor_write(struct ni
+ return 0;
+ }
+
+-static int nilfs_page_has_uncleared_buffer(struct page *page)
+-{
+- struct buffer_head *head, *bh;
+-
+- head = bh = page_buffers(page);
+- do {
+- if (buffer_dirty(bh) && !list_empty(&bh->b_assoc_buffers))
+- return 1;
+- bh = bh->b_this_page;
+- } while (bh != head);
+- return 0;
+-}
+-
+ static void __nilfs_end_page_io(struct page *page, int err)
+ {
+ if (!err) {
+@@ -1889,12 +1876,11 @@ static void nilfs_end_page_io(struct pag
+ if (!page)
+ return;
+
+- if (buffer_nilfs_node(page_buffers(page)) &&
+- nilfs_page_has_uncleared_buffer(page))
+- /* For b-tree node pages, this function may be called twice
+- or more because they might be split in a segment.
+- This check assures that cleanup has been done for all
+- buffers in a split btnode page. */
++ if (buffer_nilfs_node(page_buffers(page)) && !PageWriteback(page))
++ /*
++ * For b-tree node pages, this function may be called twice
++ * or more because they might be split in a segment.
++ */
+ return;
+
+ __nilfs_end_page_io(page, err);
+@@ -1957,7 +1943,7 @@ static void nilfs_segctor_abort_write(st
+ }
+ if (bh->b_page != fs_page) {
+ nilfs_end_page_io(fs_page, err);
+- if (unlikely(fs_page == failed_page))
++ if (fs_page && fs_page == failed_page)
+ goto done;
+ fs_page = bh->b_page;
+ }
--- /dev/null
+From 4a52df779700080de4afb0436d9dd9188514a69b Mon Sep 17 00:00:00 2001
+From: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
+Date: Thu, 18 Jun 2009 23:53:25 +0900
+Subject: nilfs2: fix incorrect KERN_CRIT messages in case of write failures
+
+From: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
+
+commit 4a52df779700080de4afb0436d9dd9188514a69b upstream.
+
+In case of write-failure retries, the following KERN_CRIT level
+messages are mistakenly output by nilfs_dat_commit_start() function:
+
+nilfs_dat_commit_start: vbn = 408463, start = 12506, end = 18446744073709551615, pbn = 530210
+nilfs_dat_commit_start: vbn = 408515, start = 12506, end = 18446744073709551615, pbn = 530211
+nilfs_dat_commit_start: vbn = 408464, start = 12506, end = 18446744073709551615, pbn = 530212
+...
+
+This suppresses these messages.
+
+Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/nilfs2/dat.c | 9 ---------
+ 1 file changed, 9 deletions(-)
+
+--- a/fs/nilfs2/dat.c
++++ b/fs/nilfs2/dat.c
+@@ -149,15 +149,6 @@ void nilfs_dat_commit_start(struct inode
+ entry = nilfs_palloc_block_get_entry(dat, req->pr_entry_nr,
+ req->pr_entry_bh, kaddr);
+ entry->de_start = cpu_to_le64(nilfs_mdt_cno(dat));
+- if (entry->de_blocknr != cpu_to_le64(0) ||
+- entry->de_end != cpu_to_le64(NILFS_CNO_MAX)) {
+- printk(KERN_CRIT
+- "%s: vbn = %llu, start = %llu, end = %llu, pbn = %llu\n",
+- __func__, (unsigned long long)req->pr_entry_nr,
+- (unsigned long long)le64_to_cpu(entry->de_start),
+- (unsigned long long)le64_to_cpu(entry->de_end),
+- (unsigned long long)le64_to_cpu(entry->de_blocknr));
+- }
+ entry->de_blocknr = cpu_to_le64(blocknr);
+ kunmap_atomic(kaddr, KM_USER0);
+
--- /dev/null
+From 0cfae3d8795f388f9de78adb0171520d19da77e9 Mon Sep 17 00:00:00 2001
+From: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
+Date: Thu, 18 Jun 2009 11:42:53 +0900
+Subject: nilfs2: remove unlikely directive causing mis-conversion of error code
+
+From: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
+
+commit 0cfae3d8795f388f9de78adb0171520d19da77e9 upstream.
+
+The following error code handling in nilfs_segctor_write() function
+wrongly converted negative error codes to a truth value (i.e. 1):
+
+ err = unlikely(err) ? : res;
+
+which originaly meant to be
+
+ err = err ? : res;
+
+This mis-conversion caused that write or sync functions receive the
+unexpected error code. This fixes the bug by removing the unlikely
+directive.
+
+Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/nilfs2/segment.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/fs/nilfs2/segment.c
++++ b/fs/nilfs2/segment.c
+@@ -1846,8 +1846,8 @@ static int nilfs_segctor_write(struct ni
+ err = nilfs_segbuf_write(segbuf, &wi);
+
+ res = nilfs_segbuf_wait(segbuf, &wi);
+- err = unlikely(err) ? : res;
+- if (unlikely(err))
++ err = err ? : res;
++ if (err)
+ return err;
+ }
+ return 0;
--- /dev/null
+From f8c73c790c588fd70fda1632c8927a87b3d31dcd Mon Sep 17 00:00:00 2001
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+Date: Thu, 11 Jun 2009 15:14:40 +0200
+Subject: partitions: fix broken uevent_suppress conversion
+
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+
+commit f8c73c790c588fd70fda1632c8927a87b3d31dcd upstream.
+
+git commit f67f129e "Driver core: implement uevent suppress in kobject"
+contains this chunk for fs/partitions/check.c:
+
+ /* suppress uevent if the disk supresses it */
+- if (!ddev->uevent_suppress)
++ if (!dev_get_uevent_suppress(pdev))
+ kobject_uevent(&pdev->kobj, KOBJ_ADD);
+
+However that should have been
+
+- if (!ddev->uevent_suppress)
++ if (!dev_get_uevent_suppress(ddev))
+
+Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
+Acked-by: Ming Lei <tom.leiming@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/partitions/check.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/partitions/check.c
++++ b/fs/partitions/check.c
+@@ -426,7 +426,7 @@ struct hd_struct *add_partition(struct g
+ rcu_assign_pointer(ptbl->part[partno], p);
+
+ /* suppress uevent if the disk supresses it */
+- if (!dev_get_uevent_suppress(pdev))
++ if (!dev_get_uevent_suppress(ddev))
+ kobject_uevent(&pdev->kobj, KOBJ_ADD);
+
+ return p;
--- /dev/null
+From 6301cb95c119ebf324bb96ee226fa9ddffad80a7 Mon Sep 17 00:00:00 2001
+From: Thomas Gleixner <tglx@linutronix.de>
+Date: Fri, 17 Jul 2009 14:15:47 +0200
+Subject: sched: fix nr_uninterruptible accounting of frozen tasks really
+
+From: Thomas Gleixner <tglx@linutronix.de>
+
+commit 6301cb95c119ebf324bb96ee226fa9ddffad80a7 upstream.
+
+commit e3c8ca8336 (sched: do not count frozen tasks toward load) broke
+the nr_uninterruptible accounting on freeze/thaw. On freeze the task
+is excluded from accounting with a check for (task->flags &
+PF_FROZEN), but that flag is cleared before the task is thawed. So
+while we prevent that the task with state TASK_UNINTERRUPTIBLE
+is accounted to nr_uninterruptible on freeze we decrement
+nr_uninterruptible on thaw.
+
+Use a separate flag which is handled by the freezing task itself. Set
+it before calling the scheduler with TASK_UNINTERRUPTIBLE state and
+clear it after we return from frozen state.
+
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ include/linux/sched.h | 3 ++-
+ kernel/freezer.c | 7 +++++++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+--- a/include/linux/sched.h
++++ b/include/linux/sched.h
+@@ -206,7 +206,7 @@ extern unsigned long long time_sync_thre
+ ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0)
+ #define task_contributes_to_load(task) \
+ ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \
+- (task->flags & PF_FROZEN) == 0)
++ (task->flags & PF_FREEZING) == 0)
+
+ #define __set_task_state(tsk, state_value) \
+ do { (tsk)->state = (state_value); } while (0)
+@@ -1630,6 +1630,7 @@ extern cputime_t task_gtime(struct task_
+ #define PF_MEMALLOC 0x00000800 /* Allocating memory */
+ #define PF_FLUSHER 0x00001000 /* responsible for disk writeback */
+ #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */
++#define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */
+ #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */
+ #define PF_FROZEN 0x00010000 /* frozen for system suspend */
+ #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */
+--- a/kernel/freezer.c
++++ b/kernel/freezer.c
+@@ -44,12 +44,19 @@ void refrigerator(void)
+ recalc_sigpending(); /* We sent fake signal, clean it up */
+ spin_unlock_irq(¤t->sighand->siglock);
+
++ /* prevent accounting of that task to load */
++ current->flags |= PF_FREEZING;
++
+ for (;;) {
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ if (!frozen(current))
+ break;
+ schedule();
+ }
++
++ /* Remove the accounting blocker */
++ current->flags &= ~PF_FREEZING;
++
+ pr_debug("%s left refrigerator\n", current->comm);
+ __set_current_state(save);
+ }
--- /dev/null
+From a1ba4d8ba9f06a397e97cbd67a93ee306860b40a Mon Sep 17 00:00:00 2001
+From: Peter Zijlstra <peterz@infradead.org>
+Date: Wed, 1 Apr 2009 18:40:15 +0200
+Subject: sched_rt: Fix overload bug on rt group scheduling
+
+From: Peter Zijlstra <peterz@infradead.org>
+
+commit a1ba4d8ba9f06a397e97cbd67a93ee306860b40a upstream.
+
+Fixes an easily triggerable BUG() when setting process affinities.
+
+Make sure to count the number of migratable tasks in the same place:
+the root rt_rq. Otherwise the number doesn't make sense and we'll hit
+the BUG in set_cpus_allowed_rt().
+
+Also, make sure we only count tasks, not groups (this is probably
+already taken care of by the fact that rt_se->nr_cpus_allowed will be 0
+for groups, but be more explicit)
+
+Tested-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
+Acked-by: Gregory Haskins <ghaskins@novell.com>
+LKML-Reference: <1247067476.9777.57.camel@twins>
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/sched.c | 1 +
+ kernel/sched_rt.c | 18 +++++++++++++++++-
+ 2 files changed, 18 insertions(+), 1 deletion(-)
+
+--- a/kernel/sched.c
++++ b/kernel/sched.c
+@@ -497,6 +497,7 @@ struct rt_rq {
+ #endif
+ #ifdef CONFIG_SMP
+ unsigned long rt_nr_migratory;
++ unsigned long rt_nr_total;
+ int overloaded;
+ struct plist_head pushable_tasks;
+ #endif
+--- a/kernel/sched_rt.c
++++ b/kernel/sched_rt.c
+@@ -10,6 +10,8 @@ static inline struct task_struct *rt_tas
+
+ #ifdef CONFIG_RT_GROUP_SCHED
+
++#define rt_entity_is_task(rt_se) (!(rt_se)->my_q)
++
+ static inline struct rq *rq_of_rt_rq(struct rt_rq *rt_rq)
+ {
+ return rt_rq->rq;
+@@ -22,6 +24,8 @@ static inline struct rt_rq *rt_rq_of_se(
+
+ #else /* CONFIG_RT_GROUP_SCHED */
+
++#define rt_entity_is_task(rt_se) (1)
++
+ static inline struct rq *rq_of_rt_rq(struct rt_rq *rt_rq)
+ {
+ return container_of(rt_rq, struct rq, rt);
+@@ -73,7 +77,7 @@ static inline void rt_clear_overload(str
+
+ static void update_rt_migration(struct rt_rq *rt_rq)
+ {
+- if (rt_rq->rt_nr_migratory && (rt_rq->rt_nr_running > 1)) {
++ if (rt_rq->rt_nr_migratory && rt_rq->rt_nr_total > 1) {
+ if (!rt_rq->overloaded) {
+ rt_set_overload(rq_of_rt_rq(rt_rq));
+ rt_rq->overloaded = 1;
+@@ -86,6 +90,12 @@ static void update_rt_migration(struct r
+
+ static void inc_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
+ {
++ if (!rt_entity_is_task(rt_se))
++ return;
++
++ rt_rq = &rq_of_rt_rq(rt_rq)->rt;
++
++ rt_rq->rt_nr_total++;
+ if (rt_se->nr_cpus_allowed > 1)
+ rt_rq->rt_nr_migratory++;
+
+@@ -94,6 +104,12 @@ static void inc_rt_migration(struct sche
+
+ static void dec_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
+ {
++ if (!rt_entity_is_task(rt_se))
++ return;
++
++ rt_rq = &rq_of_rt_rq(rt_rq)->rt;
++
++ rt_rq->rt_nr_total--;
+ if (rt_se->nr_cpus_allowed > 1)
+ rt_rq->rt_nr_migratory--;
+
usb-rndis-gadget-fix-issues-talking-from-pxa.patch
usb-fix-langid-0-regression.patch
usb-ehci-report-actual_length-for-iso-transfers.patch
+cifs-fix-regression-with-o_excl-creates-and-optimize-away-lookup.patch
+cifs-free-nativefilesystem-field-before-allocating-a-new-one.patch
+alsa-ca0106-fix-the-max-capture-buffer-size.patch
+alsa-hda-fix-pin-setup-for-sony-vaio-with-stac9872-codecs.patch
+alsa-hda-add-quirk-for-gateway-t6834c-laptop.patch
+alsa-hda-fix-mute-control-with-some-alc262-models.patch
+hid-hiddev-fix-lock-imbalance.patch
+mvsdio-fix-handling-of-partial-word-at-the-end-of-pio-transfer.patch
+asoc-fix-register-cache-initialisation-for-wm8753.patch
+partitions-fix-broken-uevent_suppress-conversion.patch
+vc-create-vcs-devices-for-consoles.patch
+x86-fix-fixmap-ordering.patch
+x86-fix-fixmap-page-order-for-fix_text_poke0-1.patch
+block-fix-sg-sg_dxfer_to_from_dev-regression.patch
+nilfs2-remove-unlikely-directive-causing-mis-conversion-of-error-code.patch
+nilfs2-fix-hang-problem-of-log-writer-which-occurs-after-write-failures.patch
+nilfs2-fix-incorrect-kern_crit-messages-in-case-of-write-failures.patch
+nilfs2-fix-disorder-in-cp-count-on-error-during-deleting-checkpoints.patch
+sched_rt-fix-overload-bug-on-rt-group-scheduling.patch
+tracing-function-fix-the-return-value-of-ftrace_trace_onoff_callback.patch
+x86-pci-insert-ioapic-resource-before-assigning-unassigned-resources.patch
+sched-fix-nr_uninterruptible-accounting-of-frozen-tasks-really.patch
+dm-raid1-wake-kmirrord-when-requeueing-delayed-bios-after-remote-recovery.patch
--- /dev/null
+From 04aef32d39cc4ef80087c0ce8ed113c6d64f1a6b Mon Sep 17 00:00:00 2001
+From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
+Date: Wed, 15 Jul 2009 12:29:06 +0800
+Subject: tracing/function: Fix the return value of ftrace_trace_onoff_callback()
+
+From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
+
+commit 04aef32d39cc4ef80087c0ce8ed113c6d64f1a6b upstream.
+
+ftrace_trace_onoff_callback() will return an error even if we do the
+right operation, for example:
+
+ # echo _spin_*:traceon:10 > set_ftrace_filter
+ -bash: echo: write error: Invalid argument
+ # cat set_ftrace_filter
+ #### all functions enabled ####
+ _spin_trylock_bh:traceon:count=10
+ _spin_unlock_irq:traceon:count=10
+ _spin_unlock_bh:traceon:count=10
+ _spin_lock_irq:traceon:count=10
+ _spin_unlock:traceon:count=10
+ _spin_trylock:traceon:count=10
+ _spin_unlock_irqrestore:traceon:count=10
+ _spin_lock_irqsave:traceon:count=10
+ _spin_lock_bh:traceon:count=10
+ _spin_lock:traceon:count=10
+
+We want to set _spin_*:traceon:10 to set_ftrace_filter, it complains
+with "Invalid argument", but the operation is successful.
+
+This is because ftrace_process_regex() returns the number of functions that
+matched the pattern. If the number is not 0, this value is returned
+by ftrace_regex_write() whereas we want to return the number of bytes
+virtually written.
+Also the file offset pointer is not updated in this case.
+
+If the number of matched functions is lower than the number of bytes written
+by the user, this results to a reprocessing of the string given by the user with
+a lower size, leading to a malformed ftrace regex and then a -EINVAL returned.
+
+So, this patch fixes it by returning 0 if no error occured.
+The fix also applies on 2.6.30
+
+Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
+Reviewed-by: Li Zefan <lizf@cn.fujitsu.com>
+Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/trace/trace_functions.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/kernel/trace/trace_functions.c
++++ b/kernel/trace/trace_functions.c
+@@ -364,7 +364,7 @@ ftrace_trace_onoff_callback(char *glob,
+ out_reg:
+ ret = register_ftrace_function_probe(glob, ops, count);
+
+- return ret;
++ return ret < 0 ? ret : 0;
+ }
+
+ static struct ftrace_func_command ftrace_traceon_cmd = {
--- /dev/null
+From c46a7aec556ffdbdb7357db0b05904b176cb3375 Mon Sep 17 00:00:00 2001
+From: Kay Sievers <kay.sievers@vrfy.org>
+Date: Mon, 20 Jul 2009 16:04:55 +0100
+Subject: vc: create vcs(a) devices for consoles
+
+From: Kay Sievers <kay.sievers@vrfy.org>
+
+commit c46a7aec556ffdbdb7357db0b05904b176cb3375 upstream.
+
+The buffer for the consoles are unconditionally allocated at con_init()
+time, which miss the creation of the vcs(a) devices.
+
+Since 2.6.30 (commit 4995f8ef9d3aac72745e12419d7fbaa8d01b1d81, 'vcs:
+hook sysfs devices into object lifetime instead of "binding"' to be
+exact) these devices are no longer created at open() and removed on
+close(), but controlled by the lifetime of the buffers.
+
+Reported-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
+Tested-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
+Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
+Signed-off-by: Alan Cox <alan@linux.intel.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/char/vc_screen.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/char/vc_screen.c
++++ b/drivers/char/vc_screen.c
+@@ -495,11 +495,15 @@ void vcs_remove_sysfs(int index)
+
+ int __init vcs_init(void)
+ {
++ unsigned int i;
++
+ if (register_chrdev(VCS_MAJOR, "vcs", &vcs_fops))
+ panic("unable to get major %d for vcs device", VCS_MAJOR);
+ vc_class = class_create(THIS_MODULE, "vc");
+
+ device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 0), NULL, "vcs");
+ device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 128), NULL, "vcsa");
++ for (i = 0; i < MIN_NR_CONSOLES; i++)
++ vcs_make_sysfs(i);
+ return 0;
+ }
--- /dev/null
+From 789d03f584484af85dbdc64935270c8e45f36ef7 Mon Sep 17 00:00:00 2001
+From: Jan Beulich <JBeulich@novell.com>
+Date: Tue, 30 Jun 2009 11:52:23 +0100
+Subject: x86: Fix fixmap ordering
+
+From: Jan Beulich <JBeulich@novell.com>
+
+commit 789d03f584484af85dbdc64935270c8e45f36ef7 upstream.
+
+The merge of the 32- and 64-bit fixmap headers made a latent
+bug on x86-64 a real one: with the right config settings
+it is possible for FIX_OHCI1394_BASE to overlap the FIX_BTMAP_*
+range.
+
+Signed-off-by: Jan Beulich <jbeulich@novell.com>
+LKML-Reference: <4A4A0A8702000078000082E8@vpn.id2.novell.com>
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/include/asm/fixmap.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/arch/x86/include/asm/fixmap.h
++++ b/arch/x86/include/asm/fixmap.h
+@@ -114,9 +114,6 @@ enum fixed_addresses {
+ FIX_TEXT_POKE0, /* reserve 2 pages for text_poke() */
+ FIX_TEXT_POKE1,
+ __end_of_permanent_fixed_addresses,
+-#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
+- FIX_OHCI1394_BASE,
+-#endif
+ /*
+ * 256 temporary boot-time mappings, used by early_ioremap(),
+ * before ioremap() is functional.
+@@ -129,6 +126,9 @@ enum fixed_addresses {
+ FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 -
+ (__end_of_permanent_fixed_addresses & 255),
+ FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1,
++#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
++ FIX_OHCI1394_BASE,
++#endif
+ #ifdef CONFIG_X86_32
+ FIX_WP_TEST,
+ #endif
--- /dev/null
+From 12b9d7ccb841805e347fec8f733f368f43ddba40 Mon Sep 17 00:00:00 2001
+From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
+Date: Wed, 1 Jul 2009 17:37:22 -0400
+Subject: x86: Fix fixmap page order for FIX_TEXT_POKE0,1
+
+From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
+
+commit 12b9d7ccb841805e347fec8f733f368f43ddba40 upstream.
+
+Masami reported:
+
+> Since the fixmap pages are assigned higher address to lower,
+> text_poke() has to use it with inverted order (FIX_TEXT_POKE1
+> to FIX_TEXT_POKE0).
+
+I prefer to just invert the order of the fixmap declaration.
+It's simpler and more straightforward.
+
+Backward fixmaps seems to be used by both x86 32 and 64.
+
+It's really rare but a nasty bug, because it only hurts when
+instructions to patch are crossing a page boundary. If this
+happens, the fixmap write accesses will spill on the following
+fixmap, which may very well crash the system. And this does not
+crash the system, it could leave illegal instructions in place.
+Thanks Masami for finding this.
+
+It seems to have crept into the 2.6.30-rc series, so this calls
+for a -stable inclusion.
+
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
+Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
+LKML-Reference: <20090701213722.GH19926@Krystal>
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/include/asm/fixmap.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/arch/x86/include/asm/fixmap.h
++++ b/arch/x86/include/asm/fixmap.h
+@@ -111,8 +111,8 @@ enum fixed_addresses {
+ #ifdef CONFIG_PARAVIRT
+ FIX_PARAVIRT_BOOTMAP,
+ #endif
+- FIX_TEXT_POKE0, /* reserve 2 pages for text_poke() */
+- FIX_TEXT_POKE1,
++ FIX_TEXT_POKE1, /* reserve 2 pages for text_poke() */
++ FIX_TEXT_POKE0, /* first page is last, because allocation is backward */
+ __end_of_permanent_fixed_addresses,
+ /*
+ * 256 temporary boot-time mappings, used by early_ioremap(),
--- /dev/null
+From 857fdc53a0a90c3ba7fcf5b1fb4c7a62ae03cf82 Mon Sep 17 00:00:00 2001
+From: Yinghai Lu <yinghai@kernel.org>
+Date: Fri, 10 Jul 2009 09:36:20 -0700
+Subject: x86/pci: insert ioapic resource before assigning unassigned resources
+
+From: Yinghai Lu <yinghai@kernel.org>
+
+commit 857fdc53a0a90c3ba7fcf5b1fb4c7a62ae03cf82 upstream.
+
+Stephen reported that his DL585 G2 needed noapic after 2.6.22 (?)
+
+Dann bisected it down to:
+ commit 30a18d6c3f1e774de656ebd8ff219d53e2ba4029
+ Date: Tue Feb 19 03:21:20 2008 -0800
+
+ x86: multi pci root bus with different io resource range, on
+ 64-bit
+
+It turns out that:
+ 1. that AMD-based systems have two HT chains.
+ 2. BIOS doesn't allocate resources for BAR 6 of devices under 8132 etc
+ 3. that multi-peer-root patch will try to split root resources to peer
+ root resources according to PCI conf of NB
+ 4. PCI core assigns unassigned resources, but they overlap with BARs
+ that are used by ioapic addr of io4 and 8132.
+
+The reason: at that point ioapic address are not inserted yet. Solution
+is to insert ioapic resources into the tree a bit earlier.
+
+Reported-by: Stephen Frost <sfrost@snowman.net>
+Reported-and-Tested-by: dann frazier <dannf@hp.com>
+Signed-off-by: Yinghai Lu <yinghai@kernel.org>
+Signed-off-by: Jesse Barnes <jbarnes@jbarnes-g45.(none)>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/include/asm/io_apic.h | 2 ++
+ arch/x86/kernel/apic/io_apic.c | 14 +++-----------
+ arch/x86/pci/i386.c | 7 +++++++
+ 3 files changed, 12 insertions(+), 11 deletions(-)
+
+--- a/arch/x86/include/asm/io_apic.h
++++ b/arch/x86/include/asm/io_apic.h
+@@ -160,6 +160,7 @@ extern int io_apic_set_pci_routing(int i
+
+ extern int (*ioapic_renumber_irq)(int ioapic, int irq);
+ extern void ioapic_init_mappings(void);
++extern void ioapic_insert_resources(void);
+
+ #ifdef CONFIG_X86_64
+ extern struct IO_APIC_route_entry **alloc_ioapic_entries(void);
+@@ -183,6 +184,7 @@ extern void ioapic_write_entry(int apic,
+ #define io_apic_assign_pci_irqs 0
+ static const int timer_through_8259 = 0;
+ static inline void ioapic_init_mappings(void) { }
++static inline void ioapic_insert_resources(void) { }
+
+ static inline void probe_nr_irqs_gsi(void) { }
+ #endif
+--- a/arch/x86/kernel/apic/io_apic.c
++++ b/arch/x86/kernel/apic/io_apic.c
+@@ -4182,28 +4182,20 @@ fake_ioapic_page:
+ }
+ }
+
+-static int __init ioapic_insert_resources(void)
++void __init ioapic_insert_resources(void)
+ {
+ int i;
+ struct resource *r = ioapic_resources;
+
+ if (!r) {
+- if (nr_ioapics > 0) {
++ if (nr_ioapics > 0)
+ printk(KERN_ERR
+ "IO APIC resources couldn't be allocated.\n");
+- return -1;
+- }
+- return 0;
++ return;
+ }
+
+ for (i = 0; i < nr_ioapics; i++) {
+ insert_resource(&iomem_resource, r);
+ r++;
+ }
+-
+- return 0;
+ }
+-
+-/* Insert the IO APIC resources after PCI initialization has occured to handle
+- * IO APICS that are mapped in on a BAR in PCI space. */
+-late_initcall(ioapic_insert_resources);
+--- a/arch/x86/pci/i386.c
++++ b/arch/x86/pci/i386.c
+@@ -35,6 +35,7 @@
+ #include <asm/pat.h>
+ #include <asm/e820.h>
+ #include <asm/pci_x86.h>
++#include <asm/io_apic.h>
+
+
+ static int
+@@ -230,6 +231,12 @@ void __init pcibios_resource_survey(void
+ pcibios_allocate_resources(1);
+
+ e820_reserve_resources_late();
++ /*
++ * Insert the IO APIC resources after PCI initialization has
++ * occured to handle IO APICS that are mapped in on a BAR in
++ * PCI space, but before trying to assign unassigned pci res.
++ */
++ ioapic_insert_resources();
+ }
+
+ /**