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

arm: Clear primask during startup for all architecture variants #9865

Merged
merged 1 commit into from
Sep 11, 2018
Merged

arm: Clear primask during startup for all architecture variants #9865

merged 1 commit into from
Sep 11, 2018

Conversation

MaureenHelm
Copy link
Member

@MaureenHelm MaureenHelm commented Sep 9, 2018

A bootloader may leave primask set, so clear it during startup when we
enable interrupts and switch to the main thread. Previously we only did
this for architecture variants which don't support basepri, but now we
do it for all architecture variants.

Fixes a failure on mimxrt1050_evk with the latency_measure test and
shell_module sample when using an nxp internal bootloader.

Signed-off-by: Maureen Helm [email protected]

Fixes #9650
Fixes #9651

@codecov-io
Copy link

codecov-io commented Sep 9, 2018

Codecov Report

Merging #9865 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #9865   +/-   ##
=======================================
  Coverage   52.28%   52.28%           
=======================================
  Files         213      213           
  Lines       25964    25964           
  Branches     5598     5598           
=======================================
  Hits        13576    13576           
  Misses      10150    10150           
  Partials     2238     2238

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5093030...555ca70. Read the comment docs.

@ioannisg
Copy link
Member

ioannisg commented Sep 10, 2018

@MaureenHelm, I suppose this PR is in the direction of making the Zephyr image more "standalone", against previously executed boot-loader images.

That said, could we enhance this patch to clear even FAULTMASK, in case the boot-loader also left that register set? Since FAULTMASK is only available on v7 architecture (and v8 with Mainline), could we have something like:

  • cpsie i <for ARMv6 and v8 Base>
  • cpsie if <for ARMv7 and v7 Main>

@galak would this be better?

@ioannisg ioannisg added area: ARM ARM (32-bit) Architecture bug The issue is a bug, or the PR is fixing a bug labels Sep 10, 2018
@ioannisg
Copy link
Member

Copy link
Member

@ioannisg ioannisg left a comment

Choose a reason for hiding this comment

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

Left a suggestion for improvement

A bootloader may leave primask or faultmask set, so clear them during
startup when we enable interrupts and switch to the main thread.
Previously we only cleared primask for architecture variants which don't
support basepri, but now we do it for all architecture variants.

Fixes a failure on mimxrt1050_evk with the latency_measure test and
shell_module sample when using an nxp internal bootloader.

Signed-off-by: Maureen Helm <[email protected]>
@MaureenHelm
Copy link
Member Author

That said, could we enhance this patch to clear even FAULTMASK, in case the boot-loader also left that register set?

Good idea, done.

Copy link
Collaborator

@hakehuang hakehuang left a comment

Choose a reason for hiding this comment

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

LGTM

@nashif nashif merged commit 0439dee into zephyrproject-rtos:master Sep 11, 2018
@MaureenHelm MaureenHelm deleted the fix-imxrt-fault branch September 11, 2018 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARM ARM (32-bit) Architecture bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants