morse-bundle: skip chip reset when reset GPIO is unavailable - #2
Open
jiahylan wants to merge 1 commit into
Open
Conversation
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Check that the
MM_RESETGPIO line is available before unloading the Morse driver or unbinding an MMC/SDIO controller.Some Raspberry Pi MM6108 device trees do not expose a GPIO line named
MM_RESET. On these systems, the existing reset sequence can leave the SDIO controller unbound for the remainder of the boot, causing the Morse device to become unavailable.Problem
This issue was observed with OpenMANET 1.8.0 on a Raspberry Pi 4B using a Heltec HT-HC01 / MM6108 module over SDIO.
During boot, the
morsechipresetinit service runs/morse/scripts/chipreset.sh. The current sequence is:/sys/devices/platform.morseanddot11ahmodules.reset_chip.MM_RESETGPIO line exists.The GPIO check currently occurs inside
reset_chip, after the controller has already been unbound.If
MM_RESETis absent or not uniquely identifiable,gpioinfofails andreset_chipexits the script. The matching bind operation is therefore never executed.This leaves the SDIO controller unbound and can result in:
wlan0not being created;morse_clibeing unable to communicate with the radio.A later manual SDIO unbind/bind can recover the device, which confirms that the failure is caused by the boot-time reset sequence rather than the radio firmware, BCF, or hardware.
Root cause
The reset GPIO is treated as a prerequisite only after destructive changes have already been made to the driver and SDIO state.
On boards without an
MM_RESETGPIO line, the reset operation is unavailable but optional. Failing to perform the reset should not leave the existing SDIO device unusable.Change
Add an early
gpioinfocheck before discovering, unloading, or unbinding any MMC/SDIO device:When MM_RESET is unavailable, the script now:
When a valid and unique MM_RESET line is available, the existing reset, unbind, and bind sequence is unchanged.
Behavior comparison
Validation
Static checks:
Both checks pass.
The same guard was also validated in a rebuilt OpenMANET 1.8.0 image on a Raspberry Pi 4B with a Heltec HT-HC01 / MM6108 SDIO module. With no MM_RESET GPIO line exposed by the device tree:
Scope
This is a minimal change to the morse-bundle boot helper. It does not modify: