MMC updates
Linus, please pull from
git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc.git for-linus
to receive the following updates:
drivers/misc/tifm_7xx1.c | 27 ++++++++++++++++++++++++--- drivers/mmc/Kconfig | 10 +++++----- drivers/mmc/card/Kconfig | 3 +-- drivers/mmc/core/Kconfig | 1 - drivers/mmc/core/core.c | 10 ++++++---- drivers/mmc/host/Kconfig | 19 +++++++++---------- drivers/mmc/host/tifm_sd.c | 13 +------------ include/linux/tifm.h | 1 + 8 files changed, 47 insertions(+), 37 deletions(-)
Alex Dubov (1):
disable socket power in adapter driver instead of media one
Jan Engelhardt (1):
mmc: Use menuconfig objects
Pierre Ossman (1):
mmc: use lock instead of claim in debug check
Quoted 4 lines · Pierre Ossman
Linus, please pull from
git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc.gitfor-linus
fsck! I pushed the wrong branch :/
This fix should have been in the last commit.
Sorry,
Signature · 5 lines
-- Pierre Ossman Linux kernel, MMC maintainer http://www.kernel.org PulseAudio, core developer http://pulseaudio.org rdesktop, core developer http://www.rdesktop.org
commit 3b9a6d78eb439016728c598a1373b50328f5e9fe
Author: Pierre Ossman <[email protected]> Date: Wed May 9 07:53:28 2007 +0200
mmc: fix wrong call to spinlock
Fix silly typo in spinlock calls.
drivers/mmc/core/core.c +2 -2
@@ -501,9 +501,9 @@ void mmc_detect_change(struct mmc_host *host, unsigned long delay) {#ifdef CONFIG_MMC_DEBUG unsigned long flags; -spin_lock_irqsave (host->lock, flags); +spin_lock_irqsave (&host->lock, flags);BUG_ON (host->removed); -spin_unlock_irqrestore (host->lock, flags); +spin_unlock_irqrestore (&host->lock, flags);#endif mmc_schedule_delayed_work (&host->detect, delay);
Quoted 32 lines · Pierre Ossman
Quoted 4 lines · Pierre Ossman
Linus, please pull from
git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc.gitfor-linusfsck! I pushed the wrong branch :/
This fix should have been in the last commit.
Sorry,
------------------------------------------------------------------------
commit
3b9a6d78eb439016728c598a1373b50328f5e9feAuthor: Pierre Ossman <[email protected]> Date: Wed May 9 07:53:28 2007 +0200mmc: fix wrong call to spinlock
Fix silly typo in spinlock calls.
Signed-off-by Pierre Ossman <[email protected]>drivers/mmc/core/core.c +0
-0
drivers/mmc/core/core.c void mmc_detect_change(struct mmc_host *host, unsigned long delay) · line 507
Quoted 9 lines
drivers/mmc/core/core.c +2
-2@@ -501,9 +501,9 @@ void mmc_detect_change(struct mmc_host *host, unsigned long delay) {#ifdef CONFIG_MMC_DEBUG unsigned long flags; -spin_lock_irqsave (host->lock, flags); +spin_lock_irqsave (&host->lock, flags);BUG_ON (host->removed); -spin_unlock_irqrestore (host->lock, flags); +spin_unlock_irqrestore (&host->lock, flags);#endif
Do you actually need the lock there at all? What is it protecting?
Signature · 1 line
SUSE Labs, Novell Inc.
Quoted 5 lines · Nick Piggin
Quoted 5 lines
drivers/mmc/core/core.c +0
-0@@ -501,9 +501,9 @@ void mmc_detect_change(struct mmc_host *host, unsigned long delay) {#ifdef CONFIG_MMC_DEBUG unsigned long flags;
Quoted 9 lines
drivers/mmc/core/core.c void mmc_detect_change(struct mmc_host *host, unsigned long delay) · line 507
Quoted 6 lines
drivers/mmc/core/core.c +2
-2-spin_lock_irqsave (host->lock, flags); +spin_lock_irqsave (&host->lock, flags);BUG_ON (host->removed); -spin_unlock_irqrestore (host->lock, flags); +spin_unlock_irqrestore (&host->lock, flags);#endif Do you actually need the lock there at all? What is it protecting?
It makes sure we don't have any race when it comes to modifying host->removed. We had some problems where controllers reported card insertion events even after they'd signaled to be removed, causing all kind of odd problems. This check was added to easier spot it should it arise again.
Rgds
Signature · 5 lines
-- Pierre Ossman Linux kernel, MMC maintainer http://www.kernel.org PulseAudio, core developer http://pulseaudio.org rdesktop, core developer http://www.rdesktop.org
Quoted 18 lines · Pierre Ossman
Quoted 5 lines · Nick Piggin
Quoted 5 lines
drivers/mmc/core/core.c +0
-0@@ -501,9 +501,9 @@ void mmc_detect_change(struct mmc_host *host, unsigned long delay) {#ifdef CONFIG_MMC_DEBUG unsigned long flags;Quoted 9 lines
drivers/mmc/core/core.c void mmc_detect_change(struct mmc_host *host, unsigned long delay) · line 507
Quoted 6 lines
drivers/mmc/core/core.c +2
-2-spin_lock_irqsave (host->lock, flags); +spin_lock_irqsave (&host->lock, flags);BUG_ON (host->removed); -spin_unlock_irqrestore (host->lock, flags); +spin_unlock_irqrestore (&host->lock, flags);#endif Do you actually need the lock there at all? What is it protecting?
Quoted 2 lines
It makes sure we don't have any race when it comes to modifying
host->removed.
If you want to ensure you always only modify host->removed from under the spinlock, it would be enforcable by introducing an accessor function and doing a BUG_ON(!spin_is_locked()) in there.
If you just want to ensure that host->removed is 0 at this point, you shouldn't need any spinlocks AFAIKS... that way you can probably afford to move it out from CONFIG_MMC_DEBUG and get wider testing.
Signature · 1 line
SUSE Labs, Novell Inc.
Quoted 9 lines · Nick Piggin
If you want to ensure you always only modify
host->removedfrom under the spinlock, it would be enforcable by introducing an accessor function and doing a BUG_ON(!spin_is_locked()) in there.If you just want to ensure that
host->removedis 0 at this point, you shouldn't need any spinlocks AFAIKS... that way you can probably afford to move it out fromCONFIG_MMC_DEBUGand get wider testing.
The host->removed member is only used for this simple test. It is set in mmc_host_remove() to indicate that the removal process has begun. At this point it is invalid to call mmc_detect_change() (the place this patch fixes). So the spinlocks are mostly there so that things are properly ordered when we go SMP. Some creative barriers would probably work as well, but I find spinlocks more "normal" and hence more readable.
Rgds
Signature · 5 lines
-- Pierre Ossman Linux kernel, MMC maintainer http://www.kernel.org PulseAudio, core developer http://pulseaudio.org rdesktop, core developer http://www.rdesktop.org
Quoted 12 lines · Pierre Ossman
Quoted 8 lines · Nick Piggin
If you want to ensure you always only modify
host->removedfrom under the spinlock, it would be enforcable by introducing an accessor function and doing a BUG_ON(!spin_is_locked()) in there.If you just want to ensure that
host->removedis 0 at this point, you shouldn't need any spinlocks AFAIKS... that way you can probably afford to move it out fromCONFIG_MMC_DEBUGand get wider testing.
Quoted 6 lines
The
host->removedmember is only used for this simple test. It is set inmmc_host_remove()to indicate that the removal process has begun. At this point it is invalid to callmmc_detect_change()(the place this patch fixes). So the spinlocks are mostly there so that things are properly ordered when we go SMP. Some creative barriers would probably work as well, but I find spinlocks more "normal" and hence more readable.
Fair enough. No big deal :)
Signature · 1 line
SUSE Labs, Novell Inc.
Quoted 6 lines · Pierre Ossman
The
host->removedmember is only used for this simple test. It is set inmmc_host_remove()to indicate that the removal process has begun. At this point it is invalid to callmmc_detect_change()(the place this patch fixes). So the spinlocks are mostly there so that things are properly ordered when we go SMP. Some creative barriers would probably work as well, but I find spinlocks more "normal" and hence more readable.
Sounds to me like either struct xyz_host { atomic_t removed; } would do the job, or that actually wider regions of mmc_host_remove() and mmc_detect_change() need to be serialized.
Signature · 3 lines
Stefan Richter -=====-=-=== -=-= -=--= http://arcgraph.de/sr/
Quoted 4 lines · Stefan Richter
Sounds to me like either struct
xyz_host{atomic_tremoved; } would do the job, or that actually wider regions ofmmc_host_remove()andmmc_detect_change()need to be serialized.
AFAIK, an atomic_t doesn't guarantee any ordering, just atomicity. So an atomic_t with a barrier would be sufficient. But barriers are mostly voodoo that few people understand ;)
Signature · 5 lines
-- Pierre Ossman Linux kernel, MMC maintainer http://www.kernel.org PulseAudio, core developer http://pulseaudio.org rdesktop, core developer http://www.rdesktop.org