firehose: give the UFS provisioning commit a longer timeout - #314
Merged
igoropaniuk merged 1 commit intoSep 1, 2026
Merged
igoropaniuk merged 1 commit into
igoropaniuk merged 1 commit into
Conversation
UFS provisioning drives the programmer with three <ufs> tags: a common tag, one or more body tags, and an epilogue. The epilogue is sent twice - first with commit=0 to validate the requested layout, then with commit=1 to actually write the UFS configuration descriptor to the device. All of these tags went through firehose_send_single_tag(), which waited only 5s for the <response value="ACK"/>. The commit=1 epilogue is the only expensive step: it makes the programmer write the configuration descriptor to the device, which can take considerably longer than 5s. When it does, the device emits its "Calling handler for ufs" log but has not answered with an ACK yet, so firehose_read() times out, firehose_send_single_tag() reports the tag as failed, and provisioning is aborted even though the device is still working. The program/erase write-back paths already use a 120s timeout for exactly this reason; the UFS commit needs the same treatment. Thread a timeout into firehose_send_single_tag() and use a short 5s wait for the cheap common/body/validation tags while giving the commit epilogue a 120s window. The commit=0 validation pass keeps the short timeout. Observed failure before the fix: $ qdl --storage ufs prog_firehose_ddr.elf provision_ufs31.xml --debug ... FIREHOSE WRITE: <?xml version="1.0"?> <data><ufs LUNtoGrow="0" commit="1"/></data> FIREHOSE READ: <?xml version="1.0" encoding="UTF-8" ?> <data> <log value="INFO: Calling handler for ufs" /></data> LOG: INFO: Calling handler for ufs ufs request failed failed to apply ufs epilogue UFS provisioning failed Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
quic-kdybcio
approved these changes
Sep 1, 2026
|
I reviewed firehose.c and noticed a possible issue in firehose_apply_ufs_epilogue(), line 1517. |
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.
UFS provisioning drives the programmer with three tags: a common tag, one or more body tags, and an epilogue. The epilogue is sent twice
The commit=1 epilogue is the only expensive step: it makes the programmer write the configuration descriptor to the device, which can take considerably longer than 5s. When it does, the device emits its "Calling handler for ufs" log but has not answered with an ACK yet, so firehose_read() times out, firehose_send_single_tag() reports the tag as failed, and provisioning is aborted even though the device is still working. The program/erase write-back paths already use a 120s timeout for exactly this reason; the UFS commit needs the same treatment.
Thread a timeout into firehose_send_single_tag() and use a short 5s wait for the cheap common/body/validation tags while giving the commit epilogue a 120s window. The commit=0 validation pass keeps the short timeout.
Observed failure before the fix:
$ qdl --storage ufs prog_firehose_ddr.elf provision_ufs31.xml --debug
...
FIREHOSE WRITE:
FIREHOSE READ:
LOG: INFO: Calling handler for ufs
ufs request failed
failed to apply ufs epilogue
UFS provisioning failed