<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Hariprasad,<br>
<div class="moz-signature">
<div class="moz-signature">
<div class="moz-signature">
<div class="WordSection1"><br>
</div>
<font face="Calibri,sans-serif"></font></div>
</div>
</div>
<div class="moz-cite-prefix">On 28/03/2019 19:24, hariprasad kelam wrote:<br>
</div>
<blockquote type="cite" cite="mid:CACFYQXM7zKBdnTe8n6A4N=2+tNEO9QzjT0aeJnM0UFSvpnn15g@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>Hi Kory Maincent.</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, 26 Mar 2019 at 13:21, Köry Maincent <<a href="mailto:kory.maincent@navocap.com" moz-do-not-send="true">kory.maincent@navocap.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">Hello,<br>
<br>
I got a kernel warning on the reboot of my embedded board, and sometimes I got stuck in the reboot.<br>
I work on the IMX6Q with a PMIC da9063 and the last kernel release.<br>
<br>
It happens in the <i>da9063_wdt_restart</i> function at the <i>regmap_write</i> call in the CONTROL_F register. (drivers/watchdog/da9063_wdt.c)<br>
<br>
</div>
</blockquote>
<div><br>
</div>
<div>From trace we are able figure out the flow,</div>
<div><br>
</div>
<div>reboot </div>
<div>|</div>
<div>|</div>
<div>invokes system call(sys_reboot)</div>
<div>|</div>
<div>|</div>
<div> watchdog_restart)notifier</div>
<div>|</div>
<div>|</div>
<div>da9063_wdt_restart <br>
</div>
<div>|</div>
<div>|</div>
<div>It sending I2c rear/write commands.</div>
<div><br>
</div>
<div>Is this expected behaviour ??</div>
</div>
</div>
</div>
</div>
</blockquote>
Yes it is.<br>
<blockquote type="cite" cite="mid:CACFYQXM7zKBdnTe8n6A4N=2+tNEO9QzjT0aeJnM0UFSvpnn15g@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div class="gmail_quote">
<div>If I access to other register in that function, I don't have this issue.<br>
</div>
<div>The reason could be ,you are accessing other registers directly not through I2C.</div>
</div>
</div>
</div>
</div>
</blockquote>
I was wrong on this point, because of bad order debug printing in the drivers.<br>
<br>
<br>
I manage to avoid the issue with a hotfix : adding <i>rcu_read_unlock();</i> before I2C writing in the da9063_wdt_restart function. There is no more koops warning neither freezing reboot.<br>
I don't think it is a clean patch and I don't understand the relation to preemption.<br>
It may happens because of an RCU critical section not closed?<br>
<br>
<br>
<br>
Regards,<br>
Kory<br>
<br>
</body>
</html>