Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1efd48b3ae8f89a1d04f1e36be96764d7bf43ae9 Commit: 1efd48b3ae8f89a1d04f1e36be96764d7bf43ae9 Parent: 790864dcc2b3fe65355dd84ef8481e54b1bc61b6 Author: Pierre Ossman <[EMAIL PROTECTED]> AuthorDate: Tue May 8 22:35:17 2007 +0200 Committer: Pierre Ossman <[EMAIL PROTECTED]> CommitDate: Tue May 8 22:42:57 2007 +0200
mmc: use lock instead of claim in debug check As mmc_detect_change() can be called from irq context, using claim (which can sleep) is inherently unsafe. Use the host spinlock instead, which also is faster. Signed-off-by: Pierre Ossman <[EMAIL PROTECTED]> --- drivers/mmc/core/core.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 72c7cf4..b6c1670 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -500,9 +500,10 @@ void __mmc_release_bus(struct mmc_host *host) void mmc_detect_change(struct mmc_host *host, unsigned long delay) { #ifdef CONFIG_MMC_DEBUG - mmc_claim_host(host); + unsigned long flags; + spin_lock_irqsave(host->lock, flags); BUG_ON(host->removed); - mmc_release_host(host); + spin_unlock_irqrestore(host->lock, flags); #endif mmc_schedule_delayed_work(&host->detect, delay); @@ -625,9 +626,10 @@ EXPORT_SYMBOL(mmc_add_host); void mmc_remove_host(struct mmc_host *host) { #ifdef CONFIG_MMC_DEBUG - mmc_claim_host(host); + unsigned long flags; + spin_lock_irqsave(&host->lock, flags); host->removed = 1; - mmc_release_host(host); + spin_unlock_irqrestore(&host->lock, flags); #endif mmc_flush_scheduled_work(); - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html