Skip to content

K64F Ethernet: avoid using NULL thread during init #5745

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 22, 2017

Conversation

kjbracey
Copy link
Contributor

The K64F Ethernet driver installs an interrupt handler that sets thread
flags, and this could be called before the thread was initialised, so it
would use a NULL thread ID.

This triggers an RTX error-checking trap in debug builds, and could also
lead to other problems with received packets not being processed.

Adjusted so the RX interrupt handler does nothing if the thread isn't
initialised yet, and manually trigger a RX event flag after initialising
the thread in case any interrupts were ignored.

An alternative would have been to implement eth_arch_enable_interrupts,
but this mechanism is not present in the EMAC world - drivers will have
to start returning interrupts in their power up.

Fixes #5680

The K64F Ethernet driver installs an interrupt handler that sets thread
flags, and this could be called before the thread was initialised, so it
would use a NULL thread ID.

This triggers an RTX error-checking trap in debug builds, and could also
lead to other problems with received packets not being processed.

Adjusted so the RX interrupt handler does nothing if the thread isn't
initialised yet, and manually trigger a RX event flag after initialising
the thread in case any interrupts were ignored.

An alternative would have been to implement eth_arch_enable_interrupts,
but this mechanism is not present in the EMAC world - drivers will have
to start returning interrupts in their power up.

Fixes ARMmbed#5680
@0xc0170
Copy link
Contributor

0xc0170 commented Dec 21, 2017

/morph build

@mbed-ci
Copy link

mbed-ci commented Dec 21, 2017

Build : SUCCESS

Build number : 739
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5745/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@mbed-ci
Copy link

mbed-ci commented Dec 21, 2017

@mbed-ci
Copy link

mbed-ci commented Dec 21, 2017

@studavekar
Copy link
Contributor

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Dec 21, 2017

@0xc0170 0xc0170 merged commit 9cce4d2 into ARMmbed:master Dec 22, 2017
@kjbracey kjbracey deleted the k64f_init_order branch January 2, 2018 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants