All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] serial: meson: add Magic SysRq support
@ 2017-09-06 13:52 ` Yixun Lan
  0 siblings, 0 replies; 12+ messages in thread
From: Yixun Lan @ 2017-09-06 13:52 UTC (permalink / raw)
  To: Kevin Hilman, Greg Kroah-Hartman
  Cc: linux-kernel, Ben Dooks, linux-serial, linux-amlogic,
	linux-arm-kernel, Yixun Lan

This dirver try to implement the Magic SysRq support[1] for
Amlogic Inc's meson platfo
>From the hardware perspective, the UART IP can't detect the 'BREAK' command
clearly via the status register. Instead, we rely on the combination of
'FRAME_ERR bit && ch == 0', and it works fine.

[1] Documentation/admin-guide/sysrq.rst

Signed-off-by: Yixun Lan <dlan@gentoo.org>

---
Changes since v1 at [0]:
- add changelog & a few more comments

[0] https://patchwork.kernel.org/patch/9728475/
---
 drivers/tty/serial/meson_uart.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index 42e4a4c7597f..3fea24bafd80 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -14,6 +14,10 @@
  *
  */
 
+#if defined(CONFIG_SERIAL_MESON_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+#define SUPPORT_SYSRQ
+#endif
+
 #include <linux/clk.h>
 #include <linux/console.h>
 #include <linux/delay.h>
@@ -183,12 +187,12 @@ static void meson_receive_chars(struct uart_port *port)
 {
 	struct tty_port *tport = &port->state->port;
 	char flag;
-	u32 status, ch, mode;
+	u32 ostatus, status, ch, mode;
 
 	do {
 		flag = TTY_NORMAL;
 		port->icount.rx++;
-		status = readl(port->membase + AML_UART_STATUS);
+		ostatus = status = readl(port->membase + AML_UART_STATUS);
 
 		if (status & AML_UART_ERR) {
 			if (status & AML_UART_TX_FIFO_WERR)
@@ -216,6 +220,16 @@ static void meson_receive_chars(struct uart_port *port)
 		ch = readl(port->membase + AML_UART_RFIFO);
 		ch &= 0xff;
 
+		if ((ostatus & AML_UART_FRAME_ERR) && (ch == 0)) {
+			port->icount.brk++;
+			flag = TTY_BREAK;
+			if (uart_handle_break(port))
+				continue;
+		}
+
+		if (uart_handle_sysrq_char(port, ch))
+			continue;
+
 		if ((status & port->ignore_status_mask) == 0)
 			tty_insert_flip_char(tport, ch, flag);
 
-- 
2.14.1

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

* [PATCH v2] serial: meson: add Magic SysRq support
@ 2017-09-06 13:52 ` Yixun Lan
  0 siblings, 0 replies; 12+ messages in thread
From: Yixun Lan @ 2017-09-06 13:52 UTC (permalink / raw)
  To: linux-arm-kernel

This dirver try to implement the Magic SysRq support[1] for
Amlogic Inc's meson platfo
>From the hardware perspective, the UART IP can't detect the 'BREAK' command
clearly via the status register. Instead, we rely on the combination of
'FRAME_ERR bit && ch == 0', and it works fine.

[1] Documentation/admin-guide/sysrq.rst

Signed-off-by: Yixun Lan <dlan@gentoo.org>

---
Changes since v1 at [0]:
- add changelog & a few more comments

[0] https://patchwork.kernel.org/patch/9728475/
---
 drivers/tty/serial/meson_uart.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index 42e4a4c7597f..3fea24bafd80 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -14,6 +14,10 @@
  *
  */
 
+#if defined(CONFIG_SERIAL_MESON_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+#define SUPPORT_SYSRQ
+#endif
+
 #include <linux/clk.h>
 #include <linux/console.h>
 #include <linux/delay.h>
@@ -183,12 +187,12 @@ static void meson_receive_chars(struct uart_port *port)
 {
 	struct tty_port *tport = &port->state->port;
 	char flag;
-	u32 status, ch, mode;
+	u32 ostatus, status, ch, mode;
 
 	do {
 		flag = TTY_NORMAL;
 		port->icount.rx++;
-		status = readl(port->membase + AML_UART_STATUS);
+		ostatus = status = readl(port->membase + AML_UART_STATUS);
 
 		if (status & AML_UART_ERR) {
 			if (status & AML_UART_TX_FIFO_WERR)
@@ -216,6 +220,16 @@ static void meson_receive_chars(struct uart_port *port)
 		ch = readl(port->membase + AML_UART_RFIFO);
 		ch &= 0xff;
 
+		if ((ostatus & AML_UART_FRAME_ERR) && (ch == 0)) {
+			port->icount.brk++;
+			flag = TTY_BREAK;
+			if (uart_handle_break(port))
+				continue;
+		}
+
+		if (uart_handle_sysrq_char(port, ch))
+			continue;
+
 		if ((status & port->ignore_status_mask) == 0)
 			tty_insert_flip_char(tport, ch, flag);
 
-- 
2.14.1

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

* [PATCH v2] serial: meson: add Magic SysRq support
@ 2017-09-06 13:52 ` Yixun Lan
  0 siblings, 0 replies; 12+ messages in thread
From: Yixun Lan @ 2017-09-06 13:52 UTC (permalink / raw)
  To: linus-amlogic

This dirver try to implement the Magic SysRq support[1] for
Amlogic Inc's meson platfo
>From the hardware perspective, the UART IP can't detect the 'BREAK' command
clearly via the status register. Instead, we rely on the combination of
'FRAME_ERR bit && ch == 0', and it works fine.

[1] Documentation/admin-guide/sysrq.rst

Signed-off-by: Yixun Lan <dlan@gentoo.org>

---
Changes since v1 at [0]:
- add changelog & a few more comments

[0] https://patchwork.kernel.org/patch/9728475/
---
 drivers/tty/serial/meson_uart.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index 42e4a4c7597f..3fea24bafd80 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -14,6 +14,10 @@
  *
  */
 
+#if defined(CONFIG_SERIAL_MESON_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+#define SUPPORT_SYSRQ
+#endif
+
 #include <linux/clk.h>
 #include <linux/console.h>
 #include <linux/delay.h>
@@ -183,12 +187,12 @@ static void meson_receive_chars(struct uart_port *port)
 {
 	struct tty_port *tport = &port->state->port;
 	char flag;
-	u32 status, ch, mode;
+	u32 ostatus, status, ch, mode;
 
 	do {
 		flag = TTY_NORMAL;
 		port->icount.rx++;
-		status = readl(port->membase + AML_UART_STATUS);
+		ostatus = status = readl(port->membase + AML_UART_STATUS);
 
 		if (status & AML_UART_ERR) {
 			if (status & AML_UART_TX_FIFO_WERR)
@@ -216,6 +220,16 @@ static void meson_receive_chars(struct uart_port *port)
 		ch = readl(port->membase + AML_UART_RFIFO);
 		ch &= 0xff;
 
+		if ((ostatus & AML_UART_FRAME_ERR) && (ch == 0)) {
+			port->icount.brk++;
+			flag = TTY_BREAK;
+			if (uart_handle_break(port))
+				continue;
+		}
+
+		if (uart_handle_sysrq_char(port, ch))
+			continue;
+
 		if ((status & port->ignore_status_mask) == 0)
 			tty_insert_flip_char(tport, ch, flag);
 
-- 
2.14.1

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

* Re: [PATCH v2] serial: meson: add Magic SysRq support
  2017-09-06 13:52 ` Yixun Lan
  (?)
@ 2017-10-20  8:10   ` Neil Armstrong
  -1 siblings, 0 replies; 12+ messages in thread
From: Neil Armstrong @ 2017-10-20  8:10 UTC (permalink / raw)
  To: Yixun Lan, Kevin Hilman, Greg Kroah-Hartman
  Cc: linux-kernel, Ben Dooks, linux-serial, linux-amlogic, linux-arm-kernel

Hi Yixun,

On 06/09/2017 15:52, Yixun Lan wrote:
> This dirver try to implement the Magic SysRq support[1] for
> Amlogic Inc's meson platfo

Please fix these typos.

> From the hardware perspective, the UART IP can't detect the 'BREAK' command
> clearly via the status register. Instead, we rely on the combination of
> 'FRAME_ERR bit && ch == 0', and it works fine.
> 
> [1] Documentation/admin-guide/sysrq.rst
> 
> Signed-off-by: Yixun Lan <dlan@gentoo.org>
> 
> ---
> Changes since v1 at [0]:
> - add changelog & a few more comments
> 
> [0] https://patchwork.kernel.org/patch/9728475/
> ---
>  drivers/tty/serial/meson_uart.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
> index 42e4a4c7597f..3fea24bafd80 100644
> --- a/drivers/tty/serial/meson_uart.c
> +++ b/drivers/tty/serial/meson_uart.c
> @@ -14,6 +14,10 @@
>   *
>   */
>  
> +#if defined(CONFIG_SERIAL_MESON_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
> +#define SUPPORT_SYSRQ
> +#endif
> +
>  #include <linux/clk.h>
>  #include <linux/console.h>
>  #include <linux/delay.h>
> @@ -183,12 +187,12 @@ static void meson_receive_chars(struct uart_port *port)
>  {
>  	struct tty_port *tport = &port->state->port;
>  	char flag;
> -	u32 status, ch, mode;
> +	u32 ostatus, status, ch, mode;
>  
>  	do {
>  		flag = TTY_NORMAL;
>  		port->icount.rx++;
> -		status = readl(port->membase + AML_UART_STATUS);
> +		ostatus = status = readl(port->membase + AML_UART_STATUS);
>  
>  		if (status & AML_UART_ERR) {
>  			if (status & AML_UART_TX_FIFO_WERR)
> @@ -216,6 +220,16 @@ static void meson_receive_chars(struct uart_port *port)
>  		ch = readl(port->membase + AML_UART_RFIFO);
>  		ch &= 0xff;
>  
> +		if ((ostatus & AML_UART_FRAME_ERR) && (ch == 0)) {
> +			port->icount.brk++;
> +			flag = TTY_BREAK;
> +			if (uart_handle_break(port))
> +				continue;
> +		}
> +
> +		if (uart_handle_sysrq_char(port, ch))
> +			continue;
> +
>  		if ((status & port->ignore_status_mask) == 0)
>  			tty_insert_flip_char(tport, ch, flag);
>  
> 

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

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

* [PATCH v2] serial: meson: add Magic SysRq support
@ 2017-10-20  8:10   ` Neil Armstrong
  0 siblings, 0 replies; 12+ messages in thread
From: Neil Armstrong @ 2017-10-20  8:10 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Yixun,

On 06/09/2017 15:52, Yixun Lan wrote:
> This dirver try to implement the Magic SysRq support[1] for
> Amlogic Inc's meson platfo

Please fix these typos.

> From the hardware perspective, the UART IP can't detect the 'BREAK' command
> clearly via the status register. Instead, we rely on the combination of
> 'FRAME_ERR bit && ch == 0', and it works fine.
> 
> [1] Documentation/admin-guide/sysrq.rst
> 
> Signed-off-by: Yixun Lan <dlan@gentoo.org>
> 
> ---
> Changes since v1 at [0]:
> - add changelog & a few more comments
> 
> [0] https://patchwork.kernel.org/patch/9728475/
> ---
>  drivers/tty/serial/meson_uart.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
> index 42e4a4c7597f..3fea24bafd80 100644
> --- a/drivers/tty/serial/meson_uart.c
> +++ b/drivers/tty/serial/meson_uart.c
> @@ -14,6 +14,10 @@
>   *
>   */
>  
> +#if defined(CONFIG_SERIAL_MESON_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
> +#define SUPPORT_SYSRQ
> +#endif
> +
>  #include <linux/clk.h>
>  #include <linux/console.h>
>  #include <linux/delay.h>
> @@ -183,12 +187,12 @@ static void meson_receive_chars(struct uart_port *port)
>  {
>  	struct tty_port *tport = &port->state->port;
>  	char flag;
> -	u32 status, ch, mode;
> +	u32 ostatus, status, ch, mode;
>  
>  	do {
>  		flag = TTY_NORMAL;
>  		port->icount.rx++;
> -		status = readl(port->membase + AML_UART_STATUS);
> +		ostatus = status = readl(port->membase + AML_UART_STATUS);
>  
>  		if (status & AML_UART_ERR) {
>  			if (status & AML_UART_TX_FIFO_WERR)
> @@ -216,6 +220,16 @@ static void meson_receive_chars(struct uart_port *port)
>  		ch = readl(port->membase + AML_UART_RFIFO);
>  		ch &= 0xff;
>  
> +		if ((ostatus & AML_UART_FRAME_ERR) && (ch == 0)) {
> +			port->icount.brk++;
> +			flag = TTY_BREAK;
> +			if (uart_handle_break(port))
> +				continue;
> +		}
> +
> +		if (uart_handle_sysrq_char(port, ch))
> +			continue;
> +
>  		if ((status & port->ignore_status_mask) == 0)
>  			tty_insert_flip_char(tport, ch, flag);
>  
> 

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

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

* [PATCH v2] serial: meson: add Magic SysRq support
@ 2017-10-20  8:10   ` Neil Armstrong
  0 siblings, 0 replies; 12+ messages in thread
From: Neil Armstrong @ 2017-10-20  8:10 UTC (permalink / raw)
  To: linus-amlogic

Hi Yixun,

On 06/09/2017 15:52, Yixun Lan wrote:
> This dirver try to implement the Magic SysRq support[1] for
> Amlogic Inc's meson platfo

Please fix these typos.

> From the hardware perspective, the UART IP can't detect the 'BREAK' command
> clearly via the status register. Instead, we rely on the combination of
> 'FRAME_ERR bit && ch == 0', and it works fine.
> 
> [1] Documentation/admin-guide/sysrq.rst
> 
> Signed-off-by: Yixun Lan <dlan@gentoo.org>
> 
> ---
> Changes since v1 at [0]:
> - add changelog & a few more comments
> 
> [0] https://patchwork.kernel.org/patch/9728475/
> ---
>  drivers/tty/serial/meson_uart.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
> index 42e4a4c7597f..3fea24bafd80 100644
> --- a/drivers/tty/serial/meson_uart.c
> +++ b/drivers/tty/serial/meson_uart.c
> @@ -14,6 +14,10 @@
>   *
>   */
>  
> +#if defined(CONFIG_SERIAL_MESON_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
> +#define SUPPORT_SYSRQ
> +#endif
> +
>  #include <linux/clk.h>
>  #include <linux/console.h>
>  #include <linux/delay.h>
> @@ -183,12 +187,12 @@ static void meson_receive_chars(struct uart_port *port)
>  {
>  	struct tty_port *tport = &port->state->port;
>  	char flag;
> -	u32 status, ch, mode;
> +	u32 ostatus, status, ch, mode;
>  
>  	do {
>  		flag = TTY_NORMAL;
>  		port->icount.rx++;
> -		status = readl(port->membase + AML_UART_STATUS);
> +		ostatus = status = readl(port->membase + AML_UART_STATUS);
>  
>  		if (status & AML_UART_ERR) {
>  			if (status & AML_UART_TX_FIFO_WERR)
> @@ -216,6 +220,16 @@ static void meson_receive_chars(struct uart_port *port)
>  		ch = readl(port->membase + AML_UART_RFIFO);
>  		ch &= 0xff;
>  
> +		if ((ostatus & AML_UART_FRAME_ERR) && (ch == 0)) {
> +			port->icount.brk++;
> +			flag = TTY_BREAK;
> +			if (uart_handle_break(port))
> +				continue;
> +		}
> +
> +		if (uart_handle_sysrq_char(port, ch))
> +			continue;
> +
>  		if ((status & port->ignore_status_mask) == 0)
>  			tty_insert_flip_char(tport, ch, flag);
>  
> 

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

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

* Re: [PATCH v2] serial: meson: add Magic SysRq support
  2017-10-20  8:10   ` Neil Armstrong
  (?)
@ 2017-10-20  8:32     ` Yixun Lan
  -1 siblings, 0 replies; 12+ messages in thread
From: Yixun Lan @ 2017-10-20  8:32 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Kevin Hilman, Greg Kroah-Hartman, linux-arm-kernel,
	linux-amlogic, Ben Dooks, linux-kernel, linux-serial

Hi Greg-KH

I think you've already accepted this patch (and merged into your git repo)

so, is it possible for you to amend the commit message? or do you want me
to send a PATCH v3 then?


On 10:10 Fri 20 Oct     , Neil Armstrong wrote:
> Hi Yixun,
> 
> On 06/09/2017 15:52, Yixun Lan wrote:
> > This dirver try to implement the Magic SysRq support[1] for
> > Amlogic Inc's meson platfo
> 
> Please fix these typos.
> 
oops, not sure why this line is broken..

s/platfo/platform./
and should squash next line .

> > From the hardware perspective, the UART IP can't detect the 'BREAK' command
> > clearly via the status register. Instead, we rely on the combination of
> > 'FRAME_ERR bit && ch == 0', and it works fine.
> > 
> > [1] Documentation/admin-guide/sysrq.rst
> > 
> > Signed-off-by: Yixun Lan <dlan@gentoo.org>
> > 
> > ---
> > Changes since v1 at [0]:
> > - add changelog & a few more comments
> > 
> > [0] https://patchwork.kernel.org/patch/9728475/
> > ---
> >  drivers/tty/serial/meson_uart.c | 18 ++++++++++++++++--
> >  1 file changed, 16 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
> > index 42e4a4c7597f..3fea24bafd80 100644
> > --- a/drivers/tty/serial/meson_uart.c
> > +++ b/drivers/tty/serial/meson_uart.c
> > @@ -14,6 +14,10 @@
> >   *
> >   */
> >  
> > +#if defined(CONFIG_SERIAL_MESON_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
> > +#define SUPPORT_SYSRQ
> > +#endif
> > +
> >  #include <linux/clk.h>
> >  #include <linux/console.h>
> >  #include <linux/delay.h>
> > @@ -183,12 +187,12 @@ static void meson_receive_chars(struct uart_port *port)
> >  {
> >  	struct tty_port *tport = &port->state->port;
> >  	char flag;
> > -	u32 status, ch, mode;
> > +	u32 ostatus, status, ch, mode;
> >  
> >  	do {
> >  		flag = TTY_NORMAL;
> >  		port->icount.rx++;
> > -		status = readl(port->membase + AML_UART_STATUS);
> > +		ostatus = status = readl(port->membase + AML_UART_STATUS);
> >  
> >  		if (status & AML_UART_ERR) {
> >  			if (status & AML_UART_TX_FIFO_WERR)
> > @@ -216,6 +220,16 @@ static void meson_receive_chars(struct uart_port *port)
> >  		ch = readl(port->membase + AML_UART_RFIFO);
> >  		ch &= 0xff;
> >  
> > +		if ((ostatus & AML_UART_FRAME_ERR) && (ch == 0)) {
> > +			port->icount.brk++;
> > +			flag = TTY_BREAK;
> > +			if (uart_handle_break(port))
> > +				continue;
> > +		}
> > +
> > +		if (uart_handle_sysrq_char(port, ch))
> > +			continue;
> > +
> >  		if ((status & port->ignore_status_mask) == 0)
> >  			tty_insert_flip_char(tport, ch, flag);
> >  
> > 
> 
> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
> 
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic

-- 
Yixun Lan (dlan)
Gentoo Linux Developer
GPG Key ID AABEFD55

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

* [PATCH v2] serial: meson: add Magic SysRq support
@ 2017-10-20  8:32     ` Yixun Lan
  0 siblings, 0 replies; 12+ messages in thread
From: Yixun Lan @ 2017-10-20  8:32 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Greg-KH

I think you've already accepted this patch (and merged into your git repo)

so, is it possible for you to amend the commit message? or do you want me
to send a PATCH v3 then?


On 10:10 Fri 20 Oct     , Neil Armstrong wrote:
> Hi Yixun,
> 
> On 06/09/2017 15:52, Yixun Lan wrote:
> > This dirver try to implement the Magic SysRq support[1] for
> > Amlogic Inc's meson platfo
> 
> Please fix these typos.
> 
oops, not sure why this line is broken..

s/platfo/platform./
and should squash next line .

> > From the hardware perspective, the UART IP can't detect the 'BREAK' command
> > clearly via the status register. Instead, we rely on the combination of
> > 'FRAME_ERR bit && ch == 0', and it works fine.
> > 
> > [1] Documentation/admin-guide/sysrq.rst
> > 
> > Signed-off-by: Yixun Lan <dlan@gentoo.org>
> > 
> > ---
> > Changes since v1 at [0]:
> > - add changelog & a few more comments
> > 
> > [0] https://patchwork.kernel.org/patch/9728475/
> > ---
> >  drivers/tty/serial/meson_uart.c | 18 ++++++++++++++++--
> >  1 file changed, 16 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
> > index 42e4a4c7597f..3fea24bafd80 100644
> > --- a/drivers/tty/serial/meson_uart.c
> > +++ b/drivers/tty/serial/meson_uart.c
> > @@ -14,6 +14,10 @@
> >   *
> >   */
> >  
> > +#if defined(CONFIG_SERIAL_MESON_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
> > +#define SUPPORT_SYSRQ
> > +#endif
> > +
> >  #include <linux/clk.h>
> >  #include <linux/console.h>
> >  #include <linux/delay.h>
> > @@ -183,12 +187,12 @@ static void meson_receive_chars(struct uart_port *port)
> >  {
> >  	struct tty_port *tport = &port->state->port;
> >  	char flag;
> > -	u32 status, ch, mode;
> > +	u32 ostatus, status, ch, mode;
> >  
> >  	do {
> >  		flag = TTY_NORMAL;
> >  		port->icount.rx++;
> > -		status = readl(port->membase + AML_UART_STATUS);
> > +		ostatus = status = readl(port->membase + AML_UART_STATUS);
> >  
> >  		if (status & AML_UART_ERR) {
> >  			if (status & AML_UART_TX_FIFO_WERR)
> > @@ -216,6 +220,16 @@ static void meson_receive_chars(struct uart_port *port)
> >  		ch = readl(port->membase + AML_UART_RFIFO);
> >  		ch &= 0xff;
> >  
> > +		if ((ostatus & AML_UART_FRAME_ERR) && (ch == 0)) {
> > +			port->icount.brk++;
> > +			flag = TTY_BREAK;
> > +			if (uart_handle_break(port))
> > +				continue;
> > +		}
> > +
> > +		if (uart_handle_sysrq_char(port, ch))
> > +			continue;
> > +
> >  		if ((status & port->ignore_status_mask) == 0)
> >  			tty_insert_flip_char(tport, ch, flag);
> >  
> > 
> 
> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
> 
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic

-- 
Yixun Lan (dlan)
Gentoo Linux Developer
GPG Key ID AABEFD55

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

* [PATCH v2] serial: meson: add Magic SysRq support
@ 2017-10-20  8:32     ` Yixun Lan
  0 siblings, 0 replies; 12+ messages in thread
From: Yixun Lan @ 2017-10-20  8:32 UTC (permalink / raw)
  To: linus-amlogic

Hi Greg-KH

I think you've already accepted this patch (and merged into your git repo)

so, is it possible for you to amend the commit message? or do you want me
to send a PATCH v3 then?


On 10:10 Fri 20 Oct     , Neil Armstrong wrote:
> Hi Yixun,
> 
> On 06/09/2017 15:52, Yixun Lan wrote:
> > This dirver try to implement the Magic SysRq support[1] for
> > Amlogic Inc's meson platfo
> 
> Please fix these typos.
> 
oops, not sure why this line is broken..

s/platfo/platform./
and should squash next line .

> > From the hardware perspective, the UART IP can't detect the 'BREAK' command
> > clearly via the status register. Instead, we rely on the combination of
> > 'FRAME_ERR bit && ch == 0', and it works fine.
> > 
> > [1] Documentation/admin-guide/sysrq.rst
> > 
> > Signed-off-by: Yixun Lan <dlan@gentoo.org>
> > 
> > ---
> > Changes since v1 at [0]:
> > - add changelog & a few more comments
> > 
> > [0] https://patchwork.kernel.org/patch/9728475/
> > ---
> >  drivers/tty/serial/meson_uart.c | 18 ++++++++++++++++--
> >  1 file changed, 16 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
> > index 42e4a4c7597f..3fea24bafd80 100644
> > --- a/drivers/tty/serial/meson_uart.c
> > +++ b/drivers/tty/serial/meson_uart.c
> > @@ -14,6 +14,10 @@
> >   *
> >   */
> >  
> > +#if defined(CONFIG_SERIAL_MESON_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
> > +#define SUPPORT_SYSRQ
> > +#endif
> > +
> >  #include <linux/clk.h>
> >  #include <linux/console.h>
> >  #include <linux/delay.h>
> > @@ -183,12 +187,12 @@ static void meson_receive_chars(struct uart_port *port)
> >  {
> >  	struct tty_port *tport = &port->state->port;
> >  	char flag;
> > -	u32 status, ch, mode;
> > +	u32 ostatus, status, ch, mode;
> >  
> >  	do {
> >  		flag = TTY_NORMAL;
> >  		port->icount.rx++;
> > -		status = readl(port->membase + AML_UART_STATUS);
> > +		ostatus = status = readl(port->membase + AML_UART_STATUS);
> >  
> >  		if (status & AML_UART_ERR) {
> >  			if (status & AML_UART_TX_FIFO_WERR)
> > @@ -216,6 +220,16 @@ static void meson_receive_chars(struct uart_port *port)
> >  		ch = readl(port->membase + AML_UART_RFIFO);
> >  		ch &= 0xff;
> >  
> > +		if ((ostatus & AML_UART_FRAME_ERR) && (ch == 0)) {
> > +			port->icount.brk++;
> > +			flag = TTY_BREAK;
> > +			if (uart_handle_break(port))
> > +				continue;
> > +		}
> > +
> > +		if (uart_handle_sysrq_char(port, ch))
> > +			continue;
> > +
> >  		if ((status & port->ignore_status_mask) == 0)
> >  			tty_insert_flip_char(tport, ch, flag);
> >  
> > 
> 
> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
> 
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic

-- 
Yixun Lan (dlan)
Gentoo Linux Developer
GPG Key ID AABEFD55

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

* Re: [PATCH v2] serial: meson: add Magic SysRq support
  2017-10-20  8:32     ` Yixun Lan
  (?)
@ 2017-10-20  8:48       ` Neil Armstrong
  -1 siblings, 0 replies; 12+ messages in thread
From: Neil Armstrong @ 2017-10-20  8:48 UTC (permalink / raw)
  To: Yixun Lan
  Cc: Kevin Hilman, Greg Kroah-Hartman, linux-arm-kernel,
	linux-amlogic, Ben Dooks, linux-kernel, linux-serial

I Yixun,

On 20/10/2017 10:32, Yixun Lan wrote:
> Hi Greg-KH
> 
> I think you've already accepted this patch (and merged into your git repo)
> 
> so, is it possible for you to amend the commit message? or do you want me
> to send a PATCH v3 then?

I was not aware greg applied it, no need to amen anything, ignore my tag.

Neil

> 
> On 10:10 Fri 20 Oct     , Neil Armstrong wrote:
>> Hi Yixun,
>>
>> On 06/09/2017 15:52, Yixun Lan wrote:
>>> This dirver try to implement the Magic SysRq support[1] for
>>> Amlogic Inc's meson platfo
>>
>> Please fix these typos.
>>
> oops, not sure why this line is broken..
> 
> s/platfo/platform./
> and should squash next line .
> 
>>> From the hardware perspective, the UART IP can't detect the 'BREAK' command
>>> clearly via the status register. Instead, we rely on the combination of
>>> 'FRAME_ERR bit && ch == 0', and it works fine.
>>>
>>> [1] Documentation/admin-guide/sysrq.rst
>>>
>>> Signed-off-by: Yixun Lan <dlan@gentoo.org>
>>>
>>> ---
>>> Changes since v1 at [0]:
>>> - add changelog & a few more comments
>>>
>>> [0] https://patchwork.kernel.org/patch/9728475/
>>> ---
>>>  drivers/tty/serial/meson_uart.c | 18 ++++++++++++++++--
>>>  1 file changed, 16 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
>>> index 42e4a4c7597f..3fea24bafd80 100644
>>> --- a/drivers/tty/serial/meson_uart.c
>>> +++ b/drivers/tty/serial/meson_uart.c
>>> @@ -14,6 +14,10 @@
>>>   *
>>>   */
>>>  
>>> +#if defined(CONFIG_SERIAL_MESON_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
>>> +#define SUPPORT_SYSRQ
>>> +#endif
>>> +
>>>  #include <linux/clk.h>
>>>  #include <linux/console.h>
>>>  #include <linux/delay.h>
>>> @@ -183,12 +187,12 @@ static void meson_receive_chars(struct uart_port *port)
>>>  {
>>>  	struct tty_port *tport = &port->state->port;
>>>  	char flag;
>>> -	u32 status, ch, mode;
>>> +	u32 ostatus, status, ch, mode;
>>>  
>>>  	do {
>>>  		flag = TTY_NORMAL;
>>>  		port->icount.rx++;
>>> -		status = readl(port->membase + AML_UART_STATUS);
>>> +		ostatus = status = readl(port->membase + AML_UART_STATUS);
>>>  
>>>  		if (status & AML_UART_ERR) {
>>>  			if (status & AML_UART_TX_FIFO_WERR)
>>> @@ -216,6 +220,16 @@ static void meson_receive_chars(struct uart_port *port)
>>>  		ch = readl(port->membase + AML_UART_RFIFO);
>>>  		ch &= 0xff;
>>>  
>>> +		if ((ostatus & AML_UART_FRAME_ERR) && (ch == 0)) {
>>> +			port->icount.brk++;
>>> +			flag = TTY_BREAK;
>>> +			if (uart_handle_break(port))
>>> +				continue;
>>> +		}
>>> +
>>> +		if (uart_handle_sysrq_char(port, ch))
>>> +			continue;
>>> +
>>>  		if ((status & port->ignore_status_mask) == 0)
>>>  			tty_insert_flip_char(tport, ch, flag);
>>>  
>>>
>>
>> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
>>
>> _______________________________________________
>> linux-amlogic mailing list
>> linux-amlogic@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-amlogic
> 

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

* [PATCH v2] serial: meson: add Magic SysRq support
@ 2017-10-20  8:48       ` Neil Armstrong
  0 siblings, 0 replies; 12+ messages in thread
From: Neil Armstrong @ 2017-10-20  8:48 UTC (permalink / raw)
  To: linux-arm-kernel

I Yixun,

On 20/10/2017 10:32, Yixun Lan wrote:
> Hi Greg-KH
> 
> I think you've already accepted this patch (and merged into your git repo)
> 
> so, is it possible for you to amend the commit message? or do you want me
> to send a PATCH v3 then?

I was not aware greg applied it, no need to amen anything, ignore my tag.

Neil

> 
> On 10:10 Fri 20 Oct     , Neil Armstrong wrote:
>> Hi Yixun,
>>
>> On 06/09/2017 15:52, Yixun Lan wrote:
>>> This dirver try to implement the Magic SysRq support[1] for
>>> Amlogic Inc's meson platfo
>>
>> Please fix these typos.
>>
> oops, not sure why this line is broken..
> 
> s/platfo/platform./
> and should squash next line .
> 
>>> From the hardware perspective, the UART IP can't detect the 'BREAK' command
>>> clearly via the status register. Instead, we rely on the combination of
>>> 'FRAME_ERR bit && ch == 0', and it works fine.
>>>
>>> [1] Documentation/admin-guide/sysrq.rst
>>>
>>> Signed-off-by: Yixun Lan <dlan@gentoo.org>
>>>
>>> ---
>>> Changes since v1 at [0]:
>>> - add changelog & a few more comments
>>>
>>> [0] https://patchwork.kernel.org/patch/9728475/
>>> ---
>>>  drivers/tty/serial/meson_uart.c | 18 ++++++++++++++++--
>>>  1 file changed, 16 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
>>> index 42e4a4c7597f..3fea24bafd80 100644
>>> --- a/drivers/tty/serial/meson_uart.c
>>> +++ b/drivers/tty/serial/meson_uart.c
>>> @@ -14,6 +14,10 @@
>>>   *
>>>   */
>>>  
>>> +#if defined(CONFIG_SERIAL_MESON_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
>>> +#define SUPPORT_SYSRQ
>>> +#endif
>>> +
>>>  #include <linux/clk.h>
>>>  #include <linux/console.h>
>>>  #include <linux/delay.h>
>>> @@ -183,12 +187,12 @@ static void meson_receive_chars(struct uart_port *port)
>>>  {
>>>  	struct tty_port *tport = &port->state->port;
>>>  	char flag;
>>> -	u32 status, ch, mode;
>>> +	u32 ostatus, status, ch, mode;
>>>  
>>>  	do {
>>>  		flag = TTY_NORMAL;
>>>  		port->icount.rx++;
>>> -		status = readl(port->membase + AML_UART_STATUS);
>>> +		ostatus = status = readl(port->membase + AML_UART_STATUS);
>>>  
>>>  		if (status & AML_UART_ERR) {
>>>  			if (status & AML_UART_TX_FIFO_WERR)
>>> @@ -216,6 +220,16 @@ static void meson_receive_chars(struct uart_port *port)
>>>  		ch = readl(port->membase + AML_UART_RFIFO);
>>>  		ch &= 0xff;
>>>  
>>> +		if ((ostatus & AML_UART_FRAME_ERR) && (ch == 0)) {
>>> +			port->icount.brk++;
>>> +			flag = TTY_BREAK;
>>> +			if (uart_handle_break(port))
>>> +				continue;
>>> +		}
>>> +
>>> +		if (uart_handle_sysrq_char(port, ch))
>>> +			continue;
>>> +
>>>  		if ((status & port->ignore_status_mask) == 0)
>>>  			tty_insert_flip_char(tport, ch, flag);
>>>  
>>>
>>
>> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
>>
>> _______________________________________________
>> linux-amlogic mailing list
>> linux-amlogic at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-amlogic
> 

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

* [PATCH v2] serial: meson: add Magic SysRq support
@ 2017-10-20  8:48       ` Neil Armstrong
  0 siblings, 0 replies; 12+ messages in thread
From: Neil Armstrong @ 2017-10-20  8:48 UTC (permalink / raw)
  To: linus-amlogic

I Yixun,

On 20/10/2017 10:32, Yixun Lan wrote:
> Hi Greg-KH
> 
> I think you've already accepted this patch (and merged into your git repo)
> 
> so, is it possible for you to amend the commit message? or do you want me
> to send a PATCH v3 then?

I was not aware greg applied it, no need to amen anything, ignore my tag.

Neil

> 
> On 10:10 Fri 20 Oct     , Neil Armstrong wrote:
>> Hi Yixun,
>>
>> On 06/09/2017 15:52, Yixun Lan wrote:
>>> This dirver try to implement the Magic SysRq support[1] for
>>> Amlogic Inc's meson platfo
>>
>> Please fix these typos.
>>
> oops, not sure why this line is broken..
> 
> s/platfo/platform./
> and should squash next line .
> 
>>> From the hardware perspective, the UART IP can't detect the 'BREAK' command
>>> clearly via the status register. Instead, we rely on the combination of
>>> 'FRAME_ERR bit && ch == 0', and it works fine.
>>>
>>> [1] Documentation/admin-guide/sysrq.rst
>>>
>>> Signed-off-by: Yixun Lan <dlan@gentoo.org>
>>>
>>> ---
>>> Changes since v1 at [0]:
>>> - add changelog & a few more comments
>>>
>>> [0] https://patchwork.kernel.org/patch/9728475/
>>> ---
>>>  drivers/tty/serial/meson_uart.c | 18 ++++++++++++++++--
>>>  1 file changed, 16 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
>>> index 42e4a4c7597f..3fea24bafd80 100644
>>> --- a/drivers/tty/serial/meson_uart.c
>>> +++ b/drivers/tty/serial/meson_uart.c
>>> @@ -14,6 +14,10 @@
>>>   *
>>>   */
>>>  
>>> +#if defined(CONFIG_SERIAL_MESON_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
>>> +#define SUPPORT_SYSRQ
>>> +#endif
>>> +
>>>  #include <linux/clk.h>
>>>  #include <linux/console.h>
>>>  #include <linux/delay.h>
>>> @@ -183,12 +187,12 @@ static void meson_receive_chars(struct uart_port *port)
>>>  {
>>>  	struct tty_port *tport = &port->state->port;
>>>  	char flag;
>>> -	u32 status, ch, mode;
>>> +	u32 ostatus, status, ch, mode;
>>>  
>>>  	do {
>>>  		flag = TTY_NORMAL;
>>>  		port->icount.rx++;
>>> -		status = readl(port->membase + AML_UART_STATUS);
>>> +		ostatus = status = readl(port->membase + AML_UART_STATUS);
>>>  
>>>  		if (status & AML_UART_ERR) {
>>>  			if (status & AML_UART_TX_FIFO_WERR)
>>> @@ -216,6 +220,16 @@ static void meson_receive_chars(struct uart_port *port)
>>>  		ch = readl(port->membase + AML_UART_RFIFO);
>>>  		ch &= 0xff;
>>>  
>>> +		if ((ostatus & AML_UART_FRAME_ERR) && (ch == 0)) {
>>> +			port->icount.brk++;
>>> +			flag = TTY_BREAK;
>>> +			if (uart_handle_break(port))
>>> +				continue;
>>> +		}
>>> +
>>> +		if (uart_handle_sysrq_char(port, ch))
>>> +			continue;
>>> +
>>>  		if ((status & port->ignore_status_mask) == 0)
>>>  			tty_insert_flip_char(tport, ch, flag);
>>>  
>>>
>>
>> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
>>
>> _______________________________________________
>> linux-amlogic mailing list
>> linux-amlogic at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-amlogic
> 

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

end of thread, other threads:[~2017-10-20  8:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-06 13:52 [PATCH v2] serial: meson: add Magic SysRq support Yixun Lan
2017-09-06 13:52 ` Yixun Lan
2017-09-06 13:52 ` Yixun Lan
2017-10-20  8:10 ` Neil Armstrong
2017-10-20  8:10   ` Neil Armstrong
2017-10-20  8:10   ` Neil Armstrong
2017-10-20  8:32   ` Yixun Lan
2017-10-20  8:32     ` Yixun Lan
2017-10-20  8:32     ` Yixun Lan
2017-10-20  8:48     ` Neil Armstrong
2017-10-20  8:48       ` Neil Armstrong
2017-10-20  8:48       ` Neil Armstrong

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.