dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

680 Commits

Author SHA1 Message Date
Jiri Slaby 01bd730d92 TTY: amiserial/simserial, use flags from tty_port
This changes flags' type to ulong which is appropriate for all the
set/clear_bits performed in the drivers..

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 12:30:51 -08:00
Jiri Slaby 12c8035435 TTY: amiserial/simserial, use count from tty_port
Nothing special. Just remove count from serial_state and change all
users to use tty_port.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 12:30:51 -08:00
Jiri Slaby 799be6ff2f TTY: amiserial/simserial, use close delays from tty_port
Note that previously simserial set the delay to 0. So we preserve
that. BUT, is it correct?

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 12:30:50 -08:00
Jiri Slaby 87758791c9 TTY: amiserial/simserial, use tty_port
Add tty_port to serial_state and start using common tty port members
from tty_port in amiserial and simserial. The rest will follow one by
one.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 12:30:50 -08:00
Jiri Slaby 588993dd8d TTY: amiserial, pass tty down to functions
This avoids pain with tty refcounting and touching tty_port in the
future. It allows us to remove some info->tty tests because the tty
passed down to them can never be NULL.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 12:30:50 -08:00
Jiri Slaby 0f9b9684db TTY: amiserial, simplify set_serial_info
Do not copy whole serial_state. We only need to know whether the speed
is to be changed. Hence store the info in advance and use it later.
A simple bool is enough.

Also remove reduntant assignments and move the tests directly to the
'if'.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 12:30:50 -08:00
Jiri Slaby 916b765675 TTY: serialP, merge serial_state and async_struct
This is the final step to get rid of the one of the structures.  A
further cleanup will follow. And I struct serial_state deserves cease
to exist after a switch to tty_port too.

While changing the lines, it removes also pointless tty->driver_data
casts.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 12:28:48 -08:00
Jiri Slaby 13c9062122 TTY: amiserial, remove IRQ_ports
They used to work as a storage for 'info' pointer used in ISRs.  They
are not really needed. Just pass the pointer through request_irq to
the handlers.

It was set to NULL and tested in the ISRs, but we do not need the
tests as we disable all the interrupts at the same places where NULL
sets were.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 12:27:58 -08:00
Jiri Slaby d852256389 TTY: simserial/amiserial, use one instance of other members
This means:
* close_delay
* closing_wait
* line
* port
* xmit_fifo_size

This actually fixes a bug in amiserial. It initializes one and uses
the other of the close delays. Yes, duplicating structure members is
evil.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 12:27:17 -08:00
Jiri Slaby fef21073af TTY: amiserial, use only one copy of async flags
Huh, why would one want to store two copies of them? Get rid of the
one from async_struct. That structure is going away as a whole soon.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:48:43 -08:00
Jiri Slaby c5f0508b99 TTY: amiserial, remove tasklet for tty_wakeup
tty_wakeup is safe to be called from all contexts. No need to schedule
a tasklet for that. Let's call it directly like in other drivers.

This allows us to kill another member of async_struct structure. (If
we remove the dummy uses in simserial.)

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:48:42 -08:00
Jiri Slaby 9c8efecc91 TTY: serialP, remove unused material
First, remove unused macro and rs_multiport_struct structure. Nobody
uses them at all.

Further, the 2 drivers (they are below) which use the rest of
structures from serialP.h (async_struct and serial_state) do not use
all the members. Remove the members:
* which are unused or
* which are only initialized and never used for something real.

Everybody should avoid the structures with a looong distance.

Finally, remove the ALPHA kludge MCR quirks. They are 1:1 copy from
8250.h. No need to redefine them here.

The 2 promised users of the structures:
arch/ia64/hp/sim/simserial.c
drivers/tty/amiserial.c

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:48:42 -08:00
Jiri Slaby 11ba8899f9 TTY: remove serialP.h inclusion from some files
All of them do not use the ugly interface defined in that header.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:47:02 -08:00
Jiri Slaby 8bc87dc999 TTY: serial, include pci.h in m32r_sio
It uses pointers to pci_dev, but compiler complains it doesn't know
it:
In file included from .../m32r_sio.c:53:
.../m32r_sio.h:21: warning: "struct pci_dev" declared inside parameter list
.../m32r_sio.h:21: warning: its scope is only this definition or declaration, which is probably not what you want
.../m32r_sio.h:22: warning: "struct pci_dev" declared inside parameter list

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:47:02 -08:00
Jiri Slaby 4da2405606 TTY: serial, use atomic_inc_return in ioc4_serial
We want to know the value of the atomic variable in intr_connect after
the increment. But atomic_inc doesn't, per definition, return the
value.  It is just a pure coincidence that ia64 defines atomic_inc as
atomic_inc_return.

So fix this mistake by using atomic_inc_return properly.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:47:01 -08:00
Jiri Slaby ecaa3bda65 TTY: ipwireless, fix tty->index handling
* do not test if tty->index is in bounds. It is always.
* tty->index is not a minor! Fix that.

>From now on, let's assume that the parameter of the function is tty
index with base being zero. This makes also the code more readable.

Factually, there is no real change as tty_driver->minor_start is zero,
so the tests are equivalent. But it did not make sense. And if this
had changed eventually, it would have caused troubles.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Cc: David Sterba <dsterba@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:42:21 -08:00
Jiri Slaby 410235fd4d TTY: remove unneeded tty->index checks
Checking if tty->index is in bounds is not needed. The tty has the
index set in the initial open. This is done in get_tty_driver. And it
can be only in interval <0,driver->num).

So remove the tests which check exactly this interval. Some are
left untouched as they check against the current backing device count.
(Leaving apart that the check is racy in most of the cases.)

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:42:21 -08:00
Jiri Slaby ecd166507f TTY: remove tty driver re-set from tty_reopen
This is from tty_reopen:
    struct tty_driver *driver = tty->driver;
    ...
    tty->driver = driver;
and it doesn't make sense at all. The driver is intended to be set in
initialize_tty_struct from tty_init_dev (initial open). So this set in
tty_reopen is not needed.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:38:50 -08:00
Jiri Slaby d4834267e8 TTY: simplify tty_driver_lookup_tty a bit
Remove the useless local variable and return the value itself.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:38:50 -08:00
Jiri Slaby 2f16669d32 TTY: remove re-assignments to tty_driver members
All num, magic and owner are set by alloc_tty_driver. No need to
re-set them on each allocation site.

pti driver sets something different to what it passes to
alloc_tty_driver. It is not a bug, since we don't use the lines
parameter in any way. Anyway this is fixed, and now we do the right
thing.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:37:58 -08:00
Jiri Slaby 1a54a76d51 TTY: let alloc_tty_driver deduce the owner automatically
Like the rest of the kernel, make a stub from alloc_tty_driver which
calls __alloc_tty_driver with proper owner. This will save us one more
assignment on the driver side.

Also this fixes some drivers which didn't set the owner. This allowed
user to remove the module from the system even though a tty from the
driver is still open.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:30:21 -08:00
Jiri Slaby a8fbc974c3 TTY: tty_io, remove buffer re-assignments
TTY buffer head and tail are initialized in tty_buffer_init. No need
to do it once again in initialize_tty_struct where tty_buffer_init is
called.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:30:21 -08:00
Alan Cox 5289475d13 vt: tackle the main part of the selection logic
We leave the existing paste mess alone and just fix up the vt side of
things.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:11:39 -08:00
Alan Cox 99cceb4e50 vt: waitevent is self locked so drop the tty_lock
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:10:28 -08:00
Alan Cox 20f62579dc vt: push down tioclinux cases
Some of this ventures into selection which is still a complete lost cause. We
are not making it any worse. It's completely busted anyway.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:10:27 -08:00
Alan Cox 4001d7b7fc vt: push down the tty lock so we can see what is left to tackle
At this point we have the tty_lock guarding a couple of oddities, plus the
translation and unimap still.

We also extend the console_lock in a couple of spots where coverage is wrong
and switch vcs_open to use the right lock !

[Fixed the locking issue Jiri reported]

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:10:27 -08:00
Alan Cox edab558feb vt: sort out locking for font handling
The font methods are console_lock covered. Unfortunately they don't extend
the lock over all the needed tests.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:10:27 -08:00
Dan Carpenter dbca36eab4 tty: cyclades: TIOCSERGETLSR should should store to a uint
TIOCSERGETLSR should be saved in a uint so the cast here to unsigned
long is a bug.

Reported-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:02:51 -08:00
Cousson, Benoit a5f43138da tty: serial: OMAP: Fix oops due to NULL pdata in DT boot
The following commit: be4b028195
(tty: serial: OMAP: block idle while the UART is transferring data in PIO mode),
is introducing an oops if OMAP is booted using device tree blob because
the pdata will not be initialized.

Check if pdata is set before de-referencing it.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Reviewed-by: Paul Walmsley <paul@pwsan.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 10:56:44 -08:00
Alan Cox 079c9534a9 vt:tackle kbd_table
Keyboard struct lifetime is easy, but the locking is not and is completely
ignored by the existing code. Tackle this one head on

- Make the kbd_table private so we can run down all direct users
- Hoick the relevant ioctl handlers into the keyboard layer
- Lock them with the keyboard lock so they don't change mid keypress
- Add helpers for things like console stop/start so we isolate the poking
  around properly
- Tweak the braille console so it still builds

There are a couple of FIXME locking cases left for ioctls that are so hideous
they should be addressed in a later patch. After this patch the kbd_table is
private and all the keyboard jiggery pokery is in one place.

This update fixes speakup and also a memory leak in the original.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 10:50:35 -08:00
Greg Kroah-Hartman 6623d64021 tty: keyboard.c: add uaccess.h to fix a build problem on sparc32
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-27 15:18:56 -08:00
Alan Cox 6aeed479fd vt: tidy a few bits of checkpatch noise
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 13:59:35 -08:00
Alan Cox 247ff8e610 vt: lock the accent table
First step to debletcherising the vt console layer - pick a victim and fix
the locking

This is a nice simple object with its own rules so lets pick it out for
treatment. The user of the table already has a lock so we will also use the
same lock for updates.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 13:59:34 -08:00
Greg Kroah-Hartman ce1000ddca Revert "TTY: pty, remove superfluous ptm test"
This reverts commit a50f724a43.

Sasha reported that this causes problems, so revert it.

Cc: Alan Cox <alan@linux.intel.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 13:56:36 -08:00
Greg Kroah-Hartman 0ef1698e4d Revert "TTY: get rid of BTM around devpts_*"
This reverts commit d3bda5298a.

Sasha reported that this causes problems, so revert it.

Cc: Sasha Levin <levinsasha928@gmail.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 13:55:54 -08:00
Chanho Min 6dc01aa653 amba-pl011​/dma: Add check for the residue in DMA callback
In DMA-operated uart, I found that rx data can be taken by the UART
interrupts during the DMA irq handler. pl011_int is occurred just
before it goes inside spin_lock_irq. When it returns to the callback,
DMA buffer already has been flushed. Then, pl011_dma_rx_chars gets
invalid data. So I add check for the residue as the patch bellow.

Signed-off-by: Chanho Min <chanho.min@lge.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 13:50:47 -08:00
Denis 'GNUtoo' Carikli b26469a8b1 serial: samsung: fix s3c2442 platform data
Without that fix machines having a s3c2442 CPU have something
  like that in dmesg:
    samsung-uart s3c2440-uart.0: could not find driver data
    samsung-uart s3c2440-uart.1: could not find driver data
    samsung-uart s3c2440-uart.2: could not find driver data
  And serial is never initialized.

The previous log was obtained trough early printk on the gta02
  machine.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 13:50:46 -08:00
Stephen Rothwell 2ae7352094 tty/powerpc: early udbg consoles can't be modules
Fixes these build errors:

ERROR: ".udbg_printf" [drivers/tty/ehv_bytechan.ko] undefined!
ERROR: ".register_early_udbg_console" [drivers/tty/ehv_bytechan.ko] undefined!
ERROR: "udbg_putc" [drivers/tty/ehv_bytechan.ko] undefined!

Cc: Timur Tabi <timur@freescale.com>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 13:50:46 -08:00
Masanari Iida 90af6d2082 serial: Fix typo in sn_console.c
Correct spelling "receieve" to "receive" in
drivers/tty/serial/sn_console.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 13:50:45 -08:00
Danny Kukawka b7974deddc tty/serial/mux.c: linux/tty.h included twice
drivers/tty/serial/mux.c included 'linux/tty.h' twice, remove
the duplicate.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 13:50:45 -08:00
Paul Gortmaker 6816383a09 tty: sparc: rename drivers/tty/serial/suncore.h -> include/linux/sunserialcore.h
There are multiple users of this file from different source
paths now, and rather than have ../ paths in include statements,
just move the file to the linux header dir.

Suggested-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10 10:44:35 -08:00
Greg Kroah-Hartman 5a22e30def Merge tag 'tty-3.3-rc3' tty-next
This is needed to handle the 8250 file merge mess properly for future
patches.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10 10:25:27 -08:00
Paul Walmsley 197234520b tty: serial: omap-serial: wakeup latency constraint is in microseconds, not milliseconds
The receive FIFO wakeup latency estimate in the omap-serial driver is
three orders of magnitude too small.  This effectively prevents the
MPU from going to a low-power state when CONFIG_CPU_IDLE=y.  This is a
major power management regression and masks some other FIFO-related
bugs in the driver.

Fix by correcting the most egregious problem in the RX wakeup latency
estimate.  There are several other flaws in the estimator; these will
be fixed by a separate patch series intended for 3.4.

The difference in low-power states with this patch can be observed via
debugfs in pm_debug/count.

This estimate does not have any effect when CONFIG_CPU_IDLE=n.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Alan Cox <alan@linux.intel.com>
Acked-by: Govindraj.R <govindraj.raja@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 10:48:36 -08:00
Paul Walmsley be4b028195 tty: serial: OMAP: block idle while the UART is transferring data in PIO mode
Prevent OMAP UARTs from going idle while they are still transferring
data in PIO mode.  This works around an oversight in the OMAP UART
hardware present in OMAP34xx and earlier: an idle UART won't send a
wakeup when the TX FIFO threshold is reached.  This causes long delays
during data transmission when the MPU powerdomain enters a low-power
mode.  The MPU interrupt controller is not able to respond to
interrupts when it's in a low-power state, so the TX buffer is not
refilled until another wakeup event occurs.

This fix changes the erratum i291 DMA idle workaround.  Rather than
toggling between force-idle and no-idle, it will toggle between
smart-idle and no-idle.  The important part of the workaround is the
no-idle part, so this shouldn't result in any change in behavior.

This fix should work on all OMAP UARTs.  Future patches intended for
the 3.4 merge window will make this workaround conditional on a
"feature" flag, and will use the OMAP36xx+ TX event wakeup support.

Thanks to Kevin Hilman <khilman@ti.com> for mentioning the erratum i291
workaround, which led to the development of this approach.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Govindraj.R <govindraj.raja@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 10:48:34 -08:00
Paul Walmsley 0ba5f66836 tty: serial: OMAP: use a 1-byte RX FIFO threshold in PIO mode
In the (default) PIO mode, use a one-byte RX FIFO threshold.  The OMAP
UART IP blocks do not appear to be capable of waking the system under
an RX timeout condition.  Since the previous RX FIFO threshold was 16
bytes, this meant that omap-serial.c did not become aware of any
received data until all those bytes arrived or until another UART
interrupt occurred.  This made the serial console and presumably other
serial applications (GPS, serial Bluetooth) unusable or extremely
slow.  A 1-byte RX FIFO threshold also allows the MPU to enter a
low-power consumption state while waiting for the FIFO to fill.

This can be verified using the serial console by comparing the
behavior when "0123456789abcde" is pasted in from another window, with
the behavior when "0123456789abcdef" is pasted in.  Since the former
string is less than sixteen bytes long, the string is not echoed for
some time, while the latter string is echoed immediately.

DMA operation is unaffected by this patch.

Thanks to Russell King - ARM Linux <linux@arm.linux.org.uk> for some
additional information on the standard behavior of the RX timeout
event, which was used to improve this commit description.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Govindraj Raja <govindraj.r@ti.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Russell King <linux@arm.linux.org.uk>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 10:48:32 -08:00
Tobias Klauser 418a936e84 tty: serial: altera_uart: Add CONSOLE_POLL support
This allows altera_uart to be used for KGDB debugging over serial line.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:04:24 -08:00
Tobias Klauser 3f5dc70721 tty: serial: altera_uart: remove early_altera_uart_setup
The function has no users inside the tree and the nios2
(out-of-mainline) port doesn't use it either (anymore).

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:04:23 -08:00
Anton Vorontsov d3a532a9c6 sysrq: Properly check for kernel threads
There's a real possibility of killing kernel threads that might
have issued use_mm(), so kthread's mm might become non-NULL.

This patch fixes the issue by checking for PF_KTHREAD (just as
get_task_mm()).

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:03:30 -08:00
Anton Vorontsov e502babe0a sysrq: Fix possible race with exiting task
sysrq should grab the tasklist lock, otherwise calling force_sig() is
not safe, as it might race with exiting task, which ->sighand might be
set to NULL already.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:03:29 -08:00
Feng Tang 6f56d0f436 serial: pch_uart: trivail cleanup by removing the pch_uart_hal_request()
pch_uart_hal_request() has parameters which it never uses, also
it is very short, so merge it with its caller to make code cleaner.
No functional changes at all.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:02:26 -08:00