lupyuen / lupyuen.github.io

Lup Yuen's Articles and Resume
https://lupyuen.github.io
Apache License 2.0
74 stars 14 forks source link

Spurious UART interrupts #18

Closed michaelengel closed 1 year ago

michaelengel commented 1 year ago

The JH7110 uses a DesignWare UART component which has some "interesting" extra features. The spurious interrupts are probably caused by a busy interrupt generated by the UART (which is caused by writing the LCR when the chip is busy). If this interrupt is not cleared, you'll end up in an interrupt storm.

See e.g. the [Linux DesignWare UART driver] for a workaround (https://elixir.bootlin.com/linux/latest/source/drivers/tty/serial/8250/8250_dw.c).

lupyuen commented 1 year ago

That's very helpful, thanks for the tip! :-)

lupyuen commented 1 year ago

Update: We fixed the Spurious UART Interrupts by waiting for UART to be not busy before setting the Line Control Register:

https://github.com/lupyuen2/wip-pinephone-nuttx/pull/36/files#diff-f208234edbfb636de240a0fef1c85f9cecb37876d5bc91ffb759f70a1e96b1d1

Thank you so much! :-)