From: Greg Kroah-Hartman Date: Thu, 20 Feb 2014 23:10:39 +0000 (-0800) Subject: 3.4-stable patches X-Git-Tag: v3.4.82~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1aa09ace862ae6569ff85519917dbc649faced4b;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: block-add-cond_resched-to-potentially-long-running-ioctl-discard-loop.patch genirq-add-missing-irq_to_desc-export-for-config_sparse_irq-n.patch ib-qib-add-missing-serdes-init-sequence.patch kvm-return-an-error-code-in-kvm_vm_ioctl_register_coalesced_mmio.patch md-raid5-fix-cpu-hotplug-callback-registration.patch modpost-fixed-usb-alias-generation-for-ranges-including-0x9-and-0xa.patch power-max17040-fix-null-pointer-dereference-when-there-is-no-platform_data.patch ring-buffer-fix-first-commit-on-sub-buffer-having-non-zero-delta.patch time-fix-overflow-when-hz-is-smaller-than-60.patch usb-ftdi_sio-add-mindstorms-ev3-console-adapter.patch usb-ftdi_sio-add-tagsys-rfid-reader-ids.patch usb-option-blacklist-zte-mf667-net-interface.patch usb-storage-add-unusual-devs-entry-for-blackberry-9000.patch usb-storage-enable-multi-lun-scanning-when-needed.patch usb-storage-restrict-bcddevice-range-for-super-top-in-cypress-atacb.patch --- diff --git a/queue-3.4/block-add-cond_resched-to-potentially-long-running-ioctl-discard-loop.patch b/queue-3.4/block-add-cond_resched-to-potentially-long-running-ioctl-discard-loop.patch new file mode 100644 index 00000000000..576bfec1a9b --- /dev/null +++ b/queue-3.4/block-add-cond_resched-to-potentially-long-running-ioctl-discard-loop.patch @@ -0,0 +1,42 @@ +From c8123f8c9cb517403b51aa41c3c46ff5e10b2c17 Mon Sep 17 00:00:00 2001 +From: Jens Axboe +Date: Wed, 12 Feb 2014 09:34:01 -0700 +Subject: block: add cond_resched() to potentially long running ioctl discard loop + +From: Jens Axboe + +commit c8123f8c9cb517403b51aa41c3c46ff5e10b2c17 upstream. + +When mkfs issues a full device discard and the device only +supports discards of a smallish size, we can loop in +blkdev_issue_discard() for a long time. If preempt isn't enabled, +this can turn into a softlock situation and the kernel will +start complaining. + +Add an explicit cond_resched() at the end of the loop to avoid +that. + +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + block/blk-lib.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/block/blk-lib.c ++++ b/block/blk-lib.c +@@ -101,6 +101,14 @@ int blkdev_issue_discard(struct block_de + + atomic_inc(&bb.done); + submit_bio(type, bio); ++ ++ /* ++ * We can loop for a long time in here, if someone does ++ * full device discards (like mkfs). Be nice and allow ++ * us to schedule out to avoid softlocking if preempt ++ * is disabled. ++ */ ++ cond_resched(); + } + + /* Wait for bios in-flight */ diff --git a/queue-3.4/genirq-add-missing-irq_to_desc-export-for-config_sparse_irq-n.patch b/queue-3.4/genirq-add-missing-irq_to_desc-export-for-config_sparse_irq-n.patch new file mode 100644 index 00000000000..85dbc311a5e --- /dev/null +++ b/queue-3.4/genirq-add-missing-irq_to_desc-export-for-config_sparse_irq-n.patch @@ -0,0 +1,42 @@ +From 2c45aada341121438affc4cb8d5b4cfaa2813d3d Mon Sep 17 00:00:00 2001 +From: Paul Gortmaker +Date: Mon, 10 Feb 2014 13:39:53 -0500 +Subject: genirq: Add missing irq_to_desc export for CONFIG_SPARSE_IRQ=n + +From: Paul Gortmaker + +commit 2c45aada341121438affc4cb8d5b4cfaa2813d3d upstream. + +In allmodconfig builds for sparc and any other arch which does +not set CONFIG_SPARSE_IRQ, the following will be seen at modpost: + + CC [M] lib/cpu-notifier-error-inject.o + CC [M] lib/pm-notifier-error-inject.o +ERROR: "irq_to_desc" [drivers/gpio/gpio-mcp23s08.ko] undefined! +make[2]: *** [__modpost] Error 1 + +This happens because commit 3911ff30f5 ("genirq: export +handle_edge_irq() and irq_to_desc()") added one export for it, but +there were actually two instances of it, in an if/else clause for +CONFIG_SPARSE_IRQ. Add the second one. + +Signed-off-by: Paul Gortmaker +Cc: Jiri Kosina +Link: http://lkml.kernel.org/r/1392057610-11514-1-git-send-email-paul.gortmaker@windriver.com +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/irq/irqdesc.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/kernel/irq/irqdesc.c ++++ b/kernel/irq/irqdesc.c +@@ -274,6 +274,7 @@ struct irq_desc *irq_to_desc(unsigned in + { + return (irq < NR_IRQS) ? irq_desc + irq : NULL; + } ++EXPORT_SYMBOL(irq_to_desc); + + static void free_desc(unsigned int irq) + { diff --git a/queue-3.4/ib-qib-add-missing-serdes-init-sequence.patch b/queue-3.4/ib-qib-add-missing-serdes-init-sequence.patch new file mode 100644 index 00000000000..5844b8590f6 --- /dev/null +++ b/queue-3.4/ib-qib-add-missing-serdes-init-sequence.patch @@ -0,0 +1,38 @@ +From 2f75e12c4457a9b3d042c0a0d748fa198dc2ffaf Mon Sep 17 00:00:00 2001 +From: Mike Marciniszyn +Date: Wed, 12 Feb 2014 11:54:15 -0500 +Subject: IB/qib: Add missing serdes init sequence + +From: Mike Marciniszyn + +commit 2f75e12c4457a9b3d042c0a0d748fa198dc2ffaf upstream. + +Research has shown that commit a77fcf895046 ("IB/qib: Use a single +txselect module parameter for serdes tuning") missed a key serdes init +sequence. + +This patch add that sequence. + +Reviewed-by: Dennis Dalessandro +Signed-off-by: Mike Marciniszyn +Signed-off-by: Roland Dreier +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/infiniband/hw/qib/qib_iba7322.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/infiniband/hw/qib/qib_iba7322.c ++++ b/drivers/infiniband/hw/qib/qib_iba7322.c +@@ -2279,6 +2279,11 @@ static int qib_7322_bringup_serdes(struc + qib_write_kreg_port(ppd, krp_ibcctrl_a, ppd->cpspec->ibcctrl_a); + qib_write_kreg(dd, kr_scratch, 0ULL); + ++ /* ensure previous Tx parameters are not still forced */ ++ qib_write_kreg_port(ppd, krp_tx_deemph_override, ++ SYM_MASK(IBSD_TX_DEEMPHASIS_OVERRIDE_0, ++ reset_tx_deemphasis_override)); ++ + if (qib_compat_ddr_negotiate) { + ppd->cpspec->ibdeltainprog = 1; + ppd->cpspec->ibsymsnap = read_7322_creg32_port(ppd, diff --git a/queue-3.4/kvm-return-an-error-code-in-kvm_vm_ioctl_register_coalesced_mmio.patch b/queue-3.4/kvm-return-an-error-code-in-kvm_vm_ioctl_register_coalesced_mmio.patch new file mode 100644 index 00000000000..068e4813463 --- /dev/null +++ b/queue-3.4/kvm-return-an-error-code-in-kvm_vm_ioctl_register_coalesced_mmio.patch @@ -0,0 +1,45 @@ +From aac5c4226e7136c331ed384c25d5560204da10a0 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Wed, 29 Jan 2014 16:16:39 +0300 +Subject: KVM: return an error code in kvm_vm_ioctl_register_coalesced_mmio() + +From: Dan Carpenter + +commit aac5c4226e7136c331ed384c25d5560204da10a0 upstream. + +If kvm_io_bus_register_dev() fails then it returns success but it should +return an error code. + +I also did a little cleanup like removing an impossible NULL test. + +Fixes: 2b3c246a682c ('KVM: Make coalesced mmio use a device per zone') +Signed-off-by: Dan Carpenter +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman + +--- + virt/kvm/coalesced_mmio.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +--- a/virt/kvm/coalesced_mmio.c ++++ b/virt/kvm/coalesced_mmio.c +@@ -154,17 +154,13 @@ int kvm_vm_ioctl_register_coalesced_mmio + list_add_tail(&dev->list, &kvm->coalesced_zones); + mutex_unlock(&kvm->slots_lock); + +- return ret; ++ return 0; + + out_free_dev: + mutex_unlock(&kvm->slots_lock); +- + kfree(dev); + +- if (dev == NULL) +- return -ENXIO; +- +- return 0; ++ return ret; + } + + int kvm_vm_ioctl_unregister_coalesced_mmio(struct kvm *kvm, diff --git a/queue-3.4/md-raid5-fix-cpu-hotplug-callback-registration.patch b/queue-3.4/md-raid5-fix-cpu-hotplug-callback-registration.patch new file mode 100644 index 00000000000..1ad3e1b7f89 --- /dev/null +++ b/queue-3.4/md-raid5-fix-cpu-hotplug-callback-registration.patch @@ -0,0 +1,196 @@ +From 789b5e0315284463617e106baad360cb9e8db3ac Mon Sep 17 00:00:00 2001 +From: Oleg Nesterov +Date: Thu, 6 Feb 2014 03:42:45 +0530 +Subject: md/raid5: Fix CPU hotplug callback registration + +From: Oleg Nesterov + +commit 789b5e0315284463617e106baad360cb9e8db3ac upstream. + +Subsystems that want to register CPU hotplug callbacks, as well as perform +initialization for the CPUs that are already online, often do it as shown +below: + + get_online_cpus(); + + for_each_online_cpu(cpu) + init_cpu(cpu); + + register_cpu_notifier(&foobar_cpu_notifier); + + put_online_cpus(); + +This is wrong, since it is prone to ABBA deadlocks involving the +cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently +with CPU hotplug operations). + +Interestingly, the raid5 code can actually prevent double initialization and +hence can use the following simplified form of callback registration: + + register_cpu_notifier(&foobar_cpu_notifier); + + get_online_cpus(); + + for_each_online_cpu(cpu) + init_cpu(cpu); + + put_online_cpus(); + +A hotplug operation that occurs between registering the notifier and calling +get_online_cpus(), won't disrupt anything, because the code takes care to +perform the memory allocations only once. + +So reorganize the code in raid5 this way to fix the deadlock with callback +registration. + +Cc: linux-raid@vger.kernel.org +Fixes: 36d1c6476be51101778882897b315bd928c8c7b5 +Signed-off-by: Oleg Nesterov +[Srivatsa: Fixed the unregister_cpu_notifier() deadlock, added the +free_scratch_buffer() helper to condense code further and wrote the changelog.] +Signed-off-by: Srivatsa S. Bhat +Signed-off-by: NeilBrown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/raid5.c | 90 +++++++++++++++++++++++++---------------------------- + 1 file changed, 44 insertions(+), 46 deletions(-) + +--- a/drivers/md/raid5.c ++++ b/drivers/md/raid5.c +@@ -4678,23 +4678,43 @@ raid5_size(struct mddev *mddev, sector_t + return sectors * (raid_disks - conf->max_degraded); + } + ++static void free_scratch_buffer(struct r5conf *conf, struct raid5_percpu *percpu) ++{ ++ safe_put_page(percpu->spare_page); ++ kfree(percpu->scribble); ++ percpu->spare_page = NULL; ++ percpu->scribble = NULL; ++} ++ ++static int alloc_scratch_buffer(struct r5conf *conf, struct raid5_percpu *percpu) ++{ ++ if (conf->level == 6 && !percpu->spare_page) ++ percpu->spare_page = alloc_page(GFP_KERNEL); ++ if (!percpu->scribble) ++ percpu->scribble = kmalloc(conf->scribble_len, GFP_KERNEL); ++ ++ if (!percpu->scribble || (conf->level == 6 && !percpu->spare_page)) { ++ free_scratch_buffer(conf, percpu); ++ return -ENOMEM; ++ } ++ ++ return 0; ++} ++ + static void raid5_free_percpu(struct r5conf *conf) + { +- struct raid5_percpu *percpu; + unsigned long cpu; + + if (!conf->percpu) + return; + +- get_online_cpus(); +- for_each_possible_cpu(cpu) { +- percpu = per_cpu_ptr(conf->percpu, cpu); +- safe_put_page(percpu->spare_page); +- kfree(percpu->scribble); +- } + #ifdef CONFIG_HOTPLUG_CPU + unregister_cpu_notifier(&conf->cpu_notify); + #endif ++ ++ get_online_cpus(); ++ for_each_possible_cpu(cpu) ++ free_scratch_buffer(conf, per_cpu_ptr(conf->percpu, cpu)); + put_online_cpus(); + + free_percpu(conf->percpu); +@@ -4720,15 +4740,7 @@ static int raid456_cpu_notify(struct not + switch (action) { + case CPU_UP_PREPARE: + case CPU_UP_PREPARE_FROZEN: +- if (conf->level == 6 && !percpu->spare_page) +- percpu->spare_page = alloc_page(GFP_KERNEL); +- if (!percpu->scribble) +- percpu->scribble = kmalloc(conf->scribble_len, GFP_KERNEL); +- +- if (!percpu->scribble || +- (conf->level == 6 && !percpu->spare_page)) { +- safe_put_page(percpu->spare_page); +- kfree(percpu->scribble); ++ if (alloc_scratch_buffer(conf, percpu)) { + pr_err("%s: failed memory allocation for cpu%ld\n", + __func__, cpu); + return notifier_from_errno(-ENOMEM); +@@ -4736,10 +4748,7 @@ static int raid456_cpu_notify(struct not + break; + case CPU_DEAD: + case CPU_DEAD_FROZEN: +- safe_put_page(percpu->spare_page); +- kfree(percpu->scribble); +- percpu->spare_page = NULL; +- percpu->scribble = NULL; ++ free_scratch_buffer(conf, per_cpu_ptr(conf->percpu, cpu)); + break; + default: + break; +@@ -4751,40 +4760,29 @@ static int raid456_cpu_notify(struct not + static int raid5_alloc_percpu(struct r5conf *conf) + { + unsigned long cpu; +- struct page *spare_page; +- struct raid5_percpu __percpu *allcpus; +- void *scribble; +- int err; ++ int err = 0; + +- allcpus = alloc_percpu(struct raid5_percpu); +- if (!allcpus) ++ conf->percpu = alloc_percpu(struct raid5_percpu); ++ if (!conf->percpu) + return -ENOMEM; +- conf->percpu = allcpus; ++ ++#ifdef CONFIG_HOTPLUG_CPU ++ conf->cpu_notify.notifier_call = raid456_cpu_notify; ++ conf->cpu_notify.priority = 0; ++ err = register_cpu_notifier(&conf->cpu_notify); ++ if (err) ++ return err; ++#endif + + get_online_cpus(); +- err = 0; + for_each_present_cpu(cpu) { +- if (conf->level == 6) { +- spare_page = alloc_page(GFP_KERNEL); +- if (!spare_page) { +- err = -ENOMEM; +- break; +- } +- per_cpu_ptr(conf->percpu, cpu)->spare_page = spare_page; +- } +- scribble = kmalloc(conf->scribble_len, GFP_KERNEL); +- if (!scribble) { +- err = -ENOMEM; ++ err = alloc_scratch_buffer(conf, per_cpu_ptr(conf->percpu, cpu)); ++ if (err) { ++ pr_err("%s: failed memory allocation for cpu%ld\n", ++ __func__, cpu); + break; + } +- per_cpu_ptr(conf->percpu, cpu)->scribble = scribble; + } +-#ifdef CONFIG_HOTPLUG_CPU +- conf->cpu_notify.notifier_call = raid456_cpu_notify; +- conf->cpu_notify.priority = 0; +- if (err == 0) +- err = register_cpu_notifier(&conf->cpu_notify); +-#endif + put_online_cpus(); + + return err; diff --git a/queue-3.4/modpost-fixed-usb-alias-generation-for-ranges-including-0x9-and-0xa.patch b/queue-3.4/modpost-fixed-usb-alias-generation-for-ranges-including-0x9-and-0xa.patch new file mode 100644 index 00000000000..5c5a7ade5e1 --- /dev/null +++ b/queue-3.4/modpost-fixed-usb-alias-generation-for-ranges-including-0x9-and-0xa.patch @@ -0,0 +1,47 @@ +From 03b56329f9bb5a1cb73d7dc659d529a9a9bf3acc Mon Sep 17 00:00:00 2001 +From: Jan Moskyto Matejka +Date: Fri, 7 Feb 2014 19:15:11 +0100 +Subject: Modpost: fixed USB alias generation for ranges including 0x9 and 0xA + +From: Jan Moskyto Matejka + +commit 03b56329f9bb5a1cb73d7dc659d529a9a9bf3acc upstream. + +Commit afe2dab4f6 ("USB: add hex/bcd detection to usb modalias generation") +changed the routine that generates alias ranges. Before that change, only +digits 0-9 were supported; the commit tried to fix the case when the range +includes higher values than 0x9. + +Unfortunately, the commit didn't fix the case when the range includes both +0x9 and 0xA, meaning that the final range must look like [x-9A-y] where +x <= 0x9 and y >= 0xA -- instead the [x-9A-x] range was produced. + +Modprobe doesn't complain as it sees no difference between no-match and +bad-pattern results of fnmatch(). + +Fixing this simple bug to fix the aliases. +Also changing the hardcoded beginning of the range to uppercase as all the +other letters are also uppercase in the device version numbers. + +Fortunately, this affects only the dvb-usb-dib0700 module, AFAIK. + +Signed-off-by: Jan Moskyto Matejka +Signed-off-by: Greg Kroah-Hartman + +--- + scripts/mod/file2alias.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/scripts/mod/file2alias.c ++++ b/scripts/mod/file2alias.c +@@ -186,8 +186,8 @@ static void do_usb_entry(struct usb_devi + range_lo < 0x9 ? "[%X-9" : "[%X", + range_lo); + sprintf(alias + strlen(alias), +- range_hi > 0xA ? "a-%X]" : "%X]", +- range_lo); ++ range_hi > 0xA ? "A-%X]" : "%X]", ++ range_hi); + } + } + if (bcdDevice_initial_digits < (sizeof(id->bcdDevice_lo) * 2 - 1)) diff --git a/queue-3.4/power-max17040-fix-null-pointer-dereference-when-there-is-no-platform_data.patch b/queue-3.4/power-max17040-fix-null-pointer-dereference-when-there-is-no-platform_data.patch new file mode 100644 index 00000000000..7309f548a0a --- /dev/null +++ b/queue-3.4/power-max17040-fix-null-pointer-dereference-when-there-is-no-platform_data.patch @@ -0,0 +1,87 @@ +From ac323d8d807060f7c95a685a9fe861e7b6300993 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Thu, 30 Jan 2014 14:32:45 +0100 +Subject: power: max17040: Fix NULL pointer dereference when there is no platform_data + +From: Krzysztof Kozlowski + +commit ac323d8d807060f7c95a685a9fe861e7b6300993 upstream. + +Fix NULL pointer dereference of "chip->pdata" if platform_data was not +supplied to the driver. + +The driver during probe stored the pointer to the platform_data: + chip->pdata = client->dev.platform_data; +Later it was dereferenced in max17040_get_online() and +max17040_get_status(). + +If platform_data was not supplied, the NULL pointer exception would +happen: + +[ 6.626094] Unable to handle kernel of a at virtual address 00000000 +[ 6.628557] pgd = c0004000 +[ 6.632868] [00000000] *pgd=66262564 +[ 6.634636] Unable to handle kernel paging request at virtual address e6262000 +[ 6.642014] pgd = de468000 +[ 6.644700] [e6262000] *pgd=00000000 +[ 6.648265] Internal error: Oops: 5 [#1] PREEMPT SMP ARM +[ 6.653552] Modules linked in: +[ 6.656598] CPU: 0 PID: 31 Comm: kworker/0:1 Not tainted 3.10.14-02717-gc58b4b4 #505 +[ 6.664334] Workqueue: events max17040_work +[ 6.668488] task: dfa11b80 ti: df9f6000 task.ti: df9f6000 +[ 6.673873] PC is at show_pte+0x80/0xb8 +[ 6.677687] LR is at show_pte+0x3c/0xb8 +[ 6.681503] pc : [] lr : [] psr: 600f0113 +[ 6.681503] sp : df9f7d58 ip : 600f0113 fp : 00000009 +[ 6.692965] r10: 00000000 r9 : 00000000 r8 : dfa11b80 +[ 6.698171] r7 : df9f7ea0 r6 : e6262000 r5 : 00000000 r4 : 00000000 +[ 6.704680] r3 : 00000000 r2 : e6262000 r1 : 600f0193 r0 : c05b3750 +[ 6.711194] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel +[ 6.718485] Control: 10c53c7d Table: 5e46806a DAC: 00000015 +[ 6.724218] Process kworker/0:1 (pid: 31, stack limit = 0xdf9f6238) +[ 6.730465] Stack: (0xdf9f7d58 to 0xdf9f8000) +[ 6.914325] [] (show_pte+0x80/0xb8) from [] (__do_kernel_fault.part.9+0x44/0x74) +[ 6.923425] [] (__do_kernel_fault.part.9+0x44/0x74) from [] (do_page_fault+0x2c4/0x360) +[ 6.933144] [] (do_page_fault+0x2c4/0x360) from [] (do_DataAbort+0x34/0x9c) +[ 6.941825] [] (do_DataAbort+0x34/0x9c) from [] (__dabt_svc+0x38/0x60) +[ 6.950058] Exception stack(0xdf9f7ea0 to 0xdf9f7ee8) +[ 6.955099] 7ea0: df0c1790 00000000 00000002 00000000 df0c1794 df0c1790 df0c1790 00000042 +[ 6.963271] 7ec0: df0c1794 00000001 00000000 00000009 00000000 df9f7ee8 c0306268 c0306270 +[ 6.971419] 7ee0: a00f0113 ffffffff +[ 6.974902] [] (__dabt_svc+0x38/0x60) from [] (max17040_work+0x8c/0x144) +[ 6.983317] [] (max17040_work+0x8c/0x144) from [] (process_one_work+0x138/0x440) +[ 6.992429] [] (process_one_work+0x138/0x440) from [] (worker_thread+0x134/0x3b8) +[ 7.001628] [] (worker_thread+0x134/0x3b8) from [] (kthread+0xa4/0xb0) +[ 7.009875] [] (kthread+0xa4/0xb0) from [] (ret_from_fork+0x14/0x2c) +[ 7.017943] Code: e1a03005 e2422480 e0826104 e59f002c (e7922104) +[ 7.024017] ---[ end trace 73bc7006b9cc5c79 ]--- + +Signed-off-by: Krzysztof Kozlowski +Fixes: c6f4a42de60b981dd210de01cd3e575835e3158e +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/power/max17040_battery.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/power/max17040_battery.c ++++ b/drivers/power/max17040_battery.c +@@ -148,7 +148,7 @@ static void max17040_get_online(struct i + { + struct max17040_chip *chip = i2c_get_clientdata(client); + +- if (chip->pdata->battery_online) ++ if (chip->pdata && chip->pdata->battery_online) + chip->online = chip->pdata->battery_online(); + else + chip->online = 1; +@@ -158,7 +158,8 @@ static void max17040_get_status(struct i + { + struct max17040_chip *chip = i2c_get_clientdata(client); + +- if (!chip->pdata->charger_online || !chip->pdata->charger_enable) { ++ if (!chip->pdata || !chip->pdata->charger_online ++ || !chip->pdata->charger_enable) { + chip->status = POWER_SUPPLY_STATUS_UNKNOWN; + return; + } diff --git a/queue-3.4/ring-buffer-fix-first-commit-on-sub-buffer-having-non-zero-delta.patch b/queue-3.4/ring-buffer-fix-first-commit-on-sub-buffer-having-non-zero-delta.patch new file mode 100644 index 00000000000..c1f88c2cccb --- /dev/null +++ b/queue-3.4/ring-buffer-fix-first-commit-on-sub-buffer-having-non-zero-delta.patch @@ -0,0 +1,47 @@ +From d651aa1d68a2f0a7ee65697b04c6a92f8c0a12f2 Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (Red Hat)" +Date: Tue, 11 Feb 2014 13:38:54 -0500 +Subject: ring-buffer: Fix first commit on sub-buffer having non-zero delta + +From: "Steven Rostedt (Red Hat)" + +commit d651aa1d68a2f0a7ee65697b04c6a92f8c0a12f2 upstream. + +Each sub-buffer (buffer page) has a full 64 bit timestamp. The events on +that page use a 27 bit delta against that timestamp in order to save on +bits written to the ring buffer. If the time between events is larger than +what the 27 bits can hold, a "time extend" event is added to hold the +entire 64 bit timestamp again and the events after that hold a delta from +that timestamp. + +As a "time extend" is always paired with an event, it is logical to just +allocate the event with the time extend, to make things a bit more efficient. + +Unfortunately, when the pairing code was written, it removed the "delta = 0" +from the first commit on a page, causing the events on the page to be +slightly skewed. + +Fixes: 69d1b839f7ee "ring-buffer: Bind time extend and data events together" +Signed-off-by: Steven Rostedt +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/trace/ring_buffer.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/kernel/trace/ring_buffer.c ++++ b/kernel/trace/ring_buffer.c +@@ -2008,6 +2008,13 @@ __rb_reserve_next(struct ring_buffer_per + write &= RB_WRITE_MASK; + tail = write - length; + ++ /* ++ * If this is the first commit on the page, then it has the same ++ * timestamp as the page itself. ++ */ ++ if (!tail) ++ delta = 0; ++ + /* See if we shot pass the end of this buffer page */ + if (unlikely(write > BUF_PAGE_SIZE)) + return rb_move_tail(cpu_buffer, length, tail, diff --git a/queue-3.4/series b/queue-3.4/series index 9df27798f8b..3b86fb514b5 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -8,3 +8,18 @@ raw-test-against-runtime-value-of-max_raw_minors.patch lockd-send-correct-lock-when-granting-a-delayed-lock.patch tty-n_gsm-fix-for-modems-with-brk-in-modem-status-control.patch staging-iio-ad799x-fix-error_free_irq-which-was-freeing-an-irq-that-may-not-have-been-requested.patch +usb-ftdi_sio-add-mindstorms-ev3-console-adapter.patch +usb-ftdi_sio-add-tagsys-rfid-reader-ids.patch +usb-storage-add-unusual-devs-entry-for-blackberry-9000.patch +usb-storage-restrict-bcddevice-range-for-super-top-in-cypress-atacb.patch +usb-storage-enable-multi-lun-scanning-when-needed.patch +usb-option-blacklist-zte-mf667-net-interface.patch +modpost-fixed-usb-alias-generation-for-ranges-including-0x9-and-0xa.patch +block-add-cond_resched-to-potentially-long-running-ioctl-discard-loop.patch +ib-qib-add-missing-serdes-init-sequence.patch +kvm-return-an-error-code-in-kvm_vm_ioctl_register_coalesced_mmio.patch +md-raid5-fix-cpu-hotplug-callback-registration.patch +time-fix-overflow-when-hz-is-smaller-than-60.patch +power-max17040-fix-null-pointer-dereference-when-there-is-no-platform_data.patch +ring-buffer-fix-first-commit-on-sub-buffer-having-non-zero-delta.patch +genirq-add-missing-irq_to_desc-export-for-config_sparse_irq-n.patch diff --git a/queue-3.4/time-fix-overflow-when-hz-is-smaller-than-60.patch b/queue-3.4/time-fix-overflow-when-hz-is-smaller-than-60.patch new file mode 100644 index 00000000000..03c6553acbc --- /dev/null +++ b/queue-3.4/time-fix-overflow-when-hz-is-smaller-than-60.patch @@ -0,0 +1,46 @@ +From 80d767d770fd9c697e434fd080c2db7b5c60c6dd Mon Sep 17 00:00:00 2001 +From: Mikulas Patocka +Date: Fri, 24 Jan 2014 16:41:36 -0500 +Subject: time: Fix overflow when HZ is smaller than 60 + +From: Mikulas Patocka + +commit 80d767d770fd9c697e434fd080c2db7b5c60c6dd upstream. + +When compiling for the IA-64 ski emulator, HZ is set to 32 because the +emulation is slow and we don't want to waste too many cycles processing +timers. Alpha also has an option to set HZ to 32. + +This causes integer underflow in +kernel/time/jiffies.c: +kernel/time/jiffies.c:66:2: warning: large integer implicitly truncated to unsigned type [-Woverflow] + .mult = NSEC_PER_JIFFY << JIFFIES_SHIFT, /* details above */ + ^ + +This patch reduces the JIFFIES_SHIFT value to avoid the overflow. + +Signed-off-by: Mikulas Patocka +Link: http://lkml.kernel.org/r/alpine.LRH.2.02.1401241639100.23871@file01.intranet.prod.int.rdu2.redhat.com +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/time/jiffies.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/kernel/time/jiffies.c ++++ b/kernel/time/jiffies.c +@@ -51,7 +51,13 @@ + * HZ shrinks, so values greater than 8 overflow 32bits when + * HZ=100. + */ ++#if HZ < 34 ++#define JIFFIES_SHIFT 6 ++#elif HZ < 67 ++#define JIFFIES_SHIFT 7 ++#else + #define JIFFIES_SHIFT 8 ++#endif + + static cycle_t jiffies_read(struct clocksource *cs) + { diff --git a/queue-3.4/usb-ftdi_sio-add-mindstorms-ev3-console-adapter.patch b/queue-3.4/usb-ftdi_sio-add-mindstorms-ev3-console-adapter.patch new file mode 100644 index 00000000000..cf9068c16a5 --- /dev/null +++ b/queue-3.4/usb-ftdi_sio-add-mindstorms-ev3-console-adapter.patch @@ -0,0 +1,37 @@ +From 67847baee056892dc35efb9c3fd05ae7f075588c Mon Sep 17 00:00:00 2001 +From: Bjørn Mork +Date: Tue, 14 Jan 2014 18:56:54 +0100 +Subject: usb: ftdi_sio: add Mindstorms EV3 console adapter + +From: Bjørn Mork + +commit 67847baee056892dc35efb9c3fd05ae7f075588c upstream. + +Signed-off-by: Bjørn Mork +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/ftdi_sio.c | 1 + + drivers/usb/serial/ftdi_sio_ids.h | 1 + + 2 files changed, 2 insertions(+) + +--- a/drivers/usb/serial/ftdi_sio.c ++++ b/drivers/usb/serial/ftdi_sio.c +@@ -165,6 +165,7 @@ static struct usb_device_id id_table_com + { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_NXTCAM_PID) }, ++ { USB_DEVICE(FTDI_VID, FTDI_EV3CON_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) }, +--- a/drivers/usb/serial/ftdi_sio_ids.h ++++ b/drivers/usb/serial/ftdi_sio_ids.h +@@ -50,6 +50,7 @@ + #define TI_XDS100V2_PID 0xa6d0 + + #define FTDI_NXTCAM_PID 0xABB8 /* NXTCam for Mindstorms NXT */ ++#define FTDI_EV3CON_PID 0xABB9 /* Mindstorms EV3 Console Adapter */ + + /* US Interface Navigator (http://www.usinterface.com/) */ + #define FTDI_USINT_CAT_PID 0xb810 /* Navigator CAT and 2nd PTT lines */ diff --git a/queue-3.4/usb-ftdi_sio-add-tagsys-rfid-reader-ids.patch b/queue-3.4/usb-ftdi_sio-add-tagsys-rfid-reader-ids.patch new file mode 100644 index 00000000000..dc23b26f450 --- /dev/null +++ b/queue-3.4/usb-ftdi_sio-add-tagsys-rfid-reader-ids.patch @@ -0,0 +1,48 @@ +From 76f24e3f39a1a94bab0d54e98899d64abcd9f69c Mon Sep 17 00:00:00 2001 +From: Ulrich Hahn +Date: Sun, 2 Feb 2014 14:42:52 +0100 +Subject: USB: ftdi_sio: add Tagsys RFID Reader IDs + +From: Ulrich Hahn + +commit 76f24e3f39a1a94bab0d54e98899d64abcd9f69c upstream. + +Adding two more IDs to the ftdi_sio usb serial driver. +It now connects Tagsys RFID readers. +There might be more IDs out there for other Tagsys models. + +Signed-off-by: Ulrich Hahn +Cc: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/ftdi_sio.c | 2 ++ + drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ + 2 files changed, 8 insertions(+) + +--- a/drivers/usb/serial/ftdi_sio.c ++++ b/drivers/usb/serial/ftdi_sio.c +@@ -205,6 +205,8 @@ static struct usb_device_id id_table_com + { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, + { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) }, ++ { USB_DEVICE(FTDI_VID, FTDI_TAGSYS_LP101_PID) }, ++ { USB_DEVICE(FTDI_VID, FTDI_TAGSYS_P200X_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_LENZ_LIUSB_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) }, +--- a/drivers/usb/serial/ftdi_sio_ids.h ++++ b/drivers/usb/serial/ftdi_sio_ids.h +@@ -364,6 +364,12 @@ + /* Sprog II (Andrew Crosland's SprogII DCC interface) */ + #define FTDI_SPROG_II 0xF0C8 + ++/* ++ * Two of the Tagsys RFID Readers ++ */ ++#define FTDI_TAGSYS_LP101_PID 0xF0E9 /* Tagsys L-P101 RFID*/ ++#define FTDI_TAGSYS_P200X_PID 0xF0EE /* Tagsys Medio P200x RFID*/ ++ + /* an infrared receiver for user access control with IR tags */ + #define FTDI_PIEGROUP_PID 0xF208 /* Product Id */ + diff --git a/queue-3.4/usb-option-blacklist-zte-mf667-net-interface.patch b/queue-3.4/usb-option-blacklist-zte-mf667-net-interface.patch new file mode 100644 index 00000000000..b36d04ebae4 --- /dev/null +++ b/queue-3.4/usb-option-blacklist-zte-mf667-net-interface.patch @@ -0,0 +1,31 @@ +From 3635c7e2d59f7861afa6fa5e87e2a58860ff514d Mon Sep 17 00:00:00 2001 +From: Raymond Wanyoike +Date: Sun, 9 Feb 2014 11:59:46 +0300 +Subject: usb: option: blacklist ZTE MF667 net interface + +From: Raymond Wanyoike + +commit 3635c7e2d59f7861afa6fa5e87e2a58860ff514d upstream. + +Interface #5 of 19d2:1270 is a net interface which has been submitted to the +qmi_wwan driver so consequently remove it from the option driver. + +Signed-off-by: Raymond Wanyoike +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/option.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -1376,7 +1376,8 @@ static const struct usb_device_id option + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1267, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1268, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1269, 0xff, 0xff, 0xff) }, +- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1270, 0xff, 0xff, 0xff) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1270, 0xff, 0xff, 0xff), ++ .driver_info = (kernel_ulong_t)&net_intf5_blacklist }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1271, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1272, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1273, 0xff, 0xff, 0xff) }, diff --git a/queue-3.4/usb-storage-add-unusual-devs-entry-for-blackberry-9000.patch b/queue-3.4/usb-storage-add-unusual-devs-entry-for-blackberry-9000.patch new file mode 100644 index 00000000000..f091e7912b2 --- /dev/null +++ b/queue-3.4/usb-storage-add-unusual-devs-entry-for-blackberry-9000.patch @@ -0,0 +1,37 @@ +From c5637e5119c43452a00e27c274356b072263ecbb Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Tue, 21 Jan 2014 10:38:45 -0500 +Subject: usb-storage: add unusual-devs entry for BlackBerry 9000 + +From: Alan Stern + +commit c5637e5119c43452a00e27c274356b072263ecbb upstream. + +This patch adds an unusual-devs entry for the BlackBerry 9000. This +fixes Bugzilla #22442. + +Signed-off-by: Alan Stern +Reported-by: Moritz Moeller-Herrmann +Tested-by: Moritz Moeller-Herrmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/storage/unusual_devs.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/usb/storage/unusual_devs.h ++++ b/drivers/usb/storage/unusual_devs.h +@@ -1441,6 +1441,13 @@ UNUSUAL_DEV( 0x0f88, 0x042e, 0x0100, 0x0 + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_FIX_CAPACITY ), + ++/* Reported by Moritz Moeller-Herrmann */ ++UNUSUAL_DEV( 0x0fca, 0x8004, 0x0201, 0x0201, ++ "Research In Motion", ++ "BlackBerry Bold 9000", ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL, ++ US_FL_MAX_SECTORS_64 ), ++ + /* Reported by Michael Stattmann */ + UNUSUAL_DEV( 0x0fce, 0xd008, 0x0000, 0x0000, + "Sony Ericsson", diff --git a/queue-3.4/usb-storage-enable-multi-lun-scanning-when-needed.patch b/queue-3.4/usb-storage-enable-multi-lun-scanning-when-needed.patch new file mode 100644 index 00000000000..70efa35c360 --- /dev/null +++ b/queue-3.4/usb-storage-enable-multi-lun-scanning-when-needed.patch @@ -0,0 +1,68 @@ +From 823d12c95c666fa7ab7dad208d735f6bc6afabdc Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Thu, 30 Jan 2014 10:43:22 -0500 +Subject: usb-storage: enable multi-LUN scanning when needed + +From: Alan Stern + +commit 823d12c95c666fa7ab7dad208d735f6bc6afabdc upstream. + +People sometimes create their own custom-configured kernels and forget +to enable CONFIG_SCSI_MULTI_LUN. This causes problems when they plug +in a USB storage device (such as a card reader) with more than one +LUN. + +Fortunately, we can tell fairly easily when a storage device claims to +have more than one LUN. When that happens, this patch asks the SCSI +layer to probe all the LUNs automatically, regardless of the config +setting. + +The patch also updates the Kconfig help text for usb-storage, +explaining that CONFIG_SCSI_MULTI_LUN may be necessary. + +Signed-off-by: Alan Stern +Reported-by: Thomas Raschbacher +CC: Matthew Dharm +CC: James Bottomley +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/storage/Kconfig | 4 +++- + drivers/usb/storage/scsiglue.c | 6 ++++++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +--- a/drivers/usb/storage/Kconfig ++++ b/drivers/usb/storage/Kconfig +@@ -19,7 +19,9 @@ config USB_STORAGE + + This option depends on 'SCSI' support being enabled, but you + probably also need 'SCSI device support: SCSI disk support' +- (BLK_DEV_SD) for most USB storage devices. ++ (BLK_DEV_SD) for most USB storage devices. Some devices also ++ will require 'Probe all LUNs on each SCSI device' ++ (SCSI_MULTI_LUN). + + To compile this driver as a module, choose M here: the + module will be called usb-storage. +--- a/drivers/usb/storage/scsiglue.c ++++ b/drivers/usb/storage/scsiglue.c +@@ -78,6 +78,8 @@ static const char* host_info(struct Scsi + + static int slave_alloc (struct scsi_device *sdev) + { ++ struct us_data *us = host_to_us(sdev->host); ++ + /* + * Set the INQUIRY transfer length to 36. We don't use any of + * the extra data and many devices choke if asked for more or +@@ -102,6 +104,10 @@ static int slave_alloc (struct scsi_devi + */ + blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1)); + ++ /* Tell the SCSI layer if we know there is more than one LUN */ ++ if (us->protocol == USB_PR_BULK && us->max_lun > 0) ++ sdev->sdev_bflags |= BLIST_FORCELUN; ++ + return 0; + } + diff --git a/queue-3.4/usb-storage-restrict-bcddevice-range-for-super-top-in-cypress-atacb.patch b/queue-3.4/usb-storage-restrict-bcddevice-range-for-super-top-in-cypress-atacb.patch new file mode 100644 index 00000000000..577ef718075 --- /dev/null +++ b/queue-3.4/usb-storage-restrict-bcddevice-range-for-super-top-in-cypress-atacb.patch @@ -0,0 +1,36 @@ +From a9c143c82608bee2a36410caa56d82cd86bdc7fa Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Thu, 30 Jan 2014 10:20:29 -0500 +Subject: usb-storage: restrict bcdDevice range for Super Top in Cypress ATACB + +From: Alan Stern + +commit a9c143c82608bee2a36410caa56d82cd86bdc7fa upstream. + +The Cypress ATACB unusual-devs entry for the Super Top SATA bridge +causes problems. Although it was originally reported only for +bcdDevice = 0x160, its range was much larger. This resulted in a bug +report for bcdDevice 0x220, so the range was capped at 0x219. Now +Milan reports errors with bcdDevice 0x150. + +Therefore this patch restricts the range to just 0x160. + +Signed-off-by: Alan Stern +Reported-and-tested-by: Milan Svoboda +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/storage/unusual_cypress.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/storage/unusual_cypress.h ++++ b/drivers/usb/storage/unusual_cypress.h +@@ -31,7 +31,7 @@ UNUSUAL_DEV( 0x04b4, 0x6831, 0x0000, 0x + "Cypress ISD-300LP", + USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0), + +-UNUSUAL_DEV( 0x14cd, 0x6116, 0x0000, 0x0219, ++UNUSUAL_DEV( 0x14cd, 0x6116, 0x0160, 0x0160, + "Super Top", + "USB 2.0 SATA BRIDGE", + USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0),