Re: NULL pointer dereference when closing a busy UART

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

 



Hello Andy,

On Tue, Apr 16, 2024 at 05:59:59PM +0300, Andy Shevchenko wrote:
> On Tue, Apr 16, 2024 at 11:52:19AM +0200, Uwe Kleine-König wrote:
> > On Mon, Apr 15, 2024 at 10:04:39PM +0200, Uwe Kleine-König wrote:
> > > On Mon, Apr 15, 2024 at 10:36:44PM +0300, Andy Shevchenko wrote:
> > > > On Mon, Apr 15, 2024 at 07:15:54PM +0200, Uwe Kleine-König wrote:
> 
> ...
> 
> > > > You might need this
> > > > 
> > > > 1aa4ad4eb695 serial: core: Fix missing shutdown and startup for serial base port
> > > > 
> > > > on top btw.
> > > 
> > > Ah, that looks exactly like my issue. Thanks, I will test that an report
> > > back.
> > 
> > It improves my situation for sure. I have yet another problem with the
> > stm32 UART that is driver specfic. I'm working on that one now ...
> 
> Please, Cc me on that when publishing, I'm curious.

I don't have a fix yet, but the problem reproduces as follows:

I have a bridge between TX and RX; and also between RTS and CTS; there
is no DMA involved. I send a big amount of data and so receive that all.
This puts pressure on the receiving line discipline and so ->throttle()
is called.

->throttle() sets stm32_port->throttled = true; which makes the ISR (=
stm32_usart_interrupt()) stop handle USART_SR_RXNE (= RXFIFO not empty).
So the ISR is called in a tight loop. Stuck irq detection doesn't step
in because the ISR returns IRQ_HANDLED unconditionally. (For the latter
I already have a prototype patch.)

It's unclear to me yet, what to do. Some further things that are (maybe)
relevant are:

 - Without a rts-gpio the driver cannot toggle RTS. (Hardware
   limitation)
 - The driver makes no effort evaluating CTS.

Best regards
Uwe

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

Attachment: signature.asc
Description: PGP signature


[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