Commit graph

388404 commits

Author SHA1 Message Date
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 5ae90d8e46 Linux 3.11-rc3 2013-07-28 20:53:33 -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 6803f37e09 Oleg is working on fixing a very tight race between opening a event file
and deleting that event at the same time (both must be done as root).
 
 I also found a bug while testing Oleg's patches which has to do with
 a race with kprobes using the function tracer.
 
 There's also a deadlock fix that was introduced with the previous fixes.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQEcBAABAgAGBQJR8nMiAAoJEOdOSU1xswtMXMMH/jNuG1vDcTjo7WXu3kYHJNWc
 u1Z3YPXunFozz4DofzXPCuSkSgRqSR4cVeGOAv3oEfwQv07jJdTAor8/FuVTNXW9
 yiGMUvth0nLVZQEmsh3VvVztqFy8FxhpnQHhIa6pillPUdROKgE/A7/q4wT37lxT
 qniM1QJTK9fIf2t6suMwSsBD7fepiDkdHwVbs5NvN7qj62/QSPN+pHLAOBl90AGp
 r5eUSj8cDHxmzlV+GAJxeqI7KH+P2PGts9USI+s5EX8mODci620jz1HkKab6XRpz
 ggYdNzJ21z1fO9vfnpGCF0d03sKdnbJoIQjkyD4AJHlojmLe3s6l/nxS6jg3wH8=
 =VrR4
 -----END PGP SIGNATURE-----

Merge tag 'trace-fixes-3.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt:
 "Oleg is working on fixing a very tight race between opening a event
  file and deleting that event at the same time (both must be done as
  root).

  I also found a bug while testing Oleg's patches which has to do with a
  race with kprobes using the function tracer.

  There's also a deadlock fix that was introduced with the previous
  fixes"

* tag 'trace-fixes-3.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  tracing: Remove locking trace_types_lock from tracing_reset_all_online_cpus()
  ftrace: Add check for NULL regs if ops has SAVE_REGS set
  tracing: Kill trace_cpu struct/members
  tracing: Change tracing_fops/snapshot_fops to rely on tracing_get_cpu()
  tracing: Change tracing_entries_fops to rely on tracing_get_cpu()
  tracing: Change tracing_stats_fops to rely on tracing_get_cpu()
  tracing: Change tracing_buffers_fops to rely on tracing_get_cpu()
  tracing: Change tracing_pipe_fops() to rely on tracing_get_cpu()
  tracing: Introduce trace_create_cpu_file() and tracing_get_cpu()
2013-07-28 18:10:39 -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 fee8bf4b74 pci_ids.h: remove PCI_VENDOR_ID_ADDIDATA_OLD and PCI_DEVICE_ID_ADDIDATA_APCI7800
These two defines are no longer used.  They were only used by the PCI
serial driver "8250_pci" to support the original ADDI-DATA APCI-7800
card.  In that driver, PCI_VENDOR_ID_ADDIDATA_OLD has been replaced with
PCI_VENDOR_ID_AMCC which has the same value (0x10e8), and
PCI_DEVICE_ID_ADDIDATA_APCI7800 has been replaced with a local #define
PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800 with the same value (0x818e).

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
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
Alexander Shiyan 21fc509f11 serial: max310x: Add MAX3109 support
This patch adds support for MAX3109 (advanced dual 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
Alexander Shiyan 10d8b34a42 serial: max310x: Driver rework
This patch rework max310x driver.
Major changes have been made:
- Prepare driver to support ICs with more than one UART.
- Prepare driver to support work with I2C-bus.
The patch changes almost every function and can not be divided into parts.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 15:53:04 -07:00
Huang Shijie b4cdc8f61b serial: imx: add DMA support for imx6q
We only enable the DMA support when the following are meet:

  [1] The uart port supports the hardware flow control(CTS/RTS).
      (Some uart port does not support the CTS/RTS.)

  [2] The application enables the CTS/RTS.

  [3] The Soc is imx6q.
      For the sdma's firmware limit, we do not support the DMA except
      the imx6q platform.

  [4] The uart is not used as a console.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 15:44:11 -07:00
Hubert Feurstein 09bd00f6e9 serial/imx: fix custom-baudrate handling
It was not possible to set custom-baudrates like 62500.

Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 15:43:37 -07:00
Huang Shijie a496e6284c serial: imx: distinguish the imx6q uart from the others
We will add the DMA support for the imx uart. For the firmware's limit,
only the imx6 serial chips (including the imx6q, imx6dl, imx6sl) can
support the DMA.

This patch adds the necessary macro and helper to distinguish the
imx6q uart from the other imx uart. Other chips can use the "fsl,imx6q-uart"
to enable the DMA support.

This patch also replaces the check "is_imx21_uart()" with "!is_imx1_uart()".

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 15:43:16 -07:00
Huang Shijie 1cf93e0d54 serial: imx: remove the uart_console() check
The uart_console() check makes the clocks(clk_per and clk_ipg) opened
even when we close the console uart.

This patch enable/disable the clocks in imx_console_write(),
so we can keep the clocks closed when the console uart is closed.

Also remove the clock enable/disable oprations in the probe, we do not
need them any more.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 15:42:46 -07:00
Jingoo Han 43b829b3c1 serial: remove unnecessary platform_set_drvdata()
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d06310
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Barry Song <baohua.song@csr.com>
Acked-by: Tony Prisk <linux@prisktech.co.nz>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 15:39:36 -07:00
Linus Torvalds 6c504ecf50 Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie:
 "This is just a regular fixes pull apart from the qxl one, it has
  radeon and intel bits in it,

  The intel fixes are for a regression with the RC6 fix and a 3.10 hdmi
  regression, whereas radeon is more DPM fixes, a few lockup fixes and
  some rn50/r100 DAC fixes"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/radeon/dpm: fix r600_enable_sclk_control()
  drm/radeon/dpm: implement force performance levels for rv6xx
  drm/radeon/dpm: fix displaygap programming on rv6xx
  drm/radeon/dpm: fix a typo in the rv6xx mclk setup
  drm/i915: initialize gt_lock early with other spin locks
  drm/i915: fix hdmi portclock limits
  drm/radeon: fix combios tables on older cards
  drm/radeon: improve dac adjust heuristics for legacy pdac
  drm/radeon: Another card with wrong primary dac adj
  drm/radeon: fix endian issues with DP handling (v3)
  drm/radeon/vm: only align the pt base to 32k
  drm/radeon: wait for 3D idle before using CP DMA
2013-07-26 14:40:10 -07:00
Linus Torvalds 2408c2e529 Merge branch 'qxl-fixes' of git://people.freedesktop.org/~airlied/linux
Pull qxl drm fixes from Dave Airlie:
 "Okay as I warned, the qxl driver was running a bit free and loose with
  its ttm object reservations and the new lockdep enabled reservation
  tracking shone a bright light into it, it also with the new
  reservations mutexes hits a possible deadlock during boot.

  The first patch is a real fix to render the console correctly as the
  driver used to just drop irq renderering as too hard, this also fixes
  a sleeping while atomic warning.

  The other two patches are the big ugly ones that redo how the driver
  allocates objects and reserves them and makes things all work
  properly, I've tested this in a VM, and compared to the current code
  which hits a lockdep warning and the sleep while atomic warning before
  failing.

  So sorry this is coming in late, I should have tested qxl before
  merging the mutex code, but I'd rather just fix qxl with this than
  revert the reservations code at this point"

* 'qxl-fixes' of git://people.freedesktop.org/~airlied/linux:
  qxl: convert qxl driver to proper use for reservations
  qxl: allow creation of pre-pinned objects and use for releases.
  drm/qxl: add delayed fb operations
2013-07-26 14:38:50 -07:00