Skip to content

Fix ENET ISR race during Ethernet driver initialization#412

Open
amit-warbhe wants to merge 1 commit intoeclipse-openbsw:mainfrom
esrlabs:cr-205372
Open

Fix ENET ISR race during Ethernet driver initialization#412
amit-warbhe wants to merge 1 commit intoeclipse-openbsw:mainfrom
esrlabs:cr-205372

Conversation

@amit-warbhe
Copy link
Copy Markdown
Contributor

Fix ENET ISR race during Ethernet driver initialization

The ENET ISR could access the Ethernet driver before it was fully initialized.

The ethernet driver pointer (pEnetDriver) was assigned during init(),
which exposed the driver to interrupts before driver.start() completed.

If an ENET interrupt occurred during this window, the ISR could call interruptGroup0() on a
partially initialized driver, leading to undefined behaviour which resulted in HardFault or sometimes
system reset.

Move the assignment of pEnetDriver from init() to run() so the driver is only exposed to the ISR
after driver.start() completes.

The ENET ISR could access the Ethernet driver before it was fully initialized.

The ethernet driver pointer (pEnetDriver) was assigned during init(),
which exposed the driver to interrupts before driver.start() completed.

If an ENET interrupt occurred during this window, the ISR could call interruptGroup0() on a
partially initialized driver, leading to undefined behaviour which resulted in HardFault or sometimes
system reset.

Move the assignment of pEnetDriver from init() to run() so the driver is only exposed to the ISR
after driver.start() completes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant