Kernel lockup/hang when attempting to reuse console UART

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Kernel lockup/hang when attempting to reuse console UART

6,774 Views
sethrichards
Contributor I

Hi,

I'm integrating a Linux 3.0.35 kernel on an i.MX6D platform (based loosely on the SABRE SDB design), and am encountering a kernel hang/lockup related to the UARTs. We're attempting to disable the serial console by specifying "console=" on the u-boot kernel command line, and then reuse the serial port for other purposes. However, we occasionally encounter locks or hangs when we attempt to open the UART from userspace.

It appears to be very similar to the problem described in this thread, but I don't see a clear resolution there:

https://community.freescale.com/thread/308092

I've attempted debugging this issue by adding a USB-serial converter to the platform and using that as a serial console, and it looks like it may be getting hung up in the imx_startup function in the i.MX serial driver; it appears that things may go off the rails during configuration of the UARTs registers. I dumped the registers to the USB console and it appears there are some leftover configuration changes from either U-boot or from kernel console setup that are apparently causing problems.

I attempted resetting the UART by writing to the SRST bit in UCR2 and it doesn't seem to have any effect. Does this bit not clear out the config registers and any interrupts? Has anyone else run into similar problems?

Thanks.

Labels (2)
27 Replies

596 Views
fabio_estevam
NXP Employee
NXP Employee

Hi Ramgopal,

I have tested RS485 on recent mainline kernel and it works fine. You can use 4.13.11, which supports RS485 on imx6.

Regards,

Fabio Estevam

0 Kudos

595 Views
ramgopalkota
Contributor I

Hi Fabio,

Thanks , Is 4.13.11 from kernel.org good enough or shall I get it from linux-imx.git.

linux-imx.git has 4.9.11 only.

Ramgopal Kota

0 Kudos

595 Views
fabio_estevam
NXP Employee
NXP Employee

Hi Ramgopal,

I suggest you to use 4.13.11 as 4.9 does not contain the recent imx rs485 fixes.

If you need further assistance, please start a new thread. This one is more than two years old :-)

Regards,

Fabio Estevam

0 Kudos

596 Views
rajendrabaniyav
Contributor I

Hello Fabio,

Patch worked for me, i.e. now it is not hanging.

Now with this fix and bootargs as "noconsole" I dont see any logs. But if I try to print something on UART ( echo Hello > /dev/ttymxc1), nothing comes on UART . Anything missing?

Thanks

Rajendra

0 Kudos

596 Views
sethrichards2
Contributor II

Fabio,

Thanks for the information. We do not have that patch in our version of the kernel. My initial testing with the patch applied looks pretty promising. I'm going to reconfigure my setup to our shipping configuration and run some stress testing overnight; I'll post with my findings in the morning.

  --Seth

0 Kudos

596 Views
cyborgnegotiato
Senior Contributor II

Hi Seth,

Did you try new Linux kernel version? Could you please, confirm your result?

Is here any problem why you cannot upgrade to newest version?

Regards,

Jozef

0 Kudos

596 Views
sethrichards2
Contributor II

Hi Jozef,

I did try the 3.10.17 image on the SABRE board and it does not appear to exhibit the problem. We plan on running some more extensive testing on this configuration when we get a chance. We're discussing moving to 3.10 in the future, but it would be a pretty major effort for our team and we have shipping deadlines we need to meet before we could complete such an effort.

Thanks,

  --Seth

0 Kudos