Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1610651

[PATCH 4.4 42/76] mmc: sdhci: Do not disable interrupts while waiting for clock

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.4 42/76] mmc: sdhci: Do not disable interrupts while waiting for clock
Date 2017-03-28 14:40 +0200
Message-ID <tpYzM-7we-21@gated-at.bofh.it> (permalink)
References <tpYzL-7we-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Adrian Hunter <adrian.hunter@intel.com>

commit e2ebfb2142acefecc2496e71360f50d25726040b upstream.

Disabling interrupts for even a millisecond can cause problems for some
devices. That can happen when sdhci changes clock frequency because it
waits for the clock to become stable under a spin lock.

The spin lock is not necessary here. Anything that is racing with changes
to the I/O state is already broken. The mmc core already provides
synchronization via "claiming" the host.

Although the spin lock probably should be removed from the code paths that
lead to this point, such a patch would touch too much code to be suitable
for stable trees. Consequently, for this patch, just drop the spin lock
while waiting.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mmc/host/sdhci.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1274,7 +1274,9 @@ clock_set:
 			return;
 		}
 		timeout--;
-		mdelay(1);
+		spin_unlock_irq(&host->lock);
+		usleep_range(900, 1100);
+		spin_lock_irq(&host->lock);
 	}
 
 	clk |= SDHCI_CLOCK_CARD_EN;

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 4.4 42/76] mmc: sdhci: Do not disable interrupts while waiting for clock Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-28 14:40 +0200
  Re: [PATCH 4.4 42/76] mmc: sdhci: Do not disable interrupts while  waiting for clock Ben Hutchings <ben.hutchings@codethink.co.uk> - 2017-04-04 19:00 +0200
    Re: [PATCH 4.4 42/76] mmc: sdhci: Do not disable interrupts while  waiting for clock Ludovic Desroches <ludovic.desroches@microchip.com> - 2017-04-06 14:20 +0200
      Re: [PATCH 4.4 42/76] mmc: sdhci: Do not disable interrupts while  waiting for clock Ben Hutchings <ben.hutchings@codethink.co.uk> - 2017-04-06 16:30 +0200

csiph-web