Build mmc_block into mmc_core directly
PATCH 1/1 Build mmc_block into mmc_core directly
Build mmc_block into mmc_core directly.
Bug Reference:
https://launchpad.net/distros/ubuntu/+source/linux-source-2.6.15/+bug/30335
Patch location:
http://www.kernel.org/git/?p=linux/kernel/git/bcollins/ubuntu-dapper.git;a=commitdiff;h=b0bf1e46d11576130fdc68d6ede8a986ce4334a1
--- drivers/mmc/Kconfig | 10 ---------- drivers/mmc/Makefile | 8 +------- drivers/mmc/mmc_block.c | 10 ++-------- drivers/mmc/mmc_sysfs.c | 26 +++++++++++++++++++++----- 4 files changed, 24 insertions(+), 30 deletions(-)
drivers/mmc/Kconfig +0 -10
@@ -19,16 +19,6 @@ config MMC_DEBUG This is an option for use by developers; most people should say N here. This enables MMC core and driver debugging. -config MMC_BLOCK - tristate "MMC block device driver" - depends on MMC - default y - help - Say Y here to enable the MMC block device driver support. - This provides a block device driver, which you can use to - mount the filesystem. Almost everyone wishing MMC support - should say Y or M here. - config MMC_ARMMMCI tristate "ARM AMBA Multimedia Card Interface support" depends on ARM_AMBA && MMC
drivers/mmc/Makefile +1 -7
@@ -7,12 +7,6 @@ # obj-$(CONFIG_MMC) += mmc_core.o -# -# Media drivers -# -obj-$(CONFIG_MMC_BLOCK) += mmc_block.o - -# # Host drivers # obj-$(CONFIG_MMC_ARMMMCI) += mmci.o
@@ -24,7 +18,7 @@ obj-$(CONFIG_MMC_AU1X) += au1xmmc.o obj-$(CONFIG_MMC_OMAP) += omap.o obj-$(CONFIG_MMC_AT91RM9200) += at91_mci.o -mmc_core-y := mmc.o mmc_queue.o mmc_sysfs.o +mmc_core-y := mmc.o mmc_queue.o mmc_sysfs.o mmc_block.o ifeq ($(CONFIG_MMC_DEBUG),y) EXTRA_CFLAGS += -DDEBUG
drivers/mmc/mmc_block.c +2 -8
@@ -540,7 +540,7 @@ static struct mmc_driver mmc_driver = { .resume = mmc_blk_resume, }; -static int __init mmc_blk_init (void ) +int __init mmc_blk_init (void ) {int res = -ENOMEM ;
@@ -559,17 +559,11 @@ static int __init mmc_blk_init(void)return res; } -static void __exit mmc_blk_exit(void) +void __exit mmc_blk_exit(void) {mmc_unregister_driver (&mmc_driver);unregister_blkdev (major,"mmc" ); } -module_init (mmc_blk_init); -module_exit (mmc_blk_exit); - -MODULE_LICENSE ("GPL" ); -MODULE_DESCRIPTION ("Multimedia Card (MMC) block device driver" ); -module_param (major, int,0444 );MODULE_PARM_DESC (major,"specify the major device number for MMC block driver" );
drivers/mmc/mmc_sysfs.c +21 -5
@@ -317,20 +317,36 @@ void mmc_free_host_sysfs(struct mmc_hostclass_device_put (&host->class_dev); } +extern int mmc_blk_init (void ); +extern void mmc_blk_exit (void );static int __init mmc_init (void ) {int ret =bus_register (&mmc_bus_type); -if (ret ==0 ) { - ret =class_register (&mmc_host_class); -if (ret) -bus_unregister (&mmc_bus_type); - } + +if (ret !=0 ) +return ret; + + ret =class_register (&mmc_host_class); +if (ret) + goto class_fail; + + ret =mmc_blk_init (); +if (ret) + goto blk_fail; + +return 0 ; + +blk_fail: +class_unregister (&mmc_host_class); +class_fail: +bus_unregister (&mmc_bus_type);return ret; } static void __exit mmc_exit(void) { +mmc_blk_exit ();class_unregister (&mmc_host_class);bus_unregister (&mmc_bus_type); }
Quoted 4 lines · Randy Dunlap
Build
mmc_blockintommc_coredirectly.Bug Reference:
https://launchpad.net/distros/ubuntu/+source/linux-source-2.6.15/+bug/30335
NAK. If it's missing the modalias then it needs to be added. But more the question is why isn't the driver being automatically loaded. Probably because hotplug doesn't know enough about the MMC subsystem. Unfortunately I'm at rather a loss what's required with hotplug because it isn't something I actually use or come into contact with.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core
Hi Russell,
Quoted 10 lines
Quoted 4 lines
Build
mmc_blockintommc_coredirectly.Bug Reference:
https://launchpad.net/distros/ubuntu/+source/linux-source-2.6.15/+bug/30335NAK. If it's missing the modalias then it needs to be added. But more the question is why isn't the driver being automatically loaded. Probably because hotplug doesn't know enough about the MMC subsystem. Unfortunately I'm at rather a loss what's required with hotplug because it isn't something I actually use or come into contact with.
actually Ubuntu can auto load the mmc_block module if needed. I also have seen a system that looked at the csd.cmdclass value and then decided to load mmc_block or not. Can't find it on Ubuntu though. Maybe this was one of my Fedora Core 5 test boxes. Anyway the mmc_block must stay separate from the mmc_core, because otherwise we will have trouble to cleanly support SDIO cards in the future.
Regards
Marcel