Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Johan Hovold <johan@kernel.org>
Cc: linux-serial@vger.kernel.org,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Erwan Le Ray <erwan.leray@foss.st.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Valentin Caron <valentin.caron@foss.st.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH v3] serial: stm32: Merge hard IRQ and threaded IRQ handling into single IRQ handler
Date: Thu, 5 Jan 2023 21:46:57 +0100	[thread overview]
Message-ID: <a66988fd-af44-63cd-e962-47ffa6205a6a@denx.de> (raw)
In-Reply-To: <Y6sHr5kuxUoahlzJ@hovoldconsulting.com>

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 ?

> 
>>   	}
>>   
>> -	if (stm32_usart_rx_dma_enabled(port))
>> -		return IRQ_WAKE_THREAD;
>> -	else
>> -		return IRQ_HANDLED;
>> -}
>> -
>> -static irqreturn_t stm32_usart_threaded_interrupt(int irq, void *ptr)
>> -{
>> -	struct uart_port *port = ptr;
>> -	struct tty_port *tport = &port->state->port;
>> -	struct stm32_port *stm32_port = to_stm32_port(port);
>> -	unsigned int size;
>> -	unsigned long flags;
>> -
>>   	/* Receiver timeout irq for DMA RX */
>> -	if (!stm32_port->throttled) {
>> +	if (stm32_usart_rx_dma_enabled(port) && !stm32_port->throttled) {
>>   		spin_lock_irqsave(&port->lock, flags);
> 
> But you could change this to spin_lock() now.

[...]

  reply	other threads:[~2023-01-05 20:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16 11:53 [PATCH v3] serial: stm32: Merge hard IRQ and threaded IRQ handling into single IRQ handler Marek Vasut
2022-12-27 14:56 ` Johan Hovold
2023-01-05 20:46   ` Marek Vasut [this message]
2023-01-06 10:56     ` Johan Hovold
2023-01-09 19:19       ` Marek Vasut
2023-01-09 10:13   ` Sebastian Andrzej Siewior
2023-01-12 13:13     ` Johan Hovold
2023-01-12 16:38       ` Marek Vasut
2023-01-12 17:09         ` Johan Hovold
2023-01-12 17:50           ` Marek Vasut
2023-01-12 17:57             ` Johan Hovold
2023-01-05 14:56 ` Valentin CARON
2023-01-05 20:47   ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a66988fd-af44-63cd-e962-47ffa6205a6a@denx.de \
    --to=marex@denx.de \
    --cc=alexandre.torgue@foss.st.com \
    --cc=bigeasy@linutronix.de \
    --cc=erwan.leray@foss.st.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=johan@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=valentin.caron@foss.st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox