Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mmc_block.ko is not included into initrd on kernel 6.1 #2102

Closed
mikhailnov opened this issue Dec 3, 2022 · 3 comments · Fixed by #2103
Closed

mmc_block.ko is not included into initrd on kernel 6.1 #2102

mikhailnov opened this issue Dec 3, 2022 · 3 comments · Fixed by #2103
Labels
bug Our bugs kernel-modules Issues related to the kernel-modules module
Milestone

Comments

@mikhailnov
Copy link
Contributor

mikhailnov commented Dec 3, 2022

Kernel module mmc_block.ko is not included into initrd on kernel 6.1-rc7 (/lib/modules/6.1.0-generic-0.rc7.1rosa2021.1-x86_64/kernel/drivers/mmc/core/mmc_block.ko.zst), but is included on kernel 5.15 (/lib/modules/5.15.77-generic-1rosa2021.1-x86_64/kernel/drivers/mmc/core/mmc_block.ko.zst). This makes booting from root on /dev/mmcblk* impossible with 6.1.

I have not understood yet why this happens, but it seems that its inclusion is rather indirect on x86_64 and is done by _blockfuncs=<...>|mmc_add_host|<...> in modules.d/90kernel-modules. However I do not see that this function would have been moved between kernels 5.15 and 6.1, it is in drivers/mmc/core/host.c in both kernels.

Hardware information gathered on kernel 5.15: https://linux-hardware.org/?probe=3f6ebcde0a

Dracut version is at commit 5eb736, it is not very easy to try a newer dracut, I don't see any relevant changes since that time.

libkmod is v30.

Logs (bash -x dracut <...>):
dracut-5.15.log
dracut-6.1.log
(there is nothing inetersting in them, in both cases dracut-install <...> -s 'ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma' =drivers is called, I ran it manually and made sure that directory drivers/mmc/core with the only file drivers/mmc/core/mmc_block.ko.zst is created only with kernel 5.15)

@mikhailnov mikhailnov added the bug Our bugs label Dec 3, 2022
@mikhailnov
Copy link
Contributor Author

Current code in modules.d/90kernel-modules/module-setup.sh looks strange. It assumes that mmc block devices related drivers are always needed, even in hostonly mode, and that =drivers/mmc/ are needed only on embeded hardware (if I understood correctly).

@mikhailnov
Copy link
Contributor Author

If run dracut-install --debug for kernel 5.15:

dracut-install: Handling /lib/modules/5.15.79-generic-1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst
dracut-install: Module mmc_block: symbol blk_cleanup_queue matched inclusion filter

If run it for 6.1:

dracut-install: No symbol or path match for '/lib/modules/6.1.0-generic-0.rc7.1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst'

@mikhailnov
Copy link
Contributor Author

Voila, it happened because of commit torvalds/linux@6f8191f "block: simplify disk shutdown" (kernels 6.0+). It says: "Rename blk_cleanup_disk to blk_mq_destroy_queue". I will prepare a quick fix for dracut.

@LaszloGombos LaszloGombos added the kernel-modules Issues related to the kernel-modules module label Dec 3, 2022
mikhailnov added a commit to mikhailnov/dracut that referenced this issue Dec 3, 2022
Commit 6f8191fdf41 ("block: simplify disk shutdown") in Linux kernels 6.0 and above
renamed blk_cleanup_disk to blk_mq_destroy_queue. Adapt code to handle both cases.

Because of the kernel module mmc_block.ko was not included into initrd on kernel 6.1:
dracut-install: No symbol or path match for '/lib/modules/6.1.0-generic-0.rc7.1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zs
while on kernel 5.15 it was included:
dracut-install: Handling /lib/modules/5.15.79-generic-1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst
dracut-install: Module mmc_block: symbol blk_cleanup_queue matched inclusion filter

It made booting OS from root on /dev/mmcblk* impossible.

Just adding blk_mq_destroy_queue was not enough to make mmc_block.ko to be included into initrd
(maybe because call of blk_cleanup_disk() was removed and call of blk_mq_destroy_queue() was not added) into it.
So also adding blk_mq_alloc_request.

Fixes: dracutdevs#2102
mikhailnov added a commit to mikhailnov/dracut that referenced this issue Dec 3, 2022
Commit 6f8191fdf41 ("block: simplify disk shutdown") in Linux kernels 6.0 and above
renamed blk_cleanup_disk to blk_mq_destroy_queue. Adapt code to handle both cases.

Because of the kernel module mmc_block.ko was not included into initrd on kernel 6.1:
dracut-install: No symbol or path match for '/lib/modules/6.1.0-generic-0.rc7.1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zs
while on kernel 5.15 it was included:
dracut-install: Handling /lib/modules/5.15.79-generic-1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst
dracut-install: Module mmc_block: symbol blk_cleanup_queue matched inclusion filter

It made booting OS from root on /dev/mmcblk* impossible.

Just adding blk_mq_destroy_queue was not enough to make mmc_block.ko to be included into initrd
(maybe because call of blk_cleanup_disk() was removed and call of blk_mq_destroy_queue() was not added) into it.
So also adding blk_mq_alloc_request.

Fixes: dracutdevs#2102
mikhailnov added a commit to mikhailnov/dracut that referenced this issue Dec 3, 2022
Commit 6f8191fdf41 ("block: simplify disk shutdown") in Linux kernels 6.0 and above
renamed blk_cleanup_disk to blk_mq_destroy_queue. Adapt code to handle both cases.

Because of this the kernel module mmc_block.ko was not included into initrd on kernel 6.1:
dracut-install: No symbol or path match for '/lib/modules/6.1.0-generic-0.rc7.1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zs
while on kernel 5.15 it was included:
dracut-install: Handling /lib/modules/5.15.79-generic-1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst
dracut-install: Module mmc_block: symbol blk_cleanup_queue matched inclusion filter

It made booting OS from root on /dev/mmcblk* impossible.

Just adding blk_mq_destroy_queue was not enough to make mmc_block.ko be included into initrd
(maybe because call of blk_cleanup_disk() was removed and call of blk_mq_destroy_queue() was not added).
So also adding blk_mq_alloc_request which is used from mmc_block.

Fixes: dracutdevs#2102
mikhailnov added a commit to mikhailnov/dracut that referenced this issue Dec 3, 2022
Commit 6f8191fdf41 ("block: simplify disk shutdown") in Linux kernels 6.0 and above
renamed blk_cleanup_disk to blk_mq_destroy_queue. Adapt code to handle both cases.

Because of this the kernel module mmc_block.ko was not included into initrd on kernel 6.1:
dracut-install: No symbol or path match for '/lib/modules/6.1.0-generic-0.rc7.1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst
while on kernel 5.15 it was included:
dracut-install: Handling /lib/modules/5.15.79-generic-1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst
dracut-install: Module mmc_block: symbol blk_cleanup_queue matched inclusion filter

It made booting OS from root on /dev/mmcblk* impossible.

Just adding blk_mq_destroy_queue was not enough to make mmc_block.ko be included into initrd
(maybe because call of blk_cleanup_disk() was removed and call of blk_mq_destroy_queue() was not added).
So also adding blk_mq_alloc_request which is used from mmc_block.

Fixes: dracutdevs#2102
mikhailnov added a commit to mikhailnov/dracut that referenced this issue Dec 4, 2022
Commit 6f8191fdf41 ("block: simplify disk shutdown") in Linux kernels 6.0 and above
renamed blk_cleanup_disk to blk_mq_destroy_queue. Adapt code to handle both cases.

Because of this the kernel module mmc_block.ko was not included into initrd on kernel 6.1:
dracut-install: No symbol or path match for '/lib/modules/6.1.0-generic-0.rc7.1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst
while on kernel 5.15 it was included:
dracut-install: Handling /lib/modules/5.15.79-generic-1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst
dracut-install: Module mmc_block: symbol blk_cleanup_queue matched inclusion filter

It made booting OS from root on /dev/mmcblk* impossible.

Just adding blk_mq_destroy_queue was not enough to make mmc_block.ko be included into initrd
(maybe because call of blk_cleanup_disk() was removed and call of blk_mq_destroy_queue() was not added).
So also adding blk_mq_alloc_request which is used from mmc_block.

Fixes: dracutdevs#2102
LaszloGombos pushed a commit to mikhailnov/dracut that referenced this issue Dec 16, 2022
Commit 6f8191fdf41 ("block: simplify disk shutdown") in Linux kernels 6.0 and above
renamed blk_cleanup_disk to blk_mq_destroy_queue. Adapt code to handle both cases.

Because of this the kernel module mmc_block.ko was not included into initrd on kernel 6.1:
dracut-install: No symbol or path match for '/lib/modules/6.1.0-generic-0.rc7.1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst
while on kernel 5.15 it was included:
dracut-install: Handling /lib/modules/5.15.79-generic-1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst
dracut-install: Module mmc_block: symbol blk_cleanup_queue matched inclusion filter

It made booting OS from root on /dev/mmcblk* impossible.

Just adding blk_mq_destroy_queue was not enough to make mmc_block.ko be included into initrd
(maybe because call of blk_cleanup_disk() was removed and call of blk_mq_destroy_queue() was not added).
So also adding blk_mq_alloc_request which is used from mmc_block.

Fixes: dracutdevs#2102
@LaszloGombos LaszloGombos added this to the dracut-058 milestone Dec 17, 2022
LaszloGombos pushed a commit that referenced this issue Dec 19, 2022
Commit 6f8191fdf41 ("block: simplify disk shutdown") in Linux kernels 6.0 and above
renamed blk_cleanup_disk to blk_mq_destroy_queue. Adapt code to handle both cases.

Because of this the kernel module mmc_block.ko was not included into initrd on kernel 6.1:
dracut-install: No symbol or path match for '/lib/modules/6.1.0-generic-0.rc7.1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst
while on kernel 5.15 it was included:
dracut-install: Handling /lib/modules/5.15.79-generic-1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst
dracut-install: Module mmc_block: symbol blk_cleanup_queue matched inclusion filter

It made booting OS from root on /dev/mmcblk* impossible.

Just adding blk_mq_destroy_queue was not enough to make mmc_block.ko be included into initrd
(maybe because call of blk_cleanup_disk() was removed and call of blk_mq_destroy_queue() was not added).
So also adding blk_mq_alloc_request which is used from mmc_block.

Fixes: #2102
pvalena pushed a commit to pvalena/dracut that referenced this issue Jul 23, 2023
Commit 6f8191fdf41 ("block: simplify disk shutdown") in Linux kernels 6.0 and above
renamed blk_cleanup_disk to blk_mq_destroy_queue. Adapt code to handle both cases.

Because of this the kernel module mmc_block.ko was not included into initrd on kernel 6.1:
dracut-install: No symbol or path match for '/lib/modules/6.1.0-generic-0.rc7.1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst
while on kernel 5.15 it was included:
dracut-install: Handling /lib/modules/5.15.79-generic-1rosa2021.1-x86_64//kernel/drivers/mmc/core/mmc_block.ko.zst
dracut-install: Module mmc_block: symbol blk_cleanup_queue matched inclusion filter

It made booting OS from root on /dev/mmcblk* impossible.

Just adding blk_mq_destroy_queue was not enough to make mmc_block.ko be included into initrd
(maybe because call of blk_cleanup_disk() was removed and call of blk_mq_destroy_queue() was not added).
So also adding blk_mq_alloc_request which is used from mmc_block.

Fixes: dracutdevs#2102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Our bugs kernel-modules Issues related to the kernel-modules module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants