Tool/software:
Hi TI Experts,
Background
Customer last generations works on AM335 Kernel Linux 3.2, and it is working normally all the time.
Their current generation has been developed for around 2 years using AM335x Linux5.1, and today they are reaching to the last stage to SOP.
There is a UART problem in the current generation (Linux5.1) which frequently cause Omap8250_IRQ, this problem is not in the last generation (Linux3.2). Customer also did a lot of testing, they used the current SW running on the last generation HW, the problem will also happen, and used the last generation SW running on the current generation HW, there is no problem. Hence, after all these testing, customer could confirm that this problem strongly relates to the SW side.
Reproduce Methods
If the Rx & Tx of UART is not the same time, then this problem is hard to reproduce (need more than 1 hour running to reproduce). To make it easier to reproduce, customer found the following two methods.
1: Rx & Tx at the same time.
2: Tx & Rx with different baud rate.
The running method is below.
1) Use the following CSerial.app & CSerial.h to compile the RS485DeviceTest, running on the AMM335.
CSerial.cppCSerial.hhttps://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/RS485DeviceTest
2) Use Windows Uart tool shown below to send 20+ bytes data every 10ms, and after 5 minutes they could reproduce the problem. (if Rx & Tx at the same)
3) The error log is shown below.
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2025.03.04 15:36:43 =~=~=~=~=~=~=~=~=~=~=~= [ 442.019615] <omap8250_irq> in [ 442.022772] <omap8250_irq> in [ 442.027641] <omap8250_irq> in [ 442.030746] <omap8250_irq> in [ 442.033997] <omap8250_irq> in [ 442.038296] <omap8250_irq> in [ 442.041658] <omap8250_irq> in gs8000:/home/user# [ 442.046415] <omap8250_irq> in [ 443.814122] <omap8250_irq> in [ 443.817272] <omap8250_irq> in [ 443.820472] <omap8250_irq> in .[ 443.823644] <omap8250_irq> in [ 443.828521] <omap8250_irq> in [ 444.025782] <omap8250_irq> in [ 444.028914] <omap8250_irq> in [ 444.032101] <omap8250_irq> in .[ 444.035267] <omap8250_irq> in [ 444.039985] <omap8250_irq> in [ 446.814953] <omap8250_irq> in [ 446.818091] <omap8250_irq> in [ 446.821285] <omap8250_irq> in R[ 446.824455] <omap8250_irq> in [ 446.829366] <omap8250_irq> in [ 447.005144] <omap8250_irq> in [ 447.008282] <omap8250_irq> in [ 447.011476] <omap8250_irq> in S[ 447.014647] <omap8250_irq> in [ 447.019313] <omap8250_irq> in [ 447.341795] <omap8250_irq> in [ 447.344958] <omap8250_irq> in [ 447.352713] <omap8250_irq> in [ 447.355894] <omap8250_irq> in [ 447.360963] <omap8250_irq> in [ 448.877933] <omap8250_irq> in [ 448.881079] <omap8250_irq> in [ 448.885477] <omap8250_irq> in [ 448.888580] <omap8250_irq> in [ 448.891833] <omap8250_irq> in [ 448.896860] <omap8250_irq> in -sh: [ 448.900407] <omap8250_irq> in ..RS: not found gs8000:/home/user# [ 448.906647] <omap8250_irq> in [ 450.951371] <omap8250_irq> in [ 450.954517] <omap8250_irq> in [ 450.957708] <omap8250_irq> in [ 450.960791] <omap8250_irq> in [ 450.964044] <omap8250_irq> in [ 450.969075] <omap8250_irq> in [ 450.972425] <omap8250_irq> in gs8000:/home/user# [ 450.977178] <omap8250_irq> in [ 452.278666] <omap8250_irq> in [ 452.281800] <omap8250_irq> in [ 452.286141] <omap8250_irq> in .[ 452.289328] <omap8250_irq> in [ 452.528377] <omap8250_irq> in [ 452.531509] <omap8250_irq> in [ 452.537531] <omap8250_irq> in /[ 452.540722] <omap8250_irq> in [ 452.545228] <omap8250_irq> in [ 453.060723] <omap8250_irq> in [ 453.063885] <omap8250_irq> in [ 453.068151] <omap8250_irq> in R[ 453.071333] <omap8250_irq> in [ 453.302358] <omap8250_irq> in [ 453.305489] <omap8250_irq> in [ 453.308665] <omap8250_irq> in S[ 453.311835] <omap8250_irq> in [ 453.782690] <omap8250_irq> in [ 453.785837] <omap8250_irq> in [ 453.789418] <omap8250_irq> in gs8000:/home/user# ./RS485DeviceTest [J[ 453.796101] <omap8250_irq> in [ 454.690276] <omap8250_irq> in [ 454.693422] <omap8250_irq> in [ 454.697816] <omap8250_irq> in [ 454.701001] <omap8250_irq> in [ 455.451916] <omap8250_irq> in [ 455.455066] <omap8250_irq> in [ 455.458264] <omap8250_irq> in [ 455.461344] <omap8250_irq> in [ 455.464598] <omap8250_irq> in [ 455.469555] <omap8250_irq> in [ 455.559883] <omap8250_irq> in [ 455.563968] <omap8250_irq> in [ 455.567159] <omap8250_irq> in <crt>write count:11 - <end - index:0> [ 455.573563] <omap8250_irq> in [ 455.576832] <omap8250_irq> in [ 455.624501] <omap8250_irq> in <crt>readcount:0 -- - <end - index:0> [ 455.631004] <omap8250_irq> in [ 455.634259] <omap8250_irq> in [ 455.677786] <omap8250_irq> in [ 455.680933] <omap8250_irq> in <crt>write count:11 - <end - index:1> [ 455.684013] <omap8250_irq> in [ 455.690421] <omap8250_irq> in [ 455.695020] <omap8250_irq> in [ 455.698290] <omap8250_irq> in [ 455.748324] <omap8250_irq> in <crt>readcount:0 -- - <end - index:1> [ 455.754835] <omap8250_irq> in [ 455.758098] <omap8250_irq> in [ 455.801577] <omap8250_irq> in [ 455.805315] <omap8250_irq> in <crt>write count:11 - <end - index:2> [ 455.808413] <omap8250_irq> in [ 455.814784] <omap8250_irq> in [ 455.819074] <omap8250_irq> in [ 455.822345] <omap8250_irq> in [ 455.872511] <omap8250_irq> in <crt>readcount:0 -- - <end - index:2> [ 455.879018] <omap8250_irq> in [ 455.882279] <omap8250_irq> in [ 455.926360] <omap8250_irq> in [ 455.929496] <omap8250_irq> in <crt>write count:11 - <end - index:3> [ 455.932575] <omap8250_irq> in [ 455.938979] <omap8250_irq> in [ 455.943170] <omap8250_irq> in [ 455.946436] <omap8250_irq> in [ 455.996459] <omap8250_irq> in <crt>readcount:0 -- - <end - index:3> [ 456.002952] <omap8250_irq> in [ 456.006207] <omap8250_irq> in [ 456.049702] <omap8250_irq> in [ 456.052836] <omap8250_irq> in <crt>write count:11 - <end - index:4> [ 456.055950] <omap8250_irq> in [ 456.062294] <omap8250_irq> in [ 456.067093] <omap8250_irq> in [ 456.070363] <omap8250_irq> in [ 456.120398] <omap8250_irq> in <crt>readcount:0 -- - <end - index:4> [ 456.126895] <omap8250_irq> in [ 456.130160] <omap8250_irq> in [ 456.174251] <omap8250_irq> in [ 456.177394] <omap8250_irq> in <crt>write count:11 - <end - index:5> [ 456.180476] <omap8250_irq> in [ 456.186881] <omap8250_irq> in [ 456.191353] <omap8250_irq> in [ 456.194620] <omap8250_irq> in [ 456.198470] <omap8250_irq> in [ 456.251756] <omap8250_irq> in <crt>readcount:0 -- - <end - index:5> [ 456.258259] <omap8250_irq> in [ 456.261519] <omap8250_irq> in [ 456.305476] <omap8250_irq> in [ 456.308607] <omap8250_irq> in <crt>write count:11 - <end - index:6> [ 456.311686] <omap8250_irq> in [ 456.318059] <omap8250_irq> in [ 456.322596] <omap8250_irq> in [ 456.325863] <omap8250_irq> in [ 456.329890] <omap8250_irq> in [ 456.383191] <omap8250_irq> in <crt>readcount:0 -- - <end - index:6> [ 456.389687] <omap8250_irq> in [ 456.392936] <omap8250_irq> in [ 456.436441] <omap8250_irq> in [ 456.439576] <omap8250_irq> in <crt>write count:11 - <end - index:7> [ 456.442655] <omap8250_irq> in [ 456.449061] <omap8250_irq> in [ 456.453175] <omap8250_irq> in [ 456.456440] <omap8250_irq> in [ 456.506484] <omap8250_irq> in <crt>readcount:0 -- - <end - index:7> [ 456.512976] <omap8250_irq> in [ 456.516232] <omap8250_irq> in [ 456.559730] <omap8250_irq> in [ 456.562867] <omap8250_irq> in <crt>write count:11 - <end - index:8> [ 456.565979] <omap8250_irq> in [ 456.572319] <omap8250_irq> in [ 456.576703] <omap8250_irq> in [ 456.579967] <omap8250_irq> in [ 456.630006] <omap8250_irq> in <crt>readcount:0 -- - <end - index:8> [ 456.636514] <omap8250_irq> in [ 456.639779] <omap8250_irq> in [ 456.683942] <omap8250_irq> in [ 456.687076] <omap8250_irq> in <crt>write count:11 - <end - index:9> [ 456.690155] <omap8250_irq> in [ 456.696562] <omap8250_irq> in [ 456.701078] <omap8250_irq> in [ 456.704341] <omap8250_irq> in [ 456.708123] <omap8250_irq> in [ 456.761408] <omap8250_irq> in <crt>readcount:0 -- - <end - index:9> [ 456.767904] <omap8250_irq> in [ 456.771165] <omap8250_irq> in [ 456.815184] <omap8250_irq> in [ 456.818325] <omap8250_irq> in <crt>write count:11 - <end - index:10> [ 456.821405] <omap8250_irq> in [ 456.827896] <omap8250_irq> in [ 456.832546] <omap8250_irq> in [ 456.835813] <omap8250_irq> in [ 456.839570] <omap8250_irq> in [ 456.892858] <omap8250_irq> in <crt>readcount:0 -- - <end - index:10> [ 456.899453] <omap8250_irq> in [ 456.902720] <omap8250_irq> in [ 456.946893] <omap8250_irq> in [ 456.950028] <omap8250_irq> in <crt>write count:11 - <end - index:11> [ 456.953107] <omap8250_irq> in [ 456.959601] <omap8250_irq> in [ 456.963154] <omap8250_irq> in [ 456.966419] <omap8250_irq> in [ 457.016449] <omap8250_irq> in
We could clearly see that Omap8250_IRQ is frequently entered when problem happens.
Testing Tried
To try solve this problem, customer found a very similar thread which also discussed this problem before. Only difference is that this thread is for AM62x.
And customer has tried the workaround discussed in the above thread but still not solved the problem yet. (code below)
static irqreturn_t omap8250_irq(int irq, void *dev_id) { struct uart_port *port = dev_id; struct omap8250_priv *priv = port->private_data; struct uart_8250_port *up = up_to_u8250p(port); unsigned int iir, lsr; int ret; #ifdef CONFIG_SERIAL_8250_DMA if (up->dma) { ret = omap_8250_dma_handle_irq(port); return IRQ_RETVAL(ret); } #endif serial8250_rpm_get(up); lsr = serial_port_in(port, UART_LSR); iir = serial_port_in(port, UART_IIR); ret = serial8250_handle_irq(port, iir); /* * On K3 SoCs, it is observed that RX TIMEOUT is signalled after * FIFO has been drained or erroneously. * So apply solution of Errata i2310 as mentioned in * https://www.ti.com/lit/pdf/sprz536 */ if (priv->habit & UART_RX_TIMEOUT_QUIRK && (iir & UART_IIR_RX_TIMEOUT) == UART_IIR_RX_TIMEOUT && serial_port_in(port, UART_OMAP_RX_LVL) == 0) { unsigned char efr2, timeout_h, timeout_l; efr2 = serial_in(up, UART_OMAP_EFR2); timeout_h = serial_in(up, UART_OMAP_TO_H); timeout_l = serial_in(up, UART_OMAP_TO_L); serial_out(up, UART_OMAP_TO_H, 0xFF); serial_out(up, UART_OMAP_TO_L, 0xFF); serial_out(up, UART_OMAP_EFR2, UART_OMAP_EFR2_TIMEOUT_BEHAVE); serial_in(up, UART_IIR); serial_out(up, UART_OMAP_EFR2, efr2); serial_out(up, UART_OMAP_TO_H, timeout_h); serial_out(up, UART_OMAP_TO_L, timeout_l); } /* Stop processing interrupts on input overrun */ if ((lsr & UART_LSR_OE) && up->overrun_backoff_time_ms > 0) { unsigned long delay; /* Synchronize UART_IER access against the console. */ spin_lock(&port->lock); up->ier = port->serial_in(port, UART_IER); if (up->ier & (UART_IER_RLSI | UART_IER_RDI)) { port->ops->stop_rx(port); } else { /* Keep restarting the timer until * the input overrun subsides. */ cancel_delayed_work(&up->overrun_backoff); } spin_unlock(&port->lock); delay = msecs_to_jiffies(up->overrun_backoff_time_ms); schedule_delayed_work(&up->overrun_backoff, delay); } serial8250_rpm_put(up); return IRQ_RETVAL(ret); }
Customer found that the yellow part below (the suggest workaround) is not actually being run though when the problem happens.
Customer also tried their best modify the 8250_omap.c file according to the latest SDK9.3, but still not solve the problem. And as the project is going to SOP, customer could not migrate the entire SDK to SDK9.3 for time being.
Hence, customer reaches to us and may need our support to help them move on to SOP on time.
Could you please help on this?
Thanks,
Kevin