Linux Serial subsystem development
 help / color / mirror / Atom feed
* Re: [PATCH 0/3] MIPS: AR7: assorted fixes
From: James Hogan @ 2017-11-08 22:03 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: linux-mips, linux-serial, Ralf Baechle, Greg Kroah-Hartman,
	Yoshihiro YUNOMAE, Florian Fainelli, Nicolas Schichan
In-Reply-To: <20171029152721.6770-1-jonas.gorski@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 540 bytes --]

On Sun, Oct 29, 2017 at 04:27:18PM +0100, Jonas Gorski wrote:
> This patchset fixes a few issues found in AR7 that accumulated in the
> past few years. One was fixed for ages in OpenWrt/LEDE and never made
> it upstream, the others weren't noticed until now.
> 
> Jonas Gorski (2):
>   MIPS: AR7: defer registration of GPIO
>   MIPS: AR7: ensure the port type's FCR value is used
> 
> Oswald Buddenhagen (1):
>   MIPS: AR7: ensure that serial ports are properly set up

Thanks. Patches 1 + 2 applied for 4.14.

Cheers
James

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: [PATCH V1 1/1] serial: 8250_fintek: Fix crash with baud rate B0
From: Alan Cox @ 2017-11-08 17:34 UTC (permalink / raw)
  To: Ji-Ze Hong (Peter Hong)
  Cc: gregkh, jslaby, lukas, rel+kernel, linux-serial, linux-kernel,
	ricardo.ribalda, Ji-Ze Hong (Peter Hong)
In-Reply-To: <1510110346-28893-1-git-send-email-hpeter+linux_kernel@gmail.com>

On Wed,  8 Nov 2017 11:05:46 +0800
"Ji-Ze Hong (Peter Hong)" <hpeter@gmail.com> wrote:

> The 8250_fintek.c is support the Fintek F81866/F81216 with dynamic clock.
> But It'll generate "division by zero" exception and crash in
> fintek_8250_set_termios() with baud rate 0 on baudrate_table[i] % baud.

0 means "hang up", so this looks good providing it leaves the device in a
sane state.


Reviewed-by: Alan Cox <alan@linux.intel.com>

^ permalink raw reply

* Re: [PATCH 3/5] serial: core: Support common rs485 binding for RTS polarity
From: Lukas Wunner @ 2017-11-08 17:33 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg Kroah-Hartman, Jiri Slaby, Sascha Hauer, Mark Jackson,
	Michal Oleszczyk, linux-serial-u79uwXL29TY76Z2rM5mHXA,
	Rob Herring, Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20171108111355.pzcrvdgqqeleinss-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

On Wed, Nov 08, 2017 at 12:13:55PM +0100, Uwe Kleine-König wrote:
> On Wed, Nov 08, 2017 at 11:32:34AM +0100, Lukas Wunner wrote:
> > When a driver invokes the uart_get_rs485_mode() helper, set the RTS
> > polarity to active high by default unless the newly introduced
> > "rs485-rts-active-low" property was specified.

Thanks a lot Uwe for your review comments, those are good points,
d'accord on all of them.  I've already incorporated all suggested
changes into my local repo but will wait a few days before respinning
to see if there are further comments.

Best,

Lukas
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH] dt-bindings: serial: fsl-imx-uart: Remove 'fsl,irda-mode' property
From: Fabio Estevam @ 2017-11-08 16:03 UTC (permalink / raw)
  To: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Fabio Estevam

From: Fabio Estevam <fabio.estevam-3arQi8VN3Tc@public.gmane.org>

'fsl,irda-mode' property has been removed since commit afe9cbb1a6ad
("serial: imx: drop support for IRDA"), so remove it from the binding
document.

Signed-off-by: Fabio Estevam <fabio.estevam-3arQi8VN3Tc@public.gmane.org>
---
 Documentation/devicetree/bindings/serial/fsl-imx-uart.txt | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt b/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
index 860a955..6b789f2 100644
--- a/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
+++ b/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
@@ -6,7 +6,6 @@ Required properties:
 - interrupts : Should contain uart interrupt
 
 Optional properties:
-- fsl,irda-mode : Indicate the uart supports irda mode
 - fsl,dte-mode : Indicate the uart works in DTE mode. The uart works
                   in DCE mode by default.
 - rs485-rts-delay, rs485-rx-during-tx, linux,rs485-enabled-at-boot-time: see rs485.txt
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: [PATCH 3/5] serial: core: Support common rs485 binding for RTS polarity
From: Uwe Kleine-König @ 2017-11-08 11:13 UTC (permalink / raw)
  To: Lukas Wunner
  Cc: Greg Kroah-Hartman, Jiri Slaby, Sascha Hauer, Mark Jackson,
	Michal Oleszczyk, linux-serial-u79uwXL29TY76Z2rM5mHXA,
	Rob Herring, Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <e85e3d02a45e79e410b6606d8fdec347f03053f4.1510134353.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>

On Wed, Nov 08, 2017 at 11:32:34AM +0100, Lukas Wunner wrote:
> When a driver invokes the uart_get_rs485_mode() helper, set the RTS
> polarity to active high by default unless the newly introduced
> "rs485-rts-active-low" property was specified.
> 
> omap-serial historically defaults to active low and supports an
> "rs485-rts-active-high" property to inverse the polarity.  Retain that
> behavior for compatibility.
> 
> Cc: Mark Jackson <mpfj-2FZW7xY0fHgqdlJmJB21zg@public.gmane.org>
> Cc: Michał Oleszczyk <oleszczyk.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Cc: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Signed-off-by: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
> ---
>  drivers/tty/serial/omap-serial.c | 7 +++++--
>  drivers/tty/serial/serial_core.c | 8 ++++++++
>  2 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
> index e6aadb6d02e5..7ef36c0af825 100644
> --- a/drivers/tty/serial/omap-serial.c
> +++ b/drivers/tty/serial/omap-serial.c
> @@ -1617,10 +1617,13 @@ static int serial_omap_probe_rs485(struct uart_omap_port *up,
>  
>  	uart_get_rs485_mode(up->dev, rs485conf);
>  
> -	if (of_property_read_bool(np, "rs485-rts-active-high"))
> +	if (of_property_read_bool(np, "rs485-rts-active-high")) {
>  		rs485conf->flags |= SER_RS485_RTS_ON_SEND;
> -	else
> +		rs485conf->flags &= ~SER_RS485_RTS_AFTER_SEND;
> +	} else {
> +		rs485conf->flags &= ~SER_RS485_RTS_ON_SEND;
>  		rs485conf->flags |= SER_RS485_RTS_AFTER_SEND;
> +	}
>  
>  	/* check for tx enable gpio */
>  	up->rts_gpio = of_get_named_gpio_flags(np, "rts-gpio", 0, &flags);
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index 548bb80223c1..64e15507a9bd 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -3048,6 +3048,14 @@ void uart_get_rs485_mode(struct device *dev, struct serial_rs485 *rs485conf)
>  		rs485conf->delay_rts_after_send = 0;
>  	}
>  
> +	if (device_property_read_bool(dev, "rs485-rts-active-low")) {
> +		rs485conf->flags &= ~SER_RS485_RTS_ON_SEND;
> +		rs485conf->flags |= SER_RS485_RTS_AFTER_SEND;
> +	} else {
> +		rs485conf->flags |= SER_RS485_RTS_ON_SEND;
> +		rs485conf->flags &= ~SER_RS485_RTS_AFTER_SEND;
> +	}
> +

I wonder if it would be easier to understand when making that:

-	rs485conf->flags &= ~(SER_RS485_RX_DURING_TX | SER_RS485_ENABLED);
+	rs485conf->flags &= ~(SER_RS485_RX_DURING_TX | SER_RS485_RTS_AFTER_SEND | SER_RS485_ENABLED);
+	rs485conf->flags |= SER_RS485_RTS_ON_SEND;
...
+	if (device_property_read_bool(dev, "rs485-rts-active-low")) {
+		rs485conf->flags &= ~SER_RS485_RTS_ON_SEND;
+		rs485conf->flags |= SER_RS485_RTS_AFTER_SEND;
+	}

(together with the then needed comment updates) which would highlight
that SER_RS485_RTS_ON_SEND is the default.

imx.c has unconditional

	sport->port.rs485.flags |= SER_RS485_RTS_ON_SEND;

that needs to be dropped in this patch.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH 0/5] rs485 properties: platform agnosticism + RTS polarity
From: Lukas Wunner @ 2017-11-08 10:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Sascha Hauer, Uwe Kleine-Koenig, Mark Jackson,
	Michal Oleszczyk, linux-serial-u79uwXL29TY76Z2rM5mHXA,
	Rob Herring, Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Jan Kiszka, Richard Genoud

Rework the common helper function for retrieving rs485 properties
to be platform agnostic (patch [1/5]) and to allow specifying the
RTS polarity (patch [2/5] and [3/5]).

Amend the fsl_lpuart and imx drivers to take advantage of this
and fix a bunch of bugs while at it (patch [4/5] and [5/5]).

Note that Michal Oleszczyk posted a patch yesterday which documents
the "rs485-rts-active-high" property supported by omap-serial in a
way which suggests that *all* drivers default to active low, which
is not the case (all other drivers default to active high).
I think the present series is a better approach, but let's have a
technical discussion about that.

I posted an earlier version of patch [1/5] a while back but withdrew
it because I wanted to change uart_get_rs485_mode() to take a
struct dev and a struct serial_rs485, instead of a struct uart_port
(which seemed too fragile on second thought).  That change has been
made now.

Thanks,

Lukas


Lukas Wunner (5):
  serial: Make retrieval of rs485 properties platform-agnostic
  dt-bindings: serial: Add common rs485 binding for RTS polarity
  serial: core: Support common rs485 binding for RTS polarity
  serial: fsl_lpuart: Support common rs485 binding for RTS polarity
  serial: imx: Support common rs485 binding for RTS polarity

 .../devicetree/bindings/serial/fsl-imx-uart.txt    |  3 ++-
 .../devicetree/bindings/serial/fsl-lpuart.txt      |  3 ++-
 .../devicetree/bindings/serial/omap_serial.txt     |  1 +
 Documentation/devicetree/bindings/serial/rs485.txt |  1 +
 drivers/tty/serial/atmel_serial.c                  |  2 +-
 drivers/tty/serial/fsl_lpuart.c                    | 15 ++++----------
 drivers/tty/serial/imx.c                           | 11 ++++++++---
 drivers/tty/serial/omap-serial.c                   | 11 +++++++----
 drivers/tty/serial/serial_core.c                   | 23 +++++++++++++++-------
 include/linux/serial_core.h                        |  3 +--
 10 files changed, 43 insertions(+), 30 deletions(-)

-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH 5/5] serial: imx: Support common rs485 binding for RTS polarity
From: Lukas Wunner @ 2017-11-08 10:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Sascha Hauer, Uwe Kleine-Koenig, Mark Jackson,
	Michal Oleszczyk, linux-serial-u79uwXL29TY76Z2rM5mHXA,
	Rob Herring, Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <cover.1510134353.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>

Invoke the ->rs485_config callback on probe to adjust the initial RTS
polarity based on the UART's device properties.

This implicitly fixes a bug:  If RTS control is not available, rs485
should be disabled even if it was enabled through a device property.
Log an error when that occurs.

Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Signed-off-by: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
---
 drivers/tty/serial/imx.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 52456fb2bff9..50d4fdcd1aec 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2087,7 +2087,6 @@ static int serial_imx_probe(struct platform_device *pdev)
 	sport->port.fifosize = 32;
 	sport->port.ops = &imx_pops;
 	sport->port.rs485_config = imx_rs485_config;
-	sport->port.rs485.flags |= SER_RS485_RTS_ON_SEND;
 	sport->port.flags = UPF_BOOT_AUTOCONF;
 	setup_timer(&sport->timer, imx_timeout, (unsigned long)sport);
 
@@ -2120,6 +2119,12 @@ static int serial_imx_probe(struct platform_device *pdev)
 
 	uart_get_rs485_mode(&pdev->dev, &sport->port.rs485);
 
+	if (sport->port.rs485.flags & SER_RS485_ENABLED &&
+	    (!sport->have_rtscts || !sport->have_rtsgpio))
+		dev_err(&pdev->dev, "no RTS control, disabling rs485\n");
+
+	imx_rs485_config(&sport->port, &sport->port.rs485);
+
 	/* Disable interrupts before requesting them */
 	reg = readl_relaxed(sport->port.membase + UCR1);
 	reg &= ~(UCR1_ADEN | UCR1_TRDYEN | UCR1_IDEN | UCR1_RRDYEN |
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH 4/5] serial: fsl_lpuart: Support common rs485 binding for RTS polarity
From: Lukas Wunner @ 2017-11-08 10:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Sascha Hauer, Uwe Kleine-Koenig, Mark Jackson,
	Michal Oleszczyk, linux-serial-u79uwXL29TY76Z2rM5mHXA,
	Rob Herring, Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <cover.1510134353.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>

Invoke the ->rs485_config callback on probe to set UARTMODEM_TXRTSPOL
appropriately based on the UART's device properties.

This implicitly sets UARTMODEM_TXRTSE if rs485 was enabled in the device
properties, so drop the identical code from lpuart_probe().

It also fixes a bug:  If an unsupported rs485 property was specified
(rs485-rx-during-tx or rs485-rts-delay), the driver returns -ENOSYS
without performing any cleanup, in particular without calling
uart_remove_one_port() or clk_disable_unprepare(), thus leaking the
uart_port. But with the invocation of ->rs485_config, the unsupported
properties are now cleared in struct serial_rs485 and thus ignored.
It therefore seems sufficient to just log an error instead of bailing
out.

Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Signed-off-by: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
---
 drivers/tty/serial/fsl_lpuart.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 009eb3f18a81..fbb8c3ce470b 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -2213,21 +2213,14 @@ static int lpuart_probe(struct platform_device *pdev)
 
 	uart_get_rs485_mode(&pdev->dev, &sport->port.rs485);
 
-	if (sport->port.rs485.flags & SER_RS485_RX_DURING_TX) {
+	if (sport->port.rs485.flags & SER_RS485_RX_DURING_TX)
 		dev_err(&pdev->dev, "driver doesn't support RX during TX\n");
-		return -ENOSYS;
-	}
 
 	if (sport->port.rs485.delay_rts_before_send ||
-	    sport->port.rs485.delay_rts_after_send) {
+	    sport->port.rs485.delay_rts_after_send)
 		dev_err(&pdev->dev, "driver doesn't support RTS delays\n");
-		return -ENOSYS;
-	}
 
-	if (sport->port.rs485.flags & SER_RS485_ENABLED) {
-		sport->port.rs485.flags |= SER_RS485_RTS_ON_SEND;
-		writeb(UARTMODEM_TXRTSE, sport->port.membase + UARTMODEM);
-	}
+	lpuart_config_rs485(&sport->port, &sport->port.rs485);
 
 	sport->dma_tx_chan = dma_request_slave_channel(sport->port.dev, "tx");
 	if (!sport->dma_tx_chan)
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH 3/5] serial: core: Support common rs485 binding for RTS polarity
From: Lukas Wunner @ 2017-11-08 10:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Sascha Hauer, Uwe Kleine-Koenig, Mark Jackson,
	Michal Oleszczyk, linux-serial-u79uwXL29TY76Z2rM5mHXA,
	Rob Herring, Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <cover.1510134353.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>

When a driver invokes the uart_get_rs485_mode() helper, set the RTS
polarity to active high by default unless the newly introduced
"rs485-rts-active-low" property was specified.

omap-serial historically defaults to active low and supports an
"rs485-rts-active-high" property to inverse the polarity.  Retain that
behavior for compatibility.

Cc: Mark Jackson <mpfj-2FZW7xY0fHgqdlJmJB21zg@public.gmane.org>
Cc: Michał Oleszczyk <oleszczyk.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Signed-off-by: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
---
 drivers/tty/serial/omap-serial.c | 7 +++++--
 drivers/tty/serial/serial_core.c | 8 ++++++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index e6aadb6d02e5..7ef36c0af825 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1617,10 +1617,13 @@ static int serial_omap_probe_rs485(struct uart_omap_port *up,
 
 	uart_get_rs485_mode(up->dev, rs485conf);
 
-	if (of_property_read_bool(np, "rs485-rts-active-high"))
+	if (of_property_read_bool(np, "rs485-rts-active-high")) {
 		rs485conf->flags |= SER_RS485_RTS_ON_SEND;
-	else
+		rs485conf->flags &= ~SER_RS485_RTS_AFTER_SEND;
+	} else {
+		rs485conf->flags &= ~SER_RS485_RTS_ON_SEND;
 		rs485conf->flags |= SER_RS485_RTS_AFTER_SEND;
+	}
 
 	/* check for tx enable gpio */
 	up->rts_gpio = of_get_named_gpio_flags(np, "rts-gpio", 0, &flags);
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 548bb80223c1..64e15507a9bd 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -3048,6 +3048,14 @@ void uart_get_rs485_mode(struct device *dev, struct serial_rs485 *rs485conf)
 		rs485conf->delay_rts_after_send = 0;
 	}
 
+	if (device_property_read_bool(dev, "rs485-rts-active-low")) {
+		rs485conf->flags &= ~SER_RS485_RTS_ON_SEND;
+		rs485conf->flags |= SER_RS485_RTS_AFTER_SEND;
+	} else {
+		rs485conf->flags |= SER_RS485_RTS_ON_SEND;
+		rs485conf->flags &= ~SER_RS485_RTS_AFTER_SEND;
+	}
+
 	/*
 	 * clear full-duplex and enabled flags to get to a defined state with
 	 * the two following properties.
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH 2/5] dt-bindings: serial: Add common rs485 binding for RTS polarity
From: Lukas Wunner @ 2017-11-08 10:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Sascha Hauer, Uwe Kleine-Koenig, Mark Jackson,
	Michal Oleszczyk, linux-serial-u79uwXL29TY76Z2rM5mHXA,
	Rob Herring, Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <cover.1510134353.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>

rs485 allows for robust half-duplex serial communication.  It is often
implemented by attaching an rs485 transceiver to a UART.  The UART's
RTS line is wired to the transceiver's Transmit Enable pin and
determines whether the transceiver is sending or receiving.

Examples for such transceivers are Maxim MAX13451E and TI SN65HVD1781A:
https://datasheets.maximintegrated.com/en/ds/MAX13450E-MAX13451E.pdf
http://www.ti.com/lit/ds/symlink/sn65hvd1781a-q1.pdf

In the devicetree, the transceiver itself is not represented, only the
UART is.  A few rs485-specific dt-bindings already exist and these go
into the UART's device node.

This commit adds a binding to set the RTS polarity.  Most (if not all)
transceivers require the Transmit Enable pin be driven high for sending,
but in some cases boards may negate the pin and RTS must then be driven
low.  Consequently the polarity defaults to active high but can be
inverted with the newly added "rs485-rts-active-low" binding.

Document this binding in rs485.txt and in the two drivers fsl-imx-uart
and fsl-lpuart that are about to be amended with support for it.

Curiously, the omap_serial driver defaults to active low and already
supports an "rs485-rts-active-high" binding to invert the polarity.
This is left unchanged to retain compatibility, but the binding is
herewith documented.

Cc: Mark Jackson <mpfj-2FZW7xY0fHgqdlJmJB21zg@public.gmane.org>
Cc: Michał Oleszczyk <oleszczyk.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Signed-off-by: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
---
 Documentation/devicetree/bindings/serial/fsl-imx-uart.txt | 3 ++-
 Documentation/devicetree/bindings/serial/fsl-lpuart.txt   | 3 ++-
 Documentation/devicetree/bindings/serial/omap_serial.txt  | 1 +
 Documentation/devicetree/bindings/serial/rs485.txt        | 1 +
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt b/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
index 860a9559839a..89b92c1314cf 100644
--- a/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
+++ b/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
@@ -9,7 +9,8 @@ Optional properties:
 - fsl,irda-mode : Indicate the uart supports irda mode
 - fsl,dte-mode : Indicate the uart works in DTE mode. The uart works
                   in DCE mode by default.
-- rs485-rts-delay, rs485-rx-during-tx, linux,rs485-enabled-at-boot-time: see rs485.txt
+- rs485-rts-delay, rs485-rts-active-low, rs485-rx-during-tx,
+  linux,rs485-enabled-at-boot-time: see rs485.txt
 
 Please check Documentation/devicetree/bindings/serial/serial.txt
 for the complete list of generic properties.
diff --git a/Documentation/devicetree/bindings/serial/fsl-lpuart.txt b/Documentation/devicetree/bindings/serial/fsl-lpuart.txt
index 59567b51cf09..6bd3f2e93d61 100644
--- a/Documentation/devicetree/bindings/serial/fsl-lpuart.txt
+++ b/Documentation/devicetree/bindings/serial/fsl-lpuart.txt
@@ -16,7 +16,8 @@ Required properties:
 Optional properties:
 - dmas: A list of two dma specifiers, one for each entry in dma-names.
 - dma-names: should contain "tx" and "rx".
-- rs485-rts-delay, rs485-rx-during-tx, linux,rs485-enabled-at-boot-time: see rs485.txt
+- rs485-rts-delay, rs485-rts-active-low, rs485-rx-during-tx,
+  linux,rs485-enabled-at-boot-time: see rs485.txt
 
 Note: Optional properties for DMA support. Write them both or both not.
 
diff --git a/Documentation/devicetree/bindings/serial/omap_serial.txt b/Documentation/devicetree/bindings/serial/omap_serial.txt
index 43eac675f21f..4b0f05adb228 100644
--- a/Documentation/devicetree/bindings/serial/omap_serial.txt
+++ b/Documentation/devicetree/bindings/serial/omap_serial.txt
@@ -20,6 +20,7 @@ Optional properties:
          node and a DMA channel number.
 - dma-names : "rx" for receive channel, "tx" for transmit channel.
 - rs485-rts-delay, rs485-rx-during-tx, linux,rs485-enabled-at-boot-time: see rs485.txt
+- rs485-rts-active-high: drive RTS high when sending (default is low).
 
 Example:
 
diff --git a/Documentation/devicetree/bindings/serial/rs485.txt b/Documentation/devicetree/bindings/serial/rs485.txt
index b8415936dfdb..b7c29f74ebb2 100644
--- a/Documentation/devicetree/bindings/serial/rs485.txt
+++ b/Documentation/devicetree/bindings/serial/rs485.txt
@@ -12,6 +12,7 @@ Optional properties:
   * b is the delay between end of data sent and rts signal in milliseconds
       it corresponds to the delay after sending data and actual release of the line.
   If this property is not specified, <0 0> is assumed.
+- rs485-rts-active-low: drive RTS low when sending (default is high).
 - linux,rs485-enabled-at-boot-time: empty property telling to enable the rs485
   feature at boot time. It can be disabled later with proper ioctl.
 - rs485-rx-during-tx: empty property that enables the receiving of data even
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: [v2] Devicetree documentation: add rs485-rts-active-high property
From: Lukas Wunner @ 2017-11-08  6:11 UTC (permalink / raw)
  To: Michal Oleszczyk
  Cc: Rob Herring, Greg Kroah-Hartman, Mark Rutland,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Mark Jackson
In-Reply-To: <20171107075336.11236-1-m.oleszczyk-z3quKL4iOrmQ6ZAhV5LmOA@public.gmane.org>

On Tue, Nov 07, 2017 at 08:53:36AM +0100, Michal Oleszczyk wrote:
> From: Michal Oleszczyk <oleszczyk.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> Add description of rs485-rts-active-high property into
> /serial/rs485.txt devicetree documentation file.

Most rs485 transceivers on the market have an active-high Transmit Enable
pin, e.g. MAX13451E, SN65HVD1781A:

https://datasheets.maximintegrated.com/en/ds/MAX13450E-MAX13451E.pdf
http://www.ti.com/lit/gpn/sn65hvd1781a-q1

In fact I'm not aware of a single transceiver that uses active-low,
do you know one?

I know that omap-serial defaults to active-low and supports an
(as yet undocumented) "rs485-rts-active-high" property.  I don't
know why it defaults to active-low.  Adding Mark Jackson to cc
who introduced that feature with commit 4a0ac0f55.

All other drivers (e.g. imx.c, fsl-lpuart.c) default to active-high.
(Which in a way contradicts with your patch as it suggests *everything*
defaults to active-low.)

I have a series in preparation that I was going to post shortly
which instead introduces an rs485-rts-active-low property for
those presumably rare cases when it's needed, but retains the
current behaviour of omap-serial for compatibility:

https://github.com/l1k/linux/commit/03ef500e98e5
https://github.com/l1k/linux/commit/8430ffdb5799
https://github.com/l1k/linux/commit/c3a86d3b862b

In my opinion that's a better approach but I'd be curious to
hear other opinions.

Thanks,

Lukas

> 
> Signed-off-by: Michal Oleszczyk <oleszczyk.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> Repair 'From' to match with 'Signed-off-by' section.
> 
>  Documentation/devicetree/bindings/serial/rs485.txt | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/serial/rs485.txt b/Documentation/devicetree/bindings/serial/rs485.txt
> index b8415936dfdb..71c38ef7f6e2 100644
> --- a/Documentation/devicetree/bindings/serial/rs485.txt
> +++ b/Documentation/devicetree/bindings/serial/rs485.txt
> @@ -16,6 +16,8 @@ Optional properties:
>    feature at boot time. It can be disabled later with proper ioctl.
>  - rs485-rx-during-tx: empty property that enables the receiving of data even
>    whilst sending data.
> +- rs485-rts-active-high: empty property telling to set RTS line high when it is 
> +  active.
>  
>  RS485 example for Atmel USART:
>  	usart0: serial@fff8c000 {
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH V1 1/1] serial: 8250_fintek: Fix crash with baud rate B0
From: Ji-Ze Hong (Peter Hong) @ 2017-11-08  3:05 UTC (permalink / raw)
  To: gregkh
  Cc: jslaby, lukas, rel+kernel, linux-serial, linux-kernel,
	ricardo.ribalda, Ji-Ze Hong (Peter Hong)

The 8250_fintek.c is support the Fintek F81866/F81216 with dynamic clock.
But It'll generate "division by zero" exception and crash in
fintek_8250_set_termios() with baud rate 0 on baudrate_table[i] % baud.

It can be tested with following C code:

	...
	struct termios options;

	tcgetattr(fd, &options);
	...
	options.c_cflag = CS8 | CREAD; /* baud rate 0 */
	tcsetattr(fd, TCSANOW, &options);
	tcflush(fd, TCIOFLUSH);

Fixes: 195638b6d44f ("serial: 8250_fintek: UART dynamic clocksource on Fintek F81866")
Reported-by: Lukas Redlinger <rel+kernel@agilox.net>
Cc: Lukas Redlinger <rel+kernel@agilox.net>
Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_kernel@gmail.com>
---
 drivers/tty/serial/8250/8250_fintek.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c
index c41cbb52f1fe..3d66c2c0d7ee 100644
--- a/drivers/tty/serial/8250/8250_fintek.c
+++ b/drivers/tty/serial/8250/8250_fintek.c
@@ -312,6 +312,13 @@ void fintek_8250_set_termios(struct uart_port *port, struct ktermios *termios,
 			F81866_UART_CLK_14_769MHZ, F81866_UART_CLK_18_432MHZ,
 			F81866_UART_CLK_24MHZ };
 
+	/*
+	 * We'll use serial8250_do_set_termios() for baud = 0, otherwise It'll
+	 * crash on baudrate_table[i] % baud with "division by zero".
+	 */
+	if (!baud)
+		goto exit;
+
 	switch (pdata->pid) {
 	case CHIP_ID_F81216H:
 		reg = RS485;
@@ -324,8 +331,7 @@ void fintek_8250_set_termios(struct uart_port *port, struct ktermios *termios,
 		dev_warn(port->dev,
 			"%s: pid: %x Not support. use default set_termios.\n",
 			__func__, pdata->pid);
-		serial8250_do_set_termios(port, termios, old);
-		return;
+		goto exit;
 	}
 
 	for (i = 0; i < ARRAY_SIZE(baudrate_table); ++i) {
@@ -353,6 +359,7 @@ void fintek_8250_set_termios(struct uart_port *port, struct ktermios *termios,
 		tty_termios_encode_baud_rate(termios, baud, baud);
 	}
 
+exit:
 	serial8250_do_set_termios(port, termios, old);
 }
 
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH] tty: serial: jsm: remove redundant pointer ts
From: Guilherme G. Piccoli @ 2017-11-07 12:53 UTC (permalink / raw)
  To: Colin King
  Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, kernel-janitors,
	linux-kernel
In-Reply-To: <20171107114107.22805-1-colin.king@canonical.com>

On 11/07/2017 09:41 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Pointer ts is assigned a value that is never read, ts is therefore
> redundant and can be removed. Cleans up clang warning:
> 
> drivers/tty/serial/jsm/jsm_tty.c:285:2: warning: Value stored to 'ts'
> is never read
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Thanks Colin!

Acked-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>


> ---
>  drivers/tty/serial/jsm/jsm_tty.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
> index e69227cc3827..5ecd878669b8 100644
> --- a/drivers/tty/serial/jsm/jsm_tty.c
> +++ b/drivers/tty/serial/jsm/jsm_tty.c
> @@ -275,14 +275,12 @@ static int jsm_tty_open(struct uart_port *port)
>  static void jsm_tty_close(struct uart_port *port)
>  {
>  	struct jsm_board *bd;
> -	struct ktermios *ts;
>  	struct jsm_channel *channel =
>  		container_of(port, struct jsm_channel, uart_port);
> 
>  	jsm_dbg(CLOSE, &channel->ch_bd->pci_dev, "start\n");
> 
>  	bd = channel->ch_bd;
> -	ts = &port->state->port.tty->termios;
> 
>  	channel->ch_flags &= ~(CH_STOPI);
> 

^ permalink raw reply

* [PATCH] tty: serial: jsm: remove redundant pointer ts
From: Colin King @ 2017-11-07 11:41 UTC (permalink / raw)
  To: Guilherme G . Piccoli, Greg Kroah-Hartman, Jiri Slaby,
	linux-serial
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Pointer ts is assigned a value that is never read, ts is therefore
redundant and can be removed. Cleans up clang warning:

drivers/tty/serial/jsm/jsm_tty.c:285:2: warning: Value stored to 'ts'
is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/tty/serial/jsm/jsm_tty.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
index e69227cc3827..5ecd878669b8 100644
--- a/drivers/tty/serial/jsm/jsm_tty.c
+++ b/drivers/tty/serial/jsm/jsm_tty.c
@@ -275,14 +275,12 @@ static int jsm_tty_open(struct uart_port *port)
 static void jsm_tty_close(struct uart_port *port)
 {
 	struct jsm_board *bd;
-	struct ktermios *ts;
 	struct jsm_channel *channel =
 		container_of(port, struct jsm_channel, uart_port);
 
 	jsm_dbg(CLOSE, &channel->ch_bd->pci_dev, "start\n");
 
 	bd = channel->ch_bd;
-	ts = &port->state->port.tty->termios;
 
 	channel->ch_flags &= ~(CH_STOPI);
 
-- 
2.14.1


^ permalink raw reply related

* [RFC PATCH] earlycon: Search for uartclk provided by DT
From: Matt Redfearn @ 2017-11-07 11:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Eugeniy Paltsev, Rob Herring, linux-mips, devicetree,
	Matt Redfearn, linux-kernel, linux-serial, Jiri Slaby

During set up of the early console, the earlycon driver will attempt to
configure a baud rate if one is set in the earlycon structure.
Previously, of_setup_earlycon left this field as 0, ignoring any baud
rate selected by the DT. Commit 31cb9a8575ca ("earlycon: initialise baud
field of earlycon device structure") changed this behaviour such that
any selected baud rate is now set. The earlycon driver must deduce the
divisor from the configured uartclk, which of_setup_earlycon sets to the
constant BASE_BAUD. One of the boards supported by the MIPS generic
kernel is the Boston FPGA board. On that board clock rates provided to
the UART depend on the FPGA bitfile. Coupled with this being a generic
kernel binary which can run across several hardware platforms, a generic
BASE_BAUD cannot be known at kernel compile time. Since MIPS generic
kernels cannot set BASE_BAUD, an incorrect divisor is now calculated for
the selected baud rate. This results in garbage being printed to the
console during boot. This was a regression in v4.14 since previously
of_setup_earlycon did not specify a baud rate and the bootloaders
configured baud rate persisted though earlycon setup.

In order to fix this, introduce a mechanism such that earlycon can find
the uartclk from the device tree. This allows the bootloader to specify
the clock frequency in the DT before the kernel is started.

There are a few different ways specified in clock-bindings.txt that the
clock frequency of a UART may be provided in DT, and this mechanism
attempts to cope with them.

1. UART node contains the <clock-frequency> property. If the UART is
clocked by a fixed clock, then it's freqeuncy may be provided directly
in the UART node.

2. UART node contains <assigned-clock-rates>. If the UART is the only
consumer of a clock, then it is allowed to specify it's rate via the
<assigned-clock-rates> property on the UART.

3. UART node contains phandle to clock provider. The clock provider node
may specify a frequency through either the <clock-frequency> property or
the <assigned-clock-rates> property.

With this change in place, the board bootloader can fill the required
information in the DT to allow earlycon to correctly configure the
uartclk and hence drivers can calculate the right divisor, restoring
console output.

Fixes: 31cb9a8575ca ("earlycon: initialise baud field of earlycon device structure")
Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>

---


I haven't handled the <assigned-clock-parents> property yet, the
documentation isn't especially clear about this, but I guess that this
should be handled as a phandle to a clock node in the same way as the
<clocks> property? With parent clocks, potentially the code would have
to walk up the clock tree following phandles until it finds one with a
clock rate specified?

I'm not quite clear what it means to have assigned-clocks which are
different to the consumed clocks specified in the clocks node, as in the
example?

This is quite a large change so I would not expect it to be a 4.14 fix.

Thanks,
Matt

---
 drivers/tty/serial/earlycon.c | 112 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 111 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 98928f082d87..c2e676e9b0a8 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -17,6 +17,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/libfdt.h>
 #include <linux/serial_core.h>
 #include <linux/sizes.h>
 #include <linux/of.h>
@@ -234,6 +235,115 @@ early_param("earlycon", param_setup_earlycon);
 
 #ifdef CONFIG_OF_EARLY_FLATTREE
 
+static unsigned long clk_node __initdata;
+
+/* Scan flat DT looking for node matching a phandle */
+static int __init of_setup_earlycon_clk_scan(unsigned long node,
+					     const char *uname, int depth,
+					     void *data)
+{
+	u32 phandle = *(u32 *)data;
+
+	if (phandle == of_get_flat_dt_phandle(node)) {
+		clk_node = node;
+		/* break now */
+		return 1;
+	}
+	return 0;
+}
+
+
+/* Determine the frequency of a clock from it's DT node
+ * @node: DT node
+ * @clk_phandle: phandle of clock consumed by UART
+ * @clk_output: which clock output - 0 for clocks with a single output
+ *
+ * Properties read are:
+ * - clock-frequency - for fixed clocks
+ * - assigned-clock-rates - for initial clock speeds
+ * - assigned clocks - determines entry in the assigned-clock-rates node
+ *
+ * returns the clock frequency or 0
+ */
+static int __init of_setup_earlycon_clk_get_rate(unsigned long node,
+						 u32 clk_phandle,
+						 int clk_output)
+{
+	const __be32 *val;
+	int size, i;
+
+	val = of_get_flat_dt_prop(node, "clock-frequency", NULL);
+	if (val)
+		return be32_to_cpu(*val);
+
+	val = of_get_flat_dt_prop(node,  "assigned-clocks", &size);
+	if (!val) {
+		/* No assigned-clocks property */
+		return 0;
+	}
+
+	/* Find the assigned-clocks property matching the phandle & output */
+	for (i = 0; i < (size / sizeof(u32)); i += 2) {
+		if ((be32_to_cpu(*(val + i)) == clk_phandle) &&
+		    (be32_to_cpu(*(val + i + 1)) == clk_output)) {
+			int output = i / 2;
+
+			/*
+			 * If the assigned-clock-rates property has enough
+			 * entries, read the frequency from there.
+			 */
+			val = of_get_flat_dt_prop(node,
+						  "assigned-clock-rates",
+						  &size);
+			if (val && size >= (sizeof(u32) * (output)))
+				return be32_to_cpu(*(val + output));
+		}
+	}
+	return 0;
+}
+
+static int __init of_setup_earlycon_clk(unsigned long node)
+{
+	u32 clk_phandle = 0, clk_output = 0;
+	int size, err, uartclk = 0;
+	const __be32 *val;
+
+	/* First try the UART's clock phandle */
+	val = of_get_flat_dt_prop(node, "clocks", &size);
+	if (val) {
+		clk_phandle = be32_to_cpu(*val);
+
+		/* Clock index optionally follows phandle */
+		if (size > sizeof(u32))
+			clk_output = be32_to_cpu(*(val + 1));
+
+		/* Find the clock's node from it's phandle */
+		err = of_scan_flat_dt(of_setup_earlycon_clk_scan, &clk_phandle);
+
+		/* If we found the clock node, check for a frequency */
+		if (err)
+			uartclk = of_setup_earlycon_clk_get_rate(clk_node,
+								 clk_phandle,
+								 clk_output);
+	}
+
+	/*
+	 * If frequency couldn't be determined from the clock node, try the
+	 * UART. The phandle / output of the clock set by assigned-clocks must
+	 * match the one consumed by the UART (clk_phandle / clk_output).
+	 */
+	if (!uartclk)
+		uartclk = of_setup_earlycon_clk_get_rate(node,
+							 clk_phandle,
+							 clk_output);
+
+	/* If frequency could't be determined from DT fall back to BASE_BAUD */
+	if (!uartclk)
+		uartclk = BASE_BAUD * 16;
+
+	return uartclk;
+}
+
 int __init of_setup_earlycon(const struct earlycon_id *match,
 			     unsigned long node,
 			     const char *options)
@@ -252,7 +362,7 @@ int __init of_setup_earlycon(const struct earlycon_id *match,
 		return -ENXIO;
 	}
 	port->mapbase = addr;
-	port->uartclk = BASE_BAUD * 16;
+	port->uartclk = of_setup_earlycon_clk(node);
 	port->membase = earlycon_map(port->mapbase, SZ_4K);
 
 	val = of_get_flat_dt_prop(node, "reg-offset", NULL);
-- 
2.7.4

^ permalink raw reply related

* Re: [patch v11 4/4] Documentation: jtag: Add ABI documentation
From: Tobias Klauser @ 2017-11-07 10:36 UTC (permalink / raw)
  To: Oleksandr Shamray
  Cc: gregkh, arnd, linux-kernel, linux-arm-kernel, devicetree, openbmc,
	joel, jiri, linux-serial, mec, vadimp, system-sw-low-level,
	robh+dt, openocd-devel-owner, linux-api, davem, mchehab
In-Reply-To: <1509724449-26221-5-git-send-email-oleksandrs@mellanox.com>

On 2017-11-03 at 16:54:09 +0100, Oleksandr Shamray <oleksandrs@mellanox.com> wrote:
> Added document that describe the ABI for JTAG class drivrer
> 
> Signed-off-by: Oleksandr Shamray <oleksandrs@mellanox.com>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> ---
> v10->v11
> v9->v10
> Fixes added by Oleksandr:
> - change jtag-cdev to jtag-dev in documentation
> - update Kernel Version and Date in jtag-dev documentation;
> v8->v9
> v7->v8
> v6->v7
> Comments pointed by Pavel Machek <pavel@ucw.cz>
> - Added jtag-cdev documentation to Documentation/ABI/testing folder
> ---
>  Documentation/ABI/testing/jatg-dev |   27 +++++++++++++++++++++++++++
>  1 files changed, 27 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/ABI/testing/jatg-dev
> 
> diff --git a/Documentation/ABI/testing/jatg-dev b/Documentation/ABI/testing/jatg-dev
> new file mode 100644
> index 0000000..803dbab
> --- /dev/null
> +++ b/Documentation/ABI/testing/jatg-dev

Typo in the file name: s/jatg-dev/jtag-dev/

> @@ -0,0 +1,27 @@
> +What:		/dev/jtag[0-9]+
> +Date:		October 2017
> +KernelVersion:	4.15
> +Contact:	oleksandrs@mellanox.com
> +Description:
> +		The misc device files /dev/jtag* are the interface
> +		between JTAG master interfase and userspace.

Typo: s/interfase/interface/

> +
> +		The ioctl(2)-based ABI is defined and documented in
> +		[include/uapi]<linux/jtag.h>.
> +
> +		The following file operations are supported:
> +
> +		open(2)
> +		The argument flag currently support only one access
> +		mode O_RDWR.
> +
> +		ioctl(2)
> +		Initiate various actions.
> +		See the inline documentation in [include/uapi]<linux/jtag.h>
> +		for descriptions of all ioctls.
> +
> +		close(2)
> +		Stops and free up the I/O contexts that was associated
> +		with the file descriptor.
> +
> +Users:		TBD
> \ No newline at end of file
> -- 
> 1.7.1
> 

^ permalink raw reply

* Re: [PATCH v3 1/1] tty: serial: imx: remove imx_disable_rx_int
From: Uwe Kleine-König @ 2017-11-07  9:50 UTC (permalink / raw)
  To: Troy Kisky
  Cc: gregkh, linux-serial, nandor.han, fabio.estevam, linux-arm-kernel,
	l.stach
In-Reply-To: <20171106194610.9983-1-troy.kisky@boundarydevices.com>

On Mon, Nov 06, 2017 at 12:46:10PM -0700, Troy Kisky wrote:
> Since imx_disable_rx_int is only called by imx_startup,
> let's integrate it into that function.
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> ---
> v2: new patch
> v3: rebased on tty-next
> ---
>  drivers/tty/serial/imx.c | 36 +++++++++---------------------------
>  1 file changed, 9 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index 1b04ef5925ef..9923b57fa60d 100644
> --- a/drivers/tty/serial/imx.c
> +++ b/drivers/tty/serial/imx.c
> @@ -712,25 +712,6 @@ static irqreturn_t imx_rxint(int irq, void *dev_id)
>  	return IRQ_HANDLED;
>  }
>  
> -static void imx_disable_rx_int(struct imx_port *sport)
> -{
> -	unsigned long temp;
> -
> -	/* disable the receiver ready and aging timer interrupts */
> -	temp = readl(sport->port.membase + UCR1);
> -	temp &= ~(UCR1_RRDYEN);
> -	writel(temp, sport->port.membase + UCR1);
> -
> -	temp = readl(sport->port.membase + UCR2);
> -	temp &= ~(UCR2_ATEN);

ATEN is never set in the driver, right? That's the only one I had to
check with the imx driver open in my editor, so maybe point out that one
in the commit log?

Other than that you change looks fine.

Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply

* [PATCH v2] Devicetree documentation: add rs485-rts-active-high property
From: Michal Oleszczyk @ 2017-11-07  7:53 UTC (permalink / raw)
  To: Rob Herring
  Cc: Greg Kroah-Hartman, Mark Rutland,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Michal Oleszczyk

From: Michal Oleszczyk <oleszczyk.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Add description of rs485-rts-active-high property into
/serial/rs485.txt devicetree documentation file.

Signed-off-by: Michal Oleszczyk <oleszczyk.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

---
Repair 'From' to match with 'Signed-off-by' section.

 Documentation/devicetree/bindings/serial/rs485.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/serial/rs485.txt b/Documentation/devicetree/bindings/serial/rs485.txt
index b8415936dfdb..71c38ef7f6e2 100644
--- a/Documentation/devicetree/bindings/serial/rs485.txt
+++ b/Documentation/devicetree/bindings/serial/rs485.txt
@@ -16,6 +16,8 @@ Optional properties:
   feature at boot time. It can be disabled later with proper ioctl.
 - rs485-rx-during-tx: empty property that enables the receiving of data even
   whilst sending data.
+- rs485-rts-active-high: empty property telling to set RTS line high when it is 
+  active.
 
 RS485 example for Atmel USART:
 	usart0: serial@fff8c000 {
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH] Devicetree documentation: add rs485-rts-active-high property
From: Michal Oleszczyk @ 2017-11-07  7:36 UTC (permalink / raw)
  To: Rob Herring
  Cc: Greg Kroah-Hartman, Mark Rutland,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Michal Oleszczyk,
	Michal Oleszczyk

Add description of rs485-rts-active-high property into
/serial/rs485.txt devicetree documentation file.

Signed-off-by: Michal Oleszczyk <oleszczyk.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

---
 Documentation/devicetree/bindings/serial/rs485.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/serial/rs485.txt b/Documentation/devicetree/bindings/serial/rs485.txt
index b8415936dfdb..71c38ef7f6e2 100644
--- a/Documentation/devicetree/bindings/serial/rs485.txt
+++ b/Documentation/devicetree/bindings/serial/rs485.txt
@@ -16,6 +16,8 @@ Optional properties:
   feature at boot time. It can be disabled later with proper ioctl.
 - rs485-rx-during-tx: empty property that enables the receiving of data even
   whilst sending data.
+- rs485-rts-active-high: empty property telling to set RTS line high when it is 
+  active.
 
 RS485 example for Atmel USART:
 	usart0: serial@fff8c000 {
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH v3 1/1] tty: serial: imx: remove imx_disable_rx_int
From: Troy Kisky @ 2017-11-06 19:46 UTC (permalink / raw)
  To: gregkh, nandor.han
  Cc: Troy Kisky, linux-serial, u.kleine-koenig, fabio.estevam,
	linux-arm-kernel, l.stach

Since imx_disable_rx_int is only called by imx_startup,
let's integrate it into that function.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
---
v2: new patch
v3: rebased on tty-next
---
 drivers/tty/serial/imx.c | 36 +++++++++---------------------------
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 1b04ef5925ef..9923b57fa60d 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -712,25 +712,6 @@ static irqreturn_t imx_rxint(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static void imx_disable_rx_int(struct imx_port *sport)
-{
-	unsigned long temp;
-
-	/* disable the receiver ready and aging timer interrupts */
-	temp = readl(sport->port.membase + UCR1);
-	temp &= ~(UCR1_RRDYEN);
-	writel(temp, sport->port.membase + UCR1);
-
-	temp = readl(sport->port.membase + UCR2);
-	temp &= ~(UCR2_ATEN);
-	writel(temp, sport->port.membase + UCR2);
-
-	/* disable the rx errors interrupts */
-	temp = readl(sport->port.membase + UCR4);
-	temp &= ~UCR4_OREN;
-	writel(temp, sport->port.membase + UCR4);
-}
-
 static void clear_rx_errors(struct imx_port *sport);
 
 /*
@@ -1261,18 +1242,21 @@ static int imx_startup(struct uart_port *port)
 	if (sport->dma_is_inited && !sport->dma_is_enabled)
 		imx_enable_dma(sport);
 
-	temp = readl(sport->port.membase + UCR1);
-	temp |= UCR1_RRDYEN | UCR1_UARTEN;
+	temp = readl(sport->port.membase + UCR1) & ~UCR1_RRDYEN;
+	if (!sport->dma_is_enabled)
+		temp |= UCR1_RRDYEN;
+	temp |= UCR1_UARTEN;
 	if (sport->have_rtscts)
 			temp |= UCR1_RTSDEN;
 
 	writel(temp, sport->port.membase + UCR1);
 
-	temp = readl(sport->port.membase + UCR4);
-	temp |= UCR4_OREN;
+	temp = readl(sport->port.membase + UCR4) & ~UCR4_OREN;
+	if (!sport->dma_is_enabled)
+		temp |= UCR4_OREN;
 	writel(temp, sport->port.membase + UCR4);
 
-	temp = readl(sport->port.membase + UCR2);
+	temp = readl(sport->port.membase + UCR2) & ~UCR2_ATEN;
 	temp |= (UCR2_RXEN | UCR2_TXEN);
 	if (!sport->have_rtscts)
 		temp |= UCR2_IRTS;
@@ -1306,10 +1290,8 @@ static int imx_startup(struct uart_port *port)
 	 * In our iMX53 the average delay for the first reception dropped from
 	 * approximately 35000 microseconds to 1000 microseconds.
 	 */
-	if (sport->dma_is_enabled) {
-		imx_disable_rx_int(sport);
+	if (sport->dma_is_enabled)
 		start_rx_dma(sport);
-	}
 
 	spin_unlock_irqrestore(&sport->port.lock, flags);
 
-- 
2.11.0

^ permalink raw reply related

* [PATCH v11 2/5] serdev: Introduce devm_serdev_device_open()
From: Andrey Smirnov @ 2017-11-06 15:29 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andrey Smirnov, linux-serial, Rob Herring, cphealy, Guenter Roeck,
	Lucas Stach, Nikita Yushchenko, Lee Jones, Greg Kroah-Hartman,
	Pavel Machek, Andy Shevchenko, Johan Hovold, Sebastian Reichel
In-Reply-To: <20171106152935.16920-1-andrew.smirnov@gmail.com>

Add code implementing managed version of serdev_device_open() for
serdev device drivers that "open" the device during driver's lifecycle
only once (e.g. opened in .probe() and closed in .remove()).

Cc: linux-kernel@vger.kernel.org
Cc: linux-serial@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>
Cc: cphealy@gmail.com
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 Documentation/driver-model/devres.txt |  3 +++
 drivers/tty/serdev/core.c             | 27 +++++++++++++++++++++++++++
 include/linux/serdev.h                |  1 +
 3 files changed, 31 insertions(+)

diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
index 69f08c0f23a8..e9c6b5cfeec1 100644
--- a/Documentation/driver-model/devres.txt
+++ b/Documentation/driver-model/devres.txt
@@ -383,6 +383,9 @@ RESET
   devm_reset_control_get()
   devm_reset_controller_register()
 
+SERDEV
+  devm_serdev_device_open()
+
 SLAVE DMA ENGINE
   devm_acpi_dma_controller_register()
 
diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index f500f6a2ca88..5074b6a7d533 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -116,6 +116,33 @@ void serdev_device_close(struct serdev_device *serdev)
 }
 EXPORT_SYMBOL_GPL(serdev_device_close);
 
+static void devm_serdev_device_release(struct device *dev, void *dr)
+{
+	serdev_device_close(*(struct serdev_device **)dr);
+}
+
+int devm_serdev_device_open(struct device *dev, struct serdev_device *serdev)
+{
+	struct serdev_device **dr;
+	int ret;
+
+	dr = devres_alloc(devm_serdev_device_release, sizeof(*dr), GFP_KERNEL);
+	if (!dr)
+		return -ENOMEM;
+
+	ret = serdev_device_open(serdev);
+	if (ret) {
+		devres_free(dr);
+		return ret;
+	}
+
+	*dr = serdev;
+	devres_add(dev, dr);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(devm_serdev_device_open);
+
 void serdev_device_write_wakeup(struct serdev_device *serdev)
 {
 	complete(&serdev->write_comp);
diff --git a/include/linux/serdev.h b/include/linux/serdev.h
index e69402d4a8ae..9929063bd45d 100644
--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -193,6 +193,7 @@ static inline int serdev_controller_receive_buf(struct serdev_controller *ctrl,
 
 int serdev_device_open(struct serdev_device *);
 void serdev_device_close(struct serdev_device *);
+int devm_serdev_device_open(struct device *, struct serdev_device *);
 unsigned int serdev_device_set_baudrate(struct serdev_device *, unsigned int);
 void serdev_device_set_flow_control(struct serdev_device *, bool);
 int serdev_device_write_buf(struct serdev_device *, const unsigned char *, size_t);
-- 
2.13.6

^ permalink raw reply related

* [PATCH v11 1/5] serdev: Make .remove in struct serdev_device_driver optional
From: Andrey Smirnov @ 2017-11-06 15:29 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andrey Smirnov, linux-serial, Rob Herring, cphealy, Guenter Roeck,
	Lucas Stach, Nikita Yushchenko, Lee Jones, Greg Kroah-Hartman,
	Pavel Machek, Andy Shevchenko, Johan Hovold, Sebastian Reichel
In-Reply-To: <20171106152935.16920-1-andrew.smirnov@gmail.com>

Using devres infrastructure it is possible to write a serdev driver
that doesn't have any code that needs to be called as a part of
.remove. Add code to make .remove optional.

Cc: linux-kernel@vger.kernel.org
Cc: linux-serial@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>
Cc: cphealy@gmail.com
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/tty/serdev/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index c68fb3a8ea1c..f500f6a2ca88 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -252,8 +252,8 @@ static int serdev_drv_probe(struct device *dev)
 static int serdev_drv_remove(struct device *dev)
 {
 	const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver);
-
-	sdrv->remove(to_serdev_device(dev));
+	if (sdrv->remove)
+		sdrv->remove(to_serdev_device(dev));
 	return 0;
 }
 
-- 
2.13.6

^ permalink raw reply related

* RE: [v11,1/4] drivers: jtag: Add JTAG core driver
From: Oleksandr Shamray @ 2017-11-06 14:28 UTC (permalink / raw)
  To: Chip Bilbrey
  Cc: gregkh@linuxfoundation.org, arnd@arndb.de,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	openbmc@lists.ozlabs.org, joel@jms.id.au, jiri@resnulli.us,
	tklauser@distanz.ch, linux-serial@vger.kernel.org, mec@shout.net,
	Vadim Pasternak, system-sw-low-level, robh+dt@kernel.org,
	"openocd-devel-owner@lists.sourceforge.net" <openocd-devel-owne>
In-Reply-To: <8760aoz78q.fsf@bilbrey.org>

Hi, 
Thanks for review>

> -----Original Message-----
> From: Chip Bilbrey [mailto:chip@bilbrey.org]
> Sent: Monday, November 6, 2017 12:33 AM
> To: Oleksandr Shamray <oleksandrs@mellanox.com>
> Cc: gregkh@linuxfoundation.org; arnd@arndb.de; linux-
> kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> devicetree@vger.kernel.org; openbmc@lists.ozlabs.org; joel@jms.id.au;
> jiri@resnulli.us; tklauser@distanz.ch; linux-serial@vger.kernel.org;
> mec@shout.net; Vadim Pasternak <vadimp@mellanox.com>; system-sw-low-
> level <system-sw-low-level@mellanox.com>; robh+dt@kernel.org; openocd-
> devel-owner@lists.sourceforge.net; linux-api@vger.kernel.org;
> davem@davemloft.net; mchehab@kernel.org; Jiri Pirko <jiri@mellanox.com>
> Subject: Re: [v11,1/4] drivers: jtag: Add JTAG core driver
> 
> 
> Oleksandr Shamray writes:
> > diff --git a/include/uapi/linux/jtag.h b/include/uapi/linux/jtag.h new
> > file mode 100644 index 0000000..0b25a83
> > --- /dev/null
> > +++ b/include/uapi/linux/jtag.h
> > [...]
> > +/**
> > + * enum jtag_xfer_mode:
> > + *
> > + * @JTAG_XFER_HW_MODE: hardware mode transfer
> > + * @JTAG_XFER_SW_MODE: software mode transfer  */ enum
> jtag_xfer_mode
> > +{
> > +	JTAG_XFER_HW_MODE,
> > +	JTAG_XFER_SW_MODE,
> > +};
> 
> Is this essentially selecting between bit-bang mode or not?  Is there a generally
> applicable reason to select SW mode over HW (or vice versa)?
> This sounds like it's tied to device-specific capability which shouldn't be exposed
> in a generic user API.

It is a mode of working some JTAG master devices. F.e Aspeed JTAG core can work in fully automatic mode when all StateMachine 
transitions and pin control done by hardware and in the more simpler mode when JTAG pin control does by the user (like bit-bang). 

It HW defined feature and can be applied not in all cases. 

Seems it can be deleted from xfer option and controlled by separate like IOCTL_SET_PARAM command.
> 
> > +/**
> > + * struct jtag_xfer - jtag xfer:
> > + *
> > + * @mode: access mode
> > + * @type: transfer type
> > + * @direction: xfer direction
> > + * @length: xfer bits len
> > + * @tdio : xfer data array
> > + * @endir: xfer end state
> > + *
> > + * Structure represents interface to Aspeed JTAG device for jtag sdr
> > +xfer
> > + * execution.
> 
> Probably should remove the reference to Aspeed here.

Thanks, will remove it.

> 
> > +/* ioctl interface */
> > +#define __JTAG_IOCTL_MAGIC	0xb2
> > +
> > +#define JTAG_IOCRUNTEST	_IOW(__JTAG_IOCTL_MAGIC, 0,\
> > +			     struct jtag_run_test_idle)
> > +#define JTAG_SIOCFREQ	_IOW(__JTAG_IOCTL_MAGIC, 1, unsigned int)
> > +#define JTAG_GIOCFREQ	_IOR(__JTAG_IOCTL_MAGIC, 2, unsigned int)
> > +#define JTAG_IOCXFER	_IOWR(__JTAG_IOCTL_MAGIC, 3, struct
> jtag_xfer)
> > +#define JTAG_GIOCSTATUS _IOWR(__JTAG_IOCTL_MAGIC, 4, enum
> > +jtag_endstate)
> 
> I notice the single-open()-per-device lock was dropped by request in an earlier
> revision of your patches, but multiple processes trying to drive a single JTAG
> master could wreak serious havoc if transactions get interleaved. Would
> something like an added JTAG_LOCKCHAIN/UNLOCKCHAIN
> ioctl() for exclusive client access be reasonable to prevent this?

Yes, it dropped by recommendation of Greg KH <gregkh@linuxfoundation.org>. 
Uer app should care about it.

> 
> -Chip

Thanks for review.
Oleksandr.

^ permalink raw reply

* Re: [PATCH] tty: fix tty_ldisc_receive_buf() documentation
From: Johan Hovold @ 2017-11-06 13:57 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Johan Hovold, Greg Kroah-Hartman, Jiri Slaby, linux-kernel,
	linux-serial
In-Reply-To: <20171106133944.2vkbbpl2tokhsabq@earth>

On Mon, Nov 06, 2017 at 02:39:44PM +0100, Sebastian Reichel wrote:
> Hi,
> 
> On Fri, Nov 03, 2017 at 03:18:05PM +0100, Johan Hovold wrote:
> > The tty_ldisc_receive_buf() helper returns the number of bytes
> > processed so drop the bogus "not" from the kernel doc comment.
> > 
> > Fixes: 8d082cd300ab ("tty: Unify receive_buf() code paths")
> > Signed-off-by: Johan Hovold <johan@kernel.org>
> > ---
> 
> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>

Thanks for the review. Greg already picked this one up for next though.

Johan

^ permalink raw reply

* Re: [PATCH] tty: fix tty_ldisc_receive_buf() documentation
From: Sebastian Reichel @ 2017-11-06 13:39 UTC (permalink / raw)
  To: Johan Hovold; +Cc: Greg Kroah-Hartman, Jiri Slaby, linux-kernel, linux-serial
In-Reply-To: <20171103141805.20292-1-johan@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]

Hi,

On Fri, Nov 03, 2017 at 03:18:05PM +0100, Johan Hovold wrote:
> The tty_ldisc_receive_buf() helper returns the number of bytes
> processed so drop the bogus "not" from the kernel doc comment.
> 
> Fixes: 8d082cd300ab ("tty: Unify receive_buf() code paths")
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>

-- Sebastian

>  drivers/tty/tty_buffer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
> index f8eba1c5412f..677fa99b7747 100644
> --- a/drivers/tty/tty_buffer.c
> +++ b/drivers/tty/tty_buffer.c
> @@ -446,7 +446,7 @@ EXPORT_SYMBOL_GPL(tty_prepare_flip_string);
>   *	Callers other than flush_to_ldisc() need to exclude the kworker
>   *	from concurrent use of the line discipline, see paste_selection().
>   *
> - *	Returns the number of bytes not processed
> + *	Returns the number of bytes processed
>   */
>  int tty_ldisc_receive_buf(struct tty_ldisc *ld, const unsigned char *p,
>  			  char *f, int count)
> -- 
> 2.15.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox