-
Notifications
You must be signed in to change notification settings - Fork 779
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
[sw] polling in ROM #6220
Comments
Thanks @tjaychen. Currently we are not using an explicit polling-timeout scheme. Instead, we are relying on the watchdog which is initialized early in the boot with a safe default (TBD) here and reconfigured based on the life cycle state here. Also, ROM does not pet the watchdog, we plan to set the timeout to a value that is long enough for proper ROM execution. The main reason for this approach is simplicity, i.e. no iteration counts to tune based on the clock frequency or peripheral being polled e.g. sram_ctrl, flash_ctrl, otbn, keymgr, hmac, uart, etc. |
@alphan just to clarify, wouldn't a watchdog in this case actually reboot the device? |
Good point, I think I was assuming debugging would provide that information. |
yeah we have a rstmgr crashdump that basically is intended to show where the processor was prior to reset. The "timeout" failure I was referring to was a failure, and more a "fall-through" of a polling loop, that would then manifest some kind of user visible error so we can figure out where to look. All of these are possible options though. |
it's not entirely the same, because the assumption is that some kind of lock-up is happening after we enter life cycle PROD, which means the debugger would no longer be available. We have seen this from time to time just because during production there's more volume and it can expose corner cases not previously thought of. We don't necessarily need a fall through like what i'm suggesting, but just have some kind of plan of how we should debug if things were to get stuck. |
Yeah, prod can be tricky. I think this deserves an offline discussion. |
@timothytrippel @moidx @cfrantz @cdgori should we pick this discussion up again for PROD? |
As of 0539d58 (and to my best knowledge) Known polling loops without timeouts:
Known polling loops with timeouts:
|
Certain setup routines (for example sram / flash scramble key request) require the ROM to make a hardware request and poll for its completion. Polling in ROM however, can be bad if the hardware underneath failed and the ROM just never gets out of the loop.
As a result, we should think a bit about what kind of polling-timeout scheme we want in ROM and how that should terminate in the event of a failure.
The text was updated successfully, but these errors were encountered: