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

pending ISR may execute after disabling interrupt #2242

Closed
odinthenerd opened this issue Jul 25, 2016 · 7 comments · Fixed by #3282
Closed

pending ISR may execute after disabling interrupt #2242

odinthenerd opened this issue Jul 25, 2016 · 7 comments · Fixed by #3282

Comments

@odinthenerd
Copy link
Contributor

odinthenerd commented Jul 25, 2016

If I am interpreting this correctly code resulting in the following (psydo) assembler would allow the load to happen before the pending ISR and thus causing many bugs in mbed.

str r0, ICER   #store mask into ICER (also known as NVIC_CLRENA on other chips)
ldr r1, r2       #load from SFR
<---- interrupt happens here because clear has not propagated yet
#use r1 although it is outdated due to modifications in the ISR

this would be one such example of a possible bug (after optimization of course)

edit: fixed link, should work now

@odinthenerd odinthenerd changed the title pending ISR and may execute aufter diabling interrupt pending ISR may execute aufter diabling interrupt Jul 25, 2016
@0xc0170
Copy link
Contributor

0xc0170 commented Jul 29, 2016

If I am interpreting this correctly code resulting in the following (psydo) assembler would allow the load to happen before the pending ISR and thus causing many bugs in mbed.

the above link is broken?

cc @c1728p9 @bogdanm @geky

@odinthenerd
Copy link
Contributor Author

thanks martin, link should work now.

@odinthenerd
Copy link
Contributor Author

I wonder what ARM Internal Ref: IOTMORF-118 means, if you guys are serious about removing race conditions I would be glad to offer some pointers, I have stopped reporting most of them because no one seemed to be interested up 'till now. The USB stack for example is full of them, many which actually occur in typical user code on a regular basis.

@sg-
Copy link
Contributor

sg- commented Sep 22, 2016

@porkybrain Thanks

We'll start looking at these and if you want to help out, more than happy to collaborate!

@ciarmcom
Copy link
Member

ARM Internal Ref: IOTMORF-511

@odinthenerd odinthenerd changed the title pending ISR may execute aufter diabling interrupt pending ISR may execute after disabling interrupt Oct 10, 2016
@c1728p9
Copy link
Contributor

c1728p9 commented Nov 14, 2016

Hi @porkybrain, thanks for reporting. I opened an issue to track this in CMSIS here: ARM-software/CMSIS_5#110

@odinthenerd
Copy link
Contributor Author

nice to see a definitive answer, after trying to actually reproduce the problem on hardware was not successful I was thinking it may just be an issue of me reading the spec in an overly paranoid way ;)

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

Successfully merging a pull request may close this issue.

6 participants