Linux SNPS ARC Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/5] earlycon hang under some conditions
@ 2017-07-18  4:29 Jeffy Chen
  2017-07-18  4:29 ` [RFC PATCH 1/5] serial: arc: Remove __init marking from early write Jeffy Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Jeffy Chen @ 2017-07-18  4:29 UTC (permalink / raw)
  To: linux-snps-arc

I was testing earlycon with 8250 dw serial console. And it hangs in
these cases:
1/ kernel hang when calling early write function after free_initmem:
a) the earlycon not disabled after the init code(due to keep_bootcon or
   not specify a real console to switch to)
b) the early write func is marked as __init, for example 8250_early.

2/ kernel hang when calling early write function after disable unused
clks/pm domain:
a) the earlycon not disabled after the init code
b) the disable unused clks/pm domain kill the requiered clks/pm
   domain, since they are not referenced by the earlycon.

3/ kernel hang when calling early write function after the serial
   console driver runtime suspended:
a) the earlycon not disabled after the init code
b) the serial console driver's runtime suspend kills the requiered
   clks/pm domain, since they are not referenced by the earlycon.

This serial fix 1/ case only.



Jeffy Chen (5):
  serial: arc: Remove __init marking from early write
  serial: omap: Remove __init marking from early write
  serial: xuartps: Remove __init marking from early write
  serial: 8250_ingenic: Remove __init marking from early write
  serial: 8250_early: Remove __init marking from early write

 drivers/tty/serial/8250/8250_early.c   |  8 ++++----
 drivers/tty/serial/8250/8250_ingenic.c |  8 ++++----
 drivers/tty/serial/arc_uart.c          |  4 ++--
 drivers/tty/serial/omap-serial.c       | 13 ++++++-------
 drivers/tty/serial/xilinx_uartps.c     |  2 +-
 5 files changed, 17 insertions(+), 18 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [RFC PATCH 1/5] serial: arc: Remove __init marking from early write
  2017-07-18  4:29 [RFC PATCH 0/5] earlycon hang under some conditions Jeffy Chen
@ 2017-07-18  4:29 ` Jeffy Chen
  2017-07-18  5:08   ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Jeffy Chen @ 2017-07-18  4:29 UTC (permalink / raw)
  To: linux-snps-arc

The earlycon would be alive outside the init code in these cases:
1/ we have keep_bootcon in cmdline.
2/ we don't have a real console to switch to.

So remove the __init marking to avoid invalid memory access.

Signed-off-by: Jeffy Chen <jeffy.chen at rock-chips.com>
---

 drivers/tty/serial/arc_uart.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c
index 5ac06fc..77fe306 100644
--- a/drivers/tty/serial/arc_uart.c
+++ b/drivers/tty/serial/arc_uart.c
@@ -549,8 +549,8 @@ static struct console arc_console = {
 	.data	= &arc_uart_driver
 };
 
-static __init void arc_early_serial_write(struct console *con, const char *s,
-					  unsigned int n)
+static void arc_early_serial_write(struct console *con, const char *s,
+				   unsigned int n)
 {
 	struct earlycon_device *dev = con->data;
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [RFC PATCH 1/5] serial: arc: Remove __init marking from early write
  2017-07-18  4:29 ` [RFC PATCH 1/5] serial: arc: Remove __init marking from early write Jeffy Chen
@ 2017-07-18  5:08   ` Greg KH
  2017-07-18  6:06     ` jeffy
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2017-07-18  5:08 UTC (permalink / raw)
  To: linux-snps-arc

On Tue, Jul 18, 2017@12:29:59PM +0800, Jeffy Chen wrote:
> The earlycon would be alive outside the init code in these cases:
> 1/ we have keep_bootcon in cmdline.
> 2/ we don't have a real console to switch to.
> 
> So remove the __init marking to avoid invalid memory access.
> 
> Signed-off-by: Jeffy Chen <jeffy.chen at rock-chips.com>
> ---
> 

I can't apply "RFC" patches.  If you have tested and found this series
to be correct, can you resend it without that on the patch?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [RFC PATCH 1/5] serial: arc: Remove __init marking from early write
  2017-07-18  5:08   ` Greg KH
@ 2017-07-18  6:06     ` jeffy
  0 siblings, 0 replies; 4+ messages in thread
From: jeffy @ 2017-07-18  6:06 UTC (permalink / raw)
  To: linux-snps-arc

Hi Greg,

On 07/18/2017 01:08 PM, Greg KH wrote:
> On Tue, Jul 18, 2017@12:29:59PM +0800, Jeffy Chen wrote:
>> The earlycon would be alive outside the init code in these cases:
>> 1/ we have keep_bootcon in cmdline.
>> 2/ we don't have a real console to switch to.
>>
>> So remove the __init marking to avoid invalid memory access.
>>
>> Signed-off-by: Jeffy Chen <jeffy.chen at rock-chips.com>
>> ---
>>
>
> I can't apply "RFC" patches.  If you have tested and found this series
> to be correct, can you resend it without that on the patch?
oh, sorry, i'll resend it :)

but i'm still not sure how to fix other hang cases(mentioned in the 
cover-letter, earlycon's required clks/pm domain been disabled by ignore 
unused initcalls or serial console driver's runtime suspend).
>
> thanks,
>
> greg k-h
>
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-18  6:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-18  4:29 [RFC PATCH 0/5] earlycon hang under some conditions Jeffy Chen
2017-07-18  4:29 ` [RFC PATCH 1/5] serial: arc: Remove __init marking from early write Jeffy Chen
2017-07-18  5:08   ` Greg KH
2017-07-18  6:06     ` jeffy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox