feelslikeautumn
Posts: 242
Joined: Wed Aug 09, 2017 9:51 pm

Confused by mmc modules

Fri Apr 06, 2018 8:05 am

Using the latest Ubuntu raspi2 kernel I'm getting an error in my dmseg. I'm guessing it is to do with the mmc modules. I've picked out the mmc bits of the dmesg:

Code: Select all

[    3.775213] sdhci: Secure Digital Host Controller Interface driver
[    3.778422] sdhci: Copyright(c) Pierre Ossman
[    3.781879] mmc-bcm2835 3f300000.mmc: could not get clk, deferring probe
[    3.785342] sdhost-bcm2835 3f202000.mmc: could not get clk, deferring probe
[    3.788708] Error: Driver 'sdhost-bcm2835' is already registered, aborting...
[    3.792028] sdhci-pltfm: SDHCI platform and OF driver helper

[    3.967945] mmc-bcm2835 3f300000.mmc: mmc_debug:0 mmc_debug2:0
[    3.971220] mmc-bcm2835 3f300000.mmc: DMA channel allocated
[    4.011940] sdhost: log_buf @ 53f6571a (fa853000)
[    4.032295] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    4.036912] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    4.041633] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    4.050403] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    4.087381] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    4.091191] hctosys: unable to open rtc device (rtc0)

[    4.172468] mmc1: new high speed SDIO card at address 0001
[    4.198049] mmc0: host does not support reading read-only switch, assuming write-enable
[    4.204236] mmc0: new high speed SDHC card at address aaaa
[    4.208074] mmcblk0: mmc0:aaaa SL08G 7.40 GiB
[    4.213926]  mmcblk0: p1 p2
The kernel seems to have a lot of mmc modules, quite a few of which are built in:

Code: Select all

#
# MMC/SD/SDIO Host Controller Drivers
#
CONFIG_MMC_BCM2835_MMC=y
CONFIG_MMC_BCM2835_DMA=y
CONFIG_MMC_BCM2835_PIO_DMA_BARRIER=2
CONFIG_MMC_BCM2835_SDHOST=y
# CONFIG_MMC_DEBUG is not set
CONFIG_MMC_ARMMMCI=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_IO_ACCESSORS=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_OF_ARASAN=m
CONFIG_MMC_SDHCI_OF_AT91=m
CONFIG_MMC_SDHCI_CADENCE=m
CONFIG_MMC_SDHCI_F_SDH30=m
CONFIG_MMC_SDHCI_IPROC=m
CONFIG_MMC_SPI=m
CONFIG_MMC_TMIO_CORE=m
CONFIG_MMC_TMIO=m
CONFIG_MMC_DW=m
CONFIG_MMC_DW_PLTFM=m
CONFIG_MMC_DW_EXYNOS=m
CONFIG_MMC_DW_K3=m
CONFIG_MMC_VUB300=m
CONFIG_MMC_USHC=m
CONFIG_MMC_USDHI6ROL0=m
CONFIG_MMC_REALTEK_USB=m
CONFIG_MMC_BCM2835=y
CONFIG_MMC_MTK=m
CONFIG_MMC_SDHCI_XENON=m
# CONFIG_MMC_SDHCI_OMAP is not set
CONFIG_MEMSTICK=m
# CONFIG_MEMSTICK_DEBUG is not set
built in modules:

Code: Select all

kernel/drivers/mmc/core/mmc_core.ko
kernel/drivers/mmc/core/pwrseq_simple.ko
kernel/drivers/mmc/core/pwrseq_emmc.ko
kernel/drivers/mmc/core/mmc_block.ko
kernel/drivers/mmc/host/armmmci.ko
kernel/drivers/mmc/host/sdhci.ko
kernel/drivers/mmc/host/bcm2835-mmc.ko
kernel/drivers/mmc/host/bcm2835-sdhost.ko
kernel/drivers/mmc/host/bcm2835.ko
kernel/drivers/mmc/host/sdhci-pltfm.ko
Running lsmod shows:

Code: Select all

sdhci_iproc            16384  0
Presumably parts of upstream and downstream have been merged to get in this situation and there are several modules trying to do the same job. I want to raise a bug about this, but I have no idea what to write! Can somebody give me a brief guide as to why there are so many mmc modules, and which is the best and recommended to use? Thanks!

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1757
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Confused by mmc modules

Fri Apr 06, 2018 8:16 am

I'm away from a keyboard today so a bit limited, but it would help if you could post the output of:

Code: Select all

dtc -I fs /proc/device-tree
For general guidance, in the Raspberry Pi kernels we use the bcm2835-sdhost driver for the SD card or EMMC interface and bcm2835-mmc for SDIO to the WiFi chip. Upstream uses bcm2835 for SD and sdhci-iproc for SDIO. At some point we may replace the downstream drivers with patched versions of the upstream variants, but it hasn't happened yet.

feelslikeautumn
Posts: 242
Joined: Wed Aug 09, 2017 9:51 pm

Re: Confused by mmc modules

Fri Apr 06, 2018 9:57 am

Thanks PhilE that's cleared it up a bit for me.

Output of your command https://pastebin.com/DMXq0ckP

Are there lots of other modules where upstream and downstream differ? (Sorry I've a lot to learn about the pi kernels!)

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1757
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Confused by mmc modules

Sat Apr 07, 2018 9:52 am

Thanks for the DT dump - it confirms that you are using the downstream DTB which includes compatible strings for all four SD/MMC drivers, so configuring out or blacklisting is required to select the preferred drivers.

We are using more upstream drivers than we used to, but there are still a few differences. Aside from the SD drivers as discussed, the main difference is the USB driver - we use a heavily optimised dwc_otg driver that makes use of the ARM's FIQ to reduce the interrupt overhead - upstream is using the standard DWC2 driver. The remaining differences are confined to a few drivers that haven't been upstreamed yet - dpi, smi, etc. - and a few patches to otherwise upstreamed drivers, including add interrupt controller functionality to the AUX clock driver.

feelslikeautumn
Posts: 242
Joined: Wed Aug 09, 2017 9:51 pm

Re: Confused by mmc modules

Sat Apr 07, 2018 6:12 pm

Thanks again PhilE. Does the pi have a special way to select which driver to use? I saw in an old thread:

Code: Select all

bcm2708.bcm2835_mmc=0
In the past I've passed on the kernel command line something like:

Code: Select all

 module.blacklist=true
(which is just passing an unknown parameter to the module which stops it loading)

Adding a module to /etc/modprobe.d/blacklist.conf doesn't work for built in modules. I assume it is the same if you add to the kernel command line modprobe.blacklist=MODULE_NAME.

Do you think I should raise a bug about this? Should I recommend that the same mmc kernel config options are used as the foundation kernel?

Return to “Linux Kernel”

Who is online

Users browsing this forum: No registered users and 2 guests