From: Greg Kroah-Hartman Date: Sat, 28 Feb 2015 22:42:56 +0000 (-0800) Subject: 3.10-stable patches X-Git-Tag: v3.10.71~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7743a2cb4c6c2a1a5b0aa69d63644f2383346760;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: alsa-hdspm-constrain-periods-to-2-on-older-cards.patch alsa-off-by-one-bug-in-snd_riptide_joystick_probe.patch cpufreq-speedstep-smi-enable-interrupts-when-waiting.patch lmedm04-fix-usb_submit_urb-bogus-urb-xfer-pipe-1-type-3-in-interrupt-urb.patch power_supply-88pm860x-fix-leaked-power-supply-on-probe-fail.patch --- diff --git a/queue-3.10/alsa-hdspm-constrain-periods-to-2-on-older-cards.patch b/queue-3.10/alsa-hdspm-constrain-periods-to-2-on-older-cards.patch new file mode 100644 index 00000000000..3d9fd4025ab --- /dev/null +++ b/queue-3.10/alsa-hdspm-constrain-periods-to-2-on-older-cards.patch @@ -0,0 +1,40 @@ +From f0153c3d948c1764f6c920a0675d86fc1d75813e Mon Sep 17 00:00:00 2001 +From: Adrian Knoth +Date: Tue, 10 Feb 2015 11:33:50 +0100 +Subject: ALSA: hdspm - Constrain periods to 2 on older cards + +From: Adrian Knoth + +commit f0153c3d948c1764f6c920a0675d86fc1d75813e upstream. + +RME RayDAT and AIO use a fixed buffer size of 16384 samples. With period +sizes of 32-4096, this translates to 4-512 periods. + +The older RME cards have a variable buffer size but require exactly two +periods. + +This patch enforces nperiods=2 on those cards. + +Signed-off-by: Adrian Knoth +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/rme9652/hdspm.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/sound/pci/rme9652/hdspm.c ++++ b/sound/pci/rme9652/hdspm.c +@@ -5863,6 +5863,12 @@ static int snd_hdspm_capture_open(struct + snd_pcm_hw_constraint_minmax(runtime, + SNDRV_PCM_HW_PARAM_PERIOD_SIZE, + 64, 8192); ++ snd_pcm_hw_constraint_minmax(runtime, ++ SNDRV_PCM_HW_PARAM_PERIODS, ++ 2, 2); ++ snd_pcm_hw_constraint_minmax(runtime, ++ SNDRV_PCM_HW_PARAM_PERIODS, ++ 2, 2); + break; + } + diff --git a/queue-3.10/alsa-off-by-one-bug-in-snd_riptide_joystick_probe.patch b/queue-3.10/alsa-off-by-one-bug-in-snd_riptide_joystick_probe.patch new file mode 100644 index 00000000000..8c3eb02243d --- /dev/null +++ b/queue-3.10/alsa-off-by-one-bug-in-snd_riptide_joystick_probe.patch @@ -0,0 +1,91 @@ +From e4940626defdf6c92da1052ad3f12741c1a28c90 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Mon, 9 Feb 2015 16:51:40 +0300 +Subject: ALSA: off by one bug in snd_riptide_joystick_probe() + +From: Dan Carpenter + +commit e4940626defdf6c92da1052ad3f12741c1a28c90 upstream. + +The problem here is that we check: + + if (dev >= SNDRV_CARDS) + +Then we increment "dev". + + if (!joystick_port[dev++]) + +Then we use it as an offset into a array with SNDRV_CARDS elements. + + if (!request_region(joystick_port[dev], 8, "Riptide gameport")) { + +This has 3 effects: +1) If you use the module option to specify the joystick port then it has + to be shifted one space over. +2) The wrong error message will be printed on failure if you have over + 32 cards. +3) Static checkers will correctly complain that are off by one. + +Fixes: db1005ec6ff8 ('ALSA: riptide - Fix joystick resource handling') +Signed-off-by: Dan Carpenter +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/riptide/riptide.c | 27 +++++++++++++++++++-------- + 1 file changed, 19 insertions(+), 8 deletions(-) + +--- a/sound/pci/riptide/riptide.c ++++ b/sound/pci/riptide/riptide.c +@@ -2032,32 +2032,43 @@ snd_riptide_joystick_probe(struct pci_de + { + static int dev; + struct gameport *gameport; ++ int ret; + + if (dev >= SNDRV_CARDS) + return -ENODEV; ++ + if (!enable[dev]) { +- dev++; +- return -ENOENT; ++ ret = -ENOENT; ++ goto inc_dev; + } + +- if (!joystick_port[dev++]) +- return 0; ++ if (!joystick_port[dev]) { ++ ret = 0; ++ goto inc_dev; ++ } + + gameport = gameport_allocate_port(); +- if (!gameport) +- return -ENOMEM; ++ if (!gameport) { ++ ret = -ENOMEM; ++ goto inc_dev; ++ } + if (!request_region(joystick_port[dev], 8, "Riptide gameport")) { + snd_printk(KERN_WARNING + "Riptide: cannot grab gameport 0x%x\n", + joystick_port[dev]); + gameport_free_port(gameport); +- return -EBUSY; ++ ret = -EBUSY; ++ goto inc_dev; + } + + gameport->io = joystick_port[dev]; + gameport_register_port(gameport); + pci_set_drvdata(pci, gameport); +- return 0; ++ ++ ret = 0; ++inc_dev: ++ dev++; ++ return ret; + } + + static void snd_riptide_joystick_remove(struct pci_dev *pci) diff --git a/queue-3.10/cpufreq-speedstep-smi-enable-interrupts-when-waiting.patch b/queue-3.10/cpufreq-speedstep-smi-enable-interrupts-when-waiting.patch new file mode 100644 index 00000000000..a1946c5af90 --- /dev/null +++ b/queue-3.10/cpufreq-speedstep-smi-enable-interrupts-when-waiting.patch @@ -0,0 +1,92 @@ +From d4d4eda23794c701442e55129dd4f8f2fefd5e4d Mon Sep 17 00:00:00 2001 +From: Mikulas Patocka +Date: Mon, 9 Feb 2015 13:38:17 -0500 +Subject: cpufreq: speedstep-smi: enable interrupts when waiting + +From: Mikulas Patocka + +commit d4d4eda23794c701442e55129dd4f8f2fefd5e4d upstream. + +On Dell Latitude C600 laptop with Pentium 3 850MHz processor, the +speedstep-smi driver sometimes loads and sometimes doesn't load with +"change to state X failed" message. + +The hardware sometimes refuses to change frequency and in this case, we +need to retry later. I found out that we need to enable interrupts while +waiting. When we enable interrupts, the hardware blockage that prevents +frequency transition resolves and the transition is possible. With +disabled interrupts, the blockage doesn't resolve (no matter how long do +we wait). The exact reasons for this hardware behavior are unknown. + +This patch enables interrupts in the function speedstep_set_state that can +be called with disabled interrupts. However, this function is called with +disabled interrupts only from speedstep_get_freqs, so it shouldn't cause +any problem. + +Signed-off-by: Mikulas Patocka +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/cpufreq/speedstep-lib.c | 3 +++ + drivers/cpufreq/speedstep-smi.c | 12 ++++++++++++ + 2 files changed, 15 insertions(+) + +--- a/drivers/cpufreq/speedstep-lib.c ++++ b/drivers/cpufreq/speedstep-lib.c +@@ -400,6 +400,7 @@ unsigned int speedstep_get_freqs(enum sp + + pr_debug("previous speed is %u\n", prev_speed); + ++ preempt_disable(); + local_irq_save(flags); + + /* switch to low state */ +@@ -464,6 +465,8 @@ unsigned int speedstep_get_freqs(enum sp + + out: + local_irq_restore(flags); ++ preempt_enable(); ++ + return ret; + } + EXPORT_SYMBOL_GPL(speedstep_get_freqs); +--- a/drivers/cpufreq/speedstep-smi.c ++++ b/drivers/cpufreq/speedstep-smi.c +@@ -188,6 +188,7 @@ static void speedstep_set_state(unsigned + return; + + /* Disable IRQs */ ++ preempt_disable(); + local_irq_save(flags); + + command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); +@@ -198,9 +199,19 @@ static void speedstep_set_state(unsigned + + do { + if (retry) { ++ /* ++ * We need to enable interrupts, otherwise the blockage ++ * won't resolve. ++ * ++ * We disable preemption so that other processes don't ++ * run. If other processes were running, they could ++ * submit more DMA requests, making the blockage worse. ++ */ + pr_debug("retry %u, previous result %u, waiting...\n", + retry, result); ++ local_irq_enable(); + mdelay(retry * 50); ++ local_irq_disable(); + } + retry++; + __asm__ __volatile__( +@@ -217,6 +228,7 @@ static void speedstep_set_state(unsigned + + /* enable IRQs */ + local_irq_restore(flags); ++ preempt_enable(); + + if (new_state == state) + pr_debug("change to %u MHz succeeded after %u tries " diff --git a/queue-3.10/lmedm04-fix-usb_submit_urb-bogus-urb-xfer-pipe-1-type-3-in-interrupt-urb.patch b/queue-3.10/lmedm04-fix-usb_submit_urb-bogus-urb-xfer-pipe-1-type-3-in-interrupt-urb.patch new file mode 100644 index 00000000000..0f96660f79e --- /dev/null +++ b/queue-3.10/lmedm04-fix-usb_submit_urb-bogus-urb-xfer-pipe-1-type-3-in-interrupt-urb.patch @@ -0,0 +1,45 @@ +From 15e1ce33182d1d5dbd8efe8d382b9352dc857527 Mon Sep 17 00:00:00 2001 +From: Malcolm Priestley +Date: Fri, 2 Jan 2015 10:56:28 -0300 +Subject: [media] lmedm04: Fix usb_submit_urb BOGUS urb xfer, pipe 1 != type 3 in interrupt urb + +From: Malcolm Priestley + +commit 15e1ce33182d1d5dbd8efe8d382b9352dc857527 upstream. + +A quirk of some older firmwares that report endpoint pipe type as PIPE_BULK +but the endpoint otheriwse functions as interrupt. + +Check if usb_endpoint_type is USB_ENDPOINT_XFER_BULK and set as usb_rcvbulkpipe. + +Signed-off-by: Malcolm Priestley +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/usb/dvb-usb-v2/lmedm04.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/media/usb/dvb-usb-v2/lmedm04.c ++++ b/drivers/media/usb/dvb-usb-v2/lmedm04.c +@@ -350,6 +350,7 @@ static int lme2510_int_read(struct dvb_u + { + struct dvb_usb_device *d = adap_to_d(adap); + struct lme2510_state *lme_int = adap_to_priv(adap); ++ struct usb_host_endpoint *ep; + + lme_int->lme_urb = usb_alloc_urb(0, GFP_ATOMIC); + +@@ -371,6 +372,12 @@ static int lme2510_int_read(struct dvb_u + adap, + 8); + ++ /* Quirk of pipe reporting PIPE_BULK but behaves as interrupt */ ++ ep = usb_pipe_endpoint(d->udev, lme_int->lme_urb->pipe); ++ ++ if (usb_endpoint_type(&ep->desc) == USB_ENDPOINT_XFER_BULK) ++ lme_int->lme_urb->pipe = usb_rcvbulkpipe(d->udev, 0xa), ++ + lme_int->lme_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; + + usb_submit_urb(lme_int->lme_urb, GFP_ATOMIC); diff --git a/queue-3.10/power_supply-88pm860x-fix-leaked-power-supply-on-probe-fail.patch b/queue-3.10/power_supply-88pm860x-fix-leaked-power-supply-on-probe-fail.patch new file mode 100644 index 00000000000..6284d9289c2 --- /dev/null +++ b/queue-3.10/power_supply-88pm860x-fix-leaked-power-supply-on-probe-fail.patch @@ -0,0 +1,32 @@ +From 24727b45b484e8937dcde53fa8d1aa70ac30ec0c Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Tue, 27 Jan 2015 16:51:54 +0100 +Subject: power_supply: 88pm860x: Fix leaked power supply on probe fail + +From: Krzysztof Kozlowski + +commit 24727b45b484e8937dcde53fa8d1aa70ac30ec0c upstream. + +Driver forgot to unregister power supply if request_threaded_irq() +failed in probe(). In such case the memory associated with power supply +leaked. + +Signed-off-by: Krzysztof Kozlowski +Fixes: a830d28b48bf ("power_supply: Enable battery-charger for 88pm860x") +Signed-off-by: Sebastian Reichel +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/power/88pm860x_charger.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/power/88pm860x_charger.c ++++ b/drivers/power/88pm860x_charger.c +@@ -711,6 +711,7 @@ static int pm860x_charger_probe(struct p + return 0; + + out_irq: ++ power_supply_unregister(&info->usb); + while (--i >= 0) + free_irq(info->irq[i], info); + out: diff --git a/queue-3.10/series b/queue-3.10/series index 0282333ab80..0cbf23259d4 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -10,3 +10,8 @@ iwlwifi-mvm-always-use-mac-color-zero.patch hid-i2c-hid-limit-reads-to-wmaxinputlength-bytes-for-input-events.patch pci-generate-uppercase-hex-for-modalias-var-in-uevent.patch pci-fix-infinite-loop-with-rom-image-of-size-0.patch +cpufreq-speedstep-smi-enable-interrupts-when-waiting.patch +lmedm04-fix-usb_submit_urb-bogus-urb-xfer-pipe-1-type-3-in-interrupt-urb.patch +alsa-off-by-one-bug-in-snd_riptide_joystick_probe.patch +alsa-hdspm-constrain-periods-to-2-on-older-cards.patch +power_supply-88pm860x-fix-leaked-power-supply-on-probe-fail.patch