protect tele_ii_tx from interrupts #60

wants to merge 1 commit into


None yet

1 participant

ngwese commented Jan 3, 2017 edited

note: this change is untested and intended primarily for review.

no idea (yet) if this helps with stability/lockups but while working through the ii code to understand how it all works i noticed that the queue manipulation in tele_ii_tx() isn't protected from changes made to the queue (at interrupt level) in handler_IItx().

this change:

  • disables interrupts while filling a queue entry in order to prevent a partially filled queue entry from being transmitted
  • mild reordering of waiting flag handling to reduce potential for partially filled ii queue entries being marked as sendable or marked as available before being sent.
  • guards against a potentially infinite loop/memory corruption case when searching for an available ii queue entry to pack (in tele_ii_tx()).
@ngwese ngwese requested a review from tehn Jan 3, 2017
ngwese commented Jan 5, 2017 edited

....after examining the code more i don't think some of the above changes have any real effect so beyond the protection against an infinite loop and the volatile change the rest is not needed (since the normal event queue provides most of the needed safety).

i'm going to restructure this PR.

@ngwese ngwese closed this Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment