diff options
Diffstat (limited to 'kernel/drivers/mmc/host/sdhci.c')
-rw-r--r-- | kernel/drivers/mmc/host/sdhci.c | 48 |
1 files changed, 15 insertions, 33 deletions
diff --git a/kernel/drivers/mmc/host/sdhci.c b/kernel/drivers/mmc/host/sdhci.c index f09bc10c9..bec8a307f 100644 --- a/kernel/drivers/mmc/host/sdhci.c +++ b/kernel/drivers/mmc/host/sdhci.c @@ -2691,31 +2691,6 @@ static irqreturn_t sdhci_thread_irq(int irq, void *dev_id) return isr ? IRQ_HANDLED : IRQ_NONE; } -#ifdef CONFIG_PREEMPT_RT_BASE -static irqreturn_t sdhci_rt_irq(int irq, void *dev_id) -{ - irqreturn_t ret; - - local_bh_disable(); - ret = sdhci_irq(irq, dev_id); - local_bh_enable(); - if (ret == IRQ_WAKE_THREAD) - ret = sdhci_thread_irq(irq, dev_id); - return ret; -} -#endif - -static int sdhci_req_irq(struct sdhci_host *host) -{ -#ifdef CONFIG_PREEMPT_RT_BASE - return request_threaded_irq(host->irq, NULL, sdhci_rt_irq, - IRQF_SHARED, mmc_hostname(host->mmc), host); -#else - return request_threaded_irq(host->irq, sdhci_irq, sdhci_thread_irq, - IRQF_SHARED, mmc_hostname(host->mmc), host); -#endif -} - /*****************************************************************************\ * * * Suspend/resume * @@ -2783,7 +2758,9 @@ int sdhci_resume_host(struct sdhci_host *host) } if (!device_may_wakeup(mmc_dev(host->mmc))) { - ret = sdhci_req_irq(host); + ret = request_threaded_irq(host->irq, sdhci_irq, + sdhci_thread_irq, IRQF_SHARED, + mmc_hostname(host->mmc), host); if (ret) return ret; } else { @@ -3060,8 +3037,11 @@ int sdhci_add_host(struct sdhci_host *host) GFP_KERNEL); host->align_buffer = kmalloc(host->align_buffer_sz, GFP_KERNEL); if (!host->adma_table || !host->align_buffer) { - dma_free_coherent(mmc_dev(mmc), host->adma_table_sz, - host->adma_table, host->adma_addr); + if (host->adma_table) + dma_free_coherent(mmc_dev(mmc), + host->adma_table_sz, + host->adma_table, + host->adma_addr); kfree(host->align_buffer); pr_warn("%s: Unable to allocate ADMA buffers - falling back to standard DMA\n", mmc_hostname(mmc)); @@ -3338,13 +3318,14 @@ int sdhci_add_host(struct sdhci_host *host) SDHCI_MAX_CURRENT_MULTIPLIER; } - /* If OCR set by external regulators, use it instead */ + /* If OCR set by host, use it instead. */ + if (host->ocr_mask) + ocr_avail = host->ocr_mask; + + /* If OCR set by external regulators, give it highest prio. */ if (mmc->ocr_avail) ocr_avail = mmc->ocr_avail; - if (host->ocr_mask) - ocr_avail &= host->ocr_mask; - mmc->ocr_avail = ocr_avail; mmc->ocr_avail_sdio = ocr_avail; if (host->ocr_avail_sdio) @@ -3440,7 +3421,8 @@ int sdhci_add_host(struct sdhci_host *host) sdhci_init(host, 0); - ret = sdhci_req_irq(host); + ret = request_threaded_irq(host->irq, sdhci_irq, sdhci_thread_irq, + IRQF_SHARED, mmc_hostname(mmc), host); if (ret) { pr_err("%s: Failed to request IRQ %d: %d\n", mmc_hostname(mmc), host->irq, ret); |