Skip to content

STM32 GPIO IRQ : add a critical section in gpio_irq_init #12067

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

Merged
merged 1 commit into from
Dec 17, 2019

Conversation

jeromecoutant
Copy link
Collaborator

@jeromecoutant jeromecoutant commented Dec 10, 2019

Summary of changes

In 5.14 branch, got issues with STM32F0 targets and PWM tests (ci-shield)

Same line is used for different IRQ for our targets,
we are then adding a critical section in gpio_irq init and free functions

Note that other functions are protected in API level in InterruptIn

Impact of changes

Ci-shield tests are OK

Migration actions required

Documentation


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


@@ -194,6 +195,8 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
return -1;
}

core_util_critical_section_enter();
Copy link
Contributor

Choose a reason for hiding this comment

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

Please also protect also the free function ...
Also please add a comment why only init (& free) need to be protected (because other functions are protected at upper level (mbed driver or hal level)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

critical section and clear flag added in the free function

Copy link
Contributor

Choose a reason for hiding this comment

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

Getting back to Pull Request message s not always handy ... I'd like to see the below information either in the code comments, or in commit message (or both)

We are adding a critical section in gpio_irq init and free functions to protect shared code structures
Note that other functions are protected in API level in InterruptIn

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Commit message updated!
Thx

@ciarmcom ciarmcom requested a review from a team December 10, 2019 14:00
@ciarmcom
Copy link
Member

@jeromecoutant, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

@@ -194,6 +195,8 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
return -1;
}

core_util_critical_section_enter();
Copy link
Contributor

Choose a reason for hiding this comment

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

Getting back to Pull Request message s not always handy ... I'd like to see the below information either in the code comments, or in commit message (or both)

We are adding a critical section in gpio_irq init and free functions to protect shared code structures
Note that other functions are protected in API level in InterruptIn

critical section added in gpio_irq init and free functions
to protect shared code structures

Note that other functions are protected in API level in InterruptIn
@0xc0170 0xc0170 added needs: CI release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0 and removed needs: review labels Dec 16, 2019
@kjbracey
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Dec 17, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@adbridge adbridge merged commit 378f8c2 into ARMmbed:master Dec 17, 2019
@jeromecoutant jeromecoutant deleted the PR_IRQ_CRITICAL branch December 19, 2019 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants