<div dir="ltr">Hello Alexander,<div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 22, 2015 at 11:08 AM, Alexander <span dir="ltr">&lt;<a href="mailto:alexhoppus111@gmail.com" target="_blank">alexhoppus111@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Arun KS,<br>
Actually, i already saw this one and something similar were tested. I just trying<br>
to figure out the reasons why generic kernel layer (console_unlock) implemented<br>
in such way: i.e. why it accounts on immediate busyloop printing? Is it reliable to<br>
defer such printing to UART interrupts?<br></blockquote><div><br></div><div>Lets try to find out why it is done the way it is. My guess is &quot;it makes printk simple and robust&quot;. Because if interrupts are blocked, console should not fail giving the critical information.</div><div><br></div><div>To change this behavior, we have to change the complete logic in the prink code to adjust with that. Because as of now printk code expects serial drivers returns only after finishing the job.</div><div><br></div><div>Thanks,</div><div>Arun </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thank you.<br>
<span class=""><br>
On Mon, 20 Jul 2015 09:34:16 +0530<br>
Arun KS &lt;<a href="mailto:getarunks@gmail.com">getarunks@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Hello Alexander,<br>
&gt;<br>
</span><span class="">&gt; On Sat, Jul 18, 2015 at 11:23 AM, Alexander &lt;<a href="mailto:alexhoppus111@gmail.com">alexhoppus111@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt; Hi!<br>
&gt; &gt; When i checked how kernel printing works, i mentioned that it takes<br>
&gt; &gt; messages<br>
&gt; &gt; from log_buffer in console_unlock and gives it to call_console_drivers -&gt;<br>
&gt; &gt; ...<br>
&gt; &gt; -&gt; some uart bsp function. Basically, as i see this BSP realization tries<br>
&gt; &gt; to flush all message chars in busyloop ... so it waits until FIFO_NOT_FULL<br>
&gt; &gt; bit will<br>
&gt; &gt; be dropped by UART and it will be able to push the next byte.<br>
&gt; &gt; Basically, as i see userspace printing do something different. It puts<br>
&gt; &gt; N_FIFO_BYTES<br>
&gt; &gt; and exits, next, when FIFO will be freed - interrupt will be generated, and<br>
&gt; &gt; other characters will be put into UART FIFO.<br>
&gt; &gt; Can we do something similar for kernel printing? i.e. do not busyloop<br>
&gt; &gt; sending char<br>
&gt; &gt; after char, but put N_FIFO chars and flush  other in interrupt. When panic<br>
&gt; &gt; will occur<br>
&gt; &gt; we can do busyloop printing again. Is it reliable? Suppose we have several<br>
&gt; &gt; cores.<br>
&gt; &gt; Thank you.<br>
&gt; &gt;<br>
&gt; What about trying this patch,<br>
&gt; <a href="https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/kernel/printk/printk.c?id=5874af2003b1aaaa053128d655710140e3187226" rel="noreferrer" target="_blank">https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/kernel/printk/printk.c?id=5874af2003b1aaaa053128d655710140e3187226</a><br>
&gt;<br>
</span><span class="">&gt; Its not changing console printing through UART to interrupt mode. But<br>
&gt; minimizes the time interrupts being disabled on printk().<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Arun<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt; --<br>
</span>&gt; &gt; Alexander &lt;<a href="mailto:alexhoppus111@gmail.com">alexhoppus111@gmail.com</a>&gt;<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Kernelnewbies mailing list<br>
&gt; &gt; <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
&gt; &gt; <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" rel="noreferrer" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
&gt; &gt;<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Alexander &lt;<a href="mailto:alexhoppus111@gmail.com">alexhoppus111@gmail.com</a>&gt;<br>
</font></span></blockquote></div><br></div></div>