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

HAL_ChibiOS: add a max quota of GPIO interrupts #15388

Merged
merged 3 commits into from Oct 1, 2020

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Sep 21, 2020

This implements a max quota of GPIO interrupts per 100ms period to prevent high interrupt counts from consuming all CPU and causing a lockup. The limit is set as 10k interrupts per 0.1s period. That limit should be high enough for all reasonable uses of GPIO interrupt handlers while being below the level that causes significant CPU loads and flight issues

This addresses issue #15384

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

Legit linking failure in CI for iofirmware needs to be fixed.

libraries/AP_HAL_ChibiOS/GPIO.cpp Show resolved Hide resolved
This implements a max quota of GPIO interrupts per 100ms period to
prevent high interrupt counts from consuming all CPU and causing a
lockup. The limit is set as 10k interrupts per 0.1s period. That limit
should be high enough for all reasonable uses of GPIO interrupt
handlers while being below the level that causes significant CPU loads
and flight issues

This addresses issue ArduPilot#15384
@tridge tridge merged commit e471b23 into ArduPilot:master Oct 1, 2020
@rmackay9 rmackay9 added this to 4.0.5-rc1 in Copter 4.0 backports Oct 1, 2020
@AndKe
Copy link
Contributor

AndKe commented Oct 7, 2020

If the quota is exceeded, interrupts are disabled until the next reboot.
Would it be feasible/wise to re-enable it after a while ?
Are there other things, like camera feedback, that will suffer?

  • maybe a statustext should be sent/logged - to clearly mark this event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Plane 4.0 Backports
  
Awaiting triage
Rover 4.0 backports
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

6 participants