提交 06fe577f 编写于 作者: M Marek Szyprowski 提交者: Chris Ball

mmc: sdhci-s3c: fix incorrect spinlock usage after merge

In the commit f522886e a merge conflict
in the sdhci-s3c driver been fixed. However the fix used incorrect
spinlock operation - it caused a race with sdhci interrupt service. The
correct way to solve it is to use spin_lock_irqsave/irqrestore() calls.
Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NChris Ball <cjb@laptop.org>
上级 245feaa6
...@@ -241,8 +241,10 @@ static struct sdhci_ops sdhci_s3c_ops = { ...@@ -241,8 +241,10 @@ static struct sdhci_ops sdhci_s3c_ops = {
static void sdhci_s3c_notify_change(struct platform_device *dev, int state) static void sdhci_s3c_notify_change(struct platform_device *dev, int state)
{ {
struct sdhci_host *host = platform_get_drvdata(dev); struct sdhci_host *host = platform_get_drvdata(dev);
unsigned long flags;
if (host) { if (host) {
spin_lock(&host->lock); spin_lock_irqsave(&host->lock, flags);
if (state) { if (state) {
dev_dbg(&dev->dev, "card inserted.\n"); dev_dbg(&dev->dev, "card inserted.\n");
host->flags &= ~SDHCI_DEVICE_DEAD; host->flags &= ~SDHCI_DEVICE_DEAD;
...@@ -253,7 +255,7 @@ static void sdhci_s3c_notify_change(struct platform_device *dev, int state) ...@@ -253,7 +255,7 @@ static void sdhci_s3c_notify_change(struct platform_device *dev, int state)
host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
} }
tasklet_schedule(&host->card_tasklet); tasklet_schedule(&host->card_tasklet);
spin_unlock(&host->lock); spin_unlock_irqrestore(&host->lock, flags);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册