--- /dev/null
+From 0767e95bb96d7fdddcd590fb809e6975d93aebc5 Mon Sep 17 00:00:00 2001
+From: Clemens Ladisch <clemens@ladisch.de>
+Date: Sun, 25 Jan 2015 14:34:29 +0100
+Subject: ALSA: seq-dummy: remove deadlock-causing events on close
+
+From: Clemens Ladisch <clemens@ladisch.de>
+
+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 <peter@www.pjb.com.au>
+Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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;
--- /dev/null
+From adc60298c80efef4c2d7a7860b91b450931a7cf8 Mon Sep 17 00:00:00 2001
+From: Aurelien BOUIN <a_bouin@yahoo.fr>
+Date: Mon, 29 Dec 2014 16:13:51 -0800
+Subject: ASoC: fsl_esai: Fix incorrect xDC field width of xCCR registers
+
+From: Aurelien BOUIN <a_bouin@yahoo.fr>
+
+commit adc60298c80efef4c2d7a7860b91b450931a7cf8 upstream.
+
+The xDC field should have 5 bit width according to Reference Manual.
+Thus this patch fixes it.
+
+Signed-off-by: Aurelien BOUIN <a_bouin@yahoo.fr>
+Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/fsl/fsl_esai.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/soc/fsl/fsl_esai.h
++++ b/sound/soc/fsl/fsl_esai.h
+@@ -302,7 +302,7 @@
+ #define ESAI_xCCR_xFP_MASK (((1 << ESAI_xCCR_xFP_WIDTH) - 1) << ESAI_xCCR_xFP_SHIFT)
+ #define ESAI_xCCR_xFP(v) ((((v) - 1) << ESAI_xCCR_xFP_SHIFT) & ESAI_xCCR_xFP_MASK)
+ #define ESAI_xCCR_xDC_SHIFT 9
+-#define ESAI_xCCR_xDC_WIDTH 4
++#define ESAI_xCCR_xDC_WIDTH 5
+ #define ESAI_xCCR_xDC_MASK (((1 << ESAI_xCCR_xDC_WIDTH) - 1) << ESAI_xCCR_xDC_SHIFT)
+ #define ESAI_xCCR_xDC(v) ((((v) - 1) << ESAI_xCCR_xDC_SHIFT) & ESAI_xCCR_xDC_MASK)
+ #define ESAI_xCCR_xPSR_SHIFT 8
--- /dev/null
+From 20602e34cd33dd452bc1836fa7c9b59978f75db0 Mon Sep 17 00:00:00 2001
+From: Peter Ujfalusi <peter.ujfalusi@ti.com>
+Date: Fri, 16 Jan 2015 11:20:25 +0200
+Subject: ASoC: omap-mcbsp: Correct CBM_CFS dai format configuration
+
+From: Peter Ujfalusi <peter.ujfalusi@ti.com>
+
+commit 20602e34cd33dd452bc1836fa7c9b59978f75db0 upstream.
+
+We should select FSR also to be driven by McBSP, not only FSX.
+
+Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
+Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/omap/omap-mcbsp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/soc/omap/omap-mcbsp.c
++++ b/sound/soc/omap/omap-mcbsp.c
+@@ -436,7 +436,7 @@ static int omap_mcbsp_dai_set_dai_fmt(st
+ case SND_SOC_DAIFMT_CBM_CFS:
+ /* McBSP slave. FS clock as output */
+ regs->srgr2 |= FSGM;
+- regs->pcr0 |= FSXM;
++ regs->pcr0 |= FSXM | FSRM;
+ break;
+ case SND_SOC_DAIFMT_CBM_CFM:
+ /* McBSP slave */
--- /dev/null
+From d3268a40d4b19ff7bee23f52eabbc4e96bb685e8 Mon Sep 17 00:00:00 2001
+From: Qais Yousef <qais.yousef@imgtec.com>
+Date: Wed, 14 Jan 2015 08:47:29 +0000
+Subject: ASoC: soc-compress.c: fix NULL dereference
+
+From: Qais Yousef <qais.yousef@imgtec.com>
+
+commit d3268a40d4b19ff7bee23f52eabbc4e96bb685e8 upstream.
+
+In soc_new_compress() when rtd->dai_link->dynamic is set, we create the pcm
+substreams with this call:
+
+ ret = snd_pcm_new_internal(rtd->card->snd_card, new_name, num,
+ 1, 0, &be_pcm);
+
+which passes 0 as capture_count leading to
+
+ be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream
+
+being NULL, hence when trying to set rtd a few lines below we get an oops.
+
+Fix by using rtd->dai_link->dpcm_playback and rtd->dai_link->dpcm_capture as
+playback_count and capture_count to snd_pcm_new_internal().
+
+Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/soc-compress.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+--- a/sound/soc/soc-compress.c
++++ b/sound/soc/soc-compress.c
+@@ -696,7 +696,8 @@ int soc_new_compress(struct snd_soc_pcm_
+ rtd->dai_link->stream_name);
+
+ ret = snd_pcm_new_internal(rtd->card->snd_card, new_name, num,
+- 1, 0, &be_pcm);
++ rtd->dai_link->dpcm_playback,
++ rtd->dai_link->dpcm_capture, &be_pcm);
+ if (ret < 0) {
+ dev_err(rtd->card->dev, "ASoC: can't create compressed for %s\n",
+ rtd->dai_link->name);
+@@ -705,8 +706,10 @@ int soc_new_compress(struct snd_soc_pcm_
+
+ rtd->pcm = be_pcm;
+ rtd->fe_compr = 1;
+- be_pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->private_data = rtd;
+- be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd;
++ if (rtd->dai_link->dpcm_playback)
++ be_pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->private_data = rtd;
++ else if (rtd->dai_link->dpcm_capture)
++ be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd;
+ memcpy(compr->ops, &soc_compr_dyn_ops, sizeof(soc_compr_dyn_ops));
+ } else
+ memcpy(compr->ops, &soc_compr_ops, sizeof(soc_compr_ops));
--- /dev/null
+From 22ee76daddb87f88d2336d1b4737ef27c4f307ac Mon Sep 17 00:00:00 2001
+From: Zidan Wang <b50113@freescale.com>
+Date: Wed, 31 Dec 2014 11:39:14 +0800
+Subject: ASoC: wm8960: Fix capture sample rate from 11250 to 11025
+
+From: Zidan Wang <b50113@freescale.com>
+
+commit 22ee76daddb87f88d2336d1b4737ef27c4f307ac upstream.
+
+wm8960 codec can't support sample rate 11250, it must be 11025.
+
+Signed-off-by: Zidan Wang <b50113@freescale.com>
+Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 },
+ };
--- /dev/null
+From ded5006667318c06df875609535176bd33f243a1 Mon Sep 17 00:00:00 2001
+From: "Ahmed S. Darwish" <ahmed.darwish@valeo.com>
+Date: Mon, 26 Jan 2015 07:20:39 +0200
+Subject: can: kvaser_usb: Do not sleep in atomic context
+
+From: "Ahmed S. Darwish" <ahmed.darwish@valeo.com>
+
+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:
+
+ <IRQ> [<ffffffff8158de87>] dump_stack+0x45/0x57
+ [<ffffffff8158b60c>] __schedule_bug+0x41/0x4f
+ [<ffffffff815904b1>] __schedule+0x5f1/0x700
+ [<ffffffff8159360a>] ? _raw_spin_unlock_irqrestore+0xa/0x10
+ [<ffffffff81590684>] schedule+0x24/0x70
+ [<ffffffff8147d0a5>] usb_kill_urb+0x65/0xa0
+ [<ffffffff81077970>] ? prepare_to_wait_event+0x110/0x110
+ [<ffffffff8147d7d8>] usb_kill_anchored_urbs+0x48/0x80
+ [<ffffffffa01f4028>] kvaser_usb_unlink_tx_urbs+0x18/0x50 [kvaser_usb]
+ [<ffffffffa01f45d0>] kvaser_usb_rx_error+0xc0/0x400 [kvaser_usb]
+ [<ffffffff8108b14a>] ? vprintk_default+0x1a/0x20
+ [<ffffffffa01f5241>] kvaser_usb_read_bulk_callback+0x4c1/0x5f0 [kvaser_usb]
+ [<ffffffff8147a73e>] __usb_hcd_giveback_urb+0x5e/0xc0
+ [<ffffffff8147a8a1>] usb_hcd_giveback_urb+0x41/0x110
+ [<ffffffffa0008748>] finish_urb+0x98/0x180 [ohci_hcd]
+ [<ffffffff810cd1a7>] ? acct_account_cputime+0x17/0x20
+ [<ffffffff81069f65>] ? local_clock+0x15/0x30
+ [<ffffffffa000a36b>] ohci_work+0x1fb/0x5a0 [ohci_hcd]
+ [<ffffffff814fbb31>] ? process_backlog+0xb1/0x130
+ [<ffffffffa000cd5b>] ohci_irq+0xeb/0x270 [ohci_hcd]
+ [<ffffffff81479fc1>] usb_hcd_irq+0x21/0x30
+ [<ffffffff8108bfd3>] handle_irq_event_percpu+0x43/0x120
+ [<ffffffff8108c0ed>] handle_irq_event+0x3d/0x60
+ [<ffffffff8108ec84>] handle_fasteoi_irq+0x74/0x110
+ [<ffffffff81004dfd>] handle_irq+0x1d/0x30
+ [<ffffffff81004727>] do_IRQ+0x57/0x100
+ [<ffffffff8159482a>] common_interrupt+0x6a/0x6a
+
+Signed-off-by: Ahmed S. Darwish <ahmed.darwish@valeo.com>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -653,11 +653,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++;
+@@ -668,7 +663,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++;
--- /dev/null
+From e638642b08c170d2021b706f0b1c4f4ae93d8cbd Mon Sep 17 00:00:00 2001
+From: "Ahmed S. Darwish" <ahmed.darwish@valeo.com>
+Date: Mon, 26 Jan 2015 07:25:43 +0200
+Subject: can: kvaser_usb: Fix state handling upon BUS_ERROR events
+
+From: "Ahmed S. Darwish" <ahmed.darwish@valeo.com>
+
+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 <ahmed.darwish@valeo.com>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -689,9 +689,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;
+@@ -701,7 +699,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;
+
--- /dev/null
+From 14c10c2a1dd8eb8e00b750b521753260befa2789 Mon Sep 17 00:00:00 2001
+From: "Ahmed S. Darwish" <ahmed.darwish@valeo.com>
+Date: Mon, 26 Jan 2015 07:24:06 +0200
+Subject: can: kvaser_usb: Retry the first bulk transfer on -ETIMEDOUT
+
+From: "Ahmed S. Darwish" <ahmed.darwish@valeo.com>
+
+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 <ahmed.darwish@valeo.com>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -1577,7 +1577,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)
+@@ -1595,7 +1595,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);
--- /dev/null
+From 3803fa6977f1de15fda4e8646c8fec97c8045cae Mon Sep 17 00:00:00 2001
+From: "Ahmed S. Darwish" <ahmed.darwish@valeo.com>
+Date: Mon, 26 Jan 2015 07:22:54 +0200
+Subject: can: kvaser_usb: Send correct context to URB completion
+
+From: "Ahmed S. Darwish" <ahmed.darwish@valeo.com>
+
+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 <ahmed.darwish@valeo.com>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -578,7 +578,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);
--- /dev/null
+From 34e81ad5f0b60007c95995eb7803da7e00c6c611 Mon Sep 17 00:00:00 2001
+From: Paul Osmialowski <p.osmialowsk@samsung.com>
+Date: Mon, 19 Jan 2015 17:03:33 +0100
+Subject: i2c: s3c2410: fix ABBA deadlock by keeping clock prepared
+
+From: Paul Osmialowski <p.osmialowsk@samsung.com>
+
+commit 34e81ad5f0b60007c95995eb7803da7e00c6c611 upstream.
+
+This patch solves deadlock between clock prepare mutex and regmap mutex reported
+by Tomasz Figa in [1] by implementing solution from [2]: "always leave the clock
+of the i2c controller in a prepared state".
+
+[1] https://lkml.org/lkml/2014/7/2/171
+[2] https://lkml.org/lkml/2014/7/2/207
+
+On each i2c transfer handled by s3c24xx_i2c_xfer(), clk_prepare_enable() was
+called, which calls clk_prepare() then clk_enable(). clk_prepare() takes
+prepare_lock mutex before proceeding. Note that i2c transfer functions are
+invoked from many places in kernel, typically with some other additional lock
+held.
+
+It may happen that function on CPU1 (e.g. regmap_update_bits()) has taken a
+mutex (i.e. regmap lock mutex) then it attempts i2c communication in order to
+proceed (so it needs to obtain clock related prepare_lock mutex during transfer
+preparation stage due to clk_prepare() call). At the same time other task on
+CPU0 wants to operate on clock (e.g. to (un)prepare clock for some other reason)
+so it has taken prepare_lock mutex.
+
+CPU0: CPU1:
+clk_disable_unused() regulator_disable()
+ clk_prepare_lock() map->lock(map->lock_arg)
+ regmap_read() s3c24xx_i2c_xfer()
+ map->lock(map->lock_arg) clk_prepare_lock()
+
+Implemented solution from [2] leaves i2c clock prepared. Preparation is done in
+s3c24xx_i2c_probe() function. Without this patch, it is immediately unprepared
+by clk_disable_unprepare() call. I've replaced this call with clk_disable() and
+I've added clk_unprepare() call in s3c24xx_i2c_remove().
+
+The s3c24xx_i2c_xfer() function now uses clk_enable() instead of
+clk_prepare_enable() (and clk_disable() instead of clk_unprepare_disable()).
+
+Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
+Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
+Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/i2c/busses/i2c-s3c2410.c | 23 +++++++++++++++++------
+ 1 file changed, 17 insertions(+), 6 deletions(-)
+
+--- a/drivers/i2c/busses/i2c-s3c2410.c
++++ b/drivers/i2c/busses/i2c-s3c2410.c
+@@ -753,14 +753,16 @@ static int s3c24xx_i2c_xfer(struct i2c_a
+ int ret;
+
+ pm_runtime_get_sync(&adap->dev);
+- clk_prepare_enable(i2c->clk);
++ ret = clk_enable(i2c->clk);
++ if (ret)
++ return ret;
+
+ for (retry = 0; retry < adap->retries; retry++) {
+
+ ret = s3c24xx_i2c_doxfer(i2c, msgs, num);
+
+ if (ret != -EAGAIN) {
+- clk_disable_unprepare(i2c->clk);
++ clk_disable(i2c->clk);
+ pm_runtime_put(&adap->dev);
+ return ret;
+ }
+@@ -770,7 +772,7 @@ static int s3c24xx_i2c_xfer(struct i2c_a
+ udelay(100);
+ }
+
+- clk_disable_unprepare(i2c->clk);
++ clk_disable(i2c->clk);
+ pm_runtime_put(&adap->dev);
+ return -EREMOTEIO;
+ }
+@@ -1153,7 +1155,7 @@ static int s3c24xx_i2c_probe(struct plat
+
+ clk_prepare_enable(i2c->clk);
+ ret = s3c24xx_i2c_init(i2c);
+- clk_disable_unprepare(i2c->clk);
++ clk_disable(i2c->clk);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "I2C controller init failed\n");
+ return ret;
+@@ -1166,6 +1168,7 @@ static int s3c24xx_i2c_probe(struct plat
+ i2c->irq = ret = platform_get_irq(pdev, 0);
+ if (ret <= 0) {
+ dev_err(&pdev->dev, "cannot find IRQ\n");
++ clk_unprepare(i2c->clk);
+ return ret;
+ }
+
+@@ -1174,6 +1177,7 @@ static int s3c24xx_i2c_probe(struct plat
+
+ if (ret != 0) {
+ dev_err(&pdev->dev, "cannot claim IRQ %d\n", i2c->irq);
++ clk_unprepare(i2c->clk);
+ return ret;
+ }
+ }
+@@ -1181,6 +1185,7 @@ static int s3c24xx_i2c_probe(struct plat
+ ret = s3c24xx_i2c_register_cpufreq(i2c);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "failed to register cpufreq notifier\n");
++ clk_unprepare(i2c->clk);
+ return ret;
+ }
+
+@@ -1197,6 +1202,7 @@ static int s3c24xx_i2c_probe(struct plat
+ if (ret < 0) {
+ dev_err(&pdev->dev, "failed to add bus to i2c core\n");
+ s3c24xx_i2c_deregister_cpufreq(i2c);
++ clk_unprepare(i2c->clk);
+ return ret;
+ }
+
+@@ -1218,6 +1224,8 @@ static int s3c24xx_i2c_remove(struct pla
+ {
+ struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
+
++ clk_unprepare(i2c->clk);
++
+ pm_runtime_disable(&i2c->adap.dev);
+ pm_runtime_disable(&pdev->dev);
+
+@@ -1246,10 +1254,13 @@ static int s3c24xx_i2c_resume(struct dev
+ {
+ struct platform_device *pdev = to_platform_device(dev);
+ struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
++ int ret;
+
+- clk_prepare_enable(i2c->clk);
++ ret = clk_enable(i2c->clk);
++ if (ret)
++ return ret;
+ s3c24xx_i2c_init(i2c);
+- clk_disable_unprepare(i2c->clk);
++ clk_disable(i2c->clk);
+ i2c->suspended = 0;
+
+ return 0;
--- /dev/null
+From e6eb2eba494d6f99e69ca3c3748cd37a2544ab38 Mon Sep 17 00:00:00 2001
+From: Laurent Dufour <ldufour@linux.vnet.ibm.com>
+Date: Thu, 15 Jan 2015 18:23:47 +0100
+Subject: powerpc/xmon: Fix another endiannes issue in RTAS call from xmon
+
+From: Laurent Dufour <ldufour@linux.vnet.ibm.com>
+
+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 <mpe@ellerman.id.au>
+Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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];
--- /dev/null
+From e69b8d414f948c242ad9f3eb2b7e24fba783dbbd Mon Sep 17 00:00:00 2001
+From: Ilya Dryomov <idryomov@redhat.com>
+Date: Mon, 19 Jan 2015 12:06:14 +0300
+Subject: rbd: drop parent_ref in rbd_dev_unprobe() unconditionally
+
+From: Ilya Dryomov <idryomov@redhat.com>
+
+commit e69b8d414f948c242ad9f3eb2b7e24fba783dbbd upstream.
+
+This effectively reverts the last hunk of 392a9dad7e77 ("rbd: detect
+when clone image is flattened").
+
+The problem with parent_overlap != 0 condition is that it's possible
+and completely valid to have an image with parent_overlap == 0 whose
+parent state needs to be cleaned up on unmap. The next commit, which
+drops the "clone image now standalone" logic, opens up another window
+of opportunity to hit this, but even without it
+
+ # cat parent-ref.sh
+ #!/bin/bash
+ rbd create --image-format 2 --size 1 foo
+ rbd snap create foo@snap
+ rbd snap protect foo@snap
+ rbd clone foo@snap bar
+ rbd resize --allow-shrink --size 0 bar
+ rbd resize --size 1 bar
+ DEV=$(rbd map bar)
+ rbd unmap $DEV
+
+leaves rbd_device/rbd_spec/etc and rbd_client along with ceph_client
+hanging around.
+
+My thinking behind calling rbd_dev_parent_put() unconditionally is that
+there shouldn't be any requests in flight at that point in time as we
+are deep into unmap sequence. Hence, even if rbd_dev_unparent() caused
+by flatten is delayed by in-flight requests, it will have finished by
+the time we reach rbd_dev_unprobe() caused by unmap, thus turning
+unconditional rbd_dev_parent_put() into a no-op.
+
+Fixes: http://tracker.ceph.com/issues/10352
+
+Signed-off-by: Ilya Dryomov <idryomov@redhat.com>
+Reviewed-by: Josh Durgin <jdurgin@redhat.com>
+Reviewed-by: Alex Elder <elder@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/block/rbd.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+--- a/drivers/block/rbd.c
++++ b/drivers/block/rbd.c
+@@ -4764,10 +4764,7 @@ static void rbd_dev_unprobe(struct rbd_d
+ {
+ struct rbd_image_header *header;
+
+- /* Drop parent reference unless it's already been done (or none) */
+-
+- if (rbd_dev->parent_overlap)
+- rbd_dev_parent_put(rbd_dev);
++ rbd_dev_parent_put(rbd_dev);
+
+ /* Free dynamic fields from the header, then zero it out */
+
x86-build-replace-perl-script-with-shell-script.patch
spi-dw-mid-fix-fifo-size.patch
+asoc-wm8960-fix-capture-sample-rate-from-11250-to-11025.patch
+asoc-fsl_esai-fix-incorrect-xdc-field-width-of-xccr-registers.patch
+asoc-soc-compress.c-fix-null-dereference.patch
+asoc-omap-mcbsp-correct-cbm_cfs-dai-format-configuration.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
+rbd-drop-parent_ref-in-rbd_dev_unprobe-unconditionally.patch
+i2c-s3c2410-fix-abba-deadlock-by-keeping-clock-prepared.patch