linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jiladahe1997 <jiladahe1997@gmail.com>
To: gregkh@linuxfoundation.org, shawnguo@kernel.org, s.hauer@pengutronix.de
Cc: linux-imx@nxp.com, linux-kernel@vger.kernel.org,
	972931182@qq.com, Mingrui Ren <jiladahe1997@gmail.com>
Subject: [PATCH RESEND] tty/serial/imx: Enable TXEN bit in imx_poll_init().
Date: Wed,  2 Dec 2020 07:03:08 +0800	[thread overview]
Message-ID: <20201201230307.5738-1-972931182@qq.com> (raw)

From: Mingrui Ren <jiladahe1997@gmail.com>

As described in Documentation, poll_init() is called by kgdb to initialize
hardware which supports both poll_put_char() and poll_get_char().

It's necessary to enable TXEN bit, otherwise, it will cause hardware fault
and kernel panic when calling imx_poll_put_char().

Generally, if use /dev/ttymxc0 as kgdb console as well as system
console, ttymxc0 is initialized early by system console which does enable
TXEN bit.But when use /dev/ttymxc1 as kgbd console, ttymxc1 is only
initialized by imx_poll_init() cannot enable the TXEN bit, which will
cause kernel panic.

Signed-off-by: Mingrui Ren <jiladahe1997@gmail.com>
---
Hi, thanks for your reply, and sorry for sending two identical emails.
The email service I used before seems to have some problems, 
so I switched to gmail.This is the "correct" version, please check.

 drivers/tty/serial/imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 43c6d7142fdd..7c665db3d897 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1829,7 +1829,7 @@ static int imx_uart_poll_init(struct uart_port *port)
 	ucr1 |= UCR1_UARTEN;
 	ucr1 &= ~(UCR1_TRDYEN | UCR1_RTSDEN | UCR1_RRDYEN);
 
-	ucr2 |= UCR2_RXEN;
+	ucr2 |= UCR2_RXEN|UCR2_TXEN;
 	ucr2 &= ~UCR2_ATEN;
 
 	imx_uart_writel(sport, ucr1, UCR1);
-- 
2.29.2


             reply	other threads:[~2020-12-01 15:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 23:03 jiladahe1997 [this message]
2020-12-01 16:47 ` [PATCH RESEND] tty/serial/imx: Enable TXEN bit in imx_poll_init() Greg KH
2020-12-02  3:16   ` jiladahe1997

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=20201201230307.5738-1-972931182@qq.com \
    --to=jiladahe1997@gmail.com \
    --cc=972931182@qq.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).