-
Notifications
You must be signed in to change notification settings - Fork 8.2k
gpio: stm32: support disabling and reenabling interrupts on gpio pin #19256
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
gpio: stm32: support disabling and reenabling interrupts on gpio pin #19256
Conversation
|
@mniestroj, btw I didn't mentioned it previously but since this change is going to have much more impact than initially, you should be aware of imminent driver rework due to new GPIO API introduction, merged yesterday actually (#16648). |
@erwango I don't see any problems, as those changes look unrelated. But thanks for pointing that, I'll try to follow it. |
mnkp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be better if this PR targeted topic-gpio branch?
erwango
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mniestroj, this PR is of particular interest for driver adaptation for GPIO API.
I've reused it on #19607 (and hence validated it as part of my tetsing).
So to make things a little bit more simple, would be nice to have it on gpio-topic branch.
Also, as mentioned by @mnkp, some changes on gpio_stm32_config function would be needed, but are not particularly linked to the purpose of this PR.
So, I've pushed #19646 on topic-gpio branch. It would be required that you base your change on that as well.
To sum up, after updating this PR wrt requested changes, can you rebase on top of #19646 and then push it on topic-gpio branch?
Thanks for your understanding on this unusualy complex PR handling.
ef3fead to
466fabc
Compare
|
All checks are passing now. checkpatch (informational only, not a failure)Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
466fabc to
0b25679
Compare
|
@erwango I've changed code according to review comments and rebased on top of topic-gpio branch. |
|
@mniestroj, thanks! |
|
@erwango Ahh, I see that you fixed those issues in separate commit :) Thanks for reviewing and pulling those changes! |
653e004 to
2222ac6
Compare
With dual core handling introduction, we now need to take care to always release lock before exiting function. Rework gpio_stm32_config to take this into account. Additionally, since ENOSYS usage is resevred to system calls handling, replace with EIO. Signed-off-by: Erwan Gouriou <[email protected]>
This allows compiler to inline function body and reduce overall code size. Signed-off-by: Marcin Niestroj <[email protected]>
Check if CONFIG_SOC_SERIES_STM32MP1X is defined instead of its value. While at it convert CONFIG_SOC_SERIES_STM32F1X check to be consistent with others. Signed-off-by: Marcin Niestroj <[email protected]>
This patch doesn't change functionality, but is only related to improved readability and reusability. Signed-off-by: Marcin Niestroj <[email protected]>
Up to now interrupts could be only configured once, with no way to disable them in runtime. Allow interrupts to be disabled in runtime and then properly reenabled on user request. This allows to ignore interrupts when software is not expecting them. The improvement over previously reverted patch [1] is that we disable interrupts only when we configure port for which interrupt line was previously selected. This for example prevents to disable interrupts line 2 in case PA2 was previously configured as interrupt source, but we are currently configuring PB2 as output. [1] 0951ce2 ("gpio: stm32: support disabling and reenabling interrupts on pin") Signed-off-by: Marcin Niestroj <[email protected]>
0b25679 to
3ef472d
Compare
|
Main changes from this PR has been merged part of #20443 PR. |
Up to now interrupts could be only configured once, with no way to disable them in runtime.
Allow interrupts to be disabled in runtime and then properly reenabled on user request. This allows to ignore interrupts when software is not expecting them.
The improvement over previously reverted patch [1] is that we disable interrupts only when we configure port for which interrupt line was previously selected. This for example prevents to disable interrupts line 2 in case PA2 was previously configured as interrupt source, but we are currently configuring PB2 as output.
Besides we make a small improvement by declaring gpio_stm32_enable_int as static and splitting into smaller functions in order to achieve better readability.
Those patches are a result of previously noticed bug #19177.
[1] 0951ce2 ("gpio: stm32: support disabling and reenabling interrupts on pin")