common: add #ifndef guard for PLDM_FW_UPDATE_TIMEOUT_MS to allow platform overrides #2641
+4
−0
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.
Historically, most platforms used a 5000 ms timeout for PLDM messaging and FW update
operations. PLDM_MSG_TIMEOUT_MS was modified in common code 14 months ago (PR #2034)
to 30000 ms for a specific platform, and several platforms, including Minerva-AG,
overrode the value locally to retain the original 5000 ms behavior.
A similar situation occurred when PLDM_FW_UPDATE_TIMEOUT_MS was later introduced with a
hard-coded 30000 ms value (PR #2519), which again unintentionally changed behavior on
platforms that continue to rely on the 5000 ms timeout.
A similar cross-platform issue also occurred when MCTP_DEFAULT_MSG_MAX_SIZE was updated
from 64 to 244 in PR #2588. That change inadvertently affected platforms that were not
prepared for the larger message size. This highlights the need for common definitions
to avoid enforcing behavior changes across platforms unless explicitly intended.
This patch adds an #ifndef guard to the PLDM_FW_UPDATE_TIMEOUT_MS definition so that
platforms may override the timeout as needed. Platforms using the 30000 ms value will
retain their behavior, while Minerva-AG can restore its 5000 ms timeout locally.
To avoid impacting other platforms' expected defaults, would it be better for future
common changes to follow a similar pattern, keeping the baseline value unchanged while
allowing platforms with different requirements to override as needed via #ifndef?