From: Greg Kroah-Hartman Date: Thu, 18 Aug 2016 12:44:57 +0000 (+0200) Subject: 4.7-stable patches X-Git-Tag: v3.14.77~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=929e59b2d7d8d0f574980fe37f84d6426d9da08a;p=thirdparty%2Fkernel%2Fstable-queue.git 4.7-stable patches added patches: alsa-hda-add-amd-bonaire-az-pci-id-with-proper-driver-caps.patch alsa-hda-fix-headset-mic-detection-problem-for-two-dell-machines.patch alsa-hda-fix-krealloc-with-__gfp_zero-usage.patch alsa-hda-realtek-can-t-adjust-speaker-s-volume-on-a-dell-aio.patch balloon-check-the-number-of-available-pages-in-leak-balloon.patch block-add-missing-group-association-in-bio-cloning-functions.patch block-fix-bdi-vs-gendisk-lifetime-mismatch.patch floppy-fix-open-o_accmode-for-ioctl-only-open.patch ftrace-recordmcount-work-around-for-addition-of-metag-magic-but-not-relocations.patch ib-core-make-rdma_rw_ctx_init-initialize-all-used-fields.patch ib-core-rdma-rw-api-do-not-exceed-qp-sge-send-limit.patch ib-mlx5-fix-iteration-overrun-in-gsi-qps.patch ib-mlx5-fix-modify_qp-command-input-structure.patch ib-rdmavt-add-missing-spin_lock_init-call-for-rdi-n_cqs_lock.patch ib-rdmavt-disable-by-default.patch ib-srpt-limit-the-number-of-sg-elements-per-work-request.patch metag-fix-__cmpxchg_u32-asm-constraint-for-cmp.patch mm-hugetlb-avoid-soft-lockup-in-set_max_huge_pages.patch mtd-nand-fix-bug-writing-1-byte-less-than-page-size.patch --- diff --git a/queue-4.7/alsa-hda-add-amd-bonaire-az-pci-id-with-proper-driver-caps.patch b/queue-4.7/alsa-hda-add-amd-bonaire-az-pci-id-with-proper-driver-caps.patch new file mode 100644 index 00000000000..5d98489429c --- /dev/null +++ b/queue-4.7/alsa-hda-add-amd-bonaire-az-pci-id-with-proper-driver-caps.patch @@ -0,0 +1,31 @@ +From fd48331f9b71d2add941adaee3619f5b8527182d Mon Sep 17 00:00:00 2001 +From: Maruthi Srinivas Bayyavarapu +Date: Wed, 3 Aug 2016 16:46:39 +0530 +Subject: ALSA: hda: add AMD Bonaire AZ PCI ID with proper driver caps + +From: Maruthi Srinivas Bayyavarapu + +commit fd48331f9b71d2add941adaee3619f5b8527182d upstream. + +This commit fixes garbled audio on Bonaire HDMI + +Signed-off-by: Maruthi Bayyavarapu +Reviewed-by: Alex Deucher +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/hda_intel.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -2265,6 +2265,8 @@ static const struct pci_device_id azx_id + { PCI_DEVICE(0x1022, 0x780d), + .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB }, + /* ATI HDMI */ ++ { PCI_DEVICE(0x1002, 0x0002), ++ .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, + { PCI_DEVICE(0x1002, 0x1308), + .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, + { PCI_DEVICE(0x1002, 0x157a), diff --git a/queue-4.7/alsa-hda-fix-headset-mic-detection-problem-for-two-dell-machines.patch b/queue-4.7/alsa-hda-fix-headset-mic-detection-problem-for-two-dell-machines.patch new file mode 100644 index 00000000000..0608352c261 --- /dev/null +++ b/queue-4.7/alsa-hda-fix-headset-mic-detection-problem-for-two-dell-machines.patch @@ -0,0 +1,46 @@ +From 59ec4b57bcaede46546d54d037a21004b9aa5cef Mon Sep 17 00:00:00 2001 +From: Hui Wang +Date: Thu, 4 Aug 2016 15:28:04 +0800 +Subject: ALSA: hda - Fix headset mic detection problem for two dell machines + +From: Hui Wang + +commit 59ec4b57bcaede46546d54d037a21004b9aa5cef upstream. + +One of the machines has ALC255 on it, another one has ALC298 on it. + +On the machine with the codec ALC298, it also has the speaker volume +problem, so we add the fixup chained to ALC298_FIXUP_SPK_VOLUME rather +than adding a group of pin definition in the pin quirk table, since +the speak volume problem does not happen on other machines yet. + +Signed-off-by: Hui Wang +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_realtek.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -5498,6 +5498,8 @@ static const struct hda_fixup alc269_fix + [ALC298_FIXUP_SPK_VOLUME] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc298_fixup_speaker_volume, ++ .chained = true, ++ .chain_id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, + }, + }; + +@@ -5821,6 +5823,10 @@ static const struct snd_hda_pin_quirk al + {0x1b, 0x01014020}, + {0x21, 0x0221103f}), + SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, ++ {0x14, 0x90170130}, ++ {0x1b, 0x02011020}, ++ {0x21, 0x0221103f}), ++ SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, + {0x14, 0x90170150}, + {0x1b, 0x02011020}, + {0x21, 0x0221105f}), diff --git a/queue-4.7/alsa-hda-fix-krealloc-with-__gfp_zero-usage.patch b/queue-4.7/alsa-hda-fix-krealloc-with-__gfp_zero-usage.patch new file mode 100644 index 00000000000..dd1b80f83e2 --- /dev/null +++ b/queue-4.7/alsa-hda-fix-krealloc-with-__gfp_zero-usage.patch @@ -0,0 +1,40 @@ +From 33baefe5e72f17a6df378e48196cd8cada11deec Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Wed, 3 Aug 2016 15:13:00 +0200 +Subject: ALSA: hda: Fix krealloc() with __GFP_ZERO usage + +From: Takashi Iwai + +commit 33baefe5e72f17a6df378e48196cd8cada11deec upstream. + +krealloc() doesn't work always properly with __GFP_ZERO flag as +expected. For clearing the reallocated area, we need to clear +explicitly instead. + +Reported-by: Joe Perches +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/hda/array.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/sound/hda/array.c ++++ b/sound/hda/array.c +@@ -21,13 +21,15 @@ void *snd_array_new(struct snd_array *ar + return NULL; + if (array->used >= array->alloced) { + int num = array->alloced + array->alloc_align; ++ int oldsize = array->alloced * array->elem_size; + int size = (num + 1) * array->elem_size; + void *nlist; + if (snd_BUG_ON(num >= 4096)) + return NULL; +- nlist = krealloc(array->list, size, GFP_KERNEL | __GFP_ZERO); ++ nlist = krealloc(array->list, size, GFP_KERNEL); + if (!nlist) + return NULL; ++ memset(nlist + oldsize, 0, size - oldsize); + array->list = nlist; + array->alloced = num; + } diff --git a/queue-4.7/alsa-hda-realtek-can-t-adjust-speaker-s-volume-on-a-dell-aio.patch b/queue-4.7/alsa-hda-realtek-can-t-adjust-speaker-s-volume-on-a-dell-aio.patch new file mode 100644 index 00000000000..fa468ec9f48 --- /dev/null +++ b/queue-4.7/alsa-hda-realtek-can-t-adjust-speaker-s-volume-on-a-dell-aio.patch @@ -0,0 +1,74 @@ +From dd9aa335c88003d131ac874e7f6809902de0b847 Mon Sep 17 00:00:00 2001 +From: Hui Wang +Date: Mon, 1 Aug 2016 10:20:32 +0800 +Subject: ALSA: hda/realtek - Can't adjust speaker's volume on a Dell AIO + +From: Hui Wang + +commit dd9aa335c88003d131ac874e7f6809902de0b847 upstream. + +We have a Dell AIO on which we can't adjust its speaker's volume. +The problem is it is connected to a Audio Output node without Amp-out +capability. To fix it, we change it to be connnected to a node with +Amp-out capability. + +Signed-off-by: Hui Wang +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_realtek.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -4674,6 +4674,22 @@ static void alc290_fixup_mono_speakers(s + } + } + ++static void alc298_fixup_speaker_volume(struct hda_codec *codec, ++ const struct hda_fixup *fix, int action) ++{ ++ if (action == HDA_FIXUP_ACT_PRE_PROBE) { ++ /* The speaker is routed to the Node 0x06 by a mistake, as a result ++ we can't adjust the speaker's volume since this node does not has ++ Amp-out capability. we change the speaker's route to: ++ Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 ( ++ Pin Complex), since Node 0x02 has Amp-out caps, we can adjust ++ speaker's volume now. */ ++ ++ hda_nid_t conn1[1] = { 0x0c }; ++ snd_hda_override_conn_list(codec, 0x17, 1, conn1); ++ } ++} ++ + /* Hook to update amp GPIO4 for automute */ + static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, + struct hda_jack_callback *jack) +@@ -4823,6 +4839,7 @@ enum { + ALC280_FIXUP_HP_HEADSET_MIC, + ALC221_FIXUP_HP_FRONT_MIC, + ALC292_FIXUP_TPT460, ++ ALC298_FIXUP_SPK_VOLUME, + }; + + static const struct hda_fixup alc269_fixups[] = { +@@ -5478,6 +5495,10 @@ static const struct hda_fixup alc269_fix + .chained = true, + .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, + }, ++ [ALC298_FIXUP_SPK_VOLUME] = { ++ .type = HDA_FIXUP_FUNC, ++ .v.func = alc298_fixup_speaker_volume, ++ }, + }; + + static const struct snd_pci_quirk alc269_fixup_tbl[] = { +@@ -5524,6 +5545,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), + SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE), + SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), ++ SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), + SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), diff --git a/queue-4.7/balloon-check-the-number-of-available-pages-in-leak-balloon.patch b/queue-4.7/balloon-check-the-number-of-available-pages-in-leak-balloon.patch new file mode 100644 index 00000000000..d5f845d0476 --- /dev/null +++ b/queue-4.7/balloon-check-the-number-of-available-pages-in-leak-balloon.patch @@ -0,0 +1,40 @@ +From 37cf99e08c6fb4dcea0f9ad2b13b6daa8c76a711 Mon Sep 17 00:00:00 2001 +From: Konstantin Neumoin +Date: Mon, 11 Jul 2016 15:28:59 +0300 +Subject: balloon: check the number of available pages in leak balloon + +From: Konstantin Neumoin + +commit 37cf99e08c6fb4dcea0f9ad2b13b6daa8c76a711 upstream. + +The balloon has a special mechanism that is subscribed to the oom +notification which leads to deflation for a fixed number of pages. +The number is always fixed even when the balloon is fully deflated. +But leak_balloon did not expect that the pages to deflate will be more +than taken, and raise a "BUG" in balloon_page_dequeue when page list +will be empty. + +So, the simplest solution would be to check that the number of releases +pages is less or equal to the number taken pages. + +Signed-off-by: Konstantin Neumoin +Signed-off-by: Denis V. Lunev +CC: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/virtio/virtio_balloon.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/virtio/virtio_balloon.c ++++ b/drivers/virtio/virtio_balloon.c +@@ -202,6 +202,8 @@ static unsigned leak_balloon(struct virt + num = min(num, ARRAY_SIZE(vb->pfns)); + + mutex_lock(&vb->balloon_lock); ++ /* We can't release more pages than taken */ ++ num = min(num, (size_t)vb->num_pages); + for (vb->num_pfns = 0; vb->num_pfns < num; + vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { + page = balloon_page_dequeue(vb_dev_info); diff --git a/queue-4.7/block-add-missing-group-association-in-bio-cloning-functions.patch b/queue-4.7/block-add-missing-group-association-in-bio-cloning-functions.patch new file mode 100644 index 00000000000..f76c957cb02 --- /dev/null +++ b/queue-4.7/block-add-missing-group-association-in-bio-cloning-functions.patch @@ -0,0 +1,107 @@ +From 20bd723ec6a3261df5e02250cd3a1fbb09a343f2 Mon Sep 17 00:00:00 2001 +From: Paolo Valente +Date: Wed, 27 Jul 2016 07:22:05 +0200 +Subject: block: add missing group association in bio-cloning functions + +From: Paolo Valente + +commit 20bd723ec6a3261df5e02250cd3a1fbb09a343f2 upstream. + +When a bio is cloned, the newly created bio must be associated with +the same blkcg as the original bio (if BLK_CGROUP is enabled). If +this operation is not performed, then the new bio is not associated +with any group, and the group of the current task is returned when +the group of the bio is requested. + +Depending on the cloning frequency, this may cause a large +percentage of the bios belonging to a given group to be treated +as if belonging to other groups (in most cases as if belonging to +the root group). The expected group isolation may thereby be broken. + +This commit adds the missing association in bio-cloning functions. + +Fixes: da2f0f74cf7d ("Btrfs: add support for blkio controllers") + +Signed-off-by: Paolo Valente +Reviewed-by: Nikolay Borisov +Reviewed-by: Jeff Moyer +Acked-by: Tejun Heo +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + block/bio.c | 15 +++++++++++++++ + fs/btrfs/extent_io.c | 6 ------ + include/linux/bio.h | 3 +++ + 3 files changed, 18 insertions(+), 6 deletions(-) + +--- a/block/bio.c ++++ b/block/bio.c +@@ -579,6 +579,8 @@ void __bio_clone_fast(struct bio *bio, s + bio->bi_rw = bio_src->bi_rw; + bio->bi_iter = bio_src->bi_iter; + bio->bi_io_vec = bio_src->bi_io_vec; ++ ++ bio_clone_blkcg_association(bio, bio_src); + } + EXPORT_SYMBOL(__bio_clone_fast); + +@@ -684,6 +686,8 @@ integrity_clone: + } + } + ++ bio_clone_blkcg_association(bio, bio_src); ++ + return bio; + } + EXPORT_SYMBOL(bio_clone_bioset); +@@ -2005,6 +2009,17 @@ void bio_disassociate_task(struct bio *b + } + } + ++/** ++ * bio_clone_blkcg_association - clone blkcg association from src to dst bio ++ * @dst: destination bio ++ * @src: source bio ++ */ ++void bio_clone_blkcg_association(struct bio *dst, struct bio *src) ++{ ++ if (src->bi_css) ++ WARN_ON(bio_associate_blkcg(dst, src->bi_css)); ++} ++ + #endif /* CONFIG_BLK_CGROUP */ + + static void __init biovec_init_slabs(void) +--- a/fs/btrfs/extent_io.c ++++ b/fs/btrfs/extent_io.c +@@ -2696,12 +2696,6 @@ struct bio *btrfs_bio_clone(struct bio * + btrfs_bio->csum = NULL; + btrfs_bio->csum_allocated = NULL; + btrfs_bio->end_io = NULL; +- +-#ifdef CONFIG_BLK_CGROUP +- /* FIXME, put this into bio_clone_bioset */ +- if (bio->bi_css) +- bio_associate_blkcg(new, bio->bi_css); +-#endif + } + return new; + } +--- a/include/linux/bio.h ++++ b/include/linux/bio.h +@@ -527,11 +527,14 @@ extern unsigned int bvec_nr_vecs(unsigne + int bio_associate_blkcg(struct bio *bio, struct cgroup_subsys_state *blkcg_css); + int bio_associate_current(struct bio *bio); + void bio_disassociate_task(struct bio *bio); ++void bio_clone_blkcg_association(struct bio *dst, struct bio *src); + #else /* CONFIG_BLK_CGROUP */ + static inline int bio_associate_blkcg(struct bio *bio, + struct cgroup_subsys_state *blkcg_css) { return 0; } + static inline int bio_associate_current(struct bio *bio) { return -ENOENT; } + static inline void bio_disassociate_task(struct bio *bio) { } ++static inline void bio_clone_blkcg_association(struct bio *dst, ++ struct bio *src) { } + #endif /* CONFIG_BLK_CGROUP */ + + #ifdef CONFIG_HIGHMEM diff --git a/queue-4.7/block-fix-bdi-vs-gendisk-lifetime-mismatch.patch b/queue-4.7/block-fix-bdi-vs-gendisk-lifetime-mismatch.patch new file mode 100644 index 00000000000..28939cf5573 --- /dev/null +++ b/queue-4.7/block-fix-bdi-vs-gendisk-lifetime-mismatch.patch @@ -0,0 +1,122 @@ +From df08c32ce3be5be138c1dbfcba203314a3a7cd6f Mon Sep 17 00:00:00 2001 +From: Dan Williams +Date: Sun, 31 Jul 2016 11:15:13 -0700 +Subject: block: fix bdi vs gendisk lifetime mismatch + +From: Dan Williams + +commit df08c32ce3be5be138c1dbfcba203314a3a7cd6f upstream. + +The name for a bdi of a gendisk is derived from the gendisk's devt. +However, since the gendisk is destroyed before the bdi it leaves a +window where a new gendisk could dynamically reuse the same devt while a +bdi with the same name is still live. Arrange for the bdi to hold a +reference against its "owner" disk device while it is registered. +Otherwise we can hit sysfs duplicate name collisions like the following: + + WARNING: CPU: 10 PID: 2078 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x64/0x80 + sysfs: cannot create duplicate filename '/devices/virtual/bdi/259:1' + + Hardware name: HP ProLiant DL580 Gen8, BIOS P79 05/06/2015 + 0000000000000286 0000000002c04ad5 ffff88006f24f970 ffffffff8134caec + ffff88006f24f9c0 0000000000000000 ffff88006f24f9b0 ffffffff8108c351 + 0000001f0000000c ffff88105d236000 ffff88105d1031e0 ffff8800357427f8 + Call Trace: + [] dump_stack+0x63/0x87 + [] __warn+0xd1/0xf0 + [] warn_slowpath_fmt+0x5f/0x80 + [] sysfs_warn_dup+0x64/0x80 + [] sysfs_create_dir_ns+0x7e/0x90 + [] kobject_add_internal+0xaa/0x320 + [] ? vsnprintf+0x34e/0x4d0 + [] kobject_add+0x75/0xd0 + [] ? mutex_lock+0x12/0x2f + [] device_add+0x125/0x610 + [] device_create_groups_vargs+0xd8/0x100 + [] device_create_vargs+0x1c/0x20 + [] bdi_register+0x8c/0x180 + [] bdi_register_dev+0x27/0x30 + [] add_disk+0x175/0x4a0 + +Reported-by: Yi Zhang +Tested-by: Yi Zhang +Signed-off-by: Dan Williams +Signed-off-by: Greg Kroah-Hartman + +Fixed up missing 0 return in bdi_register_owner(). + +Signed-off-by: Jens Axboe + +--- + block/genhd.c | 2 +- + include/linux/backing-dev-defs.h | 1 + + include/linux/backing-dev.h | 1 + + mm/backing-dev.c | 19 +++++++++++++++++++ + 4 files changed, 22 insertions(+), 1 deletion(-) + +--- a/block/genhd.c ++++ b/block/genhd.c +@@ -613,7 +613,7 @@ void add_disk(struct gendisk *disk) + + /* Register BDI before referencing it from bdev */ + bdi = &disk->queue->backing_dev_info; +- bdi_register_dev(bdi, disk_devt(disk)); ++ bdi_register_owner(bdi, disk_to_dev(disk)); + + blk_register_region(disk_devt(disk), disk->minors, NULL, + exact_match, exact_lock, disk); +--- a/include/linux/backing-dev-defs.h ++++ b/include/linux/backing-dev-defs.h +@@ -163,6 +163,7 @@ struct backing_dev_info { + wait_queue_head_t wb_waitq; + + struct device *dev; ++ struct device *owner; + + struct timer_list laptop_mode_wb_timer; + +--- a/include/linux/backing-dev.h ++++ b/include/linux/backing-dev.h +@@ -24,6 +24,7 @@ __printf(3, 4) + int bdi_register(struct backing_dev_info *bdi, struct device *parent, + const char *fmt, ...); + int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); ++int bdi_register_owner(struct backing_dev_info *bdi, struct device *owner); + void bdi_unregister(struct backing_dev_info *bdi); + + int __must_check bdi_setup_and_register(struct backing_dev_info *, char *); +--- a/mm/backing-dev.c ++++ b/mm/backing-dev.c +@@ -825,6 +825,20 @@ int bdi_register_dev(struct backing_dev_ + } + EXPORT_SYMBOL(bdi_register_dev); + ++int bdi_register_owner(struct backing_dev_info *bdi, struct device *owner) ++{ ++ int rc; ++ ++ rc = bdi_register(bdi, NULL, "%u:%u", MAJOR(owner->devt), ++ MINOR(owner->devt)); ++ if (rc) ++ return rc; ++ bdi->owner = owner; ++ get_device(owner); ++ return 0; ++} ++EXPORT_SYMBOL(bdi_register_owner); ++ + /* + * Remove bdi from bdi_list, and ensure that it is no longer visible + */ +@@ -849,6 +863,11 @@ void bdi_unregister(struct backing_dev_i + device_unregister(bdi->dev); + bdi->dev = NULL; + } ++ ++ if (bdi->owner) { ++ put_device(bdi->owner); ++ bdi->owner = NULL; ++ } + } + + void bdi_exit(struct backing_dev_info *bdi) diff --git a/queue-4.7/floppy-fix-open-o_accmode-for-ioctl-only-open.patch b/queue-4.7/floppy-fix-open-o_accmode-for-ioctl-only-open.patch new file mode 100644 index 00000000000..25439a1c8f0 --- /dev/null +++ b/queue-4.7/floppy-fix-open-o_accmode-for-ioctl-only-open.patch @@ -0,0 +1,63 @@ +From ff06db1efb2ad6db06eb5b99b88a0c15a9cc9b0e Mon Sep 17 00:00:00 2001 +From: Jiri Kosina +Date: Thu, 16 Jun 2016 09:53:58 +0200 +Subject: floppy: fix open(O_ACCMODE) for ioctl-only open + +From: Jiri Kosina + +commit ff06db1efb2ad6db06eb5b99b88a0c15a9cc9b0e upstream. + +Commit 09954bad4 ("floppy: refactor open() flags handling"), as a +side-effect, causes open(/dev/fdX, O_ACCMODE) to fail. It turns out that +this is being used setfdprm userspace for ioctl-only open(). + +Reintroduce back the original behavior wrt !(FMODE_READ|FMODE_WRITE) +modes, while still keeping the original O_NDELAY bug fixed. + +Reported-by: Wim Osterholt +Tested-by: Wim Osterholt +Signed-off-by: Jiri Kosina +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/floppy.c | 21 +++++++++------------ + 1 file changed, 9 insertions(+), 12 deletions(-) + +--- a/drivers/block/floppy.c ++++ b/drivers/block/floppy.c +@@ -3663,11 +3663,6 @@ static int floppy_open(struct block_devi + + opened_bdev[drive] = bdev; + +- if (!(mode & (FMODE_READ|FMODE_WRITE))) { +- res = -EINVAL; +- goto out; +- } +- + res = -ENXIO; + + if (!floppy_track_buffer) { +@@ -3711,13 +3706,15 @@ static int floppy_open(struct block_devi + if (UFDCS->rawcmd == 1) + UFDCS->rawcmd = 2; + +- UDRS->last_checked = 0; +- clear_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags); +- check_disk_change(bdev); +- if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags)) +- goto out; +- if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags)) +- goto out; ++ if (mode & (FMODE_READ|FMODE_WRITE)) { ++ UDRS->last_checked = 0; ++ clear_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags); ++ check_disk_change(bdev); ++ if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags)) ++ goto out; ++ if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags)) ++ goto out; ++ } + + res = -EROFS; + diff --git a/queue-4.7/ftrace-recordmcount-work-around-for-addition-of-metag-magic-but-not-relocations.patch b/queue-4.7/ftrace-recordmcount-work-around-for-addition-of-metag-magic-but-not-relocations.patch new file mode 100644 index 00000000000..a4f9d9e7ba3 --- /dev/null +++ b/queue-4.7/ftrace-recordmcount-work-around-for-addition-of-metag-magic-but-not-relocations.patch @@ -0,0 +1,61 @@ +From b2e1c26f0b62531636509fbcb6dab65617ed8331 Mon Sep 17 00:00:00 2001 +From: Laura Abbott +Date: Fri, 8 Jul 2016 12:18:50 -0700 +Subject: ftrace/recordmcount: Work around for addition of metag magic but not relocations + +From: Laura Abbott + +commit b2e1c26f0b62531636509fbcb6dab65617ed8331 upstream. + +glibc recently did a sync up (94e73c95d9b5 "elf.h: Sync with the gabi +webpage") that added a #define for EM_METAG but did not add relocations + +This triggers build errors: + +scripts/recordmcount.c: In function 'do_file': +scripts/recordmcount.c:466:28: error: 'R_METAG_ADDR32' undeclared (first use in this function) + case EM_METAG: reltype = R_METAG_ADDR32; + ^~~~~~~~~~~~~~ +scripts/recordmcount.c:466:28: note: each undeclared identifier is reported only once for each function it appears in +scripts/recordmcount.c:468:20: error: 'R_METAG_NONE' undeclared (first use in this function) + rel_type_nop = R_METAG_NONE; + ^~~~~~~~~~~~ + +Work around this change with some more #ifdefery for the relocations. + +Fedora Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1354034 + +Link: http://lkml.kernel.org/r/1468005530-14757-1-git-send-email-labbott@redhat.com + +Cc: James Hogan +Fixes: 00512bdd4573 ("metag: ftrace support") +Reported-by: Ross Burton +Signed-off-by: Laura Abbott +Signed-off-by: Steven Rostedt +Signed-off-by: Greg Kroah-Hartman + +--- + scripts/recordmcount.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/scripts/recordmcount.c ++++ b/scripts/recordmcount.c +@@ -33,10 +33,17 @@ + #include + #include + ++/* ++ * glibc synced up and added the metag number but didn't add the relocations. ++ * Work around this in a crude manner for now. ++ */ + #ifndef EM_METAG +-/* Remove this when these make it to the standard system elf.h. */ + #define EM_METAG 174 ++#endif ++#ifndef R_METAG_ADDR32 + #define R_METAG_ADDR32 2 ++#endif ++#ifndef R_METAG_NONE + #define R_METAG_NONE 3 + #endif + diff --git a/queue-4.7/ib-core-make-rdma_rw_ctx_init-initialize-all-used-fields.patch b/queue-4.7/ib-core-make-rdma_rw_ctx_init-initialize-all-used-fields.patch new file mode 100644 index 00000000000..cd15542e183 --- /dev/null +++ b/queue-4.7/ib-core-make-rdma_rw_ctx_init-initialize-all-used-fields.patch @@ -0,0 +1,92 @@ +From eaa74ec7329a48a4b724d8de440b3a2cbaabf7c8 Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Thu, 21 Jul 2016 13:03:09 -0700 +Subject: IB/core: Make rdma_rw_ctx_init() initialize all used fields + +From: Bart Van Assche + +commit eaa74ec7329a48a4b724d8de440b3a2cbaabf7c8 upstream. + +Some but not all callers of rdma_rw_ctx_init() zero-initialize +struct rdma_rw_ctx. Hence make rdma_rw_ctx_init() initialize all +work request fields that will be read by ib_post_send(). + +Fixes: a060b5629ab0 ("IB/core: generic RDMA READ/WRITE API") +Signed-off-by: Bart Van Assche +Reviewed-by: Sagi Grimberg +Reviewed-by: Christoph Hellwig +Tested-by: Steve Wise +Tested-by: Laurence Oberman +Cc: Parav Pandit +Cc: Nicholas Bellinger +Signed-off-by: Doug Ledford +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/infiniband/core/rw.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +--- a/drivers/infiniband/core/rw.c ++++ b/drivers/infiniband/core/rw.c +@@ -71,6 +71,7 @@ static inline u32 rdma_rw_fr_page_list_l + return min_t(u32, dev->attrs.max_fast_reg_page_list_len, 256); + } + ++/* Caller must have zero-initialized *reg. */ + static int rdma_rw_init_one_mr(struct ib_qp *qp, u8 port_num, + struct rdma_rw_reg_ctx *reg, struct scatterlist *sg, + u32 sg_cnt, u32 offset) +@@ -114,6 +115,7 @@ static int rdma_rw_init_mr_wrs(struct rd + u8 port_num, struct scatterlist *sg, u32 sg_cnt, u32 offset, + u64 remote_addr, u32 rkey, enum dma_data_direction dir) + { ++ struct rdma_rw_reg_ctx *prev = NULL; + u32 pages_per_mr = rdma_rw_fr_page_list_len(qp->pd->device); + int i, j, ret = 0, count = 0; + +@@ -125,7 +127,6 @@ static int rdma_rw_init_mr_wrs(struct rd + } + + for (i = 0; i < ctx->nr_ops; i++) { +- struct rdma_rw_reg_ctx *prev = i ? &ctx->reg[i - 1] : NULL; + struct rdma_rw_reg_ctx *reg = &ctx->reg[i]; + u32 nents = min(sg_cnt, pages_per_mr); + +@@ -162,9 +163,13 @@ static int rdma_rw_init_mr_wrs(struct rd + sg_cnt -= nents; + for (j = 0; j < nents; j++) + sg = sg_next(sg); ++ prev = reg; + offset = 0; + } + ++ if (prev) ++ prev->wr.wr.next = NULL; ++ + ctx->type = RDMA_RW_MR; + return count; + +@@ -205,11 +210,10 @@ static int rdma_rw_init_map_wrs(struct r + rdma_wr->wr.opcode = IB_WR_RDMA_READ; + rdma_wr->remote_addr = remote_addr + total_len; + rdma_wr->rkey = rkey; ++ rdma_wr->wr.num_sge = nr_sge; + rdma_wr->wr.sg_list = sge; + + for (j = 0; j < nr_sge; j++, sg = sg_next(sg)) { +- rdma_wr->wr.num_sge++; +- + sge->addr = ib_sg_dma_address(dev, sg) + offset; + sge->length = ib_sg_dma_len(dev, sg) - offset; + sge->lkey = qp->pd->local_dma_lkey; +@@ -220,8 +224,8 @@ static int rdma_rw_init_map_wrs(struct r + offset = 0; + } + +- if (i + 1 < ctx->nr_ops) +- rdma_wr->wr.next = &ctx->map.wrs[i + 1].wr; ++ rdma_wr->wr.next = i + 1 < ctx->nr_ops ? ++ &ctx->map.wrs[i + 1].wr : NULL; + } + + ctx->type = RDMA_RW_MULTI_WR; diff --git a/queue-4.7/ib-core-rdma-rw-api-do-not-exceed-qp-sge-send-limit.patch b/queue-4.7/ib-core-rdma-rw-api-do-not-exceed-qp-sge-send-limit.patch new file mode 100644 index 00000000000..26a0af25d50 --- /dev/null +++ b/queue-4.7/ib-core-rdma-rw-api-do-not-exceed-qp-sge-send-limit.patch @@ -0,0 +1,95 @@ +From 632bc3f65081dd1e2e5394a9161580a0f78e8839 Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Thu, 21 Jul 2016 13:03:30 -0700 +Subject: IB/core, RDMA RW API: Do not exceed QP SGE send limit + +From: Bart Van Assche + +commit 632bc3f65081dd1e2e5394a9161580a0f78e8839 upstream. + +Compute the SGE limit for RDMA READ and WRITE requests in +ib_create_qp(). Use that limit in the RDMA RW API implementation. + +Signed-off-by: Bart Van Assche +Cc: Christoph Hellwig +Cc: Sagi Grimberg +Cc: Steve Wise +Cc: Parav Pandit +Cc: Nicholas Bellinger +Cc: Laurence Oberman +Reviewed-by: Christoph Hellwig +Signed-off-by: Doug Ledford +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/infiniband/core/rw.c | 10 ++-------- + drivers/infiniband/core/verbs.c | 9 +++++++++ + include/rdma/ib_verbs.h | 6 ++++++ + 3 files changed, 17 insertions(+), 8 deletions(-) + +--- a/drivers/infiniband/core/rw.c ++++ b/drivers/infiniband/core/rw.c +@@ -58,13 +58,6 @@ static inline bool rdma_rw_io_needs_mr(s + return false; + } + +-static inline u32 rdma_rw_max_sge(struct ib_device *dev, +- enum dma_data_direction dir) +-{ +- return dir == DMA_TO_DEVICE ? +- dev->attrs.max_sge : dev->attrs.max_sge_rd; +-} +- + static inline u32 rdma_rw_fr_page_list_len(struct ib_device *dev) + { + /* arbitrary limit to avoid allocating gigantic resources */ +@@ -186,7 +179,8 @@ static int rdma_rw_init_map_wrs(struct r + u64 remote_addr, u32 rkey, enum dma_data_direction dir) + { + struct ib_device *dev = qp->pd->device; +- u32 max_sge = rdma_rw_max_sge(dev, dir); ++ u32 max_sge = dir == DMA_TO_DEVICE ? qp->max_write_sge : ++ qp->max_read_sge; + struct ib_sge *sge; + u32 total_len = 0, i, j; + +--- a/drivers/infiniband/core/verbs.c ++++ b/drivers/infiniband/core/verbs.c +@@ -814,6 +814,15 @@ struct ib_qp *ib_create_qp(struct ib_pd + } + } + ++ /* ++ * Note: all hw drivers guarantee that max_send_sge is lower than ++ * the device RDMA WRITE SGE limit but not all hw drivers ensure that ++ * max_send_sge <= max_sge_rd. ++ */ ++ qp->max_write_sge = qp_init_attr->cap.max_send_sge; ++ qp->max_read_sge = min_t(u32, qp_init_attr->cap.max_send_sge, ++ device->attrs.max_sge_rd); ++ + return qp; + } + EXPORT_SYMBOL(ib_create_qp); +--- a/include/rdma/ib_verbs.h ++++ b/include/rdma/ib_verbs.h +@@ -1428,6 +1428,10 @@ struct ib_srq { + } ext; + }; + ++/* ++ * @max_write_sge: Maximum SGE elements per RDMA WRITE request. ++ * @max_read_sge: Maximum SGE elements per RDMA READ request. ++ */ + struct ib_qp { + struct ib_device *device; + struct ib_pd *pd; +@@ -1449,6 +1453,8 @@ struct ib_qp { + void (*event_handler)(struct ib_event *, void *); + void *qp_context; + u32 qp_num; ++ u32 max_write_sge; ++ u32 max_read_sge; + enum ib_qp_type qp_type; + }; + diff --git a/queue-4.7/ib-mlx5-fix-iteration-overrun-in-gsi-qps.patch b/queue-4.7/ib-mlx5-fix-iteration-overrun-in-gsi-qps.patch new file mode 100644 index 00000000000..ff6214b9e7c --- /dev/null +++ b/queue-4.7/ib-mlx5-fix-iteration-overrun-in-gsi-qps.patch @@ -0,0 +1,73 @@ +From b0ffeb537f3a726931d962ab6d03e34a2f070ea4 Mon Sep 17 00:00:00 2001 +From: Slava Shwartsman +Date: Sun, 3 Jul 2016 15:28:19 +0300 +Subject: IB/mlx5: Fix iteration overrun in GSI qps + +From: Slava Shwartsman + +commit b0ffeb537f3a726931d962ab6d03e34a2f070ea4 upstream. + +Number of outstanding_pi may overflow and as a result may indicate that +there are no elements in the queue. The effect of doing this is that the +MAD layer will get stuck waiting for completions. The MAD layer will +think that the QP is full - because it didn't receive these completions. + +This fix changes it so the outstanding_pi number is increased +with 32-bit wraparound and is not limited to max_send_wr so +that the difference between outstanding_pi and outstanding_ci will +really indicate the number of outstanding completions. + +Fixes: ea6dc2036224 ('IB/mlx5: Reorder GSI completions') +Signed-off-by: Slava Shwartsman +Signed-off-by: Leon Romanovsky +Reviewed-by: Haggai Eran +Reviewed-by: Sagi Grimberg +Signed-off-by: Doug Ledford +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/infiniband/hw/mlx5/gsi.c | 19 ++++++------------- + 1 file changed, 6 insertions(+), 13 deletions(-) + +--- a/drivers/infiniband/hw/mlx5/gsi.c ++++ b/drivers/infiniband/hw/mlx5/gsi.c +@@ -69,15 +69,6 @@ static bool mlx5_ib_deth_sqpn_cap(struct + return MLX5_CAP_GEN(dev->mdev, set_deth_sqpn); + } + +-static u32 next_outstanding(struct mlx5_ib_gsi_qp *gsi, u32 index) +-{ +- return ++index % gsi->cap.max_send_wr; +-} +- +-#define for_each_outstanding_wr(gsi, index) \ +- for (index = gsi->outstanding_ci; index != gsi->outstanding_pi; \ +- index = next_outstanding(gsi, index)) +- + /* Call with gsi->lock locked */ + static void generate_completions(struct mlx5_ib_gsi_qp *gsi) + { +@@ -85,8 +76,9 @@ static void generate_completions(struct + struct mlx5_ib_gsi_wr *wr; + u32 index; + +- for_each_outstanding_wr(gsi, index) { +- wr = &gsi->outstanding_wrs[index]; ++ for (index = gsi->outstanding_ci; index != gsi->outstanding_pi; ++ index++) { ++ wr = &gsi->outstanding_wrs[index % gsi->cap.max_send_wr]; + + if (!wr->completed) + break; +@@ -430,8 +422,9 @@ static int mlx5_ib_add_outstanding_wr(st + return -ENOMEM; + } + +- gsi_wr = &gsi->outstanding_wrs[gsi->outstanding_pi]; +- gsi->outstanding_pi = next_outstanding(gsi, gsi->outstanding_pi); ++ gsi_wr = &gsi->outstanding_wrs[gsi->outstanding_pi % ++ gsi->cap.max_send_wr]; ++ gsi->outstanding_pi++; + + if (!wc) { + memset(&gsi_wr->wc, 0, sizeof(gsi_wr->wc)); diff --git a/queue-4.7/ib-mlx5-fix-modify_qp-command-input-structure.patch b/queue-4.7/ib-mlx5-fix-modify_qp-command-input-structure.patch new file mode 100644 index 00000000000..112373aae3e --- /dev/null +++ b/queue-4.7/ib-mlx5-fix-modify_qp-command-input-structure.patch @@ -0,0 +1,35 @@ +From e3353c268b06236d6c40fa1714c114f21f44451c Mon Sep 17 00:00:00 2001 +From: Artemy Kovalyov +Date: Fri, 17 Jun 2016 15:33:31 +0300 +Subject: IB/mlx5: Fix MODIFY_QP command input structure + +From: Artemy Kovalyov + +commit e3353c268b06236d6c40fa1714c114f21f44451c upstream. + +Make MODIFY_QP command input structure compliant to specification + +Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB adapters') +Signed-off-by: Artemy Kovalyov +Signed-off-by: Leon Romanovsky +Signed-off-by: Doug Ledford +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/mlx5/qp.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/include/linux/mlx5/qp.h ++++ b/include/linux/mlx5/qp.h +@@ -556,9 +556,9 @@ struct mlx5_destroy_qp_mbox_out { + struct mlx5_modify_qp_mbox_in { + struct mlx5_inbox_hdr hdr; + __be32 qpn; +- u8 rsvd1[4]; +- __be32 optparam; + u8 rsvd0[4]; ++ __be32 optparam; ++ u8 rsvd1[4]; + struct mlx5_qp_context ctx; + u8 rsvd2[16]; + }; diff --git a/queue-4.7/ib-rdmavt-add-missing-spin_lock_init-call-for-rdi-n_cqs_lock.patch b/queue-4.7/ib-rdmavt-add-missing-spin_lock_init-call-for-rdi-n_cqs_lock.patch new file mode 100644 index 00000000000..c56fa314fd2 --- /dev/null +++ b/queue-4.7/ib-rdmavt-add-missing-spin_lock_init-call-for-rdi-n_cqs_lock.patch @@ -0,0 +1,83 @@ +From a6580f4310ded039fc9f682cbf027fbba217652b Mon Sep 17 00:00:00 2001 +From: Jianxin Xiong +Date: Mon, 25 Jul 2016 13:39:08 -0700 +Subject: IB/rdmavt: Add missing spin_lock_init call for rdi->n_cqs_lock + +From: Jianxin Xiong + +commit a6580f4310ded039fc9f682cbf027fbba217652b upstream. + +This fixes the following warning with PROV_LOCKING enabled kernel: + +INFO: trying to register non-static key. +the code is fine but needs lockdep annotation. +turning off the locking correctness validator. +CPU: 15 PID: 12286 Comm: modprobe Not tainted 4.7.0-rc5.prove_rcu+ #1 +Hardware name: Intel Corporation S2600WT2R/S2600WT2R, +...... +Call Trace: +[] dump_stack+0x85/0xc8 +[] register_lock_class+0x415/0x4b0 +[] ? __lock_acquire+0x40c/0x1960 +[] __lock_acquire+0x99/0x1960 +[] ? find_vmap_area+0x42/0x60 +[] ? find_vmap_area+0x19/0x60 +[] lock_acquire+0xd3/0x200 +[] ? rvt_create_cq+0xc8/0x250 [rdmavt] +[] _raw_spin_lock+0x31/0x40 +[] ? rvt_create_cq+0xc8/0x250 [rdmavt] +[] rvt_create_cq+0xc8/0x250 [rdmavt] +[] ? static_obj+0x36/0x50 +[] ib_alloc_cq+0x49/0x180 [ib_core] +[] ib_mad_init_device+0x204/0x6d0 [ib_core] +[] ? up_write+0x1f/0x40 +[] ib_register_device+0x3d0/0x510 [ib_core] +[] ? read_cc_setting_bin+0x200/0x200 [hfi1] +[] ? static_obj+0x36/0x50 +[] ? lockdep_init_map+0x88/0x200 +[] rvt_register_device+0x17f/0x320 [rdmavt] +[] hfi1_register_ib_device+0x6ca/0x7c0 [hfi1] +[] init_one+0x2b4/0x430 [hfi1] +[] local_pci_probe+0x45/0xa0 +[] ? pci_match_device+0xe0/0x110 +[] pci_device_probe+0xfc/0x140 +[] driver_probe_device+0x239/0x460 +[] __driver_attach+0xcd/0xf0 +[] ? driver_probe_device+0x460/0x460 +[] bus_for_each_dev+0x73/0xc0 +[] driver_attach+0x1e/0x20 +[] bus_add_driver+0x1d3/0x290 +[] ? dev_init+0x114/0x114 [hfi1] +[] driver_register+0x60/0xe0 +[] ? dev_init+0x114/0x114 [hfi1] +[] __pci_register_driver+0x60/0x70 +[] hfi1_mod_init+0x196/0x1fe [hfi1] +[] do_one_initcall+0x50/0x190 +[] ? rcu_read_lock_sched_held+0x62/0x70 +[] ? kmem_cache_alloc_trace+0x23a/0x2a0 +[] ? do_init_module+0x27/0x1dc +[] do_init_module+0x60/0x1dc +[] load_module+0x132c/0x1ac0 +[] ? __symbol_put+0x60/0x60 +[] ? ima_post_read_file+0x3d/0x80 + +Reviewed-by: Mike Marciniszyn +Signed-off-by: Jianxin Xiong +Signed-off-by: Dennis Dalessandro +Signed-off-by: Doug Ledford +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/infiniband/sw/rdmavt/cq.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/infiniband/sw/rdmavt/cq.c ++++ b/drivers/infiniband/sw/rdmavt/cq.c +@@ -510,6 +510,7 @@ int rvt_driver_cq_init(struct rvt_dev_in + + if (rdi->worker) + return 0; ++ spin_lock_init(&rdi->n_cqs_lock); + rdi->worker = kzalloc(sizeof(*rdi->worker), GFP_KERNEL); + if (!rdi->worker) + return -ENOMEM; diff --git a/queue-4.7/ib-rdmavt-disable-by-default.patch b/queue-4.7/ib-rdmavt-disable-by-default.patch new file mode 100644 index 00000000000..eddb52cf242 --- /dev/null +++ b/queue-4.7/ib-rdmavt-disable-by-default.patch @@ -0,0 +1,34 @@ +From 378fc3201eae07ab0fa7fb4133da141c3072f995 Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Tue, 19 Jul 2016 10:03:17 -0700 +Subject: IB/rdmavt: Disable by default + +From: Bart Van Assche + +commit 378fc3201eae07ab0fa7fb4133da141c3072f995 upstream. + +There is a strict policy in the Linux kernel that new drivers must be +disabled by default. Hence leave out the "default m" line from Kconfig. + +Fixes: 0194621b2253 ("IB/rdmavt: Create module framework and handle driver registration") +Signed-off-by: Bart Van Assche +Cc: Jubin John +Cc: Dennis Dalessandro +Cc: Ira Weiny +Cc: Mike Marciniszyn +Signed-off-by: Doug Ledford +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/infiniband/sw/rdmavt/Kconfig | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/infiniband/sw/rdmavt/Kconfig ++++ b/drivers/infiniband/sw/rdmavt/Kconfig +@@ -1,6 +1,5 @@ + config INFINIBAND_RDMAVT + tristate "RDMA verbs transport library" + depends on 64BIT +- default m + ---help--- + This is a common software verbs provider for RDMA networks. diff --git a/queue-4.7/ib-srpt-limit-the-number-of-sg-elements-per-work-request.patch b/queue-4.7/ib-srpt-limit-the-number-of-sg-elements-per-work-request.patch new file mode 100644 index 00000000000..4d6feb9622e --- /dev/null +++ b/queue-4.7/ib-srpt-limit-the-number-of-sg-elements-per-work-request.patch @@ -0,0 +1,64 @@ +From 30c6d8773de06878f920666d8c945f81cb2081b3 Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Thu, 21 Jul 2016 13:03:47 -0700 +Subject: IB/srpt: Limit the number of SG elements per work request + +From: Bart Van Assche + +commit 30c6d8773de06878f920666d8c945f81cb2081b3 upstream. + +Limit the number of SG elements per work request to what the HCA +and the queue pair support. + +Fixes: 34693573fde0 ("IB/srpt: Reduce QP buffer size") +Reported-by: Parav Pandit +Signed-off-by: Bart Van Assche +Cc: Christoph Hellwig +Cc: Sagi Grimberg +Cc: Steve Wise +Cc: Parav Pandit +Cc: Nicholas Bellinger +Cc: Laurence Oberman +Reviewed-by: Christoph Hellwig +Signed-off-by: Doug Ledford +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/infiniband/ulp/srpt/ib_srpt.c | 3 ++- + drivers/infiniband/ulp/srpt/ib_srpt.h | 6 +++++- + 2 files changed, 7 insertions(+), 2 deletions(-) + +--- a/drivers/infiniband/ulp/srpt/ib_srpt.c ++++ b/drivers/infiniband/ulp/srpt/ib_srpt.c +@@ -1601,6 +1601,7 @@ static int srpt_create_ch_ib(struct srpt + struct ib_qp_init_attr *qp_init; + struct srpt_port *sport = ch->sport; + struct srpt_device *sdev = sport->sdev; ++ const struct ib_device_attr *attrs = &sdev->device->attrs; + u32 srp_sq_size = sport->port_attrib.srp_sq_size; + int ret; + +@@ -1638,7 +1639,7 @@ retry: + */ + qp_init->cap.max_send_wr = srp_sq_size / 2; + qp_init->cap.max_rdma_ctxs = srp_sq_size / 2; +- qp_init->cap.max_send_sge = SRPT_DEF_SG_PER_WQE; ++ qp_init->cap.max_send_sge = min(attrs->max_sge, SRPT_MAX_SG_PER_WQE); + qp_init->port_num = ch->sport->port; + + ch->qp = ib_create_qp(sdev->pd, qp_init); +--- a/drivers/infiniband/ulp/srpt/ib_srpt.h ++++ b/drivers/infiniband/ulp/srpt/ib_srpt.h +@@ -106,7 +106,11 @@ enum { + SRP_LOGIN_RSP_MULTICHAN_MAINTAINED = 0x2, + + SRPT_DEF_SG_TABLESIZE = 128, +- SRPT_DEF_SG_PER_WQE = 16, ++ /* ++ * An experimentally determined value that avoids that QP creation ++ * fails due to "swiotlb buffer is full" on systems using the swiotlb. ++ */ ++ SRPT_MAX_SG_PER_WQE = 16, + + MIN_SRPT_SQ_SIZE = 16, + DEF_SRPT_SQ_SIZE = 4096, diff --git a/queue-4.7/metag-fix-__cmpxchg_u32-asm-constraint-for-cmp.patch b/queue-4.7/metag-fix-__cmpxchg_u32-asm-constraint-for-cmp.patch new file mode 100644 index 00000000000..c470ecfa5df --- /dev/null +++ b/queue-4.7/metag-fix-__cmpxchg_u32-asm-constraint-for-cmp.patch @@ -0,0 +1,48 @@ +From 6154c187b97ee7513046bb4eb317a89f738f13ef Mon Sep 17 00:00:00 2001 +From: James Hogan +Date: Thu, 4 Aug 2016 17:36:08 +0100 +Subject: metag: Fix __cmpxchg_u32 asm constraint for CMP + +From: James Hogan + +commit 6154c187b97ee7513046bb4eb317a89f738f13ef upstream. + +The LNKGET based atomic sequence in __cmpxchg_u32 has slightly incorrect +constraints for the return value which under certain circumstances can +allow an address unit register to be used as the first operand of a CMP +instruction. This isn't a valid instruction however as the encodings +only allow a data unit to be specified. This would result in an +assembler error like the following: + + Error: failed to assemble instruction: "CMP A0.2,D0Ar6" + +Fix by changing the constraint from "=&da" (assigned, early clobbered, +data or address unit register) to "=&d" (data unit register only). + +The constraint for the second operand, "bd" (an op2 register where op1 +is a data unit register and the instruction supports O2R) is already +correct assuming the first operand is a data unit register. + +Other cases of CMP in inline asm have had their constraints checked, and +appear to all be fine. + +Fixes: 6006c0d8ce94 ("metag: Atomics, locks and bitops") +Signed-off-by: James Hogan +Cc: linux-metag@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + arch/metag/include/asm/cmpxchg_lnkget.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/metag/include/asm/cmpxchg_lnkget.h ++++ b/arch/metag/include/asm/cmpxchg_lnkget.h +@@ -73,7 +73,7 @@ static inline unsigned long __cmpxchg_u3 + " DCACHE [%2], %0\n" + #endif + "2:\n" +- : "=&d" (temp), "=&da" (retval) ++ : "=&d" (temp), "=&d" (retval) + : "da" (m), "bd" (old), "da" (new) + : "cc" + ); diff --git a/queue-4.7/mm-hugetlb-avoid-soft-lockup-in-set_max_huge_pages.patch b/queue-4.7/mm-hugetlb-avoid-soft-lockup-in-set_max_huge_pages.patch new file mode 100644 index 00000000000..11f23230f50 --- /dev/null +++ b/queue-4.7/mm-hugetlb-avoid-soft-lockup-in-set_max_huge_pages.patch @@ -0,0 +1,56 @@ +From 649920c6ab93429b94bc7c1aa7c0e8395351be32 Mon Sep 17 00:00:00 2001 +From: Jia He +Date: Tue, 2 Aug 2016 14:02:31 -0700 +Subject: mm/hugetlb: avoid soft lockup in set_max_huge_pages() + +From: Jia He + +commit 649920c6ab93429b94bc7c1aa7c0e8395351be32 upstream. + +In powerpc servers with large memory(32TB), we watched several soft +lockups for hugepage under stress tests. + +The call traces are as follows: +1. +get_page_from_freelist+0x2d8/0xd50 +__alloc_pages_nodemask+0x180/0xc20 +alloc_fresh_huge_page+0xb0/0x190 +set_max_huge_pages+0x164/0x3b0 + +2. +prep_new_huge_page+0x5c/0x100 +alloc_fresh_huge_page+0xc8/0x190 +set_max_huge_pages+0x164/0x3b0 + +This patch fixes such soft lockups. It is safe to call cond_resched() +there because it is out of spin_lock/unlock section. + +Link: http://lkml.kernel.org/r/1469674442-14848-1-git-send-email-hejianet@gmail.com +Signed-off-by: Jia He +Reviewed-by: Naoya Horiguchi +Acked-by: Michal Hocko +Acked-by: Dave Hansen +Cc: Mike Kravetz +Cc: "Kirill A. Shutemov" +Cc: Paul Gortmaker +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/hugetlb.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/mm/hugetlb.c ++++ b/mm/hugetlb.c +@@ -2214,6 +2214,10 @@ static unsigned long set_max_huge_pages( + * and reducing the surplus. + */ + spin_unlock(&hugetlb_lock); ++ ++ /* yield cpu to avoid soft lockup */ ++ cond_resched(); ++ + if (hstate_is_gigantic(h)) + ret = alloc_fresh_gigantic_page(h, nodes_allowed); + else diff --git a/queue-4.7/mtd-nand-fix-bug-writing-1-byte-less-than-page-size.patch b/queue-4.7/mtd-nand-fix-bug-writing-1-byte-less-than-page-size.patch new file mode 100644 index 00000000000..cf51b7960b3 --- /dev/null +++ b/queue-4.7/mtd-nand-fix-bug-writing-1-byte-less-than-page-size.patch @@ -0,0 +1,53 @@ +From 144f4c98399e2c0ca60eb414c15a2c68125c18b8 Mon Sep 17 00:00:00 2001 +From: Hector Palacios +Date: Mon, 18 Jul 2016 10:39:18 +0200 +Subject: mtd: nand: fix bug writing 1 byte less than page size + +From: Hector Palacios + +commit 144f4c98399e2c0ca60eb414c15a2c68125c18b8 upstream. + +nand_do_write_ops() determines if it is writing a partial page with the +formula: + part_pagewr = (column || writelen < (mtd->writesize - 1)) + +When 'writelen' is exactly 1 byte less than the NAND page size the formula +equates to zero, so the code doesn't process it as a partial write, +although it should. +As a consequence the function remains in the while(1) loop with 'writelen' +becoming 0xffffffff and iterating endlessly. + +The bug may not be easy to reproduce in Linux since user space tools +usually force the padding or round-up the write size to a page-size +multiple. +This was discovered in U-Boot where the issue can be reproduced by +writing any size that is 1 byte less than a page-size multiple. +For example, on a NAND with 2K page (0x800): + => nand erase.part + => nand write $loadaddr 7ff + +[Editor's note: the bug was added in commit 29072b96078f, but moved +around in commit 66507c7bc8895 ("mtd: nand: Add support to use nand_base +poi databuf as bounce buffer")] + +Fixes: 29072b96078f ("[MTD] NAND: add subpage write support") +Signed-off-by: Hector Palacios +Acked-by: Boris Brezillon +Signed-off-by: Brian Norris +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mtd/nand/nand_base.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mtd/nand/nand_base.c ++++ b/drivers/mtd/nand/nand_base.c +@@ -2610,7 +2610,7 @@ static int nand_do_write_ops(struct mtd_ + int cached = writelen > bytes && page != blockmask; + uint8_t *wbuf = buf; + int use_bufpoi; +- int part_pagewr = (column || writelen < (mtd->writesize - 1)); ++ int part_pagewr = (column || writelen < mtd->writesize); + + if (part_pagewr) + use_bufpoi = 1; diff --git a/queue-4.7/series b/queue-4.7/series index 9898f77f835..ee5fff261a0 100644 --- a/queue-4.7/series +++ b/queue-4.7/series @@ -138,3 +138,22 @@ drm-aux-transfer-can-return-0-deal-with-it.patch drm-edid-add-6-bpc-quirk-for-display-aeo-model-0.patch drm-i915-never-fully-mask-the-the-ei-up-rps-interrupt-on-snb-ivb.patch drm-i915-dp-revert-drm-i915-dp-fall-back-to-18-bpp-when-sink-capability-is-unknown.patch +balloon-check-the-number-of-available-pages-in-leak-balloon.patch +ftrace-recordmcount-work-around-for-addition-of-metag-magic-but-not-relocations.patch +metag-fix-__cmpxchg_u32-asm-constraint-for-cmp.patch +block-add-missing-group-association-in-bio-cloning-functions.patch +block-fix-bdi-vs-gendisk-lifetime-mismatch.patch +floppy-fix-open-o_accmode-for-ioctl-only-open.patch +mtd-nand-fix-bug-writing-1-byte-less-than-page-size.patch +mm-hugetlb-avoid-soft-lockup-in-set_max_huge_pages.patch +alsa-hda-fix-krealloc-with-__gfp_zero-usage.patch +alsa-hda-realtek-can-t-adjust-speaker-s-volume-on-a-dell-aio.patch +alsa-hda-add-amd-bonaire-az-pci-id-with-proper-driver-caps.patch +alsa-hda-fix-headset-mic-detection-problem-for-two-dell-machines.patch +ib-mlx5-fix-iteration-overrun-in-gsi-qps.patch +ib-mlx5-fix-modify_qp-command-input-structure.patch +ib-rdmavt-disable-by-default.patch +ib-rdmavt-add-missing-spin_lock_init-call-for-rdi-n_cqs_lock.patch +ib-srpt-limit-the-number-of-sg-elements-per-work-request.patch +ib-core-make-rdma_rw_ctx_init-initialize-all-used-fields.patch +ib-core-rdma-rw-api-do-not-exceed-qp-sge-send-limit.patch