aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2006-10-04 05:15:39 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-04 10:55:14 -0400
commit5f25a66f6bbac563c94af94f03491b3ae43c40af (patch)
treeb1469a08f016f3cbd2739f138d3dec4f45c408b0 /drivers/mmc
parentf9565129993446e16678cfc4d9c7f3b7e75eecbd (diff)
[PATCH] mmc: fix MMIO vs memory races in sdhci
Sprinkle some mmiowb() where needed (writeX() before unlock()). Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/sdhci.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 4dab5ec392ea..9ff9231116a6 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -717,6 +717,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
717 } else 717 } else
718 sdhci_send_command(host, mrq->cmd); 718 sdhci_send_command(host, mrq->cmd);
719 719
720 mmiowb();
720 spin_unlock_irqrestore(&host->lock, flags); 721 spin_unlock_irqrestore(&host->lock, flags);
721} 722}
722 723
@@ -753,6 +754,7 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
753 ctrl &= ~SDHCI_CTRL_4BITBUS; 754 ctrl &= ~SDHCI_CTRL_4BITBUS;
754 writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL); 755 writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL);
755 756
757 mmiowb();
756 spin_unlock_irqrestore(&host->lock, flags); 758 spin_unlock_irqrestore(&host->lock, flags);
757} 759}
758 760
@@ -860,6 +862,7 @@ static void sdhci_tasklet_finish(unsigned long param)
860 862
861 sdhci_deactivate_led(host); 863 sdhci_deactivate_led(host);
862 864
865 mmiowb();
863 spin_unlock_irqrestore(&host->lock, flags); 866 spin_unlock_irqrestore(&host->lock, flags);
864 867
865 mmc_request_done(host->mmc, mrq); 868 mmc_request_done(host->mmc, mrq);
@@ -893,6 +896,7 @@ static void sdhci_timeout_timer(unsigned long data)
893 } 896 }
894 } 897 }
895 898
899 mmiowb();
896 spin_unlock_irqrestore(&host->lock, flags); 900 spin_unlock_irqrestore(&host->lock, flags);
897} 901}
898 902
@@ -1030,6 +1034,7 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id, struct pt_regs *regs)
1030 1034
1031 result = IRQ_HANDLED; 1035 result = IRQ_HANDLED;
1032 1036
1037 mmiowb();
1033out: 1038out:
1034 spin_unlock(&host->lock); 1039 spin_unlock(&host->lock);
1035 1040
@@ -1095,6 +1100,7 @@ static int sdhci_resume (struct pci_dev *pdev)
1095 if (chip->hosts[i]->flags & SDHCI_USE_DMA) 1100 if (chip->hosts[i]->flags & SDHCI_USE_DMA)
1096 pci_set_master(pdev); 1101 pci_set_master(pdev);
1097 sdhci_init(chip->hosts[i]); 1102 sdhci_init(chip->hosts[i]);
1103 mmiowb();
1098 ret = mmc_resume_host(chip->hosts[i]->mmc); 1104 ret = mmc_resume_host(chip->hosts[i]->mmc);
1099 if (ret) 1105 if (ret)
1100 return ret; 1106 return ret;
@@ -1327,6 +1333,8 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
1327 host->chip = chip; 1333 host->chip = chip;
1328 chip->hosts[slot] = host; 1334 chip->hosts[slot] = host;
1329 1335
1336 mmiowb();
1337
1330 mmc_add_host(mmc); 1338 mmc_add_host(mmc);
1331 1339
1332 printk(KERN_INFO "%s: SDHCI at 0x%08lx irq %d %s\n", mmc_hostname(mmc), 1340 printk(KERN_INFO "%s: SDHCI at 0x%08lx irq %d %s\n", mmc_hostname(mmc),