<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/tty/serial/serial_core.c, branch v3.2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty</title>
<updated>2011-10-26T13:11:09+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-10-26T13:11:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=efb8d21b2c6db3497655cc6a033ae8a9883e4063'/>
<id>efb8d21b2c6db3497655cc6a033ae8a9883e4063</id>
<content type='text'>
* 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (79 commits)
  TTY: serial_core: Fix crash if DCD drop during suspend
  tty/serial: atmel_serial: bootconsole removed from auto-enumerates
  Revert "TTY: call tty_driver_lookup_tty unconditionally"
  tty/serial: atmel_serial: add device tree support
  tty/serial: atmel_serial: auto-enumerate ports
  tty/serial: atmel_serial: whitespace and braces modifications
  tty/serial: atmel_serial: change platform_data variable name
  tty/serial: RS485 bindings for device tree
  TTY: call tty_driver_lookup_tty unconditionally
  TTY: pty, release tty in all ptmx_open fail paths
  TTY: make tty_add_file non-failing
  TTY: drop driver reference in tty_open fail path
  8250_pci: Fix kernel panic when pch_uart is disabled
  h8300: drivers/serial/Kconfig was moved
  parport_pc: release IO region properly if unsupported ITE887x card is found
  tty: Support compat_ioctl get/set termios_locked
  hvc_console: display printk messages on console.
  TTY: snyclinkmp: forever loop in tx_load_dma_buffer()
  tty/n_gsm: avoid fifo overflow in gsm_dlci_data_output
  tty/n_gsm: fix a bug in gsm_dlci_data_output (adaption = 2 case)
  ...

Fix up Conflicts in:
 - drivers/tty/serial/8250_pci.c
	Trivial conflict with removed duplicate device ID
 - drivers/tty/serial/atmel_serial.c
	Annoying silly conflict between "specify the port num via
	platform_data" and other changes to atmel_console_init
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (79 commits)
  TTY: serial_core: Fix crash if DCD drop during suspend
  tty/serial: atmel_serial: bootconsole removed from auto-enumerates
  Revert "TTY: call tty_driver_lookup_tty unconditionally"
  tty/serial: atmel_serial: add device tree support
  tty/serial: atmel_serial: auto-enumerate ports
  tty/serial: atmel_serial: whitespace and braces modifications
  tty/serial: atmel_serial: change platform_data variable name
  tty/serial: RS485 bindings for device tree
  TTY: call tty_driver_lookup_tty unconditionally
  TTY: pty, release tty in all ptmx_open fail paths
  TTY: make tty_add_file non-failing
  TTY: drop driver reference in tty_open fail path
  8250_pci: Fix kernel panic when pch_uart is disabled
  h8300: drivers/serial/Kconfig was moved
  parport_pc: release IO region properly if unsupported ITE887x card is found
  tty: Support compat_ioctl get/set termios_locked
  hvc_console: display printk messages on console.
  TTY: snyclinkmp: forever loop in tx_load_dma_buffer()
  tty/n_gsm: avoid fifo overflow in gsm_dlci_data_output
  tty/n_gsm: fix a bug in gsm_dlci_data_output (adaption = 2 case)
  ...

Fix up Conflicts in:
 - drivers/tty/serial/8250_pci.c
	Trivial conflict with removed duplicate device ID
 - drivers/tty/serial/atmel_serial.c
	Annoying silly conflict between "specify the port num via
	platform_data" and other changes to atmel_console_init
</pre>
</div>
</content>
</entry>
<entry>
<title>TTY: serial_core: Fix crash if DCD drop during suspend</title>
<updated>2011-10-19T20:07:19+00:00</updated>
<author>
<name>Doug Anderson</name>
<email>dianders@chromium.org</email>
</author>
<published>2011-10-19T18:52:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d208a3bf77f902283894f546b6b5383202cf7882'/>
<id>d208a3bf77f902283894f546b6b5383202cf7882</id>
<content type='text'>
This crash was showing up 100% of the time on Tegra CPUs when an
agetty was running on the serial port and the console was not running
on the serial port.  The reason the Tegra saw it so reliably is that
the Tegra CPU internally ties DTR to DCD/DSR.  That means when we
dropped DTR during suspend we would get always get an immediate DCD
drop.

The specific order of operations that were running:
* uart_suspend_port() would be called to put the uart in suspend mode
* we'd drop DTR (ops-&gt;set_mctrl(uport, 0)).
* the DTR drop would be looped back in the CPU to be a DCD drop.
* the DCD drop would look to the serial driver as a hangup
* the hangup would call uart_shutdown()
* ... suspend / resume happens ...
* uart_resume_port() would be called and run the code in the
  (port-&gt;flags &amp; ASYNC_SUSPENDED) block, which would startup the port
  (and enable tx again).
* Since the UART would be available for tx, we'd immediately get
  an interrupt, eventually calling transmit_chars()
* The transmit_chars() function would crash.  The first crash would
  be a dereference of a NULL tty member, but since the port has been
  shutdown that was just a symptom.

I have proposed a patch that would fix the Tegra CPUs here (see
https://lkml.org/lkml/2011/10/11/444 - tty/serial: Prevent drop of DCD
on suspend for Tegra UARTs).  However, even with that fix it is still
possible for systems that have an externally visible DCD line to see a
crash if the DCD drops at just the right time during suspend: thus
this patch is still useful.

Signed-off-by: Doug Anderson &lt;dianders@chromium.org&gt;
Acked-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This crash was showing up 100% of the time on Tegra CPUs when an
agetty was running on the serial port and the console was not running
on the serial port.  The reason the Tegra saw it so reliably is that
the Tegra CPU internally ties DTR to DCD/DSR.  That means when we
dropped DTR during suspend we would get always get an immediate DCD
drop.

The specific order of operations that were running:
* uart_suspend_port() would be called to put the uart in suspend mode
* we'd drop DTR (ops-&gt;set_mctrl(uport, 0)).
* the DTR drop would be looped back in the CPU to be a DCD drop.
* the DCD drop would look to the serial driver as a hangup
* the hangup would call uart_shutdown()
* ... suspend / resume happens ...
* uart_resume_port() would be called and run the code in the
  (port-&gt;flags &amp; ASYNC_SUSPENDED) block, which would startup the port
  (and enable tx again).
* Since the UART would be available for tx, we'd immediately get
  an interrupt, eventually calling transmit_chars()
* The transmit_chars() function would crash.  The first crash would
  be a dereference of a NULL tty member, but since the port has been
  shutdown that was just a symptom.

I have proposed a patch that would fix the Tegra CPUs here (see
https://lkml.org/lkml/2011/10/11/444 - tty/serial: Prevent drop of DCD
on suspend for Tegra UARTs).  However, even with that fix it is still
possible for systems that have an externally visible DCD line to see a
crash if the DCD drops at just the right time during suspend: thus
this patch is still useful.

Signed-off-by: Doug Anderson &lt;dianders@chromium.org&gt;
Acked-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial-core: power up uart port early before we do set_termios when resuming</title>
<updated>2011-09-22T23:08:56+00:00</updated>
<author>
<name>Ning Jiang</name>
<email>ning.jiang@marvell.com</email>
</author>
<published>2011-09-05T08:28:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=94abc56f4d90f289ea32a0a11d3577fcd8cb28fb'/>
<id>94abc56f4d90f289ea32a0a11d3577fcd8cb28fb</id>
<content type='text'>
The following patch removed uart_change_pm() in uart_resume_port():

commit 5933a161abcb8d83a2c145177f48027c3c0a8995
Author: Yin Kangkai &lt;kangkai.yin@linux.intel.com&gt;
    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:
[&lt;c0281f30&gt;] (unwind_backtrace+0x0/0xf0) from [&lt;c029341c&gt;] (warn_slowpath_common+0x4c/0x64)
[&lt;c029341c&gt;] (warn_slowpath_common+0x4c/0x64) from [&lt;c029344c&gt;] (warn_slowpath_null+0x18/0x1c)
[&lt;c029344c&gt;] (warn_slowpath_null+0x18/0x1c) from [&lt;c044b1e4&gt;] (serial_pxa_set_termios+0x1dc/0x250)
[&lt;c044b1e4&gt;] (serial_pxa_set_termios+0x1dc/0x250) from [&lt;c044a840&gt;] (uart_resume_port+0x128/0x2dc)
[&lt;c044a840&gt;] (uart_resume_port+0x128/0x2dc) from [&lt;c044bbe0&gt;] (serial_pxa_resume+0x18/0x24)
[&lt;c044bbe0&gt;] (serial_pxa_resume+0x18/0x24) from [&lt;c0454d34&gt;] (platform_pm_resume+0x40/0x4c)
[&lt;c0454d34&gt;] (platform_pm_resume+0x40/0x4c) from [&lt;c0457ebc&gt;] (pm_op+0x68/0xb4)
[&lt;c0457ebc&gt;] (pm_op+0x68/0xb4) from [&lt;c0458368&gt;] (device_resume+0xb0/0xec)
[&lt;c0458368&gt;] (device_resume+0xb0/0xec) from [&lt;c04584c8&gt;] (dpm_resume+0xe0/0x194)
[&lt;c04584c8&gt;] (dpm_resume+0xe0/0x194) from [&lt;c0458588&gt;] (dpm_resume_end+0xc/0x18)
[&lt;c0458588&gt;] (dpm_resume_end+0xc/0x18) from [&lt;c02c518c&gt;] (suspend_devices_and_enter+0x16c/0x1ac)
[&lt;c02c518c&gt;] (suspend_devices_and_enter+0x16c/0x1ac) from [&lt;c02c5278&gt;] (enter_state+0xac/0xdc)
[&lt;c02c5278&gt;] (enter_state+0xac/0xdc) from [&lt;c02c48ec&gt;] (state_store+0xa0/0xbc)
[&lt;c02c48ec&gt;] (state_store+0xa0/0xbc) from [&lt;c0408f7c&gt;] (kobj_attr_store+0x18/0x1c)
[&lt;c0408f7c&gt;] (kobj_attr_store+0x18/0x1c) from [&lt;c034a6a4&gt;] (sysfs_write_file+0x108/0x140)
[&lt;c034a6a4&gt;] (sysfs_write_file+0x108/0x140) from [&lt;c02fb798&gt;] (vfs_write+0xac/0x134)
[&lt;c02fb798&gt;] (vfs_write+0xac/0x134) from [&lt;c02fb8cc&gt;] (sys_write+0x3c/0x68)
[&lt;c02fb8cc&gt;] (sys_write+0x3c/0x68) from [&lt;c027c700&gt;] (ret_fast_syscall+0x0/0x2c)
---[ end trace 88289eceb4675b04 ]---

This patch fix the problem by adding the power on opertion back for uart
console when console_suspend_enabled is true.

Signed-off-by: Ning Jiang &lt;ning.jiang@marvell.com&gt;
Tested-by: Mayank Rana &lt;mrana@codeaurora.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following patch removed uart_change_pm() in uart_resume_port():

commit 5933a161abcb8d83a2c145177f48027c3c0a8995
Author: Yin Kangkai &lt;kangkai.yin@linux.intel.com&gt;
    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:
[&lt;c0281f30&gt;] (unwind_backtrace+0x0/0xf0) from [&lt;c029341c&gt;] (warn_slowpath_common+0x4c/0x64)
[&lt;c029341c&gt;] (warn_slowpath_common+0x4c/0x64) from [&lt;c029344c&gt;] (warn_slowpath_null+0x18/0x1c)
[&lt;c029344c&gt;] (warn_slowpath_null+0x18/0x1c) from [&lt;c044b1e4&gt;] (serial_pxa_set_termios+0x1dc/0x250)
[&lt;c044b1e4&gt;] (serial_pxa_set_termios+0x1dc/0x250) from [&lt;c044a840&gt;] (uart_resume_port+0x128/0x2dc)
[&lt;c044a840&gt;] (uart_resume_port+0x128/0x2dc) from [&lt;c044bbe0&gt;] (serial_pxa_resume+0x18/0x24)
[&lt;c044bbe0&gt;] (serial_pxa_resume+0x18/0x24) from [&lt;c0454d34&gt;] (platform_pm_resume+0x40/0x4c)
[&lt;c0454d34&gt;] (platform_pm_resume+0x40/0x4c) from [&lt;c0457ebc&gt;] (pm_op+0x68/0xb4)
[&lt;c0457ebc&gt;] (pm_op+0x68/0xb4) from [&lt;c0458368&gt;] (device_resume+0xb0/0xec)
[&lt;c0458368&gt;] (device_resume+0xb0/0xec) from [&lt;c04584c8&gt;] (dpm_resume+0xe0/0x194)
[&lt;c04584c8&gt;] (dpm_resume+0xe0/0x194) from [&lt;c0458588&gt;] (dpm_resume_end+0xc/0x18)
[&lt;c0458588&gt;] (dpm_resume_end+0xc/0x18) from [&lt;c02c518c&gt;] (suspend_devices_and_enter+0x16c/0x1ac)
[&lt;c02c518c&gt;] (suspend_devices_and_enter+0x16c/0x1ac) from [&lt;c02c5278&gt;] (enter_state+0xac/0xdc)
[&lt;c02c5278&gt;] (enter_state+0xac/0xdc) from [&lt;c02c48ec&gt;] (state_store+0xa0/0xbc)
[&lt;c02c48ec&gt;] (state_store+0xa0/0xbc) from [&lt;c0408f7c&gt;] (kobj_attr_store+0x18/0x1c)
[&lt;c0408f7c&gt;] (kobj_attr_store+0x18/0x1c) from [&lt;c034a6a4&gt;] (sysfs_write_file+0x108/0x140)
[&lt;c034a6a4&gt;] (sysfs_write_file+0x108/0x140) from [&lt;c02fb798&gt;] (vfs_write+0xac/0x134)
[&lt;c02fb798&gt;] (vfs_write+0xac/0x134) from [&lt;c02fb8cc&gt;] (sys_write+0x3c/0x68)
[&lt;c02fb8cc&gt;] (sys_write+0x3c/0x68) from [&lt;c027c700&gt;] (ret_fast_syscall+0x0/0x2c)
---[ end trace 88289eceb4675b04 ]---

This patch fix the problem by adding the power on opertion back for uart
console when console_suspend_enabled is true.

Signed-off-by: Ning Jiang &lt;ning.jiang@marvell.com&gt;
Tested-by: Mayank Rana &lt;mrana@codeaurora.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>TTY: serial: Move mutex_unlock in uart_close function</title>
<updated>2011-09-22T22:47:53+00:00</updated>
<author>
<name>Nobuhiro Iwamatsu</name>
<email>nobuhiro.iwamatsu.yj@renesas.com</email>
</author>
<published>2011-08-29T06:43:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=55956216f4b42fefaee70060b054359d63d2afa5'/>
<id>55956216f4b42fefaee70060b054359d63d2afa5</id>
<content type='text'>
When mutex_lock is not called, mutex_unlock is sometimes called.
This deletes unnecessary goto and makes modifications so that
mutex_unlock is called.

[    8.304000] WARNING: at kernel/muex-debug.c:78
[    8.304000] Modules linked in:
[    8.304000]
[    8.304000] Pid : 114, Comm:                 modprobe
[    8.304000] CPU : 0                  Not tainted  (3.1.0-rc3-next-20110826 #810)
[    8.304000]
[    8.304000] PC is at debug_mutex_unlock+0xf4/0x120
[    8.304000] PR is at debug_mutex_unlock+0xe6/0x120
[    8.304000] PC  : 80051114 SP  : 9f02de58 SR  : 400081f1 TEA : 295cf4f2
[    8.304000] R0  : 00000001 R1  : 00000000 R2  : 0000000f R3  : 00000000
[    8.304000] R4  : 9fc63158 R5  : 00000000 R6  : 00000001 R7  : 9fe1de78
[    8.304000] R8  : 805c6b2c R9  : 80003920 R10 : 00000000 R11 : 805c6b2c
[    8.304000] R12 : 80425ca0 R13 : 00000000 R14 : 9f02de58
[    8.304000] MACH: 00000003 MACL: 00000000 GBR : 296e1678 PR  : 80051106
[    8.304000]
[    8.304000] Call trace:
[    8.304000]  [&lt;804236c6&gt;] __mutex_unlock_slowpath+0x46/0x120
[    8.304000]  [&lt;804237aa&gt;] mutex_unlock+0xa/0x20
[    8.304000]  [&lt;80240ed6&gt;] uart_close+0x76/0x2c0
[    8.304000]  [&lt;80223b98&gt;] tty_release+0xf8/0x5c0
[    8.304000]  [&lt;800a93a6&gt;] lookup_object+0x26/0xa0
[    8.304000]  [&lt;80063f6a&gt;] call_rcu+0x8a/0xc0
[    8.304000]  [&lt;800a944a&gt;] put_object+0x2a/0x60
[    8.304000]  [&lt;80003920&gt;] arch_local_irq_restore+0x0/0x40
[    8.304000]  [&lt;800af320&gt;] fput+0x180/0x2c0
[    8.304000]  [&lt;800af248&gt;] fput+0xa8/0x2c0
[    8.304000]  [&lt;800ab1a8&gt;] filp_close+0x48/0xc0
[    8.304000]  [&lt;800ab29a&gt;] sys_close+0x7a/0x100
[    8.304000]  [&lt;8000825a&gt;] syscall_call+0xc/0x10
[    8.304000]  [&lt;800ab220&gt;] sys_close+0x0/0x100
[    8.304000]
[    8.304000] Code:
[    8.304000]   8005110e:  mov.l     @r1, r1
[    8.304000]   80051110:  tst       r1, r1
[    8.304000]   80051112:  bf        80051116
[    8.304000] -&gt;80051114:  trapa     #62
[    8.304000]   80051116:  mov.l     @r8, r1
[    8.304000]   80051118:  tst       r1, r1
[    8.304000]   8005111a:  bt.s      8005104c
[    8.304000]   8005111c:  mov       #0, r1
[    8.304000]   8005111e:  bra       80051056
[    8.304000]
[    8.304000] ---[ end trace e8f8e04c313f429b ]---

Signed-off-by: Nobuhiro Iwamatsu &lt;nobuhiro.iwamatsu.yj@renesas.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When mutex_lock is not called, mutex_unlock is sometimes called.
This deletes unnecessary goto and makes modifications so that
mutex_unlock is called.

[    8.304000] WARNING: at kernel/muex-debug.c:78
[    8.304000] Modules linked in:
[    8.304000]
[    8.304000] Pid : 114, Comm:                 modprobe
[    8.304000] CPU : 0                  Not tainted  (3.1.0-rc3-next-20110826 #810)
[    8.304000]
[    8.304000] PC is at debug_mutex_unlock+0xf4/0x120
[    8.304000] PR is at debug_mutex_unlock+0xe6/0x120
[    8.304000] PC  : 80051114 SP  : 9f02de58 SR  : 400081f1 TEA : 295cf4f2
[    8.304000] R0  : 00000001 R1  : 00000000 R2  : 0000000f R3  : 00000000
[    8.304000] R4  : 9fc63158 R5  : 00000000 R6  : 00000001 R7  : 9fe1de78
[    8.304000] R8  : 805c6b2c R9  : 80003920 R10 : 00000000 R11 : 805c6b2c
[    8.304000] R12 : 80425ca0 R13 : 00000000 R14 : 9f02de58
[    8.304000] MACH: 00000003 MACL: 00000000 GBR : 296e1678 PR  : 80051106
[    8.304000]
[    8.304000] Call trace:
[    8.304000]  [&lt;804236c6&gt;] __mutex_unlock_slowpath+0x46/0x120
[    8.304000]  [&lt;804237aa&gt;] mutex_unlock+0xa/0x20
[    8.304000]  [&lt;80240ed6&gt;] uart_close+0x76/0x2c0
[    8.304000]  [&lt;80223b98&gt;] tty_release+0xf8/0x5c0
[    8.304000]  [&lt;800a93a6&gt;] lookup_object+0x26/0xa0
[    8.304000]  [&lt;80063f6a&gt;] call_rcu+0x8a/0xc0
[    8.304000]  [&lt;800a944a&gt;] put_object+0x2a/0x60
[    8.304000]  [&lt;80003920&gt;] arch_local_irq_restore+0x0/0x40
[    8.304000]  [&lt;800af320&gt;] fput+0x180/0x2c0
[    8.304000]  [&lt;800af248&gt;] fput+0xa8/0x2c0
[    8.304000]  [&lt;800ab1a8&gt;] filp_close+0x48/0xc0
[    8.304000]  [&lt;800ab29a&gt;] sys_close+0x7a/0x100
[    8.304000]  [&lt;8000825a&gt;] syscall_call+0xc/0x10
[    8.304000]  [&lt;800ab220&gt;] sys_close+0x0/0x100
[    8.304000]
[    8.304000] Code:
[    8.304000]   8005110e:  mov.l     @r1, r1
[    8.304000]   80051110:  tst       r1, r1
[    8.304000]   80051112:  bf        80051116
[    8.304000] -&gt;80051114:  trapa     #62
[    8.304000]   80051116:  mov.l     @r8, r1
[    8.304000]   80051118:  tst       r1, r1
[    8.304000]   8005111a:  bt.s      8005104c
[    8.304000]   8005111c:  mov       #0, r1
[    8.304000]   8005111e:  bra       80051056
[    8.304000]
[    8.304000] ---[ end trace e8f8e04c313f429b ]---

Signed-off-by: Nobuhiro Iwamatsu &lt;nobuhiro.iwamatsu.yj@renesas.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>TTY: use tty_wait_until_sent_from_close in other drivers</title>
<updated>2011-08-25T16:00:42+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2011-08-25T13:12:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0b058353abfcdba4403af60f06998da590ebeffe'/>
<id>0b058353abfcdba4403af60f06998da590ebeffe</id>
<content type='text'>
Let's use the newly added helper to avoid stalls in drivers which are
not yet ported to tty_port helpers.

Those which are broken (call tty_wait_until_sent with irqs disabled)
are left untouched. They are in a deeper trouble than we are trying to
solve here. This includes amiserial, 68328serial, 68360serial and
crisv10.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Let's use the newly added helper to avoid stalls in drivers which are
not yet ported to tty_port helpers.

Those which are broken (call tty_wait_until_sent with irqs disabled)
are left untouched. They are in a deeper trouble than we are trying to
solve here. This includes amiserial, 68328serial, 68360serial and
crisv10.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>TTY: serial, move locking in uart_close</title>
<updated>2011-08-25T16:00:39+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2011-08-25T13:12:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=bafb0bd24d7e0e0124318625b239a55d58c757a2'/>
<id>bafb0bd24d7e0e0124318625b239a55d58c757a2</id>
<content type='text'>
So now, when we handle CLOSING flag, there is no point to hold
port-&gt;mutex over the start of uart_close.

Yes, there are still several things to reason about:
* port-&gt;count etc is and always was protected by a spinlock
* -&gt;stop_rx is protected by a spinlock. Otherwise it would
  race with interrupts.
* uart_wait_until_sent -- that one is already called without
  port-&gt;mutex from set_termios and tty_set_ldisc. Should anything
  be protected there, it would be tx_empty. And by a spinlock.
  8250 does this internally...

This step is needed to fix system stalls. To not create an AB-BA lock
dependency (see next patches).

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
So now, when we handle CLOSING flag, there is no point to hold
port-&gt;mutex over the start of uart_close.

Yes, there are still several things to reason about:
* port-&gt;count etc is and always was protected by a spinlock
* -&gt;stop_rx is protected by a spinlock. Otherwise it would
  race with interrupts.
* uart_wait_until_sent -- that one is already called without
  port-&gt;mutex from set_termios and tty_set_ldisc. Should anything
  be protected there, it would be tx_empty. And by a spinlock.
  8250 does this internally...

This step is needed to fix system stalls. To not create an AB-BA lock
dependency (see next patches).

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>TTY: serial, use ASYNCB_CLOSING in uart_close</title>
<updated>2011-08-25T16:00:39+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2011-08-25T13:12:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=426929f8d3514d7f727b8c464d1eeeaf74b21519'/>
<id>426929f8d3514d7f727b8c464d1eeeaf74b21519</id>
<content type='text'>
We need to move port-&gt;mutex locking after wait_until_sent in
uart_close (for rationale see next patches). But if we did it now, we
would introduce a race between close and open. This is exactly why
port-&gt;mutex is locked at the top of uart_close.

To avoid the race, we add ASYNCB_CLOSING to uart_close. Like every
other sane TTY driver. Thanks to tty_port_block_til_ready used in
uart_open we will have this for free. Then we can move the port-&gt;mutex
lock.

Also note that this will make the conversion to tty_port helpers
easier. They are currently handling ASYNC_CLOSING flag correctly.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We need to move port-&gt;mutex locking after wait_until_sent in
uart_close (for rationale see next patches). But if we did it now, we
would introduce a race between close and open. This is exactly why
port-&gt;mutex is locked at the top of uart_close.

To avoid the race, we add ASYNCB_CLOSING to uart_close. Like every
other sane TTY driver. Thanks to tty_port_block_til_ready used in
uart_open we will have this for free. Then we can move the port-&gt;mutex
lock.

Also note that this will make the conversion to tty_port helpers
easier. They are currently handling ASYNC_CLOSING flag correctly.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tty: serial8250: remove UPIO_DWAPB{,32}</title>
<updated>2011-08-23T17:53:00+00:00</updated>
<author>
<name>Jamie Iles</name>
<email>jamie@jamieiles.com</email>
</author>
<published>2011-08-15T09:17:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4834d028978583dfe8e1fc19f1180ceb03d8dfb7'/>
<id>4834d028978583dfe8e1fc19f1180ceb03d8dfb7</id>
<content type='text'>
Now that platforms can override the port IRQ handler and the only user
of these UPIO modes has been converted over, kill off UPIO_DWAPB and
UPIO_DWAPB32.

Acked-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Jamie Iles &lt;jamie@jamieiles.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that platforms can override the port IRQ handler and the only user
of these UPIO modes has been converted over, kill off UPIO_DWAPB and
UPIO_DWAPB32.

Acked-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Jamie Iles &lt;jamie@jamieiles.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>TTY: remove tty_locked</title>
<updated>2011-08-23T17:34:07+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2011-07-14T12:35:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=906cbe1364d94da7cbf74c1d05e3e78b2883f661'/>
<id>906cbe1364d94da7cbf74c1d05e3e78b2883f661</id>
<content type='text'>
We used it really only serial and ami_serial. The rest of the
callsites were BUG/WARN_ONs to check if BTM is held. Now that we
pruned tty_locked from both of the real users, we can get rid of
tty_lock along with __big_tty_mutex_owner.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We used it really only serial and ami_serial. The rest of the
callsites were BUG/WARN_ONs to check if BTM is held. Now that we
pruned tty_locked from both of the real users, we can get rid of
tty_lock along with __big_tty_mutex_owner.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>TTY: serial, remove tasklet for tty_wakeup</title>
<updated>2011-08-23T17:34:06+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2011-07-14T12:35:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6a3e492b6daaf7ec4dc41e51d87d2aae8ff886f2'/>
<id>6a3e492b6daaf7ec4dc41e51d87d2aae8ff886f2</id>
<content type='text'>
tty_wakeup can be called from any context. So there is no need to have
an extra tasklet for calling that. Hence save some space and remove
the tasklet completely.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tty_wakeup can be called from any context. So there is no need to have
an extra tasklet for calling that. Hence save some space and remove
the tasklet completely.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
