Skip to content
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

Fix an issue on RT1180 where TRDC permissions failed to be obtained #85545

Conversation

lucien-nxp
Copy link
Contributor

soc: nxp: imxrt: imxrt118x: change trdc permission getting strategy
When TRDC permission fails to be obtained, it does not recycle to access ELE core to prevent blocking problems. The current practice only generates a log warning alarm.

@lucien-nxp lucien-nxp changed the title Fixed an issue on RT1180 where TRDC permissions failed to be obtained Fix an issue on RT1180 where TRDC permissions failed to be obtained Feb 11, 2025
butok
butok previously approved these changes Feb 11, 2025
@lucien-nxp lucien-nxp force-pushed the feature/change_trdc_premission_getting_strategy branch from 3a7e740 to a2ecdfc Compare February 11, 2025 08:25
#if defined(CONFIG_SOC_MIMXRT1189_CM33)
/* Release TRDC A to CM33 core */
sts = ELE_BaseAPI_ReleaseRDC(MU_RT_S3MUA, ELE_TRDC_AON_ID, ELE_CORE_CM33_ID);
#elif defined(CONFIG_SOC_MIMXRT1189_CM7)
/* Release TRDC A to CM7 core */
sts = ELE_BaseAPI_ReleaseRDC(MU_RT_S3MUA, ELE_TRDC_AON_ID, ELE_CORE_CM7_ID);
#endif
} while (ELE_IS_FAILED(sts));
if (sts != kStatus_Success) {
LOG_ERR("error: TRDC A permission get failed.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it reports false errors,
a Warning (not Error) can be a compromise.
We do not want stress users by "False" error messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I have modified to warning log. Thank you.

@lucien-nxp lucien-nxp force-pushed the feature/change_trdc_premission_getting_strategy branch from a2ecdfc to 49a2b3a Compare February 11, 2025 08:48
butok
butok previously approved these changes Feb 11, 2025
@@ -528,27 +531,27 @@ static ALWAYS_INLINE void trdc_enable_all_access(void)
sts = ELE_BaseAPI_GetFwStatus(MU_RT_S3MUA, &ele_fw_sts);
} while (sts != kStatus_Success);

do {
#if defined(CONFIG_SOC_MIMXRT1189_CM33)
/* Release TRDC A to CM33 core */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the code indentation as the enclosing while loop has been removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Fixed.

@@ -528,27 +531,27 @@ static ALWAYS_INLINE void trdc_enable_all_access(void)
sts = ELE_BaseAPI_GetFwStatus(MU_RT_S3MUA, &ele_fw_sts);
} while (sts != kStatus_Success);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this while loop? Also line 524 should be fixed to use a tab instead of spaces.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This while loop don't need to be removed because the correct process need to get FW status firstly, and FW status getting won't block the CPU generally.

524 line have been used tab. Thank you.

#if defined(CONFIG_SOC_MIMXRT1189_CM33)
/* Release TRDC A to CM33 core */
sts = ELE_BaseAPI_ReleaseRDC(MU_RT_S3MUA, ELE_TRDC_AON_ID, ELE_CORE_CM33_ID);
#elif defined(CONFIG_SOC_MIMXRT1189_CM7)
/* Release TRDC A to CM7 core */
sts = ELE_BaseAPI_ReleaseRDC(MU_RT_S3MUA, ELE_TRDC_AON_ID, ELE_CORE_CM7_ID);
#endif
} while (ELE_IS_FAILED(sts));
if (sts != kStatus_Success) {
LOG_WRN("warning: TRDC A permission get failed.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change to TRDC AON.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

} while (ELE_IS_FAILED(sts));

if (sts != kStatus_Success) {
LOG_WRN("warning: TRDC W permission get failed.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change to TRDC Wakeup

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the implications if the Release TRDC fails? This should be mentioned in the warning message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. I added information in the warning log.

When TRDC permission fails to be obtained, it does not recycle to
access ELE core to prevent blocking problems. The current practice
only generates a log warning alarm.

Signed-off-by: Lucien Zhao <[email protected]>
@lucien-nxp lucien-nxp force-pushed the feature/change_trdc_premission_getting_strategy branch from 49a2b3a to 9cacfc3 Compare February 12, 2025 03:24
@mmahadevan108 mmahadevan108 requested a review from butok February 12, 2025 22:13
@kartben kartben merged commit e3538a3 into zephyrproject-rtos:main Feb 13, 2025
22 checks passed
@butok
Copy link
Contributor

butok commented Feb 13, 2025

Hi @lucien-nxp

After this commit, @tomi-font has reported error on Zephyr CI Discord: https://discordapp.com/channels/720317445772017664/1014241011989487716/1339527153347330110
job: https://github.com/zephyrproject-rtos/zephyr/actions/runs/13303120524/job/37148350472 :
west build -p -b mimxrt1180_evk/mimxrt1189/cm33 samples/net/dsa -T sample.net.dsa
It is a linker error:
../zephyr/soc/nxp/imxrt/imxrt118x/soc.c:624: undefined reference to log_dynamic_soc'`
Could you look it.

Other common samples are fine, so most probably this is a configuration issue (in a worst case to remove the soc logs).

@kartben
Copy link
Collaborator

kartben commented Feb 13, 2025

@lucien-nxp I confirm this is breaking CI in main https://github.com/zephyrproject-rtos/zephyr/actions/runs/13303203198/job/37148374503
Will line up a revert PR but let us know ASAP if you are working on a fix. cc @fabiobaltieri

@kartben
Copy link
Collaborator

kartben commented Feb 13, 2025

FWIW the revert PR is here: #85720

@lucien-nxp
Copy link
Contributor Author

Hi @lucien-nxp

After this commit, @tomi-font has reported error on Zephyr CI Discord: https://discordapp.com/channels/720317445772017664/1014241011989487716/1339527153347330110 job: https://github.com/zephyrproject-rtos/zephyr/actions/runs/13303120524/job/37148350472 : west build -p -b mimxrt1180_evk/mimxrt1189/cm33 samples/net/dsa -T sample.net.dsa It is a linker error: ../zephyr/soc/nxp/imxrt/imxrt118x/soc.c:624: undefined reference to log_dynamic_soc'` Could you look it.

Other common samples are fine, so most probably this is a configuration issue (in a worst case to remove the soc logs).

Mahesh help me resolve the building issue and create #85741. Thank you for you reminding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants