Commit graph

190087 commits

Author SHA1 Message Date
Vineet Gupta 00a135b395 serial/arc-uart: Remove the goto/label
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Mischa Jonker <mjonker@synopsys.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-02 11:54:12 +08:00
Vineet Gupta 5284eba7b3 serial/arc-uart: Handle Rx Error Interrupts w/o any data
Currently, Rx error handling only triggers if there is some Rx data.
Fix that by checking for error - before the data handling.

Reported-by: Mischa Jonker <mjonker@synopsys.com>
Tested-by: Mischa Jonker <mjonker@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-02 11:54:12 +08:00
Peter Hurley cb50e5235b tty: Only hangup once
Instrumented testing shows a tty can be hungup multiple times [1].
Although concurrent hangups are properly serialized, multiple
hangups for the same tty should be prevented.

If tty has already been HUPPED, abort hangup. Note it is not
necessary to cleanup file *redirect on subsequent hangups,
as only TIOCCONS can set that value and ioctls are disabled
after hangup.

[1]
Test performed by simulating a concurrent async hangup via
tty_hangup() with a sync hangup via tty_vhangup(), while
__tty_hangup() was instrumented with:

	diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
	index 26bb78c..fe8b061 100644
	--- a/drivers/tty/tty_io.c
	+++ b/drivers/tty/tty_io.c
	@@ -629,6 +629,8 @@ static void __tty_hangup(struct tty_struct *tty, int exit_session)

		tty_lock(tty);

	+	WARN_ON(test_bit(TTY_HUPPED, &tty->flags));
	+
		/* some functions below drop BTM, so we need this bit */
		set_bit(TTY_HUPPING, &tty->flags);

Test result:

WARNING: at /home/peter/src/kernels/mainline/drivers/tty/tty_io.c:632 __tty_hangup+0x459/0x460()
Modules linked in: ip6table_filter ip6_tables ebtable_nat <...snip...>
CPU: 6 PID: 1197 Comm: kworker/6:2 Not tainted 3.10.0-0+rfcomm-xeon #0+rfcomm
Hardware name: Dell Inc. Precision WorkStation T5400  /0RW203, BIOS A11 04/30/2012
Workqueue: events do_tty_hangup
 0000000000000009 ffff8802b16d7d18 ffffffff816b553e ffff8802b16d7d58
 ffffffff810407e0 ffff880254f95c00 ffff880254f95c00 ffff8802bfd92b00
 ffff8802bfd96b00 ffff880254f95e40 0000000000000180 ffff8802b16d7d68
Call Trace:
 [<ffffffff816b553e>] dump_stack+0x19/0x1b
 [<ffffffff810407e0>] warn_slowpath_common+0x70/0xa0
 [<ffffffff8104082a>] warn_slowpath_null+0x1a/0x20
 [<ffffffff813fb279>] __tty_hangup+0x459/0x460
 [<ffffffff8107409c>] ? finish_task_switch+0xbc/0xe0
 [<ffffffff813fb297>] do_tty_hangup+0x17/0x20
 [<ffffffff8105fd6f>] process_one_work+0x16f/0x450
 [<ffffffff8106007c>] process_scheduled_works+0x2c/0x40
 [<ffffffff8106060a>] worker_thread+0x26a/0x380
 [<ffffffff810603a0>] ? rescuer_thread+0x310/0x310
 [<ffffffff810698a0>] kthread+0xc0/0xd0
 [<ffffffff816b0000>] ? destroy_compound_page+0x65/0x92
 [<ffffffff810697e0>] ? kthread_create_on_node+0x130/0x130
 [<ffffffff816c495c>] ret_from_fork+0x7c/0xb0
 [<ffffffff810697e0>] ? kthread_create_on_node+0x130/0x130
---[ end trace 98d9f01536cf411e ]---

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-02 11:47:42 +08:00
Alexander Shiyan 85c9969074 serial: sccnxp: Add DT support
Add DT support to the SCCNCP serial driver.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 18:09:35 -07:00
Alexander Shiyan ea4c39beac serial: sccnxp: Using structure for each supported IC instead of switch in probe
This patch replaces switch in probe function to constant structure
for each supported IC. This makes code a bit smaller and cleaner and
helps adding DT support to the driver in the future.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 18:08:02 -07:00
Alexander Shiyan 90efa75f7a serial: sccnxp: Using CLK API for getting UART clock
This patch removes "frequency" parameter from SCCNXP platform_data
and uses CLK API for getting clock. If CLK ommited, default IC
frequency will be used instead.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 18:08:01 -07:00
Alexander Shiyan e087ab74f3 serial: sccnxp: Disable regulator on error
The patch disables the regulator in case of errors, if we have it.
In addition, the patch adds support for deferred regulator probe and
makes error path are a bit clean.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 18:08:01 -07:00
Uwe Kleine-König 3fc1eb5fe5 serial/efm32-uart: don't slur over failure in probe_dt
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 18:05:41 -07:00
Uwe Kleine-König 11f1ad3ab4 serial/efm32-uart: don't use pdev->id to determine the port's line
pdev->id is not a valid choice for device-tree probed devices. So use
the (properly determined) line from efm32_uart_probe consistenly

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 18:05:39 -07:00
Jingoo Han 574de559c1 serial: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:56:15 -07:00
Darren Hart e26439ce03 serial: pch_uart: Fix signed-ness and casting of uartclk related fields
Storing one struct per known board would be overkill. Pre-cast the
driver_data pointer to an unsigned long to avoid the pointer to int
compiler warning:

drivers/tty/serial/pch_uart.c:431:10: warning: cast from pointer to
integer of different size [-Wpointer-to-int-cast]

Unify the signed-ness of the baud and uartclk types throughout the
driver.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 15:27:48 -07:00
Elen Song 2e68c22fde serial: at91: make UART support dma and pdc transfers
Because the UART lack of receive timeout register, so we use a timer to trigger
data receive.
The DBGU is regarded as UART.

Signed-off-by: Elen Song <elen.song@atmel.com>
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 13:05:04 -07:00
Elen Song 055560b04a serial: at91: distinguish usart and uart
Distinguish usart and uart by read ip name register,
The usart read name is "USAR",
The uart and dbgu read name is "DBGU".

Signed-off-by: Elen Song <elen.song@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 13:04:12 -07:00
Elen Song 33d64c4ffa serial: at91: support run time switch transfer mode
We will switch to pio mode when request of dma or pdc fail.
But soon or later, when the request is success, the transfer mode can switch to them at
next open serial port action.
So in startup stage, we should get original transfer mode.

Signed-off-by: Elen Song <elen.song@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 13:03:30 -07:00
Elen Song 34df42f59a serial: at91: add rx dma support
Request a cyclic dma channel for rx dma use. Use cyclic transfer is to prevent
receive data overrun.

We allocate a cycle dma cookie after request channel,
after that, enable uart timeout interrupt in startup stage, when data successful
received, the timeout callback will check the residual bytes and insert
receiving datas into the framework during the transfer interval.

When current descriptor finished, the dma callback will also check the residual
bytes and filp the receiving data.

Signed-off-by: Elen Song <elen.song@atmel.com>
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 13:03:29 -07:00
Elen Song 08f738be88 serial: at91: add tx dma support
Request a slave dma channel for tx dma use. Tx dma will setup a single transfer,
when transfer complete, it will call atmel_complete_tx_dma to do finish stuff.

Signed-off-by: Elen Song <elen.song@atmel.com>
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 13:03:29 -07:00
Elen Song a930e52875 serial: at91: use function pointer to choose pdc or pio
use function pointer can avoid define atmel_use_pdc_tx/rx everywhere.
(*prepare_rx/tx)() is in setup transfer stage.
(*schedule_rx/tx)() is in tasklet schedule stage.
(*release_rx/tx)() is used when shutdown the transfer.

Signed-off-by: Elen Song <elen.song@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 13:03:29 -07:00
Elen Song 64e22ebe49 serial: at91: correct definition from DMA to PDC
The DMA is available since at91sam9x5 socs, before that, we use PDC.

Signed-off-by: Elen Song <elen.song@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 12:52:40 -07:00
Darren Hart 0a09ae98ea serial: pch_uart: Remove __initdata annotation from dmi_table
The dmi_table is best accessed from the probe function, which is not
an __init function. Drop the __initdata annotation from the dmi_table
to avoid the section mismatch compiler warnings:

WARNING: drivers/tty/serial/pch_uart.o(.text+0x4871): Section mismatch
in reference from the function pch_uart_init_port() to the variable
.init.data:pch_uart_dmi_table

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 12:47:37 -07:00
Alexandru Juncu e06922aa83 TTY: synclink: replace bitmasks add operation with OR operation.
Found with coccinelle, manually fixed and verified.

Signed-off-by: Alexandru Juncu <alexj@rosedu.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 12:47:37 -07:00
Alexander Shiyan c29782965b serial: max310x: Fix dev_pm_ops
This patch fixes wrong dev_pm_ops which caused by commit:
serial: max310x: Driver rework.

  CC      drivers/tty/serial/max310x.o
  LD      drivers/video/fb.o
  CC      drivers/w1/slaves/w1_ds2433.o
  CC      drivers/w1/slaves/w1_ds2760.o
  CC      drivers/xen/balloon.o
  CC      drivers/video/backlight/adp8870_bl.o
drivers/tty/serial/max310x.c:1292:8: warning: initialization from incompatible pointer type [enabled by default]
drivers/tty/serial/max310x.c:1292:8: warning: (near initialization for 'max310x_pm_ops.suspend') [enabled by default]
drivers/tty/serial/max310x.c:1292:8: warning: initialization from incompatible pointer type [enabled by default]
drivers/tty/serial/max310x.c:1292:8: warning: (near initialization for 'max310x_pm_ops.resume') [enabled by default]
drivers/tty/serial/max310x.c:1292:8: warning: initialization from incompatible pointer type [enabled by default]
drivers/tty/serial/max310x.c:1292:8: warning: (near initialization for 'max310x_pm_ops.freeze') [enabled by default]
drivers/tty/serial/max310x.c:1292:8: warning: initialization from incompatible pointer type [enabled by default]
drivers/tty/serial/max310x.c:1292:8: warning: (near initialization for 'max310x_pm_ops.thaw') [enabled by default]
drivers/tty/serial/max310x.c:1292:8: warning: initialization from incompatible pointer type [enabled by default]
drivers/tty/serial/max310x.c:1292:8: warning: (near initialization for 'max310x_pm_ops.poweroff') [enabled by default]
drivers/tty/serial/max310x.c:1292:8: warning: initialization from incompatible pointer type [enabled by default]
drivers/tty/serial/max310x.c:1292:8: warning: (near initialization for 'max310x_pm_ops.restore') [enabled by default]

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 12:47:37 -07:00
Greg Kroah-Hartman cf204a1b54 Merge 3.11-rc3 into tty-next
We want the tty fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 12:32:30 -07:00
Linus Torvalds 76d25a5f2f Pin control fixes for the v3.11 series:
- Driver fixes for AM33xx, SIRF and PFC pin controllers.
 
 - Fix a compile warning from the pinctrl single-register
   driver.
 
 - Fix a little nasty memory leak.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.13 (GNU/Linux)
 
 iQIcBAABAgAGBQJR9YhoAAoJEEEQszewGV1zfl8P/jk2VjlRE0P4LRLSRn3Rt7yj
 Wz7IyZTol+mFnaY0yKQS9rToK+GqtJQHA1zuNP8iQnJbQh+UromAZwBd58dP7cnu
 mYSi2QS4osYT5RjvVtB2yYy9sRrc4iTb+qJFekanA4IcHt0zKDZysyN8moU5JxmN
 TVr+cauFm7qimkjps2Dns94UhVGpgB7A6Y8yC3SYtPv1GPdWQgSaDabWqMYq0bn1
 ARUaz3XcbjMAGbPi8kDEFsP/SkM2OcMXpjX23G6ifgO9pyEKeum5+FWtllVeeAzb
 LmymMJYVcTPLFw0yj+9lkRBew2K9JKmPp8rAUBvbDn53vbguMkDJTczM3IUZ279h
 lRvR+w9F2M1rqIfwSa0/ZqTYKXbsF/IASYMXL/awNywnss+caPUxiN4EWRuKDssS
 Wh6veS9l4roMupaez6GU7gQ8UgNnFTQg2BYzeFYbAg1jJ1b/U+E0MK/9yUzewXQw
 phlcFFibYce+1qhJhQ3lIYb6O512vw+2Xk+G6JBZVuwzMVvUUJwJqfGRKCoobxZz
 DRBIQJ9U4DRMethjfp5mP0H6nH7/fwKqvftKlsnOb9SXZregpcLV+ymrkkmW/Ey2
 XuEHQqUbmD0zoPHvFgoUmAYlzmhxtmHK5uJDSH1aZ4b9IOzr2mV1RSt0xwo3BpTS
 gwtDvmutV/JQ8RZMLLvw
 =URtB
 -----END PGP SIGNATURE-----

Merge tag 'pinctrl-for-v3.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control fixes from Linus Walleij:
 - Driver fixes for AM33xx, SIRF and PFC pin controllers
 - Fix a compile warning from the pinctrl single-register driver
 - Fix a little nasty memory leak

* tag 'pinctrl-for-v3.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: fix a memleak when freeing maps
  pinctrl: pinctrl-single: fix compile warning when no CONFIG_PM
  pinctrl: sh-pfc: fix SDHI0 VccQ regulator on sh73a0 with DT
  arm/dts: sirf: fix the pingroup name mismatch between drivers and dts
  pinctrl: sirf: add usp0_uart_nostreamctrl pin group for usp-uart without flowctrl
  pinctrl: sirf: fix the pin number and mux bit for usp0
  pinctrl: am33xx dt binding: correct include path
2013-07-28 18:19:27 -07:00
Linus Torvalds 561d9e8185 SCSI fixes on 20130727
This is five bug fixes, two of which fix long standing problems causing
 crashes (sd and mvsas).  The remaining three are hung (isci race) or lost
 (qla2xxx, isci) devices.
 
 Signed-off-by: James Bottomley <JBottomley@Parallels.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQEcBAABAgAGBQJR8+WtAAoJEDeqqVYsXL0MDIUIAKkm+XVgNPAUhDnPH5IUcHVB
 jr0NnKnsmlWVNV/Jc8xYKAjPeyBGr4foMR4W+Qqy2g8tTXI55AkXq4A8lyJfYVj9
 1j8HTdbJFcOIwQO3e4gp6yJ9j2AdMoM9eHMYqts9u/G+2ckQm8GyMksgttUatVPu
 gShyvU2Er546Di6D+JKNMjLufMucnuyPBHmzAKFc9l0L8A31vE0zkbO1qGozDTEB
 tDotPSRuaaHaNQDvP/V0uwEIA1/KTq50ZJQerFp/mhc+gAvC/bQlmiOpWEJ8BxW7
 3L0TEBsU+Bq1f+1uIWCHk3NWZEjj7nFLfk2lkhh32UtfXMB8Io46PbQAC9/Nk6U=
 =/0W8
 -----END PGP SIGNATURE-----

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "This is five bug fixes, two of which fix long standing problems
  causing crashes (sd and mvsas).  The remaining three are hung (isci
  race) or lost (qla2xxx, isci) devices"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  [SCSI] isci: fix breakage caused by >16byte CDB patch
  [SCSI] mvsas: Fix kernel panic on tile due to unaligned data access
  [SCSI] sd: fix crash when UA received on DIF enabled device
  [SCSI] qla2xxx: Properly set the tagging for commands.
  [SCSI] isci: Fix a race condition in the SSP task management path
2013-07-28 18:09:34 -07:00
Laurent Pinchart 299a62575a serial8250-em: Convert to devm_* managed helpers
Replace kzalloc and clk_get by their managed counterparts to simplify
error and cleanup paths.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:20:24 -07:00
Andreas Platschek cf940ebe98 tty: Remove dead code
-> The ledptrs[] array is never initialized.
-> There is no place where kbd->ledmode is set to LED_SHOW_MEM therefore the if
   statement does not make much sense.
-> Since LED_SHOW_MEM is not used, it can be removed from the header file as well.

Signed-off-by: Andreas Platschek <andi.platschek@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:19:48 -07:00
Stephen Boyd 17fae28efe msm_serial: Send more than 1 character at a time on UARTDM
UARTDM cores have a TX fifo that can accept more than one
character per register write, but the msm_serial driver currently
only supports 1 character mode. Add support for this mode of operation
to speed up the transmit path on DM devices.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:13:30 -07:00
Stephen Boyd 6909dadd91 msm_serial: Make baud_code detection more dynamic
Currently msm_set_baud_rate() assumes the uart clock rate is
1.8432 MHz. This is not always true, and limits our options to
program the baud rate. Instead of assuming the rate and
hard-coding the baud_code based on it, calculate the divider that
we want and try to find the closest baud_code that matches. This
allows us to support uarts with faster clock speeds.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:13:29 -07:00
Stephen Boyd f8fb952fd4 msm_serial: Fix sparse warnings
drivers/tty/serial/msm_serial.c:302:6: warning: symbol 'msm_set_mctrl' was
not declared. Should it be static?
drivers/tty/serial/msm_serial.c:597:17: warning: incorrect type in argument 2
(different address spaces)
drivers/tty/serial/msm_serial.c:597:17: expected void volatile [noderef] <asn:2>*addr
drivers/tty/serial/msm_serial.c:597:17: got unsigned int *
drivers/tty/serial/msm_serial.c:608:33: warning: incorrect type in argument 1
(different address spaces)
drivers/tty/serial/msm_serial.c:608:33: expected void volatile [noderef] <asn:2>*addr
drivers/tty/serial/msm_serial.c:608:33: got unsigned int *gsbi_base
drivers/tty/serial/msm_serial.c:648:37: warning: incorrect type in assignment
(different address spaces)
drivers/tty/serial/msm_serial.c:648:37: expected unsigned int *gsbi_base
drivers/tty/serial/msm_serial.c:648:37: got void [noderef] <asn:2>*

Mark the ioremapped memory as __iomem and use writel instead of
iowrite because we're not dealing with PCI devices. Also, mark
msm_set_mctrl() static because it isn't used outside this file.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:13:29 -07:00
Stephen Boyd 4a5662d6a6 msm_serial: Fix NUL byte output on UARTDM
UARTDM serial devices require us to wait for the entire TX fifo
to drain before we can change the contents of the NCF_TX
register. Furthermore, if we write any characters to the TX fifo
within the same clock cycle of changing the NCF_TX register the
NCF_TX register won't latch properly.

To fix these issues we should read back the NCF_TX register to
delay any TX fifo accesses by a clock cycle and we should wait
for the TX fifo to drain (instead of just waiting for the fifo to
be ready to receive more characters). Failure to do so leads to
random NUL bytes interspersed in the output.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:13:29 -07:00
Ian Abbott 57c1f0e934 serial: 8250_pci: use local device ID for ADDI-DATA APCI-7800
The quirks and PCI ID table entries for the original ADDI-DATA APCI-7800
(not the newer APCI-7800-3) use PCI_DEVICE_ID_ADDIDATA_APCI7800 from
<linux/pci_ids.h> but the device ID was actually assigned to ADDI-DATA
by Applied Micro Circuits Corporation (PCI_VENDOR_ID_AMCC).  Replace it
locally with #define PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:10:53 -07:00
Ian Abbott 086231f7f8 serial: 8250_pci: replace PCI_VENDOR_ID_ADDIDATA_OLD
PCI_VENDOR_ID_ADDIDATA_OLD has the same value (0x10e8) as
PCI_VENDOR_ID_AMCC in <linux/pci_ids.h>.  The vender ID is actually
assigned to Applied Micro Circuits Corporation.  The 8250_pci driver
uses PCI_VENDOR_ID_ADDIDATA_OLD in the lists of quirks and PCI IDs for
the ADDI-DATA APCI-7800 card.  Change it to use the more accurate
PCI_VENDOR_ID_AMCC.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:10:53 -07:00
Ian Abbott 12197de2cd pci_ids.h: move PCI_VENDOR_ID_AMCC here
PCI_VENDOR_ID_AMCC is defined locally in
"drivers/staging/comedi/comedidev.h" for a few comedi hardware drivers,
namely "adl_pci9118", "addi_apci_1500" and "addi_apci_3120" (also
"addi_apci_1710" but that is not currently built and will probably be
removed soon).  Move the define into "include/linux/pci_ids.h" as it is
shared by several drivers (albeit all comedi drivers currently).

PCI_VENDOR_ID_AMCC happens to have the same value (0x10e8) as
PCI_VENDOR_ID_ADDIDATA_OLD.  The vendor ID is actually assigned to
Applied Micro Circuits Corporation and Addi-Data were using device IDs
assigned by AMCC on some of their earlier PCI boards. The
PCI_VENDOR_ID_ADDIDATA_OLD define is still being used by the "8250_pci"
PCI serial board driver.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:10:53 -07:00
Srinivas Kandagatla c4b0585607 serial:st-asc: Add ST ASC driver.
This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP is common
across all the ST parts for settop box platforms.

ASC is embedded in ST COMMS IP block. It supports Rx & Tx functionality.
It support all industry standard baud rates.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
CC: Stephen Gallimore <stephen.gallimore@st.com>
CC: Stuart Menefy <stuart.menefy@st.com>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:08:02 -07:00
Uwe Kleine-König 75e66aa65e serial/efm32-uart: make of_device_id array const
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:06:15 -07:00
Uwe Kleine-König 2f2a0c70ce serial/efm32-uart: use COMPILE_TEST symbol to extend compile test coverage
The driver fails to build on x86 because writel_relaxed isn't available
there. That function exists on arm, arm64, avr32, hexagon, mips and sh,
but adding all these is overkill so stick to arm only.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:06:15 -07:00
Wei Yongjun 195be84aaa msm_serial: add missing iounmap() on error in msm_request_port()
Add the missing iounmap() before return from msm_request_port()
in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:04:50 -07:00
Axel Lin 37e1ceb179 serial: bfin_uart: Remove redundant testing for ifdef CONFIG_SERIAL_BFIN_MODULE
No idea why we have redundant testing for ifdef CONFIG_SERIAL_BFIN_MODULE,
check it once is enough.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:04:50 -07:00
Darren Hart 4e3234897f pch_uart: Use DMI interface for board detection
Use the DMI interface rather than manually matching DMI strings.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Michael Brunner <mibru@gmx.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:04:50 -07:00
Kees Cook 7d12b9769f serial: report base_baud after initialization
Some serial ports will not use the standard base baud rate. Report
this after initialization so it might be discovered and used for early
console configuration.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:03:05 -07:00
Grygorii Strashko 3026d14a98 serial: omap: enable PM runtime only when its fully configured
If earlyprintk is enabled and current UART is console port the platform
code can mark it as RPM_ACTIVE to sync real IP state with PM Runtime and
avoid resuming of already active device, but now, driver initialization
will be performed in the wrong way:

	pm_runtime_enable(&pdev->dev);
    <-- PM runtime alowed (device state RPM_ACTIVE)
	if (omap_up_info->autosuspend_timeout == 0)
		omap_up_info->autosuspend_timeout = -1;
	device_init_wakeup(up->dev, true);
	pm_runtime_use_autosuspend(&pdev->dev);
	<-- update_autosuspend() will be called and it will disable device
        (device state RPM_SUSPENDED)
	pm_runtime_set_autosuspend_delay(&pdev->dev,
			omap_up_info->autosuspend_timeout);
	<-- update_autosuspend() will be called which will re-enable device
        (device state RPM_ACTIVE), because autosuspend_timeout < 0

	pm_runtime_irq_safe(&pdev->dev);
	pm_runtime_get_sync(&pdev->dev);
	<-- will do nothing

Such behavior isn't expected by OMAP serial drivers and causes
unpredictable calls of serial_omap_runtime_suspend() and
serial_omap_runtime_resume().

Hence, fix it by allowing PM runtime only after all its parameters are
configured.

CC: Tony Lindgren <tony@atomide.com>
CC: Rajendra Nayak <rnayak@ti.com>
CC: Felipe Balbi <balbi@ti.com>
CC: Kevin Hilman <khilman@linaro.org>
Tested-by: Mark Jackson <mpfj-list@newflow.co.uk>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:01:20 -07:00
Axel Lin 39c34b09f2 serial: fsl_lpuart: Return proper error on lpuart_serial_init error path
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:01:20 -07:00
Shawn Guo bc764b8fdb serial: fsl_lpuart: restore UARTCR2 after watermark setup is done
Function lpuart_setup_watermark() clears some bits in register UARTCR2
before writing FIFO configuration registers as required by hardware.
But it should restore UARTCR2 after that.  Otherwise, we end up changing
UARTCR2 register when setting up watermark, and that is not really
desirable.  At least, when low-level debug and earlyprint is enabled,
serial console is broken due to it.

Fix the problem by restoring UARTCR2 register at the end of function
lpuart_setup_watermark().

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 16:01:20 -07:00
Ruchika Kharwar 908fd7e566 serial: omap: Fix IRQ handling return value
Ensure the Interrupt handling routine return IRQ_HANDLED vs
IRQ_NONE.

Signed-off-by: Ruchika Kharwar <ruchika@ti.com>
Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 15:55:44 -07:00
Vikram Pandita a0a490f9df serial: omap: Initialize platform_data
Otherwise serial driver would crash accessing platform_data that was
not initialized in functions like:

        serial_omap_pm(...)
        ...
        if (!state && pdata->enable_wakeup)
                   ^^^^^^^
        ...

Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 15:55:44 -07:00
Ruchika Kharwar 76bac1987c OMAP: UART: Fix the revision register read.
The revision register is a 32 bit register. The serial_in() function reads
only the lower 16 bits of the register. This leads to an incorrect computation
of the Module revision.

Signed-off-by: Ruchika Kharwar <ruchika@ti.com>
[oleksandr.savchenko@ti.com: add some whitespaces]
Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 15:55:44 -07:00
Dmitry Fink c441508421 OMAP: UART: Keep the TX fifo full when possible
Current logic results in interrupt storm since the fifo
is constantly below the threshold level. Change the logic
to fill all the available spaces in the fifo as long as
we have data to minimize the possibilty of underflow and
elimiate excessive interrupts.

Signed-off-by: Dmitry Fink <finik@ti.com>
Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 15:55:44 -07:00
Govindraj.R f64ffda60e OMAP2+: UART: enable tx wakeup bit for wer reg
wer has TX wakeup bit available enable the same
by populating the necessary tx wakeup flag for the
applicable module ip blocks and use the same
while configuaring wer reg.

Also wer is not context restored, restore wer when
context is lost.

Cc: Paul Walmsley <paul@pwsan.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Kevin Hilman <kevin.hilman@linaro.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(for drivers/tty changes)
Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 15:53:34 -07:00
Stefan Seyfried 972ce08578 8250_pci: improve code comments and Kconfig help
The recent regression about NetMos 9835 Multi-I/O boards indicates
that comment pointing to the parport_serial driver could be helpful.

Signed-off-by: Stefan Seyfried <seife+kernel@b1-systems.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 15:53:34 -07:00
Alexander Shiyan 003236d9ac serial: max310x: Add MAX14830 support
This patch adds support for MAX14830 (advanced quad universal asynchronous
receiver-transmitter) into max310x driver.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 15:53:27 -07:00