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

Delay arch_disable_mmu() #52

Merged
merged 1 commit into from
Jun 30, 2023
Merged

Delay arch_disable_mmu() #52

merged 1 commit into from
Jun 30, 2023

Conversation

ultra-azu
Copy link
Member

On gcc versions after 11.2.0, when using -O2 the compiler inlines pm8xxx_reg_write()
function into the others that use it. However, when it does so, on the
assembly cmd ends up unaligned. This is fine if MMU is enabled, but
when executing pmic_reset_configure(), inside scm_elexec_call(), MMU is
disabled. This causes a data abort, which causes lk to try and reboot
into DLOAD mode, only to hit the exact same bug on
pm8x41_clear_pmic_watchdog().

Fix this by keeping MMU enabled until almost just before kernel is about
to boot. This way we also avoid potentially hitting the same bug on
another function in the future.

On gcc versions after 11.2.0, when using -O2 the compiler inlines pm8xxx_reg_write()
function into the others that use it. However, when it does so, on the
assembly `cmd` ends up unaligned. This is fine if MMU is enabled, but
when executing pmic_reset_configure(), inside scm_elexec_call(), MMU is
disabled. This causes a data abort, which causes lk to try and reboot
into DLOAD mode, only to hit the exact same bug on
pm8x41_clear_pmic_watchdog().

Fix this by keeping MMU enabled until almost just before kernel is about
to boot. This way we also avoid potentially hitting the same bug on
another function in the future.
@vldly vldly merged commit 553e8b1 into msm8953-mainline:main Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants