From: Matt Mullins Date: Sun, 21 Jun 2015 22:52:39 +0000 (-0700) Subject: Merge tag 'v3.10.80' into edison-3.10-2015ww25 X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=75da32029896e000bc1492cc3ed06fd0d7284e1b;p=linux-edison.git Merge tag 'v3.10.80' into edison-3.10-2015ww25 This is the 3.10.80 stable release Conflicts: drivers/bluetooth/hci_ldisc.c drivers/hwmon/coretemp.c drivers/mmc/card/block.c drivers/mmc/card/queue.h drivers/mmc/host/sdhci.c drivers/spi/spi-dw-mid.c include/sound/compress_driver.h sound/core/compress_offload.c I didn't even test how well I resolved the conflicts at all. --- 75da32029896e000bc1492cc3ed06fd0d7284e1b diff --cc drivers/i2c/busses/i2c-designware-core.c index b316ea335c4,f24a7385260..859eb20da4f --- a/drivers/i2c/busses/i2c-designware-core.c +++ b/drivers/i2c/busses/i2c-designware-core.c @@@ -1034,8 -380,11 +1034,11 @@@ static void i2c_dw_xfer_init(struct dw_ ic_con &= ~DW_IC_CON_10BITADDR_MASTER; dw_writel(dev, ic_con, DW_IC_CON); + /* enforce disabled interrupts (due to HW issues) */ + i2c_dw_disable_int(dev); + /* Enable the adapter */ - __i2c_dw_enable(dev, true); + i2c_dw_enable(dev); /* Clear and enable interrupts */ i2c_dw_clear_int(dev); diff --cc drivers/mmc/host/sdhci.c index 1f7c7967191,836e2ac36a0..e350210eaac --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@@ -1574,7 -1316,7 +1574,8 @@@ static void sdhci_request(struct mmc_ho sdhci_runtime_pm_get(host); + sdhci_acquire_ownership(host->mmc); + present = mmc_gpio_get_cd(host->mmc); spin_lock_irqsave(&host->lock, flags); diff --cc drivers/usb/dwc3/gadget.c index d5418acc8da,87f8fc63b3e..196891d6edc --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@@ -691,18 -599,14 +690,22 @@@ static void dwc3_remove_requests(struc static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep) { struct dwc3 *dwc = dep->dwc; + struct ebc_io *ebc = dep->ebc; u32 reg; + if (ebc) { + dwc->is_ebc = 0; + + if (ebc->is_ondemand && ebc->xfer_stop) + ebc->xfer_stop(); + } + dwc3_remove_requests(dwc, dep); + /* make sure HW endpoint isn't stalled */ + if (dep->flags & DWC3_EP_STALL) + __dwc3_gadget_ep_set_halt(dep, 0, false); + reg = dwc3_readl(dwc->regs, DWC3_DALEPENA); reg &= ~DWC3_DALEPENA_EP(dep->number); dwc3_writel(dwc->regs, DWC3_DALEPENA, reg); @@@ -1035,9 -925,10 +1037,12 @@@ static void dwc3_prepare_trbs(struct dw if (last_one) break; } + + if (last_one) + break; } else { + unsigned csp = false; + dma = req->request.dma; length = req->request.length; trbs_left--; diff --cc drivers/usb/host/xhci.c index 04de933cfd8,10223f2b18d..9bf5d404b71 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@@ -315,11 -315,11 +315,14 @@@ static void xhci_cleanup_msix(struct xh struct usb_hcd *hcd = xhci_to_hcd(xhci); struct pci_dev *pdev = to_pci_dev(hcd->self.controller); + if (xhci->quirks & XHCI_PLAT) + return; + xhci_free_irq(xhci); + if (xhci->quirks & XHCI_PLAT) + return; + if (xhci->msix_entries) { pci_disable_msix(pdev); kfree(xhci->msix_entries); diff --cc sound/core/compress_offload.c index 632dcd658a4,3fdf998ad05..8dc970bcfd2 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@@ -684,65 -659,68 +684,89 @@@ static int snd_compr_start(struct snd_c return retval; } -static int snd_compr_stop(struct snd_compr_stream *stream) +int snd_compr_stop(struct snd_compr_stream *stream) { - int retval; + int retval = 0; - if (stream->runtime->state == SNDRV_PCM_STATE_PREPARED || - stream->runtime->state == SNDRV_PCM_STATE_SETUP) + if (stream->runtime->state == SNDRV_PCM_STATE_SETUP) return -EPERM; - retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_STOP); + if (stream->runtime->state != SNDRV_PCM_STATE_PREPARED) + retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_STOP); if (!retval) { - stream->runtime->state = SNDRV_PCM_STATE_SETUP; - wake_up(&stream->runtime->sleep); snd_compr_drain_notify(stream); stream->runtime->total_bytes_available = 0; stream->runtime->total_bytes_transferred = 0; } return retval; } +EXPORT_SYMBOL(snd_compr_stop); + +static int snd_compress_wait_for_drain(struct snd_compr_stream *stream) +{ + /* + * We are called with lock held. So drop the lock while we wait for + * drain complete notfication from the driver + * + * It is expected that driver will notify the drain completion and then + * stream will be moved to SETUP state, even if draining resulted in an + * error. We can trigger next track after this. + */ + stream->runtime->state = SNDRV_PCM_STATE_DRAINING; + mutex_unlock(&stream->device->lock); + + wait_event(stream->runtime->wait, stream->runtime->drain_wake); + + wake_up(&stream->runtime->sleep); + mutex_lock(&stream->device->lock); + + return 0; +} + static int snd_compress_wait_for_drain(struct snd_compr_stream *stream) + { + int ret; + + /* + * We are called with lock held. So drop the lock while we wait for + * drain complete notfication from the driver + * + * It is expected that driver will notify the drain completion and then + * stream will be moved to SETUP state, even if draining resulted in an + * error. We can trigger next track after this. + */ + stream->runtime->state = SNDRV_PCM_STATE_DRAINING; + mutex_unlock(&stream->device->lock); + + /* we wait for drain to complete here, drain can return when + * interruption occurred, wait returned error or success. + * For the first two cases we don't do anything different here and + * return after waking up + */ + + ret = wait_event_interruptible(stream->runtime->sleep, + (stream->runtime->state != SNDRV_PCM_STATE_DRAINING)); + if (ret == -ERESTARTSYS) + pr_debug("wait aborted by a signal"); + else if (ret) + pr_debug("wait for drain failed with %d\n", ret); + + + wake_up(&stream->runtime->sleep); + mutex_lock(&stream->device->lock); + + return ret; + } + static int snd_compr_drain(struct snd_compr_stream *stream) { - int retval; + int retval = 0; - if (stream->runtime->state == SNDRV_PCM_STATE_PREPARED || - stream->runtime->state == SNDRV_PCM_STATE_SETUP) + if (stream->runtime->state == SNDRV_PCM_STATE_SETUP) return -EPERM; - stream->runtime->drain_wake = 0; - - /* this is hackish for our tree but for now lets carry it while we fix - * usermode behaviour - */ - if (stream->runtime->state != SNDRV_PCM_STATE_PREPARED) - retval = stream->ops->trigger(stream, SND_COMPR_TRIGGER_DRAIN); - else - return 0; - + retval = stream->ops->trigger(stream, SND_COMPR_TRIGGER_DRAIN); if (retval) { - pr_err("SND_COMPR_TRIGGER_DRAIN failed %d\n", retval); + pr_debug("SND_COMPR_TRIGGER_DRAIN failed %d\n", retval); wake_up(&stream->runtime->sleep); return retval; }