Re: [PATCH v3] serial: stm32: Merge hard IRQ and threaded IRQ handling into single IRQ handler

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

 



On Thu, Jan 05, 2023 at 09:46:57PM +0100, Marek Vasut wrote:
> On 12/27/22 15:56, Johan Hovold wrote:
> 
> [...]
> 
> >> @@ -793,27 +794,13 @@ static irqreturn_t stm32_usart_interrupt(int irq, void *ptr)
> >>   	}
> >>   
> >>   	if ((sr & USART_SR_TXE) && !(stm32_port->tx_ch)) {
> >> -		spin_lock(&port->lock);
> >> +		spin_lock_irqsave(&port->lock, flags);
> >>   		stm32_usart_transmit_chars(port);
> >> -		spin_unlock(&port->lock);
> >> +		spin_unlock_irqrestore(&port->lock, flags);
> > 
> > This is not needed as the handler runs with interrupts disabled.
> 
> On SMP system, another thread on another core can call 
> stm32_usart_transmit_chars() . I don't think removing the locking is 
> correct ?

I didn't say that you should remove the locking, which is very much
needed. There's just no need to disable interrupts in a (non-threaded)
interrupt handler as that has already been done by IRQ core (and, yes,
that is also the case with forced threading).

Johan



[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