Jingchang Lu | 24 Oct 11:20 2014

[PATCH] serial: fsl-lpuart: add lpuart32 power management support

This adds 32-bit register lpuart32 power management support,
this also updates the 8-bit register lpuart resume function.

Signed-off-by: Jingchang Lu <jingchang.lu <at> freescale.com>
---
 drivers/tty/serial/fsl_lpuart.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 6dd53af..4e25772 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
 <at>  <at>  -1862,6 +1862,20  <at>  <at>  static int lpuart_suspend(struct device *dev)
 static int lpuart_resume(struct device *dev)
 {
 	struct lpuart_port *sport = dev_get_drvdata(dev);
+	unsigned long temp;
+
+	if (sport->lpuart32) {
+		lpuart32_setup_watermark(sport);
+		temp = lpuart32_read(sport->port.membase + UARTCTRL);
+		temp |= (UARTCTRL_RIE | UARTCTRL_TIE | UARTCTRL_RE |
+			 UARTCTRL_TE | UARTCTRL_ILIE);
+		lpuart32_write(temp, sport->port.membase + UARTCTRL);
+	} else {
+		lpuart_setup_watermark(sport);
+		temp = readb(sport->port.membase + UARTCR2);
+		temp |= (UARTCR2_RIE | UARTCR2_TIE | UARTCR2_RE | UARTCR2_TE);
+		writeb(temp, sport->port.membase + UARTCR2);
+	}
(Continue reading)

Kevin Cernekee | 22 Oct 00:22 2014
Picon

[PATCH V3 00/10] bcm63xx_uart and of-serial updates

V2->V3:

Change DT clock node based on review feedback (thanks Arnd!)

Rebase on Linus' master branch

Kevin Cernekee (10):
  tty: serial: bcm63xx: Allow bcm63xx_uart to be built on other
    platforms
  tty: serial: bcm63xx: Add support for unnamed clock outputs from DT
  tty: serial: bcm63xx: Update the Kconfig help text
  tty: serial: bcm63xx: Fix typo in MODULE_DESCRIPTION
  Documentation: DT: Add entries for bcm63xx UART
  tty: serial: bcm63xx: Enable DT earlycon support
  tty: serial: bcm63xx: Eliminate unnecessary request/release functions
  tty: serial: of-serial: Suppress warnings if OF earlycon is invoked
    twice
  tty: serial: of-serial: Allow OF earlycon to default to "on"
  MAINTAINERS: Add entry for rp2 (Rocketport Express/Infinity) driver

 .../devicetree/bindings/serial/bcm63xx-uart.txt    | 30 ++++++++++++
 MAINTAINERS                                        |  6 +++
 drivers/of/fdt.c                                   | 17 +++++--
 drivers/tty/serial/Kconfig                         | 30 ++++++++----
 drivers/tty/serial/bcm63xx_uart.c                  | 55 +++++++++++++---------
 include/linux/serial_bcm63xx.h                     |  2 -
 6 files changed, 104 insertions(+), 36 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/serial/bcm63xx-uart.txt

--

-- 
(Continue reading)

Jingchang Lu | 21 Oct 10:50 2014

[PATCH] serial: of-serial: fix uninitialized kmalloc variable

The info pointer points to an uninitialized kmalloced space.
If a device doesn't have clk property, then info->clk may
have unpredicated value and cause call trace. So use kzalloc
to make sure it is NULL initialized.

Signed-off-by: Jingchang Lu <jingchang.lu <at> freescale.com>
---
 drivers/tty/serial/of_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
index 8bc2563..56982da4 100644
--- a/drivers/tty/serial/of_serial.c
+++ b/drivers/tty/serial/of_serial.c
 <at>  <at>  -158,7 +158,7  <at>  <at>  static int of_platform_serial_probe(struct platform_device *ofdev)
 	if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL))
 		return -EBUSY;

-	info = kmalloc(sizeof(*info), GFP_KERNEL);
+	info = kzalloc(sizeof(*info), GFP_KERNEL);
 	if (info == NULL)
 		return -ENOMEM;

--

-- 
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
(Continue reading)

Kevin Cernekee | 20 Oct 22:53 2014
Picon

[PATCH V2 0/9] bcm63xx_uart and of-serial updates

In the course of bringing up a new platform[1] that uses this hardware,
I made a couple of improvements:

 - Allow the driver to be built for targets that do not define
   CONFIG_BCM63xx (as mine doesn't)
 - Use devm_ioremap_resource() to simplify the initialization code
 - Allow OF earlycon to be hardwired "on" in the kernel build, so it can
   eventually replace the MIPS EARLY_PRINTK scheme
 - Update documentation; fix typos/grammar

V1->V2:

 - Add acks from Florian
 - Rebase on tty-next (3.18-rc1)
 - bcm63xx_uart: add patches 3,4,6
 - Rework my earlycon change (patches 7,8) to use a config option
   instead of a function call

[1] https://github.com/cernekee/linux/commits/bcm3384

Kevin Cernekee (9):
  tty: serial: bcm63xx: Allow bcm63xx_uart to be built on other
    platforms
  tty: serial: bcm63xx: Update the Kconfig help text
  tty: serial: bcm63xx: Fix typo in MODULE_DESCRIPTION
  Documentation: DT: Add entries for bcm63xx UART
  tty: serial: bcm63xx: Enable DT earlycon support
  tty: serial: bcm63xx: Eliminate unnecessary request/release functions
  tty: serial: of-serial: Suppress warnings if OF earlycon is invoked
    twice
(Continue reading)

Kevin Cernekee | 19 Oct 19:26 2014
Picon

[PATCH 4/3] tty: serial: bcm63xx: Enable DT earlycon support

This enables early console output if there is a chosen/stdout-path
property referencing a UART node with the "brcm,bcm6345-uart" compatible
string.  The bootloader sets up the pinmux and baud/parity/etc.
Tested on bcm3384 (MIPS, DT).

Signed-off-by: Kevin Cernekee <cernekee <at> gmail.com>
---
 drivers/tty/serial/Kconfig        |  1 +
 drivers/tty/serial/bcm63xx_uart.c | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 815b652..fdd851e 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
 <at>  <at>  -1297,6 +1297,7  <at>  <at>  config SERIAL_BCM63XX_CONSOLE
 	bool "Console on BCM63xx serial port"
 	depends on SERIAL_BCM63XX=y
 	select SERIAL_CORE_CONSOLE
+	select SERIAL_EARLYCON
 	help
 	  If you have enabled the serial port on the BCM63xx CPU
 	  you can make it the console by answering Y to this option.
diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c
index 2315190..48bd509 100644
--- a/drivers/tty/serial/bcm63xx_uart.c
+++ b/drivers/tty/serial/bcm63xx_uart.c
 <at>  <at>  -782,6 +782,26  <at>  <at>  static int __init bcm63xx_console_init(void)

 console_initcall(bcm63xx_console_init);
(Continue reading)

Kevin Cernekee | 19 Oct 04:30 2014
Picon

[PATCH 1/3] tty: serial: bcm63xx: Allow bcm63xx_uart to be built on other platforms

This device was originally supported on bcm63xx only, but it shows up on
a wide variety of MIPS and ARM chipsets spanning multiple product lines.
Now that the driver has eliminated dependencies on bcm63xx-specific
header files, we can build it on any non-bcm63xx kernel.

Compile-tested on x86, both statically and as a module.  Tested for
functionality on bcm3384 (a new MIPS platform under active development).

Signed-off-by: Kevin Cernekee <cernekee <at> gmail.com>
---
 drivers/tty/serial/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 649b784..4a5c0c8 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
 <at>  <at>  -1283,7 +1283,7  <at>  <at>  config SERIAL_TIMBERDALE
 config SERIAL_BCM63XX
 	tristate "bcm63xx serial port support"
 	select SERIAL_CORE
-	depends on BCM63XX
+	depends on MIPS || ARM || COMPILE_TEST
 	help
 	  If you have a bcm63xx CPU, you can enable its onboard
 	  serial port by enabling this options.
--

-- 
2.1.1

--
(Continue reading)

Peter Hurley | 16 Oct 22:54 2014

[PATCH -next 00/10] serial core fixes

Hi Greg,

The first 3 patches are picked out from the closing series that was
split up; the first 2 patches lay the groundwork for the fixing
the locking for the ->set_termios() method.

The 2 UPF_*/ASYNC* patches are to bind the definitions together
since userspace only gets one set of definitions, but the code
operates as if the definitions are synch'd.

The remainder except the last patch are cleanups; the last patch
fixes port count mismatch in uart_open()/uart_close(), which
Geert and I discussed a while back. So one less thing on my todo
list.

Still on the todo list:
1. Some tty_port flags usage is non-atomic.
2. uart_remove_one_port will happily remove an in-use port since
   there's no reference counting.
3. fixing autoRTS for omap (so it clears RTS when tiocmset drops
   RTS)

Regards,

Peter Hurley (10):
  serial: Refactor uart_flush_buffer() from uart_close()
  serial: core: Flush ldisc after dropping port mutex in uart_close()
  serial: Fix locking for uart driver set_termios() method
  tty,serial: Unify UPF_* and ASYNC_* flag definitions
  tty: Document defunct ASYNC_* bits in uapi header
(Continue reading)

John Crispin | 16 Oct 22:43 2014

[PATCH] serial: of_serial: add "ralink,rt2880-uart" to the binding documentation

Signed-off-by: John Crispin <blogic <at> openwrt.org>
---
 Documentation/devicetree/bindings/serial/of-serial.txt |    1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/serial/of-serial.txt b/Documentation/devicetree/bindings/serial/of-serial.txt
index 7705477..67a5b3c 100644
--- a/Documentation/devicetree/bindings/serial/of-serial.txt
+++ b/Documentation/devicetree/bindings/serial/of-serial.txt
 <at>  <at>  -10,6 +10,7  <at>  <at>  Required properties:
 	- "ns16850"
 	- "nvidia,tegra20-uart"
 	- "nxp,lpc3220-uart"
+	- "ralink,rt2880-uart"
 	- "ibm,qpace-nwp-serial"
 	- "altr,16550-FIFO32"
 	- "altr,16550-FIFO64"
--

-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Peter Hurley | 16 Oct 22:24 2014

[PATCH -next 00/27] tty locking changes

Hi Greg,

This patch series has 3 major changes to how tty locking behaves:
1. the lock order of tty_lock() and tty->ldisc_sem is reversed;
   this eliminates a bunch of lock drop/reacquire which, in turn,
   eliminates tty state tracking that can no longer be observed.
   This also allows the pty driver to wait for input processing to
   complete while closing before setting TTY_OTHER_CLOSED (which
   eliminates the ugliness of checking input twice in n_tty_read() and
   n_tty_poll()).
2. the footprint of tty_mutex is reduced to only adding and removing
   ttys and is no longer held to acquire the tty_lock() in tty_open();
   this allows for multiple ttys to be opened concurrently, even if
   one open stalls waiting for its tty_lock().
3. pty pair locking is reordered to master first, then slave, rather
   than by address. This works because, while releasing the master pty,
   the slave tty count needs to be changed, whereas, when releasing the
   slave, the master pty does not need to be accessed.
   This furthur eliminates more lock drop/reacquire.

The longer-term goals, which this series builds towards, is:
1. simplifying the tty open/close behavior
2. eliminating the ASYNC_CLOSING code without breaking existing userspace
3. eliminating returning -EIO from tty_open(). Not sure if this is possible yet.

Regards,

Peter Hurley (27):
  tty: Don't hold tty_lock for ldisc release
  tty: Invert tty_lock/ldisc_sem lock order
(Continue reading)

John Crispin | 16 Oct 21:48 2014

[PATCH 1/2] serial: of: add a PORT_RT2880 definition

The Ralink RT2880 SoC and its successors have an internal 8250 core. This core
needs the same quirks applied as the AMD AU1xxx uart. In addition to these
quirks, the ports memory region is only 0x100 unlike the AU1xxx which has a
size of 0x1000.

Signed-off-by: John Crispin <blogic <at> openwrt.org>
---
 drivers/tty/serial/8250/8250_core.c |    5 ++++-
 drivers/tty/serial/of_serial.c      |   10 +++++++++-
 include/uapi/linux/serial_core.h    |    3 ++-
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 1d42dba..f487b13 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
 <at>  <at>  -2502,8 +2502,11  <at>  <at>  serial8250_pm(struct uart_port *port, unsigned int state,

 static unsigned int serial8250_port_size(struct uart_8250_port *pt)
 {
-	if (pt->port.iotype == UPIO_AU)
+	if (pt->port.iotype == UPIO_AU) {
+		if (pt->port.type == PORT_RT2880)
+			return 0x100;
 		return 0x1000;
+	}
 	if (is_omap1_8250(pt))
 		return 0x16 << pt->port.regshift;

diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
(Continue reading)

Peter Hurley | 16 Oct 21:36 2014

[PATCH -next] n_tty: Remove stale read lock comment

The stale comment refers to lock behavior which was eliminated in
commit 6d76bd2618535c581f1673047b8341fd291abc67,
n_tty: Make N_TTY ldisc receive path lockless.

Signed-off-by: Peter Hurley <peter <at> hurleysoftware.com>
---
 drivers/tty/n_tty.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 379f60c..38ac7b9 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
 <at>  <at>  -2248,8 +2248,6  <at>  <at>  static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
 				nr--;
 			}

-			/* The copy function takes the read lock and handles
-			   locking internally for this case */
 			uncopied = copy_from_read_buf(tty, &b, &nr);
 			uncopied += copy_from_read_buf(tty, &b, &nr);
 			if (uncopied) {
--

-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)


Gmane