diff options
| author | Adrian Hunter <adrian.hunter@intel.com> | 2017-03-20 13:50:37 -0400 |
|---|---|---|
| committer | Ulf Hansson <ulf.hansson@linaro.org> | 2017-04-24 15:41:29 -0400 |
| commit | d1e4f74f911daee4d69b5fd0c81902f7d37de579 (patch) | |
| tree | 9ea1ec6a4b468a1c0b000273e6046bef6c579081 /drivers/mmc/host/sdhci.c | |
| parent | 0c62e6752d0c769aae41bfade6258e5f9aedbe2d (diff) | |
mmc: sdhci: Do not use spin lock in set_ios paths
The spin lock is not necessary in set_ios. Anything that is racing with
changes to the I/O state is already broken. The mmc core already provides
synchronization via "claiming" the host. So remove spin_lock and friends
from sdhci_set_ios and related callbacks.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
| -rw-r--r-- | drivers/mmc/host/sdhci.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index e055bd3f5fe8..5c2b35dd1c45 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
| @@ -1361,9 +1361,7 @@ void sdhci_enable_clk(struct sdhci_host *host, u16 clk) | |||
| 1361 | sdhci_dumpregs(host); | 1361 | sdhci_dumpregs(host); |
| 1362 | return; | 1362 | return; |
| 1363 | } | 1363 | } |
| 1364 | spin_unlock_irq(&host->lock); | ||
| 1365 | udelay(10); | 1364 | udelay(10); |
| 1366 | spin_lock_irq(&host->lock); | ||
| 1367 | } | 1365 | } |
| 1368 | 1366 | ||
| 1369 | clk |= SDHCI_CLOCK_CARD_EN; | 1367 | clk |= SDHCI_CLOCK_CARD_EN; |
| @@ -1392,9 +1390,7 @@ static void sdhci_set_power_reg(struct sdhci_host *host, unsigned char mode, | |||
| 1392 | { | 1390 | { |
| 1393 | struct mmc_host *mmc = host->mmc; | 1391 | struct mmc_host *mmc = host->mmc; |
| 1394 | 1392 | ||
| 1395 | spin_unlock_irq(&host->lock); | ||
| 1396 | mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); | 1393 | mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); |
| 1397 | spin_lock_irq(&host->lock); | ||
| 1398 | 1394 | ||
| 1399 | if (mode != MMC_POWER_OFF) | 1395 | if (mode != MMC_POWER_OFF) |
| 1400 | sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL); | 1396 | sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL); |
| @@ -1574,16 +1570,12 @@ EXPORT_SYMBOL_GPL(sdhci_set_uhs_signaling); | |||
| 1574 | static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | 1570 | static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) |
| 1575 | { | 1571 | { |
| 1576 | struct sdhci_host *host = mmc_priv(mmc); | 1572 | struct sdhci_host *host = mmc_priv(mmc); |
| 1577 | unsigned long flags; | ||
| 1578 | u8 ctrl; | 1573 | u8 ctrl; |
| 1579 | 1574 | ||
| 1580 | if (ios->power_mode == MMC_POWER_UNDEFINED) | 1575 | if (ios->power_mode == MMC_POWER_UNDEFINED) |
| 1581 | return; | 1576 | return; |
| 1582 | 1577 | ||
| 1583 | spin_lock_irqsave(&host->lock, flags); | ||
| 1584 | |||
| 1585 | if (host->flags & SDHCI_DEVICE_DEAD) { | 1578 | if (host->flags & SDHCI_DEVICE_DEAD) { |
| 1586 | spin_unlock_irqrestore(&host->lock, flags); | ||
| 1587 | if (!IS_ERR(mmc->supply.vmmc) && | 1579 | if (!IS_ERR(mmc->supply.vmmc) && |
| 1588 | ios->power_mode == MMC_POWER_OFF) | 1580 | ios->power_mode == MMC_POWER_OFF) |
| 1589 | mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); | 1581 | mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); |
| @@ -1729,7 +1721,6 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
| 1729 | sdhci_do_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); | 1721 | sdhci_do_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); |
| 1730 | 1722 | ||
| 1731 | mmiowb(); | 1723 | mmiowb(); |
| 1732 | spin_unlock_irqrestore(&host->lock, flags); | ||
| 1733 | } | 1724 | } |
| 1734 | 1725 | ||
| 1735 | static int sdhci_get_cd(struct mmc_host *mmc) | 1726 | static int sdhci_get_cd(struct mmc_host *mmc) |
