From: Greg Kroah-Hartman Date: Tue, 3 Feb 2015 02:46:31 +0000 (-0800) Subject: 3.10-stable patches X-Git-Tag: v3.18.6~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=010a56f1a213c6d716fbfb902528dffe8d9c67c3;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: alsa-seq-dummy-remove-deadlock-causing-events-on-close.patch asoc-wm8960-fix-capture-sample-rate-from-11250-to-11025.patch can-kvaser_usb-do-not-sleep-in-atomic-context.patch can-kvaser_usb-fix-state-handling-upon-bus_error-events.patch can-kvaser_usb-retry-the-first-bulk-transfer-on-etimedout.patch can-kvaser_usb-send-correct-context-to-urb-completion.patch powerpc-xmon-fix-another-endiannes-issue-in-rtas-call-from-xmon.patch --- diff --git a/queue-3.10/alsa-seq-dummy-remove-deadlock-causing-events-on-close.patch b/queue-3.10/alsa-seq-dummy-remove-deadlock-causing-events-on-close.patch new file mode 100644 index 00000000000..28b4a95d6cd --- /dev/null +++ b/queue-3.10/alsa-seq-dummy-remove-deadlock-causing-events-on-close.patch @@ -0,0 +1,74 @@ +From 0767e95bb96d7fdddcd590fb809e6975d93aebc5 Mon Sep 17 00:00:00 2001 +From: Clemens Ladisch +Date: Sun, 25 Jan 2015 14:34:29 +0100 +Subject: ALSA: seq-dummy: remove deadlock-causing events on close + +From: Clemens Ladisch + +commit 0767e95bb96d7fdddcd590fb809e6975d93aebc5 upstream. + +When the last subscriber to a "Through" port has been removed, the +subscribed destination ports might still be active, so it would be +wrong to send "all sounds off" and "reset controller" events to them. +The proper place for such a shutdown would be the closing of the actual +MIDI port (and close_substream() in rawmidi.c already can do this). + +This also fixes a deadlock when dummy_unuse() tries to send events to +its own port that is already locked because it is being freed. + +Reported-by: Peter Billam +Signed-off-by: Clemens Ladisch +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/core/seq/seq_dummy.c | 31 ------------------------------- + 1 file changed, 31 deletions(-) + +--- a/sound/core/seq/seq_dummy.c ++++ b/sound/core/seq/seq_dummy.c +@@ -82,36 +82,6 @@ struct snd_seq_dummy_port { + static int my_client = -1; + + /* +- * unuse callback - send ALL_SOUNDS_OFF and RESET_CONTROLLERS events +- * to subscribers. +- * Note: this callback is called only after all subscribers are removed. +- */ +-static int +-dummy_unuse(void *private_data, struct snd_seq_port_subscribe *info) +-{ +- struct snd_seq_dummy_port *p; +- int i; +- struct snd_seq_event ev; +- +- p = private_data; +- memset(&ev, 0, sizeof(ev)); +- if (p->duplex) +- ev.source.port = p->connect; +- else +- ev.source.port = p->port; +- ev.dest.client = SNDRV_SEQ_ADDRESS_SUBSCRIBERS; +- ev.type = SNDRV_SEQ_EVENT_CONTROLLER; +- for (i = 0; i < 16; i++) { +- ev.data.control.channel = i; +- ev.data.control.param = MIDI_CTL_ALL_SOUNDS_OFF; +- snd_seq_kernel_client_dispatch(p->client, &ev, 0, 0); +- ev.data.control.param = MIDI_CTL_RESET_CONTROLLERS; +- snd_seq_kernel_client_dispatch(p->client, &ev, 0, 0); +- } +- return 0; +-} +- +-/* + * event input callback - just redirect events to subscribers + */ + static int +@@ -175,7 +145,6 @@ create_port(int idx, int type) + | SNDRV_SEQ_PORT_TYPE_PORT; + memset(&pcb, 0, sizeof(pcb)); + pcb.owner = THIS_MODULE; +- pcb.unuse = dummy_unuse; + pcb.event_input = dummy_input; + pcb.private_free = dummy_free; + pcb.private_data = rec; diff --git a/queue-3.10/asoc-wm8960-fix-capture-sample-rate-from-11250-to-11025.patch b/queue-3.10/asoc-wm8960-fix-capture-sample-rate-from-11250-to-11025.patch new file mode 100644 index 00000000000..fd1fa721053 --- /dev/null +++ b/queue-3.10/asoc-wm8960-fix-capture-sample-rate-from-11250-to-11025.patch @@ -0,0 +1,31 @@ +From 22ee76daddb87f88d2336d1b4737ef27c4f307ac Mon Sep 17 00:00:00 2001 +From: Zidan Wang +Date: Wed, 31 Dec 2014 11:39:14 +0800 +Subject: ASoC: wm8960: Fix capture sample rate from 11250 to 11025 + +From: Zidan Wang + +commit 22ee76daddb87f88d2336d1b4737ef27c4f307ac upstream. + +wm8960 codec can't support sample rate 11250, it must be 11025. + +Signed-off-by: Zidan Wang +Acked-by: Charles Keepax +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/wm8960.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/soc/codecs/wm8960.c ++++ b/sound/soc/codecs/wm8960.c +@@ -555,7 +555,7 @@ static struct { + { 22050, 2 }, + { 24000, 2 }, + { 16000, 3 }, +- { 11250, 4 }, ++ { 11025, 4 }, + { 12000, 4 }, + { 8000, 5 }, + }; diff --git a/queue-3.10/can-kvaser_usb-do-not-sleep-in-atomic-context.patch b/queue-3.10/can-kvaser_usb-do-not-sleep-in-atomic-context.patch new file mode 100644 index 00000000000..b5d2d5c8b06 --- /dev/null +++ b/queue-3.10/can-kvaser_usb-do-not-sleep-in-atomic-context.patch @@ -0,0 +1,101 @@ +From ded5006667318c06df875609535176bd33f243a1 Mon Sep 17 00:00:00 2001 +From: "Ahmed S. Darwish" +Date: Mon, 26 Jan 2015 07:20:39 +0200 +Subject: can: kvaser_usb: Do not sleep in atomic context + +From: "Ahmed S. Darwish" + +commit ded5006667318c06df875609535176bd33f243a1 upstream. + +Upon receiving a hardware event with the BUS_RESET flag set, +the driver kills all of its anchored URBs and resets all of +its transmit URB contexts. + +Unfortunately it does so under the context of URB completion +handler `kvaser_usb_read_bulk_callback()', which is often +called in an atomic context. + +While the device is flooded with many received error packets, +usb_kill_urb() typically sleeps/reschedules till the transfer +request of each killed URB in question completes, leading to +the sleep in atomic bug. [3] + +In v2 submission of the original driver patch [1], it was +stated that the URBs kill and tx contexts reset was needed +since we don't receive any tx acknowledgments later and thus +such resources will be locked down forever. Fortunately this +is no longer needed since an earlier bugfix in this patch +series is now applied: all tx URB contexts are reset upon CAN +channel close. [2] + +Moreover, a BUS_RESET is now treated _exactly_ like a BUS_OFF +event, which is the recommended handling method advised by +the device manufacturer. + +[1] http://article.gmane.org/gmane.linux.network/239442 + http://www.webcitation.org/6Vr2yagAQ + +[2] can: kvaser_usb: Reset all URB tx contexts upon channel close + 889b77f7fd2bcc922493d73a4c51d8a851505815 + +[3] Stacktrace: + + [] dump_stack+0x45/0x57 + [] __schedule_bug+0x41/0x4f + [] __schedule+0x5f1/0x700 + [] ? _raw_spin_unlock_irqrestore+0xa/0x10 + [] schedule+0x24/0x70 + [] usb_kill_urb+0x65/0xa0 + [] ? prepare_to_wait_event+0x110/0x110 + [] usb_kill_anchored_urbs+0x48/0x80 + [] kvaser_usb_unlink_tx_urbs+0x18/0x50 [kvaser_usb] + [] kvaser_usb_rx_error+0xc0/0x400 [kvaser_usb] + [] ? vprintk_default+0x1a/0x20 + [] kvaser_usb_read_bulk_callback+0x4c1/0x5f0 [kvaser_usb] + [] __usb_hcd_giveback_urb+0x5e/0xc0 + [] usb_hcd_giveback_urb+0x41/0x110 + [] finish_urb+0x98/0x180 [ohci_hcd] + [] ? acct_account_cputime+0x17/0x20 + [] ? local_clock+0x15/0x30 + [] ohci_work+0x1fb/0x5a0 [ohci_hcd] + [] ? process_backlog+0xb1/0x130 + [] ohci_irq+0xeb/0x270 [ohci_hcd] + [] usb_hcd_irq+0x21/0x30 + [] handle_irq_event_percpu+0x43/0x120 + [] handle_irq_event+0x3d/0x60 + [] handle_fasteoi_irq+0x74/0x110 + [] handle_irq+0x1d/0x30 + [] do_IRQ+0x57/0x100 + [] common_interrupt+0x6a/0x6a + +Signed-off-by: Ahmed S. Darwish +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/can/usb/kvaser_usb.c | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +--- a/drivers/net/can/usb/kvaser_usb.c ++++ b/drivers/net/can/usb/kvaser_usb.c +@@ -654,11 +654,6 @@ static void kvaser_usb_rx_error(const st + priv = dev->nets[channel]; + stats = &priv->netdev->stats; + +- if (status & M16C_STATE_BUS_RESET) { +- kvaser_usb_unlink_tx_urbs(priv); +- return; +- } +- + skb = alloc_can_err_skb(priv->netdev, &cf); + if (!skb) { + stats->rx_dropped++; +@@ -669,7 +664,7 @@ static void kvaser_usb_rx_error(const st + + netdev_dbg(priv->netdev, "Error status: 0x%02x\n", status); + +- if (status & M16C_STATE_BUS_OFF) { ++ if (status & (M16C_STATE_BUS_OFF | M16C_STATE_BUS_RESET)) { + cf->can_id |= CAN_ERR_BUSOFF; + + priv->can.can_stats.bus_off++; diff --git a/queue-3.10/can-kvaser_usb-fix-state-handling-upon-bus_error-events.patch b/queue-3.10/can-kvaser_usb-fix-state-handling-upon-bus_error-events.patch new file mode 100644 index 00000000000..b58568c8868 --- /dev/null +++ b/queue-3.10/can-kvaser_usb-fix-state-handling-upon-bus_error-events.patch @@ -0,0 +1,53 @@ +From e638642b08c170d2021b706f0b1c4f4ae93d8cbd Mon Sep 17 00:00:00 2001 +From: "Ahmed S. Darwish" +Date: Mon, 26 Jan 2015 07:25:43 +0200 +Subject: can: kvaser_usb: Fix state handling upon BUS_ERROR events + +From: "Ahmed S. Darwish" + +commit e638642b08c170d2021b706f0b1c4f4ae93d8cbd upstream. + +While being in an ERROR_WARNING state, and receiving further +bus error events with error counters still in the ERROR_WARNING +range of 97-127 inclusive, the state handling code erroneously +reverts back to ERROR_ACTIVE. + +Per the CAN standard, only revert to ERROR_ACTIVE when the +error counters are less than 96. + +Moreover, in certain Kvaser models, the BUS_ERROR flag is +always set along with undefined bits in the M16C status +register. Thus use bitwise operators instead of full equality +for checking that register against bus errors. + +Signed-off-by: Ahmed S. Darwish +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/can/usb/kvaser_usb.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +--- a/drivers/net/can/usb/kvaser_usb.c ++++ b/drivers/net/can/usb/kvaser_usb.c +@@ -690,9 +690,7 @@ static void kvaser_usb_rx_error(const st + } + + new_state = CAN_STATE_ERROR_PASSIVE; +- } +- +- if (status == M16C_STATE_BUS_ERROR) { ++ } else if (status & M16C_STATE_BUS_ERROR) { + if ((priv->can.state < CAN_STATE_ERROR_WARNING) && + ((txerr >= 96) || (rxerr >= 96))) { + cf->can_id |= CAN_ERR_CRTL; +@@ -702,7 +700,8 @@ static void kvaser_usb_rx_error(const st + + priv->can.can_stats.error_warning++; + new_state = CAN_STATE_ERROR_WARNING; +- } else if (priv->can.state > CAN_STATE_ERROR_ACTIVE) { ++ } else if ((priv->can.state > CAN_STATE_ERROR_ACTIVE) && ++ ((txerr < 96) && (rxerr < 96))) { + cf->can_id |= CAN_ERR_PROT; + cf->data[2] = CAN_ERR_PROT_ACTIVE; + diff --git a/queue-3.10/can-kvaser_usb-retry-the-first-bulk-transfer-on-etimedout.patch b/queue-3.10/can-kvaser_usb-retry-the-first-bulk-transfer-on-etimedout.patch new file mode 100644 index 00000000000..fafd3f279ce --- /dev/null +++ b/queue-3.10/can-kvaser_usb-retry-the-first-bulk-transfer-on-etimedout.patch @@ -0,0 +1,50 @@ +From 14c10c2a1dd8eb8e00b750b521753260befa2789 Mon Sep 17 00:00:00 2001 +From: "Ahmed S. Darwish" +Date: Mon, 26 Jan 2015 07:24:06 +0200 +Subject: can: kvaser_usb: Retry the first bulk transfer on -ETIMEDOUT + +From: "Ahmed S. Darwish" + +commit 14c10c2a1dd8eb8e00b750b521753260befa2789 upstream. + +On some x86 laptops, plugging a Kvaser device again after an +unplug makes the firmware always ignore the very first command. +For such a case, provide some room for retries instead of +completely exiting the driver init code. + +Signed-off-by: Ahmed S. Darwish +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/can/usb/kvaser_usb.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +--- a/drivers/net/can/usb/kvaser_usb.c ++++ b/drivers/net/can/usb/kvaser_usb.c +@@ -1578,7 +1578,7 @@ static int kvaser_usb_probe(struct usb_i + { + struct kvaser_usb *dev; + int err = -ENOMEM; +- int i; ++ int i, retry = 3; + + dev = devm_kzalloc(&intf->dev, sizeof(*dev), GFP_KERNEL); + if (!dev) +@@ -1596,7 +1596,15 @@ static int kvaser_usb_probe(struct usb_i + + usb_set_intfdata(intf, dev); + +- err = kvaser_usb_get_software_info(dev); ++ /* On some x86 laptops, plugging a Kvaser device again after ++ * an unplug makes the firmware always ignore the very first ++ * command. For such a case, provide some room for retries ++ * instead of completely exiting the driver. ++ */ ++ do { ++ err = kvaser_usb_get_software_info(dev); ++ } while (--retry && err == -ETIMEDOUT); ++ + if (err) { + dev_err(&intf->dev, + "Cannot get software infos, error %d\n", err); diff --git a/queue-3.10/can-kvaser_usb-send-correct-context-to-urb-completion.patch b/queue-3.10/can-kvaser_usb-send-correct-context-to-urb-completion.patch new file mode 100644 index 00000000000..cbd7c61a3b2 --- /dev/null +++ b/queue-3.10/can-kvaser_usb-send-correct-context-to-urb-completion.patch @@ -0,0 +1,35 @@ +From 3803fa6977f1de15fda4e8646c8fec97c8045cae Mon Sep 17 00:00:00 2001 +From: "Ahmed S. Darwish" +Date: Mon, 26 Jan 2015 07:22:54 +0200 +Subject: can: kvaser_usb: Send correct context to URB completion + +From: "Ahmed S. Darwish" + +commit 3803fa6977f1de15fda4e8646c8fec97c8045cae upstream. + +Send expected argument to the URB completion hander: a CAN +netdevice instead of the network interface private context +`kvaser_usb_net_priv'. + +This was discovered by having some garbage in the kernel +log in place of the netdevice names: can0 and can1. + +Signed-off-by: Ahmed S. Darwish +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/can/usb/kvaser_usb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/can/usb/kvaser_usb.c ++++ b/drivers/net/can/usb/kvaser_usb.c +@@ -579,7 +579,7 @@ static int kvaser_usb_simple_msg_async(s + usb_sndbulkpipe(dev->udev, + dev->bulk_out->bEndpointAddress), + buf, msg->len, +- kvaser_usb_simple_msg_callback, priv); ++ kvaser_usb_simple_msg_callback, netdev); + usb_anchor_urb(urb, &priv->tx_submitted); + + err = usb_submit_urb(urb, GFP_ATOMIC); diff --git a/queue-3.10/powerpc-xmon-fix-another-endiannes-issue-in-rtas-call-from-xmon.patch b/queue-3.10/powerpc-xmon-fix-another-endiannes-issue-in-rtas-call-from-xmon.patch new file mode 100644 index 00000000000..57bdda5ea8e --- /dev/null +++ b/queue-3.10/powerpc-xmon-fix-another-endiannes-issue-in-rtas-call-from-xmon.patch @@ -0,0 +1,39 @@ +From e6eb2eba494d6f99e69ca3c3748cd37a2544ab38 Mon Sep 17 00:00:00 2001 +From: Laurent Dufour +Date: Thu, 15 Jan 2015 18:23:47 +0100 +Subject: powerpc/xmon: Fix another endiannes issue in RTAS call from xmon + +From: Laurent Dufour + +commit e6eb2eba494d6f99e69ca3c3748cd37a2544ab38 upstream. + +The commit 3b8a3c010969 ("powerpc/pseries: Fix endiannes issue in RTAS +call from xmon") was fixing an endianness issue in the call made from +xmon to RTAS. + +However, as Michael Ellerman noticed, this fix was not complete, the +token value was not byte swapped. This lead to call an unexpected and +most of the time unexisting RTAS function, which is silently ignored by +RTAS. + +This fix addresses this hole. + +Reported-by: Michael Ellerman +Signed-off-by: Laurent Dufour +Signed-off-by: Michael Ellerman +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/xmon/xmon.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/powerpc/xmon/xmon.c ++++ b/arch/powerpc/xmon/xmon.c +@@ -288,6 +288,7 @@ static inline void disable_surveillance( + args.token = rtas_token("set-indicator"); + if (args.token == RTAS_UNKNOWN_SERVICE) + return; ++ args.token = cpu_to_be32(args.token); + args.nargs = cpu_to_be32(3); + args.nret = cpu_to_be32(1); + args.rets = &args.args[3]; diff --git a/queue-3.10/series b/queue-3.10/series index 01ad6fa8c67..15b287bb605 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -1 +1,8 @@ spi-dw-mid-fix-fifo-size.patch +asoc-wm8960-fix-capture-sample-rate-from-11250-to-11025.patch +can-kvaser_usb-do-not-sleep-in-atomic-context.patch +can-kvaser_usb-send-correct-context-to-urb-completion.patch +can-kvaser_usb-retry-the-first-bulk-transfer-on-etimedout.patch +can-kvaser_usb-fix-state-handling-upon-bus_error-events.patch +powerpc-xmon-fix-another-endiannes-issue-in-rtas-call-from-xmon.patch +alsa-seq-dummy-remove-deadlock-causing-events-on-close.patch