drivers: sdhc: SDHC_INIT_PRIORITY default change breaks boards with SDHC depending on fixed regulators
priority: lowarea: Storage
**Describe the bug**
Commit 713cdff1183 ("drivers: sdhc: set SDHC_INIT_PRIORITY to KERNEL_INIT_PRIORITY_DEVICE") changed the default of `SDHC_INIT_PRIORITY` from `85` to `KERNEL_INIT_PRIORITY_DEVICE` (50). `REGULATOR_FIXED_INIT_PRIORITY` defaults to `75`, so an SDHC device now initializes **before** the fixed regulators it depends on via devicetree (`vmmc-supply` / `vqmmc-supply`). This violates the devicetree dependency ordering enforced by `scripts/build/check_init_priorities.py`, and the build fails.
Before that commit, SDHC (85) initialized after fixed regulators (75), which satisfied the dependency.
**To Reproduce**
Steps to reproduce the behavior:
1. `west build -p -b rcar_salvator_xs/r8a77961 samples/subsys/fs/littlefs -- -DCONF_FILE=prj_blk.conf`
2. Build fails at the device initialization priority validation step.
Same failure with `-b rcar_h3ulcb/r8a77951/a57` (twister scenario `sample.filesystem.littlefs.blk`).
**Expected behavior**
The build succeeds, with the SDHC device initialized after its regulator dependencies.
**Impact**
Build failure (annoyance / CI breakage for affected boards). Any board whose SDHC/MMC node references fixed regulators is potentially affected, not only the two rcar boards above.
**Logs and console output**
```
ERROR: Device initialization priority validation failed, the sequence of initialization calls does not match the devicetree dependencies.
ERROR: /soc/mmc@ee140000 <rcar_mmc_init> is initialized before its dependency /regulator_1p8v <regulator_fixed_init> (POST_KERNEL+1 < POST_KERNEL+2)
ERROR: /soc/mmc@ee140000 <rcar_mmc_init> is initialized before its dependency /regulator_3p3v <regulator_fixed_init> (POST_KERNEL+1 < POST_KERNEL+3)
ninja: build stopped: subcommand failed.
```
Relevant `.config` values:
```
CONFIG_KERNEL_INIT_PRIORITY_DEVICE=50
CONFIG_REGULATOR_FIXED_INIT_PRIORITY=75
CONFIG_SDHC_INIT_PRIORITY=50
```
**Environment (please complete the following information):**
- OS: Linux
- Toolchain: Zephyr SDK (aarch64-zephyr-elf)
- Commit SHA or Version used: 713cdff1183 (current `main` HEAD)
**Additional context**
Possible fix directions:
- Revert the default to a value that keeps SDHC after fixed regulators (e.g. `85`, or any value `> REGULATOR_FIXED_INIT_PRIORITY`), or
- Have boards/SoCs with SDHC-to-regulator dependencies override `SDHC_INIT_PRIORITY` explicitly.
The first option seems safer since the dependency pattern (SDHC supplied by fixed regulators) is not rcar-specific.
关闭于 14 天前 1 条评论