Re: [EXT] Re: [PATCH tty/serial 1/1] tty: serial: imx: fix sysrq lockdep issue

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

 



On Mon 2019-11-25 01:23:14, Andy Duan wrote:
> From: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> Sent: Friday, November 22, 2019 6:34 PM
> > Hello,
> > 
> > On Fri, Nov 22, 2019 at 10:00:53AM +0000, Andy Duan wrote:
> > > From: Fugang Duan <fugang.duan@xxxxxxx>
> > >
> > > commit dbdda842fe96 ("printk: Add console owner and waiter logic to
> > > load balance console writes") introduces the lockdep issue for imx
> > > serial driver in sysrq case:
> > >      CPU0                    CPU1
> > >      ----                    ----
> > > lock(&port_lock_key);
> > >                              lock(console_owner);
> > >                              lock(&port_lock_key);
> > > lock(console_owner);
> > >
> > > It should unlock port_lock_key in handle_sysrq().
> > 
> > I already discussed this problem some time ago but then failed to complete
> > the topic. You might want to look at the old discussion, see
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.s
> > pinics.net%2Flists%2Fkernel%2Fmsg3266353.html&amp;data=02%7C01%7Cf
> > ugang.duan%40nxp.com%7C88047af87afa448bddaf08d76f377e8b%7C686ea
> > 1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637100156446083651&amp;
> > sdata=mLk%2BLEyiJjIuRlLs0STJpWJ8K7Q2uPa2fL44bcf2mgY%3D&amp;reserv
> > ed=0.
> > 
> > Best regards
> > Uwe
> 
> Thanks for point out the old discussion.
> The issue seems exist all most of serial drivers. It is better to fix it on common code.

Do you have an idea how to fix this in a common code, please?

I am afraid that all affected drivers need to be fixed separately
as discussed in the above mentioned thread.


> How about the next step, we hope to the lockdep issue is fixed ASAP. 
> Thanks!

I would prefer if

   + uart_prepare_sysrq_char() gets renamed to uart_store_sysrq_char()

   + uart_unlock_and_check_sysrq() gets replaced with:

	sysrq_ch = uart_get_sysrq_char(port);
	spin_unlock(&port->lock);

	if (sysrq_ch)
		handle_sysrq(sysrq_ch);

as metnioned in
https://lore.kernel.org/lkml/20190926085855.debu7t46s7kgb26p@xxxxxxxxxxxxxxx/

Would you like to prepare the patchset, please?

Best Regards,
Petr



[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