All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Genoud <richard.genoud@gmail.com>
To: Michael Walle <michael@walle.cc>,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] serial: atmel: don't stop the transmitter when doing PIO
Date: Wed, 23 Nov 2022 13:46:17 +0100	[thread overview]
Message-ID: <ffb1f40b-bbe8-5431-63cf-a53fc0606971@gmail.com> (raw)
In-Reply-To: <df233ce37626fdb194b583808326d966@walle.cc>

Le 23/11/2022 à 09:50, Michael Walle a écrit :
> Am 2022-11-23 09:27, schrieb Jiri Slaby (SUSE):
>> Writing ATMEL_US_TXDIS to ATMEL_US_CR makes the transmitter NOT to send
>> the just queued character. This means when the character is last and
>> uart calls ops->stop_tx(), the character is not sent at all.
>>
>> The usart datasheet is not much specific on this, it just says the
>> transmitter is stopped. But apparently, the character is dropped. So
>> we should stop the transmitter only for DMA and PDC transfers to not
>> send any more characters. For PIO, this is unexpected and deviates from
>> other drivers. In particular, the below referenced commit broke TX as it
>> added a call to ->stop_tx() after the very last character written to the
>> transmitter.
>>
>> So fix this by limiting the write of ATMEL_US_TXDIS to DMA transfers
>> only.
>>
>> Even there, I don't know if it is correctly implemented. Are all the
>> queued characters sent once ->start_tx() is called? Anyone tested flow
>> control -- be it hard (RTSCTS) or the soft (XOFF/XON) one?
>>
>> Fixes: 2d141e683e9a ("tty: serial: use uart_port_tx() helper")
>> Cc: Richard Genoud <richard.genoud@gmail.com>
>> Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
>> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
>> Cc: Claudiu Beznea <claudiu.beznea@microchip.com>
>> Cc: linux-arm-kernel@lists.infradead.org
>> Reported-by: Michael Walle <michael@walle.cc>
>> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
> 
> Already merged, but:
> Tested-by: Michael Walle <michael@walle.cc>
Acked-by: Richard Genoud <richard.genoud@gmail.com>

> 
> Thanks,
> -michael
Thanks !

WARNING: multiple messages have this Message-ID (diff)
From: Richard Genoud <richard.genoud@gmail.com>
To: Michael Walle <michael@walle.cc>,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	linux-serial@vger.kernel.org,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] serial: atmel: don't stop the transmitter when doing PIO
Date: Wed, 23 Nov 2022 13:46:17 +0100	[thread overview]
Message-ID: <ffb1f40b-bbe8-5431-63cf-a53fc0606971@gmail.com> (raw)
In-Reply-To: <df233ce37626fdb194b583808326d966@walle.cc>

Le 23/11/2022 à 09:50, Michael Walle a écrit :
> Am 2022-11-23 09:27, schrieb Jiri Slaby (SUSE):
>> Writing ATMEL_US_TXDIS to ATMEL_US_CR makes the transmitter NOT to send
>> the just queued character. This means when the character is last and
>> uart calls ops->stop_tx(), the character is not sent at all.
>>
>> The usart datasheet is not much specific on this, it just says the
>> transmitter is stopped. But apparently, the character is dropped. So
>> we should stop the transmitter only for DMA and PDC transfers to not
>> send any more characters. For PIO, this is unexpected and deviates from
>> other drivers. In particular, the below referenced commit broke TX as it
>> added a call to ->stop_tx() after the very last character written to the
>> transmitter.
>>
>> So fix this by limiting the write of ATMEL_US_TXDIS to DMA transfers
>> only.
>>
>> Even there, I don't know if it is correctly implemented. Are all the
>> queued characters sent once ->start_tx() is called? Anyone tested flow
>> control -- be it hard (RTSCTS) or the soft (XOFF/XON) one?
>>
>> Fixes: 2d141e683e9a ("tty: serial: use uart_port_tx() helper")
>> Cc: Richard Genoud <richard.genoud@gmail.com>
>> Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
>> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
>> Cc: Claudiu Beznea <claudiu.beznea@microchip.com>
>> Cc: linux-arm-kernel@lists.infradead.org
>> Reported-by: Michael Walle <michael@walle.cc>
>> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
> 
> Already merged, but:
> Tested-by: Michael Walle <michael@walle.cc>
Acked-by: Richard Genoud <richard.genoud@gmail.com>

> 
> Thanks,
> -michael
Thanks !

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-11-23 12:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23  8:27 [PATCH 1/2] serial: atmel: cleanup atmel_start+stop_tx() Jiri Slaby (SUSE)
2022-11-23  8:27 ` Jiri Slaby (SUSE)
2022-11-23  8:27 ` [PATCH 2/2] serial: atmel: don't stop the transmitter when doing PIO Jiri Slaby (SUSE)
2022-11-23  8:27   ` Jiri Slaby (SUSE)
2022-11-23  8:50   ` Michael Walle
2022-11-23  8:50     ` Michael Walle
2022-11-23 12:46     ` Richard Genoud [this message]
2022-11-23 12:46       ` Richard Genoud
2022-11-23  8:50 ` [PATCH 1/2] serial: atmel: cleanup atmel_start+stop_tx() Michael Walle
2022-11-23  8:50   ` Michael Walle
2022-11-23 12:47   ` Richard Genoud
2022-11-23 12:47     ` Richard Genoud

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=ffb1f40b-bbe8-5431-63cf-a53fc0606971@gmail.com \
    --to=richard.genoud@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=nicolas.ferre@microchip.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.