All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH RESEND] tty/serial/imx: Enable TXEN bit in imx_poll_init().
  2020-12-01 23:03 [PATCH RESEND] tty/serial/imx: Enable TXEN bit in imx_poll_init() jiladahe1997
@ 2020-12-01 16:47 ` Greg KH
  2020-12-02  3:16   ` jiladahe1997
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2020-12-01 16:47 UTC (permalink / raw)
  To: jiladahe1997; +Cc: shawnguo, s.hauer, linux-imx, linux-kernel, 972931182

On Wed, Dec 02, 2020 at 07:03:08AM +0800, jiladahe1997 wrote:
> 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;

Didn't checkpatch complain about this?  Please use ' ' characters around
the '|' character.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH RESEND] tty/serial/imx: Enable TXEN bit in imx_poll_init().
@ 2020-12-01 23:03 jiladahe1997
  2020-12-01 16:47 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: jiladahe1997 @ 2020-12-01 23:03 UTC (permalink / raw)
  To: gregkh, shawnguo, s.hauer; +Cc: linux-imx, linux-kernel, 972931182, Mingrui Ren

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND] tty/serial/imx: Enable TXEN bit in imx_poll_init().
  2020-12-01 16:47 ` Greg KH
@ 2020-12-02  3:16   ` jiladahe1997
  0 siblings, 0 replies; 3+ messages in thread
From: jiladahe1997 @ 2020-12-02  3:16 UTC (permalink / raw)
  To: Greg KH; +Cc: shawnguo, s.hauer, linux-imx, linux-kernel, 972931182

On 2020/12/2 0:47, Greg KH wrote:
> On Wed, Dec 02, 2020 at 07:03:08AM +0800, jiladahe1997 wrote:
>> 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;
> Didn't checkpatch complain about this?  Please use ' ' characters around
> the '|' character.
>
> thanks,
>
> greg k-h
Yeah, checkpatch didn't complain:


root@iZ2zefbvkcoj7o7ledf4oqZ:~/workspace/linux-imx$
./scripts/checkpatch.pl 
0001-tty-serial-imx-Enable-TXEN-bit-in-imx_poll_init.patch
total: 0 errors, 0 warnings, 8 lines checked

0001-tty-serial-imx-Enable-TXEN-bit-in-imx_poll_init.patch has no
obvious style problems and is ready for submission.


Maybe some patches should be submitted to checkpatch.pl :).

Anyway, I will add  ' '  characters and send PATCH V2.


Thanks,

Mingrui Ren




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-02  3:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01 23:03 [PATCH RESEND] tty/serial/imx: Enable TXEN bit in imx_poll_init() jiladahe1997
2020-12-01 16:47 ` Greg KH
2020-12-02  3:16   ` jiladahe1997

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.