Greg KH | 26 Oct 13:42 2011
Picon

[GIT PATCH] TTY/serial driver patches for 3.2

Here is the tty/serial driver patchset for the 3.2 tree.

Nothing major here, with a lot of good cleanup of the tty layer from
Jiri Slaby, and some driver updates and additions.

Note, you will get a merge error in the following files when merging
with your tree:
	drivers/tty/serial/8250_pci.c
	drivers/tty/serial/atmel_serial.c

The one in 8250_pci.c is trivial to fix, the atmel_serial one isn't as
easy, but I'm sure you can figure it out :)  If you want me to do the
merge for it, I'll be glad to do so, just let me know.

Please pull from:
	git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-next

All of these patches have been in the -mm and -next trees for a while.

Patches will be sent to the linux-serial mailing list, if anyone wants
to see them.

thanks,

greg k-h

------------

 Documentation/devicetree/bindings/serial/rs485.txt |   31 +
 .../devicetree/bindings/tty/serial/atmel-usart.txt |   27 +
(Continue reading)

Linus Torvalds | 26 Oct 15:18 2011

Re: [GIT PATCH] TTY/serial driver patches for 3.2

On Wed, Oct 26, 2011 at 1:42 PM, Greg KH <gregkh <at> suse.de> wrote:
>
> The one in 8250_pci.c is trivial to fix, the atmel_serial one isn't as
> easy, but I'm sure you can figure it out :)  If you want me to do the
> merge for it, I'll be glad to do so, just let me know.

So I figured it out, but please double-check, especially since it
seems to be some arm-only driver that I can't even compile-test my
resolution.

                 Linus
--
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

Greg KH | 26 Oct 15:34 2011
Picon

Re: [GIT PATCH] TTY/serial driver patches for 3.2

On Wed, Oct 26, 2011 at 03:18:21PM +0200, Linus Torvalds wrote:
> On Wed, Oct 26, 2011 at 1:42 PM, Greg KH <gregkh <at> suse.de> wrote:
> >
> > The one in 8250_pci.c is trivial to fix, the atmel_serial one isn't as
> > easy, but I'm sure you can figure it out :)  If you want me to do the
> > merge for it, I'll be glad to do so, just let me know.
> 
> So I figured it out, but please double-check, especially since it
> seems to be some arm-only driver that I can't even compile-test my
> resolution.

I think it looks correct, but yeah, as I can't build it either, it's
tough to tell.

Nicolas, can you verify that Linus's merge was done correctly?  If not,
can you send a patch?  It is commit
efb8d21b2c6db3497655cc6a033ae8a9883e4063 in Linus's tree right now.

thanks,

greg k-h
Domenico Andreoli | 26 Oct 16:16 2011
Picon

Re: [GIT PATCH] TTY/serial driver patches for 3.2

On Wed, Oct 26, 2011 at 03:34:38PM +0200, Greg KH wrote:
> On Wed, Oct 26, 2011 at 03:18:21PM +0200, Linus Torvalds wrote:
> > On Wed, Oct 26, 2011 at 1:42 PM, Greg KH <gregkh <at> suse.de> wrote:
> > >
> > > The one in 8250_pci.c is trivial to fix, the atmel_serial one isn't as
> > > easy, but I'm sure you can figure it out :)  If you want me to do the
> > > merge for it, I'll be glad to do so, just let me know.
> > 
> > So I figured it out, but please double-check, especially since it
> > seems to be some arm-only driver that I can't even compile-test my
> > resolution.
> 
> I think it looks correct, but yeah, as I can't build it either, it's
> tough to tell.
> 
> Nicolas, can you verify that Linus's merge was done correctly?  If not,
> can you send a patch?  It is commit
> efb8d21b2c6db3497655cc6a033ae8a9883e4063 in Linus's tree right now.

tryed to build efb8d21 with at91cap9adk_defconfig + DT + 8250 but it fails:

drivers/tty/serial/atmel_serial.c: In function 'atmel_serial_probe':
drivers/tty/serial/atmel_serial.c:1788:3: error: implicit declaration of function
'of_alias_get_id' [-Werror=implicit-function-declaration]
drivers/tty/serial/atmel_serial.c: At top level:
drivers/tty/serial/atmel_serial.c:1893:3: error: implicit declaration of function 'of_match_ptr' [-Werror=implicit-function-declaration]
drivers/tty/serial/atmel_serial.c:1893:3: error: initializer element is not constant
drivers/tty/serial/atmel_serial.c:1893:3: error: (near initialization for 'atmel_serial_driver.driver.of_match_table')
cc1: some warnings being treated as errors

(Continue reading)

Jiri Kosina | 26 Oct 23:38 2011
Picon

Re: [GIT PATCH] TTY/serial driver patches for 3.2

On Wed, 26 Oct 2011, Domenico Andreoli wrote:

> > > > The one in 8250_pci.c is trivial to fix, the atmel_serial one isn't as
> > > > easy, but I'm sure you can figure it out :)  If you want me to do the
> > > > merge for it, I'll be glad to do so, just let me know.
> > > 
> > > So I figured it out, but please double-check, especially since it
> > > seems to be some arm-only driver that I can't even compile-test my
> > > resolution.
> > 
> > I think it looks correct, but yeah, as I can't build it either, it's
> > tough to tell.
> > 
> > Nicolas, can you verify that Linus's merge was done correctly?  If not,
> > can you send a patch?  It is commit
> > efb8d21b2c6db3497655cc6a033ae8a9883e4063 in Linus's tree right now.
> 
> tryed to build efb8d21 with at91cap9adk_defconfig + DT + 8250 but it fails:
> 
> drivers/tty/serial/atmel_serial.c: In function 'atmel_serial_probe':
> drivers/tty/serial/atmel_serial.c:1788:3: error: implicit declaration of function
'of_alias_get_id' [-Werror=implicit-function-declaration]
> drivers/tty/serial/atmel_serial.c: At top level:
> drivers/tty/serial/atmel_serial.c:1893:3: error: implicit declaration of function
'of_match_ptr' [-Werror=implicit-function-declaration]
> drivers/tty/serial/atmel_serial.c:1893:3: error: initializer element is not constant
> drivers/tty/serial/atmel_serial.c:1893:3: error: (near initialization for 'atmel_serial_driver.driver.of_match_table')
> cc1: some warnings being treated as errors
> 
> there is not mention of such (new) of_match_ptr macro anywhere in Linus' tree.
(Continue reading)

Nicolas Ferre | 26 Oct 17:01 2011

Re: [GIT PATCH] TTY/serial driver patches for 3.2

On 10/26/2011 03:34 PM, Greg KH :
> On Wed, Oct 26, 2011 at 03:18:21PM +0200, Linus Torvalds wrote:
>> On Wed, Oct 26, 2011 at 1:42 PM, Greg KH <gregkh <at> suse.de> wrote:
>>>
>>> The one in 8250_pci.c is trivial to fix, the atmel_serial one isn't as
>>> easy, but I'm sure you can figure it out :)  If you want me to do the
>>> merge for it, I'll be glad to do so, just let me know.
>>
>> So I figured it out, but please double-check, especially since it
>> seems to be some arm-only driver that I can't even compile-test my
>> resolution.
> 
> I think it looks correct, but yeah, as I can't build it either, it's
> tough to tell.
> 
> Nicolas, can you verify that Linus's merge was done correctly?  If not,
> can you send a patch?  It is commit
> efb8d21b2c6db3497655cc6a033ae8a9883e4063 in Linus's tree right now.

Yes, I have verified Linus's merge and it is correct.

Stephen hit this merge conflict in linux-next yesterday and I sent the
fixup as "[PATCH] tty/serial: atmel_serial: fixup merge conflict".
Anyway, sorry for the noise it has produced...

For the functions and macros that has been highlighted by Domenico in
his attempt to compile the atmel_serial driver, they shall come with
"device tree" git tree pull.

Best regards,
(Continue reading)

Greg Kroah-Hartman | 26 Oct 14:12 2011
Picon

[PATCH 01/79] tty/powerpc: introduce the ePAPR embedded hypervisor byte channel driver

From: Timur Tabi <timur <at> freescale.com>

The ePAPR embedded hypervisor specification provides an API for "byte
channels", which are serial-like virtual devices for sending and receiving
streams of bytes.  This driver provides Linux kernel support for byte
channels via three distinct interfaces:

1) An early-console (udbg) driver.  This provides early console output
through a byte channel.  The byte channel handle must be specified in a
Kconfig option.

2) A normal console driver.  Output is sent to the byte channel designated
for stdout in the device tree.  The console driver is for handling kernel
printk calls.

3) A tty driver, which is used to handle user-space input and output.  The
byte channel used for the console is designated as the default tty.

Signed-off-by: Timur Tabi <timur <at> freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh <at> suse.de>
---
 arch/powerpc/include/asm/udbg.h |    1 +
 arch/powerpc/kernel/udbg.c      |    2 +
 drivers/tty/Kconfig             |   34 ++
 drivers/tty/Makefile            |    1 +
 drivers/tty/ehv_bytechan.c      |  888 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 926 insertions(+), 0 deletions(-)
 create mode 100644 drivers/tty/ehv_bytechan.c

diff --git a/arch/powerpc/include/asm/udbg.h b/arch/powerpc/include/asm/udbg.h
(Continue reading)

Greg Kroah-Hartman | 26 Oct 14:12 2011
Picon

[PATCH 49/79] cris: fix a build error in drivers/tty/serial/crisv10.c

From: WANG Cong <xiyou.wangcong <at> gmail.com>

This patch fixes the following build error:

drivers/tty/serial/crisv10.c:4453: error: 'if_ser0' undeclared (first use in this function): 2
errors in 2 logs
        v3.1-rc4/cris/cris-allmodconfig v3.1-rc4/cris/cris-allyesconfig
drivers/tty/serial/crisv10.c:4453: error: (Each undeclared identifier is reported only once: 2
errors in 2 logs
        v3.1-rc4/cris/cris-allmodconfig v3.1-rc4/cris/cris-allyesconfig
drivers/tty/serial/crisv10.c:4453: error: for each function it appears in.): 2 errors in 2 logs
        v3.1-rc4/cris/cris-allmodconfig v3.1-rc4/cris/cris-allyesconfig

"if_ser0" is a typo, it should be "if_serial_0".

Cc: Mikael Starvik <starvik <at> axis.com>
Cc: Jesper Nilsson <jesper.nilsson <at> axis.com>
Signed-off-by: WANG Cong <xiyou.wangcong <at> gmail.com>
Cc: stable <stable <at> kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh <at> suse.de>
---
 drivers/tty/serial/crisv10.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c
index 225123b..58be715 100644
--- a/drivers/tty/serial/crisv10.c
+++ b/drivers/tty/serial/crisv10.c
 <at>  <at>  -4450,7 +4450,7  <at>  <at>  static int __init rs_init(void)

(Continue reading)

Greg Kroah-Hartman | 26 Oct 14:12 2011
Picon

[PATCH 45/79] serial: pxa: work around for errata #20

From: Marcus Folkesson <marcus.folkesson <at> gmail.com>

Errata E20: UART: Character Timeout interrupt remains set under certain
software conditions.

Implication: The software servicing the UART can be trapped in an infinite loop.

Signed-off-by: Marcus Folkesson <marcus.folkesson <at> gmail.com>
Cc: stable <stable <at> kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh <at> suse.de>
---
 drivers/tty/serial/pxa.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
index 531931c..5c8e3bb 100644
--- a/drivers/tty/serial/pxa.c
+++ b/drivers/tty/serial/pxa.c
 <at>  <at>  -100,6 +100,16  <at>  <at>  static inline void receive_chars(struct uart_pxa_port *up, int *status)
 	int max_count = 256;

 	do {
+		/* work around Errata #20 according to
+		 * Intel(R) PXA27x Processor Family
+		 * Specification Update (May 2005)
+		 *
+		 * Step 2
+		 * Disable the Reciever Time Out Interrupt via IER[RTOEI]
+		 */
+		up->ier &= ~UART_IER_RTOIE;
(Continue reading)

Greg Kroah-Hartman | 26 Oct 14:13 2011
Picon

[PATCH 55/79] serial-core: power up uart port early before we do set_termios when resuming

From: Ning Jiang <ning.jiang <at> marvell.com>

The following patch removed uart_change_pm() in uart_resume_port():

commit 5933a161abcb8d83a2c145177f48027c3c0a8995
Author: Yin Kangkai <kangkai.yin <at> linux.intel.com>
    serial-core: reset the console speed on resume

It will break the pxa serial driver when the system resumes from suspend mode
as it will try to set baud rate divider register in set_termios but with
clock off. The register value can not be set correctly on some platform if
the clock is disabled. The pxa driver will check the value and report the
following warning:

------------[ cut here ]------------
WARNING: at drivers/tty/serial/pxa.c:545 serial_pxa_set_termios+0x1dc/0x250()
Modules linked in:
[<c0281f30>] (unwind_backtrace+0x0/0xf0) from [<c029341c>] (warn_slowpath_common+0x4c/0x64)
[<c029341c>] (warn_slowpath_common+0x4c/0x64) from [<c029344c>] (warn_slowpath_null+0x18/0x1c)
[<c029344c>] (warn_slowpath_null+0x18/0x1c) from [<c044b1e4>] (serial_pxa_set_termios+0x1dc/0x250)
[<c044b1e4>] (serial_pxa_set_termios+0x1dc/0x250) from [<c044a840>] (uart_resume_port+0x128/0x2dc)
[<c044a840>] (uart_resume_port+0x128/0x2dc) from [<c044bbe0>] (serial_pxa_resume+0x18/0x24)
[<c044bbe0>] (serial_pxa_resume+0x18/0x24) from [<c0454d34>] (platform_pm_resume+0x40/0x4c)
[<c0454d34>] (platform_pm_resume+0x40/0x4c) from [<c0457ebc>] (pm_op+0x68/0xb4)
[<c0457ebc>] (pm_op+0x68/0xb4) from [<c0458368>] (device_resume+0xb0/0xec)
[<c0458368>] (device_resume+0xb0/0xec) from [<c04584c8>] (dpm_resume+0xe0/0x194)
[<c04584c8>] (dpm_resume+0xe0/0x194) from [<c0458588>] (dpm_resume_end+0xc/0x18)
[<c0458588>] (dpm_resume_end+0xc/0x18) from [<c02c518c>] (suspend_devices_and_enter+0x16c/0x1ac)
[<c02c518c>] (suspend_devices_and_enter+0x16c/0x1ac) from [<c02c5278>] (enter_state+0xac/0xdc)
[<c02c5278>] (enter_state+0xac/0xdc) from [<c02c48ec>] (state_store+0xa0/0xbc)
(Continue reading)

Greg Kroah-Hartman | 26 Oct 14:13 2011
Picon

[PATCH 68/79] TTY: drop driver reference in tty_open fail path

From: Jiri Slaby <jslaby <at> suse.cz>

When tty_driver_lookup_tty fails in tty_open, we forget to drop a
reference to the tty driver. This was added by commit 4a2b5fddd5 (Move
tty lookup/reopen to caller).

Fix that by adding tty_driver_kref_put to the fail path.

I will refactor the code later. This is for the ease of backporting to
stable.

Introduced-in: v2.6.28-rc2
Signed-off-by: Jiri Slaby <jslaby <at> suse.cz>
Cc: stable <stable <at> vger.kernel.org>
Cc: Alan Cox <alan <at> lxorguk.ukuu.org.uk>
Acked-by: Sukadev Bhattiprolu <sukadev <at> linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh <at> suse.de>
---
 drivers/tty/tty_io.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 4ca4bcd..6913da8 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
 <at>  <at>  -1873,6 +1873,7  <at>  <at>  got_driver:
 		if (IS_ERR(tty)) {
 			tty_unlock();
 			mutex_unlock(&tty_mutex);
+			tty_driver_kref_put(driver);
(Continue reading)

Greg Kroah-Hartman | 26 Oct 14:13 2011
Picon

[PATCH 70/79] TTY: pty, release tty in all ptmx_open fail paths

From: Jiri Slaby <jslaby <at> suse.cz>

Mistakenly, commit 64ba3dc3143d (tty: never hold BTM while getting
tty_mutex) switched one fail path in ptmx_open to not free the newly
allocated tty.

Fix that by jumping to the appropriate place. And rename the labels so
that it's clear what is going on there.

Introduced-in: v2.6.36-rc2
Signed-off-by: Jiri Slaby <jslaby <at> suse.cz>
Cc: stable <stable <at> vger.kernel.org>
Cc: Arnd Bergmann <arnd <at> arndb.de>
Cc: Alan Cox <alan <at> lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh <at> suse.de>
---
 drivers/tty/pty.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 7613f95..2feea63 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
 <at>  <at>  -686,15 +686,15  <at>  <at>  static int ptmx_open(struct inode *inode, struct file *filp)

 	retval = devpts_pty_new(inode, tty->link);
 	if (retval)
-		goto out1;
+		goto err_release;

(Continue reading)

Greg Kroah-Hartman | 26 Oct 14:13 2011
Picon

[PATCH 71/79] TTY: call tty_driver_lookup_tty unconditionally

From: Jiri Slaby <jslaby <at> suse.cz>

Commit 4a2b5fddd5 (Move tty lookup/reopen to caller) made the call to
tty_driver_lookup_tty conditional in tty_open. It doesn't look like it
was an intention. Or if it was, it was not documented in the changelog
and the code now looks weird. For example there would be no need to
remember the tty driver and tty index. Further the condition depends
on a tty which we drop a reference of already.

If I'm looking correctly, this should not matter thanks to the locking
currently done there. Thus, tty_driver->ttys[idx] cannot change under
our hands. But anyway, it makes sense to change that to the old
behaviour.

Introduced-in: v2.6.28-rc2
Signed-off-by: Jiri Slaby <jslaby <at> suse.cz>
Cc: stable <stable <at> vger.kernel.org>
Cc: Sukadev Bhattiprolu <sukadev <at> us.ibm.com>
Cc: Alan Cox <alan <at> redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh <at> suse.de>
---
 drivers/tty/tty_io.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 767ecbb..0425170 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
 <at>  <at>  -1821,7 +1821,7  <at>  <at>  int tty_release(struct inode *inode, struct file *filp)

(Continue reading)

Greg Kroah-Hartman | 26 Oct 14:13 2011
Picon

[PATCH 77/79] Revert "TTY: call tty_driver_lookup_tty unconditionally"

This reverts commit 631180aca723cb92e128fdac5fd144e913ca84e5.

It caused problems when /dev/tty is a pty:
	https://lkml.org/lkml/2011/10/12/401

Cc: Jiri Slaby <jslaby <at> suse.cz>
Cc: stable <stable <at> vger.kernel.org>
Cc: Sukadev Bhattiprolu <sukadev <at> us.ibm.com>
Cc: Alan Cox <alan <at> redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh <at> suse.de>
---
 drivers/tty/tty_io.c |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 0425170..767ecbb 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
 <at>  <at>  -1821,7 +1821,7  <at>  <at>  int tty_release(struct inode *inode, struct file *filp)

 static int tty_open(struct inode *inode, struct file *filp)
 {
-	struct tty_struct *tty;
+	struct tty_struct *tty = NULL;
 	int noctty, retval;
 	struct tty_driver *driver;
 	int index;
 <at>  <at>  -1892,14 +1892,17  <at>  <at>  retry_open:
 		return -ENODEV;
 	}
(Continue reading)

Greg Kroah-Hartman | 26 Oct 14:13 2011
Picon

[PATCH 69/79] TTY: make tty_add_file non-failing

From: Jiri Slaby <jslaby <at> suse.cz>

If tty_add_file fails at the point it is now, we have to revert all
the changes we did to the tty. It means either decrease all refcounts
if this was a tty reopen or delete the tty if it was newly allocated.

There was a try to fix this in v3.0-rc2 using tty_release in 0259894c7
(TTY: fix fail path in tty_open). But instead it introduced a NULL
dereference. It's because tty_release dereferences
filp->private_data, but that one is set even in our tty_add_file. And
when tty_add_file fails, it's still NULL/garbage. Hence tty_release
cannot be called there.

To circumvent the original leak (and the current NULL deref) we split
tty_add_file into two functions, making the latter non-failing. In
that case we may do the former early in open, where handling failures
is easy. The latter stays as it is now. So there is no change in
functionality.

The original bug (leak) was introduced by f573bd176 (tty: Remove
__GFP_NOFAIL from tty_add_file()). Thanks Dan for reporting this.

Later, we may split tty_release into more functions and call only some
of them in this fail path instead. (If at all possible.)

Introduced-in: v2.6.37-rc2
Signed-off-by: Jiri Slaby <jslaby <at> suse.cz>
Reported-by: Dan Carpenter <dan.carpenter <at> oracle.com>
Cc: stable <stable <at> vger.kernel.org>
Cc: Alan Cox <alan <at> lxorguk.ukuu.org.uk>
(Continue reading)

Greg Kroah-Hartman | 26 Oct 14:12 2011
Picon

[PATCH 02/79] drivers/tty/synclink: remove double comment

From: Edwin van Vliet <edwin <at> cheatah.nl>

Redundant comment line was removed

Signed-off-by: Edwin van Vliet <edwin <at> cheatah.nl>
Reviewed-by: Jesper Juhl <jj <at> chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh <at> suse.de>
---
 drivers/tty/synclink.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c
index 272e417..e67fb20 100644
--- a/drivers/tty/synclink.c
+++ b/drivers/tty/synclink.c
 <at>  <at>  -2124,7 +2124,6  <at>  <at>  static int mgsl_write(struct tty_struct * tty,
 	if ( info->params.mode == MGSL_MODE_HDLC ||
 			info->params.mode == MGSL_MODE_RAW ) {
 		/* operating in synchronous (frame oriented) mode */
-		/* operating in synchronous (frame oriented) mode */
 		if (info->tx_active) {

 			if ( info->params.mode == MGSL_MODE_HDLC ) {
--

-- 
1.7.7

--
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