RE: [EXT] Re: [PATCH tty/serial 1/1] tty: serial: imx: keep console clocks always on

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> Sent: Wednesday, November 11, 2020 4:31 AM
> On Mon, Nov 09, 2020 at 05:14:03PM +0800, Fugang Duan wrote:
> > For below code, there has chance to cause deadlock in SMP system:
> > Thread 1:
> > clk_enable_lock();
> > pr_info("debug message");
> > clk_enable_unlock(flags);
> 
> flags?

Will remove it, thanks.
> 
> >
> > Thread 2:
> > imx_uart_console_write()
> > 	clk_enable()
> > 		clk_enable_lock();
> >
> > Thread 1:
> > Acuired clk enable_lock -> printk -> console_trylock_spinning Thread
> > 2:
> > console_unlock() -> imx_uart_console_write -> clk_disable -> Acquite
> > clk enable_lock
> >
> > So the patch is to keep console port clocks always on like other
> > console drivers.
> >
> > Signed-off-by: Fugang Duan <fugang.duan@xxxxxxx>
> 
> Depending on how old this problem is, identifying the commit that introduces
> the problem (and noting it in a Fixes: line) would be good.
> 
In normal boot, there has no problem since there have no printk
between clk_enable_lock() and clk_enable_unlock(). If you add debug
message between them or enable track in clk driver, the issue should be
triggered.

Will add the Fixes tag in v2, thanks.

> Best regards
> Uwe
> 
> --
> Pengutronix e.K.                           | Uwe Kleine-König
> |
> Industrial Linux Solutions                 | https://www.pengutronix.de/ |




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux