da9063 - Reboot issue : koops rcu_note_context_switch

Köry Maincent kory.maincent at navocap.com
Mon Apr 1 03:53:54 EDT 2019


Hi Hariprasad,

On 28/03/2019 19:24, hariprasad kelam wrote:
Hi Kory Maincent.

On Tue, 26 Mar 2019 at 13:21, Köry Maincent <kory.maincent at navocap.com<mailto:kory.maincent at navocap.com>> wrote:
Hello,

I got a kernel warning on the reboot of my embedded board, and sometimes I got stuck in the reboot.
I work on the IMX6Q with a PMIC da9063 and the last kernel release.

It happens in the da9063_wdt_restart function at the regmap_write call in the CONTROL_F register. (drivers/watchdog/da9063_wdt.c)


From trace we are able figure out the flow,

reboot
|
|
invokes system call(sys_reboot)
|
|
 watchdog_restart)notifier
|
|
da9063_wdt_restart
|
|
It sending I2c rear/write commands.

Is this expected behaviour  ??
Yes it is.
If I access to other register in that function, I don't have this issue.
The reason could be ,you are accessing other registers directly not through I2C.
I was wrong on this point, because of bad order debug printing in the drivers.


I manage to avoid the issue with a hotfix : adding rcu_read_unlock(); before I2C writing in the da9063_wdt_restart function. There is no more koops warning neither freezing reboot.
I don't think it is a clean patch and I don't understand the relation to preemption.
It may happens because of an RCU critical section not closed?



Regards,
Kory

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20190401/0d2a1aae/attachment.html>


More information about the Kernelnewbies mailing list