Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
To: Frieder Schrempf <frieder.schrempf@kontron.de>,
	Eberhard Stoll <eberhard.stoll@gmx.de>,
	sherry.sun@nxp.com
Cc: festevam@gmail.com, gregkh@linuxfoundation.org,
	jirislaby@kernel.org, kernel@pengutronix.de,
	linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	s.hauer@pengutronix.de, shawnguo@kernel.org,
	eberhard.stoll@kontron.de
Subject: Re: [PATCH] serial: imx: also enable Transmit Complete interrupt in rs232 mode
Date: Wed, 22 Nov 2023 14:34:42 +0100	[thread overview]
Message-ID: <8c9133ba-31d0-4582-918d-1e1b5dee5eb1@prevas.dk> (raw)
In-Reply-To: <fc843c33-03e4-4603-9cc9-0b30b2c21c66@kontron.de>

On 22/11/2023 14.01, Frieder Schrempf wrote:
> On 22.11.23 09:03, Rasmus Villemoes wrote:
>> On 21/11/2023 21.49, Eberhard Stoll wrote:

>>> But IMHO there is one next issue with this situation: When the port
>>> operates with WAIT_AFTER_RTS and WAIT_AFTER_SEND then some timers
>>> for callback functions might be active. I did not discover where they
>>> are stopped for the case when the serial port is closed. Maybe stopping
>>> is not required ...
>>
>> Indeed, that's an extra complication. Adding two hrtimer_try_to_cancel()
>> in shutdown would probably not hurt, along with setting tx_state OFF.
>>
>> I wonder if at least mode switching should simply be disallowed (-EBUSY)
>> if tx_state is anything but OFF.
> 
> Is there a valid use-case for switching the mode while the device is
> transmitting? Is this something we need to support for whatever reason?
> It sounds rather an obscure thing to do.

No, I don't think there is, and that's not at all what I'm trying to do.
I was just thinking out loud that maybe we should explicitly disallow it
[further, in fact, if possible, it should be disallowed in the serial
core]. But of course that requires that ->tx_state can actually be
relied upon, which is what my patch attempts to do for the rs232 case -
though it might not be an entirely complete fix, as described by
Eberhard, since we can get to ->shutdown and thus disable the TC
interrupt before it has a chance to fire.

Rasmus


  reply	other threads:[~2023-11-22 13:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 13:22 [PATCH] serial: imx: also enable Transmit Complete interrupt in rs232 mode Rasmus Villemoes
2023-11-21  6:37 ` Sherry Sun
2023-11-21  7:26   ` Rasmus Villemoes
2023-11-21 20:49   ` Eberhard Stoll
2023-11-22  8:03     ` Rasmus Villemoes
2023-11-22  9:31       ` Eberhard Stoll
2023-11-22 13:01       ` Frieder Schrempf
2023-11-22 13:34         ` Rasmus Villemoes [this message]
2023-11-21 20:59 ` Eberhard Stoll

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=8c9133ba-31d0-4582-918d-1e1b5dee5eb1@prevas.dk \
    --to=rasmus.villemoes@prevas.dk \
    --cc=eberhard.stoll@gmx.de \
    --cc=eberhard.stoll@kontron.de \
    --cc=festevam@gmail.com \
    --cc=frieder.schrempf@kontron.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=sherry.sun@nxp.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