Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: Stefan Eichenberger <eichest@gmail.com>,
	gregkh@linuxfoundation.org, shawnguo@kernel.org,
	s.hauer@pengutronix.de, kernel@pengutronix.de,
	festevam@gmail.com, cniedermaier@dh-electronics.com,
	stefan.eichenberger@toradex.com, l.sanfilippo@kunbus.com,
	tglx@linutronix.de, rickaran@axis.com,
	francesco.dolcini@toradex.com
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v1] serial: imx: only set receiver level if it is zero
Date: Mon, 8 Jul 2024 08:28:10 +0200	[thread overview]
Message-ID: <68b3481e-7a4d-4070-a711-709021154412@kernel.org> (raw)
In-Reply-To: <20240703112543.148304-1-eichest@gmail.com>

On 03. 07. 24, 13:25, Stefan Eichenberger wrote:
> From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> 
> With commit a81dbd0463ec ("serial: imx: set receiver level before
> starting uart") we set the receiver level to its default value. This
> caused a regression when using SDMA, where the receiver level is 9
> instead of 8 (default). This change will first check if the receiver
> level is zero and only then set it to the default. This still avoids the
> interrupt storm when the receiver level is zero.
> 
> Fixes: a81dbd0463ec ("serial: imx: set receiver level before starting uart")
> Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> ---
>   drivers/tty/serial/imx.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index f4f40c9373c2f..e22be8f45c93e 100644
> --- a/drivers/tty/serial/imx.c
> +++ b/drivers/tty/serial/imx.c
> @@ -120,6 +120,7 @@
>   #define UCR4_OREN	(1<<1)	/* Receiver overrun interrupt enable */
>   #define UCR4_DREN	(1<<0)	/* Recv data ready interrupt enable */
>   #define UFCR_RXTL_SHF	0	/* Receiver trigger level shift */
> +#define UFCR_RXTL_MASK	0x3F	/* Receiver trigger 6 bits wide */
>   #define UFCR_DCEDTE	(1<<6)	/* DCE/DTE mode select */
>   #define UFCR_RFDIV	(7<<7)	/* Reference freq divider mask */

All these should be converted to BIT() and GENMASK(). Then, 
UFCR_RXTL_MASK should be obviously GENMASK(5, 0).

UFCR_RXTL_SHF is unused (and unneeded) BTW.

>   #define UFCR_RFDIV_REG(x)	(((x) < 7 ? 6 - (x) : 6) << 7)

thanks,
-- 
js


      reply	other threads:[~2024-07-08  6:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-03 11:25 [PATCH v1] serial: imx: only set receiver level if it is zero Stefan Eichenberger
2024-07-08  6:28 ` Jiri Slaby [this message]

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=68b3481e-7a4d-4070-a711-709021154412@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=cniedermaier@dh-electronics.com \
    --cc=eichest@gmail.com \
    --cc=festevam@gmail.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=l.sanfilippo@kunbus.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=rickaran@axis.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=stefan.eichenberger@toradex.com \
    --cc=tglx@linutronix.de \
    /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