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

fix(90kernel-modules): fix MMC and NVMe on kernels 6.0+ #2103

Merged
merged 1 commit into from
Dec 19, 2022

Conversation

mikhailnov
Copy link
Contributor

Commit 6f8191fdf41 ("block: simplify disk shutdown") (torvalds/linux@6f8191f) 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

@github-actions github-actions bot added kernel-modules Issues related to the kernel-modules module modules Issue tracker for all modules labels Dec 3, 2022
@LaszloGombos LaszloGombos added the bug Our bugs label Dec 3, 2022
@LaszloGombos
Copy link
Collaborator

LaszloGombos commented Dec 3, 2022

@mikhailnov

Error: commit_message:1:24: error: commit message's description contains blacklisted word or repeats type tag
fix(90kernel-modules): fix MMC and NVMe on kernels 6.0+
^^^
commit_message:1:24: note: prefer using the imperative for verbs

maybe "fix(90kernel-modules): fixed MMC and NVMe....' ?

@mikhailnov
Copy link
Contributor Author

maybe "fix(90kernel-modules): fixed MMC and NVMe....' ?

Done

@LaszloGombos
Copy link
Collaborator

@mikhailnov

Error: commit_message:1:24: error: commit message's description contains blacklisted word or repeats type tag
fix(90kernel-modules): fixed MMC and NVMe on kernels 6.0+
^^^^^
commit_message:1:24: note: prefer using the imperative for verbs

Please try to find a solution (it is me not doing this) - https://github.com/dracutdevs/dracut/actions/runs/3610891530/jobs/6084978300

Perhaps "correct"

Copy link
Collaborator

@johannbg johannbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to rephrase your commit message excluding the word fixed other than LGTM

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
Copy link
Collaborator

@LaszloGombos LaszloGombos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mikhailnov
Copy link
Contributor Author

@LaszloGombos thanks for rephrasing the commit message

@aafeijoo-suse
Copy link
Member

aafeijoo-suse commented Dec 19, 2022

Related: redhat-plumbers/dracut-rhel9#57
@pvalena is there any reason why RH didn't send this upstream first, so all distros using dracut with the latest kernel version could benefit from this patch?

@LaszloGombos LaszloGombos dismissed johannbg’s stale review December 19, 2022 12:52

your commit message rephrased in the latest PR

@LaszloGombos LaszloGombos merged commit e0d57a8 into dracutdevs:master Dec 19, 2022
@aafeijoo-suse
Copy link
Member

Related: redhat-plumbers/dracut-rhel9#57 @pvalena is there any reason why RH didn't send this upstream first, so all distros using dracut with the latest kernel version could benefit from this patch?

@johannbg what's your opinion here? I'm a bit upset, things like this should never happen with RH and the worst thing is we are only getting silence and no justification.

@johannbg
Copy link
Collaborator

@aafeijoo-suse I can only assume the reason but how can you be upset? Any corporation or individual is free to submit patches upstream or not RH and or it's employees are not obliged to submit patches here upstream or owe upstream somekind of justification if they dont.

@aafeijoo-suse
Copy link
Member

Yeah, better forget about this.

In another vein, maybe we should add that patch, because I think this PR does not cover the case of the nvdimm drivers.

# zstd -d /lib/modules/5.14.21-150400.24.18-default/kernel/drivers/nvdimm/nd_pmem.ko.zst -o nd_pmem.ko
/lib/modules/5.14.21-150400.24.18-default/kernel/drivers/nvdimm/nd_pmem.ko.zst: 38904 bytes 
# nm nd_pmem.ko | grep blk
                 U __blk_alloc_disk
-------------->  U blk_cleanup_disk
                 U blk_freeze_queue_start
                 U blk_queue_flag_set
                 U blk_queue_logical_block_size
                 U blk_queue_max_hw_sectors
                 U blk_queue_physical_block_size
                 U blk_queue_write_cache
                 U blk_status_to_errno
                 U errno_to_blk_status

# zstd -d /lib/modules/6.1.0-3.g7f1864f-default/kernel/drivers/nvdimm/nd_pmem.ko.zst -o nd_pmem.ko
/lib/modules/6.1.0-3.g7f1864f-default/kernel/drivers/nvdimm/nd_pmem.ko.zst: 46191 bytes 
# nm nd_pmem.ko | grep blk
                 U __blk_alloc_disk
                 U blk_queue_flag_set
                 U blk_queue_logical_block_size
                 U blk_queue_max_hw_sectors
                 U blk_queue_physical_block_size
                 U blk_queue_write_cache
                 U blk_status_to_errno
                 U errno_to_blk_status

@johannbg
Copy link
Collaborator

@aafeijoo-suse yeah I dont see why not but I probably should mention he did not add his patch to fedora either ( which might raise some eyebrows in Raleigh, rarely is a fix limited to RHEL ) so there might be a catch 22 for doing that

@mikhailnov
Copy link
Contributor Author

Also, it would be very nice to somehow clean up hackery like explicitly adding drivers/mmc on aarch64 only

, while relying on detecting used kernel symbols on other architectures

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 modules Issue tracker for all modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mmc_block.ko is not included into initrd on kernel 6.1
4 participants