1
0
Fork 0
Commit Graph

2548 Commits (c8d1f02245a3cf36d0817deba88caf13de498a43)

Author SHA1 Message Date
Ricardo Ribalda Delgado 1eacbfb06d serial/uartlite: Let it build on any arch with IOMEM
Being a soft core, it can be located not only on PPC or Microblaze
platforms.

Since the driver already does endianness detection we only need to
change the Kconfig to use it in other arches.

This is also done in other softcores as xilinx-spi.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 17:37:53 -07:00
Maxime Coquelin 6b596a8341 serial: stm32-usart: Fix SysRq support
SysRq support activation depends on CONFIG_SERIAL_STM32_USART_CONSOLE, but
this config flag does not exists.

This patch fix this by depending on the valid config flag, which is
SERIAL_STM32_CONSOLE.

Reported-by: Andreas Ruprecht <andreas.ruprecht@fau.de>
Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 17:37:53 -07:00
Bo Svangård dec273ecc1 sc16is7xx: fix FIFO address of secondary UART
Calls to regmap_raw_read/write needed register rewrite in a
similar way as function calls to regmap_read/write already had.
This enables reading/writing the serial datastream to the device.

Signed-off-by: Bo Svangård <bo.svangard@embeddedart.se>
Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Jon Ringle <jringle@gridpoint.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:32:32 -07:00
Jakub Kicinski 32aa6339d9 sc16is7xx: fix Kconfig dependencies
When I2C=m and SPI=y or-ing them will produce =y while
what we need is the lower bound, i.e. =m.  Fortunately
SPI is a boolean so we need to handle only one special
case.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:32:32 -07:00
Qipan Li 466e285b1f serial: sirf: let uart's receive start in right place
While UART work in DMA mode, function start_rx will request descriptor
from DMA engine, if there is no left descriptor UART, driver will give
err logs "DMA slave single fail".

currently start_rx is called in set_termios function, so everytime, port
setting will call start_rx once.

Now put start_rx in startup, it will be called once while open the port.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:32:04 -07:00
Qipan Li 1d26c9ff42 serial: sirf: workaround rx process to avoid possible data loss
when UART works in DMA mode and left bytes in rx fifo less than
a dma transfer unit, DMA engine can't transfer the bytes out
to rx DMA buffer. so it need a way to fetch them out and
flush them into tty buffer in time.

in the above case, we want UART switch from DMA mode to PIO mode and
fetch && flush bytes into tty layer buffer until rxfifo become empty,
after that done let UART switch from PIO mode back to DMA mode.
(record as method1)

method1 result in the next receive result wrong. for example in PIO part
of method1, we fetched && pushed X1...X3 bytes, when UART rxfifo newly
received Y1...Y4 bytes, UART trigger a DMA unit transfer, the DMA unit's
content is X1...X3Y1 and rxfifo fifo status is empty, so X1X2X3 pushed
twice by PIO way and DMA way also the bytes Y2Y3Y4 missed. add rxfifo
reset operation before UART switch back to DMA mode would resolve the
issue. ([method1 + do fifo reset] record as method2)

before the commit, UART driver use method2. but methd2 have a risk of
data loss, as if UART's shift register receive a complete byte and
transfer it into rxfifo before rxfifo reset operation the byte will
loss.

UART and USP have the similar bits CLEAR_RX_ADDR_EN(uart)/FRADDR_CLR_EN(usp),
When found UART controller changing I/O to DMA mode, UART controller
clears the two low bits of read point (rx_fifo_addr[1:0]).
when enable the bit + method1(record as method3), in above example
the DMA unit's content is X1...X3Y1 and there are Y2Y3Y4 in rxfifo by
experiment, we just push bytes in rx DMA buffer.

BTW, the workaround works only for UART receive DMA channel use SINGLE
DMA mode.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:32:04 -07:00
Axel Lin d8c2c0d892 serial: etraxfs-uart: Fix release etraxfs_uart_ports
In probe, we use dev_id as array index of etraxfs_uart_ports and store the
index in port->line. So etraxfs_uart_ports[port->line] should be released
when unload the module.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Niklas Cassel <nks@flawful.org>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:25:38 -07:00
Axel Lin e9bb4b5100 serial: etraxfs-uart: Convert to uart_console_device instead of open-coded
The implementation of cris_console_device() is exactly the same as
uart_console_device(), so let's switch to use uart_console_device().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Niklas Cassel <nks@flawful.org>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:24:12 -07:00
Peter Hurley 5bac4b3d25 serial: 8250_omap: Remove auto-IXON flow control
OMAP h/w-assisted IXON flow control is borked. The transmitter becomes
stuck if XON is never received; clearing the fifos or resetting the
rx flow control bits has no effect.

Remove auto-IXANY as well, since without auto-IXON, it has no purpose.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:24:12 -07:00
Sekhar Nori 27c93af7e7 serial: 8250_omap: workaround module disable errata on dra7x SoCs
Due to Advisory 21 as documented in AM437x errata document,
UART module cannot be disabled once DMA is used. The only
workaround is to softreset the module before disabling it.

DRA7x UARTs are compatible to AM437x UARTs in terms of
this errata and prescribed workaround.

Enable usage of workaround for this errata on DRA7x SoCs.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:24:11 -07:00
Sekhar Nori cdb929e445 serial: 8250_omap: workaround errata around idling UART after using DMA
AM335x, AM437x and DRA7x SoCs have an errata[1] due to which UART
cannot be idled after it has been used with DMA.

OMAP3 has a similar sounding errata which has been worked around
in a2fc36613a ("ARM: OMAP3: Use manual idle for UARTs
because of DMA errata"). But the workaround used there does not
apply to AM335x, AM437x SoCs.

After using DMA, the UART module on these SoCs must be soft reset
to go to idle.

This patch implements that errata workaround. It is expected that
UART will be used with DMA so no explicit check for DMA usage
has been added for errata applicability.

MDR1 register needs to be restored right after soft-reset because
"UART mode" must be set in that register for module wake-up on AM335x
to work. As a result, SCR register is now used to determine if
context was lost during sleep.

[1] See Advisory 21 in AM437x errata SPRZ408B, updated April 2015.
    http://www.ti.com/lit/er/sprz408b/sprz408b.pdf

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:24:11 -07:00
Sekhar Nori 4fcdff9bca serial: 8250_omap: introduce "ti,am3352-uart" compatible property
Use of of_machine_is_compatible() for handling AM335x specific
"DMA kick" quirk in 8250_omap driver makes it ugly to extend the
quirk for other platforms. Instead use a new compatible.

The new compatible will also make it easier to take care of
other quirks on AM335x and like SoCs.

In order to not break backward DTB compatibility for users of
8250_omap driver on AM335x based boards, existing use of
of_machine_is_compatible() has not been removed.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:24:11 -07:00
Sekhar Nori 6f03541f6b serial: 8250_omap: refactor mdr1 update
The silicon errata[1] workaround implemented in a follow-on
patch, "serial: 8250_omap: workaround errata on disabling
UART after using DMA", requires MDR1 register programming.

Extract MDR1 register update into helper function,
omap8250_update_mdr1() to help with that.

[1] Advisory 21 in http://www.ti.com/lit/er/sprz408b/sprz408b.pdf

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:24:11 -07:00
Sekhar Nori 727fd8ab79 serial: 8250_omap: fix kernel crash in suspend-to-ram
omap_device infrastructure has a suspend_noirq hook which
runtime suspends all devices late in the suspend cycle (see
_od_suspend_noirq() in arch/arm/mach-omap2/omap_device.c)

This leads to a NULL pointer exception in 8250_omap driver
since by the time omap8250_runtime_suspend() is called, 8250_dma
driver has already set rxchan to NULL via serial8250_release_dma().

Make an explicit check to see if rxchan is NULL in
runtime_{suspend|resume} hooks to fix this.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:24:11 -07:00
Ricardo Ribalda Delgado 29d58642f1 serial/8250_fintek: Support for any io address.
Fintek chip can be configured for io addresses different than the standard.

Query the chip for the configured addresses and try to match it with the
pnp address.

Reported-by: Peter Hong <peter_hong@fintek.com.tw>
Reviewed-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:14:42 -07:00
Ricardo Ribalda Delgado ce8c267e2e serial/8250_fintek: Support keys different than default
Chip can be configured to use entry key different than 0x77. Try all the
valid keys until one gives out the right chip id.

Reported-by: Peter Hong <peter_hong@fintek.com.tw>
Reviewed-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:14:42 -07:00
Ricardo Ribalda Delgado dae77f7579 serial/8250_fintek: Support for chip_ip 0x0501
There are some chips with the same interface but different chip ip.

Reported-by: Peter Hong <peter_hong@fintek.com.tw>
Reviewed-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:14:42 -07:00
Ricardo Ribalda Delgado 017bec38c0 serial/8250_fintek: Support for multiple base_ports
Fintek chip can be connected at address 0x4e and also 0x2e.
Add some logic to find out the address of the chip.

Reported-by: Peter Hong <peter_hong@fintek.com.tw>
Reviewed-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:14:42 -07:00
Ricardo Ribalda Delgado 92a5f11a1a serial/8250_fintek: Use private data structure
Save the port index and the line id in a private structure.

Reported-by: Peter Hong <peter_hong@fintek.com.tw>
Reviewed-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:14:42 -07:00
Krzysztof Kozlowski 97a60eac33 serial: amba-pl011: Fix devm_ioremap_resource return value check
Value returned by devm_ioremap_resource() was checked for non-NULL but
devm_ioremap_resource() returns IOMEM_ERR_PTR, not NULL. In case of
error this could lead to dereference of ERR_PTR.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Cc: <stable@vger.kernel.org>
Fixes: 3873e2d7f6 ("drivers: PL011: refactor pl011_probe()")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23 15:05:53 -07:00
Linus Torvalds d4113f2f17 ARM: SoC: late fixes and dependencies
This is a collection of a few late fixes and other misc. stuff that
 had dependencies on things being merged from other trees.
 
 Other than the fixes, the primary feature being added is the
 conversion of some OMAP drivers to the new generic wakeirq interface.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJVlXl/AAoJEFk3GJrT+8ZlDccQAJ5vxvImNvJmoqeCv+6Tkshm
 UOGtoTBWKu+1wVgvYvYWXbNL06NKtS1c/CP8CZE0V6XdLQ+EHd4RWsHyRLHi4xwS
 6qqtwVfqYwFLli++87NKqzizl01a0eImPiHl5Rwo9oFy0u81+lsivwWbCBk+Dh0n
 HtkmuKzWnKSYL3rgnApq1USL4dhbc6SbNYo0pwvZXNDTK57FrQN/2Z2Pl1FZS9RQ
 BQgnqDSdhvF5PD/fWJ5KHs2k2WDtjMMN2TgVMtMjMg2x5kSMAN6fBwi49wYgcwUz
 ndHtuHosX4BkPgDHvzIv7jRCYHeRaHOYxbPG+tzYXci4gXUUEn3i8jte91Hb3+ri
 tDcgAnod+R1SoBmSRdj/nqM7Y8Qw7Pnjo2tuKYfb1NFaX5KtjrjaaDx/09G7PD+U
 fw400HKPi4r2h11n96Y5MZUbLv9XgB9BAePmIdNLuQZabFc1DcsUOG9JbRsMArRT
 5g6Sk+Lar9FGH32fLk5sGEAroFs52YmGmLviHKiAsbBSOV751SN2AcA8NDXBuKI1
 L+hC41NslENztHTgLsmEt6YY4H/4+jW66du5GYc4ZkPd1scO2+esXDzPZ864vxo+
 rIIMnRNQHb2hGiNvImyzEt2NgelSk/xKQR5Dl6MNiKCmiyw2XHlR5UTkRRBZXDd+
 5T1KnOvKE2THuxWyWARH
 =bhUU
 -----END PGP SIGNATURE-----

Merge tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC late fixes and dependencies from Kevin Hilman:
 "This is a collection of a few late fixes and other misc stuff that had
  dependencies on things being merged from other trees.

  Other than the fixes, the primary feature being added is the
  conversion of some OMAP drivers to the new generic wakeirq interface"

* tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  ARM: multi_v7_defconfig: Enable BRCMNAND driver
  ARM: BCM: Do not select CONFIG_MTD_NAND_BRCMNAND
  ARM: at91/dt: update udc compatible strings
  ARM: at91/dt: trivial: fix USB udc compatible string
  arm64: dts: Add APM X-Gene standby GPIO controller DTS entries
  soc: qcom: spm: Fix idle on THUMB2 kernels
  ARM: dove: fix legacy dove IRQ numbers
  ARM: mvebu: fix suspend to RAM on big-endian configurations
  ARM: mvebu: adjust Armada XP DT spi muxing after pinctrl function rename
  serial: 8250_omap: Move wake-up interrupt to generic wakeirq
  serial: omap: Switch wake-up interrupt to generic wakeirq
  mmc: omap_hsmmc: Change wake-up interrupt to use generic wakeirq
2015-07-02 14:40:49 -07:00
Linus Torvalds 78c10e556e Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle:

 - Improvements to the tlb_dump code
 - KVM fixes
 - Add support for appended DTB
 - Minor improvements to the R12000 support
 - Minor improvements to the R12000 support
 - Various platform improvments for BCM47xx
 - The usual pile of minor cleanups
 - A number of BPF fixes and improvments
 - Some improvments to the support for R3000 and DECstations
 - Some improvments to the ATH79 platform support
 - A major patchset for the JZ4740 SOC adding support for the CI20 platform
 - Add support for the Pistachio SOC
 - Minor BMIPS/BCM63xx platform support improvments.
 - Avoid "SYNC 0" as memory barrier when unlocking spinlocks
 - Add support for the XWR-1750 board.
 - Paul's __cpuinit/__cpuinitdata cleanups.
 - New Malta CPU board support large memory so enable ZONE_DMA32.

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (131 commits)
  MIPS: spinlock: Adjust arch_spin_lock back-off time
  MIPS: asmmacro: Ensure 64-bit FP registers are used with MSA
  MIPS: BCM47xx: Simplify handling SPROM revisions
  MIPS: Cobalt Don't use module_init in non-modular MTD registration.
  MIPS: BCM47xx: Move NVRAM driver to the drivers/firmware/
  MIPS: use for_each_sg()
  MIPS: BCM47xx: Don't select BCMA_HOST_PCI
  MIPS: BCM47xx: Add helper variable for storing NVRAM length
  MIPS: IRQ/IP27: Move IRQ allocation API to platform code.
  MIPS: Replace smp_mb with release barrier function in unlocks.
  MIPS: i8259: DT support
  MIPS: Malta: Basic DT plumbing
  MIPS: include errno.h for ENODEV in mips-cm.h
  MIPS: Define GCR_GIC_STATUS register fields
  MIPS: BPF: Introduce BPF ASM helpers
  MIPS: BPF: Use BPF register names to describe the ABI
  MIPS: BPF: Move register definition to the BPF header
  MIPS: net: BPF: Replace RSIZE with SZREG
  MIPS: BPF: Free up some callee-saved registers
  MIPS: Xtalk: Update xwidget.h with known Xtalk device numbers
  ...
2015-06-27 12:44:34 -07:00
Linus Torvalds 8c7febe839 TTY/Serial driver patches for 4.2-rc1
Here's the tty and serial driver patches for 4.2-rc1.
 
 A number of individual driver updates, some code cleanups, and other
 minor things, full details in the shortlog.
 
 All have been in linux-next for a while with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlWNoSAACgkQMUfUDdst+ymxNQCguSEmkAYNDdLyYhdcOqSxJt9u
 U1gAoMThUDoomkx6CTDMU1wn53hxgMk9
 =eCUS
 -----END PGP SIGNATURE-----

Merge tag 'tty-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial driver updates from Greg KH:
 "Here's the tty and serial driver patches for 4.2-rc1.

  A number of individual driver updates, some code cleanups, and other
  minor things, full details in the shortlog.

  All have been in linux-next for a while with no reported issues"

* tag 'tty-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (152 commits)
  Doc: serial-rs485.txt: update RS485 driver interface
  Doc: tty.txt: remove mention of the BKL
  MAINTAINERS: tty: add serial docs directory
  serial: sprd: check for NULL after calling devm_clk_get
  serial: 8250_pci: Correct uartclk for xr17v35x expansion chips
  serial: 8250_pci: Add support for 12 port Exar boards
  serial: 8250_uniphier: add bindings document for UniPhier UART
  serial: core: cleanup in uart_get_baud_rate()
  serial: stm32-usart: Add STM32 USART Driver
  tty/serial: kill off set_irq_flags usage
  tty: move linux/gsmmux.h to uapi
  doc: dt: add documentation for nxp,lpc1850-uart
  serial: 8250: add LPC18xx/43xx UART driver
  serial: 8250_uniphier: add UniPhier serial driver
  serial: 8250_dw: support ACPI platforms with integrated DMA engine
  serial: of_serial: check the return value of clk_prepare_enable()
  serial: of_serial: use devm_clk_get() instead of clk_get()
  serial: earlycon: Add support for big-endian MMIO accesses
  serial: sirf: use hrtimer for data rx
  serial: sirf: correct the fifo empty_bit
  ...
2015-06-26 15:53:22 -07:00
Linus Torvalds 55a7d4b85c h8300 pull request for 4.2
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJVi5eKAAoJEEdC8EELKDmcZWoQANh4UC+JGcP3XJ+AWyJpX1Rg
 VQMmSAiF/QZr3ty9sbU/6v3pNK5B1s2etY7lWzzCsp7GMhYln83OjwJn8pkcAvRk
 4GoEio4Yp0RMTOYk1nvKEhUGnxLwpma+xX5ulZkSTaYhZl++eX8HUGmfHhpxMcK9
 Unz1Y7vRIRaNUIawZECijxVj9yvteczwdwjWBp7AH2HChZ3LWJGo2xikd1Jwizx8
 zPv+mdaHkV9gbORS53hvqVaXXjiZVmLKQEz6LlWHubuWysf98YcBzNAhSKpjQzqW
 cwjXyw3MNc5fPjliwUstN/9ImWFdRJgwmdQ0DJ1v6kWPbHMQ4lCxeasy02YJ7l0R
 TWUOTyTSGT7Hd8CRrryo7akQ3nt8g7fZAR6nVujexbjkSt9ZbBSplAikiSKRbjU2
 7jkolYSM1ADqEeBBwcDnG2O45Pv8PxKGa4/8MV2hkcvrkkJp2lW+KybY0qp19MWb
 Dw09QYzFb5u6sKqD6AsjJQ6GKxLxNn3yBKk16V1yF0kAvQRdIj0XPgtMnGUgdkAw
 QA1nRQM25CLyOtH9SVWogRLof8UTZUlPtUCxKRww2//pAVkKGHg/afnnkqN933Yc
 Kv7/Mz2es6Km+D4qkQetnXF/IOxWfVUvnQa23Oe7gmkg4KNNrGO6bo7iQXDjDrHa
 LuNfJZRG5DzDjbdcp2t3
 =fE8E
 -----END PGP SIGNATURE-----

Merge tag 'for-4.2' of git://git.sourceforge.jp/gitroot/uclinux-h8/linux

Pull Renesas H8/300 architecture re-introduction from Yoshinori Sato.

We dropped arch/h8300 two years ago as stale and old, this is a new and
more modern rewritten arch support for the same architecture.

* tag 'for-4.2' of git://git.sourceforge.jp/gitroot/uclinux-h8/linux: (27 commits)
  h8300: fix typo.
  h8300: Always build dtb
  h8300: Remove ARCH_WANT_IPC_PARSE_VERSION
  sh-sci: Get register size from platform device
  clk: h8300: fix error handling in h8s2678_pll_clk_setup()
  h8300: Symbol name fix
  h8300: devicetree source
  h8300: configs
  h8300: IRQ chip driver
  h8300: clocksource
  h8300: clock driver
  h8300: Build scripts
  h8300: library functions
  h8300: Memory management
  h8300: miscellaneous functions
  h8300: process helpers
  h8300: compressed image support
  h8300: Low level entry
  h8300: kernel startup
  h8300: Interrupt and exceptions
  ...
2015-06-25 13:07:24 -07:00
Linus Torvalds 10b4b096d0 This is the big bulk of GPIO changes queued for the v4.2
kernel series:
 
 - A big set of cleanups to the aged sysfs interface from
   Johan Hovold. To get these in, v4.1-rc3 was merged into
   the tree as the first patch in that series had to go
   into stable. This makes the locking much more fine-grained
   (get rid of the "big GPIO lock(s)" and store states in the
   GPIO descriptors.
 
 - Rename gpiod_[g|s]et_array() to gpiod_[g|s]et_array_value()
   to avoid confusions.
 
 - New drivers for:
   - NXP LPC18xx (currently LPC1850)
   - NetLogic XLP
   - Broadcom STB SoC's
   - Axis ETRAXFS
   - Zynq Ultrascale+ (subdriver)
 
 - ACPI:
   - Make it possible to retrieve GpioInt resources from
     a GPIO device using acpi_dev_gpio_irq_get()
   - Merge some dependent I2C changes exploiting this.
   - Support the ARM X-Gene GPIO standby driver.
 
 - Make it possible for the generic GPIO driver to read
   back the value set registers to reflect current
   status.
 
 - Loads of OMAP IRQ handling fixes.
 
 - Incremental improvements to Kona, max732x, OMAP, MXC, RCAR,
   PCA953x, STP-XWAY, PCF857x, Crystalcove, TB10x.
 
 - Janitorial (contification, checkpatch cleanups)
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJVh76DAAoJEEEQszewGV1zYFsP/AnyCHs4M67k5Eegxtiwoomc
 OTqkVtOcob9kfqMkbZ1dsjZe2ZYIDiyWeQ1xuV+dD9nx/iAu6inUxb0dXhxKXonr
 +7mQglg32+zWTepLOJosoftoIqOb06lsMfgjL+tJcY5Od7/rewpdEplfEcjmq1O0
 0OdaV2FCXIhHDt52iYHT4tYI1GCky9K4Au9NlPCbKAsGneb3fQahF9o3JpYXl1Oq
 YhIFzUEhM+Zi2IoRsloGdK/eGEHni59IDekhZDf4PnYgA4Dkx2/e1A2Q0h5oT+QI
 j2yfRbI9t1gA5UK7JR/rVJF+5+E8uZ06TZgTo8tU00U4ZvppNgHt8O4KZkJMFBce
 KZzD9rkVVGp0NIDVwmOWjnfwkVVcQzMg/Wf17oM+qdaPO4GHEXNaQaInk1zmwqZq
 tQiTk47zA4rrEaYq3YZjt4xQjl8+ExDlOzFjnfLYAm27gbIl6EFWbX2ON981MC8g
 Nap8MLZINbGTlyDHtuqUlnqN+oXoP8niFuuDixYR+pM1P1bgwIVF+VopRJBFJRJP
 IeR6VdsI9KS99Kg8ICf4ds6WdKAGU3Htj+26udgMhIlOWrkCbvvexIxq9oBkwIB1
 VZofnSZLqnlKvo9Z140atvJWkFti7mqhItVjohmZyvyImLtmQBMq3kSGurXEqWms
 /NGZ0txPd1lMHx5o6ZPK
 =vKYs
 -----END PGP SIGNATURE-----

Merge tag 'gpio-v4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull gpio updates from Linus Walleij:
 "This is the big bulk of GPIO changes queued for the v4.2 kernel
  series:

   - a big set of cleanups to the aged sysfs interface from Johan
     Hovold.  To get these in, v4.1-rc3 was merged into the tree as the
     first patch in that series had to go into stable.  This makes the
     locking much more fine-grained (get rid of the "big GPIO lock(s)"
     and store states in the GPIO descriptors.

   - rename gpiod_[g|s]et_array() to gpiod_[g|s]et_array_value() to
     avoid confusions.

   - New drivers for:
      * NXP LPC18xx (currently LPC1850)
      * NetLogic XLP
      * Broadcom STB SoC's
      * Axis ETRAXFS
      * Zynq Ultrascale+ (subdriver)

   - ACPI:
      * make it possible to retrieve GpioInt resources from a GPIO
        device using acpi_dev_gpio_irq_get()
      * merge some dependent I2C changes exploiting this.
      * support the ARM X-Gene GPIO standby driver.

   - make it possible for the generic GPIO driver to read back the value
     set registers to reflect current status.

   - loads of OMAP IRQ handling fixes.

   - incremental improvements to Kona, max732x, OMAP, MXC, RCAR,
     PCA953x, STP-XWAY, PCF857x, Crystalcove, TB10x.

   - janitorial (constification, checkpatch cleanups)"

* tag 'gpio-v4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (71 commits)
  gpio: Fix checkpatch.pl issues
  gpio: pcf857x: handle only enabled irqs
  gpio / ACPI: Return -EPROBE_DEFER if the gpiochip was not found
  GPIO / ACPI: export acpi_gpiochip_request(free)_interrupts for module use
  gpio: improve error reporting on own descriptors
  gpio: promote own request failure to pr_err()
  gpio: Added support to Zynq Ultrascale+ MPSoC
  gpio: add ETRAXFS GPIO driver
  fix documentation after renaming gpiod_set_array to gpiod_set_array_value
  gpio: Add GPIO support for Broadcom STB SoCs
  gpio: xgene: add ACPI support for APM X-Gene GPIO standby driver
  gpio: tb10x: Drop unneeded free_irq() call
  gpio: crystalcove: set IRQCHIP_SKIP_SET_WAKE for the irqchip
  gpio: stp-xway: Use the of_property_read_u32 helper
  gpio: pcf857x: Check for irq_set_irq_wake() failures
  gpio-stp-xway: Fix enabling the highest bit of the PHY LEDs
  gpio: Prevent an integer overflow in the pca953x driver
  gpio: omap: rework omap_gpio_irq_startup to handle current pin state properly
  gpio: omap: rework omap_gpio_request to touch only gpio specific registers
  gpio: omap: rework omap_x_irq_shutdown to touch only irqs specific registers
  ...
2015-06-23 13:34:02 -07:00
Yoshinori Sato e4d6f911a7 sh-sci: Get register size from platform device
There is much SCI of SoC having within,
and the register size is also different in everyone.
So get from platform device.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Acked-by: by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
2015-06-23 13:35:59 +09:00
Yoshinori Sato e1d0be6161 sh-sci: Add h8300 SCI
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
2015-06-23 13:35:48 +09:00
Paul Burton 0cf985f487 serial: 8250_ingenic: support for Ingenic SoC UARTs
Introduce a driver suitable for use with the UARTs present in
Ingenic SoCs such as the JZ4740 & JZ4780. These are described as being
ns16550 compatible but aren't quite - they require the setting of an
extra bit in the FCR register to enable the UART module. The serial_out
implementation is the same as that in arch/mips/jz4740/serial.c - which
will shortly be removed.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: linux-serial@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: linux-kernel@vger.kernel.org
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: John Crispin <blogic@openwrt.org>
Patchwork: https://patchwork.linux-mips.org/patch/10159/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2015-06-21 21:53:24 +02:00
Fernando Guzman Lugo ff0daa1c1a serial: sprd: check for NULL after calling devm_clk_get
In platforms which does not use CLK framework (HAVE_CLK not set), the
clk_* functions return NULL instead of an error. This patch handles that
scenario.

Signed-off-by: Fernando Guzman Lugo <fernando.guzman.lugo@intel.com>
Signed-off-by: Chunyan Zhang <chunyan.zhang@spreadtrum.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:39:50 -07:00
Soeren Grunewald 899f0c1c7d serial: 8250_pci: Correct uartclk for xr17v35x expansion chips
The internal clock of the master chip, which is usually 125MHz, is only half
(62.5MHz) for the slave chips. So we have to adjust the uartclk for all the
slave ports. Therefor we add a new function to determine if a slave chip is
present and update pci_xr17v35x_setup accordingly.

Signed-off-by: Soeren Grunewald <soeren.grunewald@desy.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:34:40 -07:00
Soeren Grunewald be32c0cf04 serial: 8250_pci: Add support for 12 port Exar boards
The Exar XR17V358 can also be combined with a XR17V354 chip to act as a
single 12 port chip. This works the same way as the combining two XR17V358
chips. But the reported device id then is 0x4358.

Signed-off-by: Soeren Grunewald <soeren.grunewald@desy.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:34:40 -07:00
Joakim Nordell f10a223321 serial: core: cleanup in uart_get_baud_rate()
Align with coding guidelines:
Replaced a chain of "else if" by a switch case.

Signed-off-by: Joakim Nordell <joakim.nordell@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:34:36 -07:00
Maxime Coquelin 48a6092fb4 serial: stm32-usart: Add STM32 USART Driver
This drivers adds support to the STM32 USART controller, which is a
standard serial driver.

Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Reviewed-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-10 17:34:26 -07:00
Tony Lindgren a3e362f18c serial: 8250_omap: Move wake-up interrupt to generic wakeirq
We can now use generic wakeirq handling and remove the custom handling
for the wake-up interrupts.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2015-06-09 23:35:00 -07:00
Tony Lindgren ee83bd3b64 serial: omap: Switch wake-up interrupt to generic wakeirq
We can now use generic wakeirq handling and remove the custom handling
for the wake-up interrupts.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2015-06-09 23:35:00 -07:00
Rob Herring 2a4462418a tty/serial: kill off set_irq_flags usage
set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also set IRQ_NOPROBE and this has been maintained although it is not
clear that is really needed. There appears to be a great deal of blind
copy and paste of this code.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Barry Song <baohua@kernel.org>
Cc: linux-serial@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-09 12:26:32 -07:00
Greg Kroah-Hartman 00fda1682e Merge 4.1-rc7 into tty-next
This fixes up a merge issue with the amba-pl011.c driver, and we want
the fixes in this branch as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 10:49:28 -07:00
Rojhalat Ibrahim 3fff99bc4e gpiolib: rename gpiod_set_array to gpiod_set_array_value
There have been concerns that the function names gpiod_set_array() and
gpiod_get_array() might be confusing to users. One might expect
gpiod_get_array() to return array values, while it is actually the array
counterpart of gpiod_get(). To be consistent with the single descriptor API
we could rename gpiod_set_array() to gpiod_set_array_value(). This makes
some function names a bit lengthy: gpiod_set_raw_array_value_cansleep().

Signed-off-by: Rojhalat Ibrahim <imr@rtschenk.de>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2015-06-01 15:10:09 +02:00
Sebastian Andrzej Siewior 9809889c70 serial: 8250_omap: provide complete custom startup & shutdown callbacks
The currently in-use port->startup and port->shutdown are "okay". The
startup part for instance does the tiny omap extra part and invokes
serial8250_do_startup() for the remaining pieces. The workflow in
serial8250_do_startup() is okay except for the part where UART_RX is
read without a check if there is something to read. I tried to
workaround it in commit 0aa525d118 ("tty: serial: 8250_core: read only
RX if there is something in the FIFO") but then reverted it later in
commit ca8bb4aefb ("serial: 8250: Revert "tty: serial: 8250_core: read
only RX if there is something in the FIFO"").

This is the second attempt to get it to work on older OMAPs without
breaking other chips this time
Peter Hurley suggested to pull in the few needed lines from
serial8250_do_startup() and drop everything else that is not required
including making it simpler like using just request_irq() instead the
chain handler like it is doing now.
So lets try that.

Fixes: ca8bb4aefb ("serial: 8250: Revert "tty: serial: 8250_core:
       read only RX if there is something in the FIFO"")
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 07:10:37 +09:00
Joachim Eastwood d2aef35a5c serial: 8250: add LPC18xx/43xx UART driver
Serial port driver for the 8250-based UART found on LPC18xx/43xx
devices. The UART is 16550A compatible with additional features
like RS485 support, synchronous mode, IrDA, and DMA.

For now only basic UART and RS485 operation is supported.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:56:33 +09:00
Masahiro Yamada 1a8d2903cb serial: 8250_uniphier: add UniPhier serial driver
Add the driver for on-chip UART used on UniPhier SoCs.

This hardware is similar to 8250, but the register mapping is
slightly different:
  - The offset to FCR, MCR is different.
  - The divisor latch access bit does not exist.  Instead, the
    divisor latch register is available at offset 9.

This driver overrides serial_{in,out}, dl_{read,write} callbacks,
but wants to borrow most of code from 8250_core.c.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:55:13 +09:00
Heikki Krogerus 0788c39b95 serial: 8250_dw: support ACPI platforms with integrated DMA engine
On many new Intel SoCs the UART has an integrated DMA engine
(iDMA). In order to use it a special filter function is needed.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:55:12 +09:00
Masahiro Yamada 6f0c3091e7 serial: of_serial: check the return value of clk_prepare_enable()
The function clk_prepare_enable() may fail, and in that case it
does not make sense to proceed.  Let's check its return code and
error out if it is a negative value.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:55:12 +09:00
Masahiro Yamada 3a63d22425 serial: of_serial: use devm_clk_get() instead of clk_get()
The probe method of this driver calls clk_get(), but clk_put() is
missing from the remove callback.

Using the managed clk function is easier than fixing other parts.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:55:12 +09:00
Noam Camus 6e63be3fee serial: earlycon: Add support for big-endian MMIO accesses
Support command line parameters of the form:
earlycon=<name>,io|mmio|mmio32|mmio32be,<addr>,<options>

This commit seem to be needed even after commit:
serial: 8250: Add support for big-endian MMIO accesses
c627f2ceb6

Signed-off-by: Noam Camus <noamc@ezchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:55:12 +09:00
Qipan Li 0f17e3b478 serial: sirf: use hrtimer for data rx
when the serial works as a bluetooth sink, due to audio realtime
requirement, the driver should have something similar with ALSA:
1. one big DMA buffer to easy the schedule jitter
2. split this big DMA buffer to multiple small periods, for each
period, we get a DMA interrupt, then push the data to userspace.
the small periods will easy the audio latency.

so ALSA generally uses a cyclic chained DMA.

but for sirfsoc, the dma hardware has the limitation: we have
only two loops in the cyclic mode, so we can only support two
small periods to switch. if we make the DMA buffer too big, we
get long latency, if we make the DMA buffer too little, we get
miss in scheduling for audio realtime.

so this patch moves to use a hrtimer to simulate the cyclic
DMA, then we can have a big buffer, and also have a timely
data push to users as the hrtimer can generate in small period
then actual HW interrupts.

with this patch, we also delete a lot of complex codes to handle
loop buffers, and RX timeout interrupt since the RX work can be
completely handled from hrtimer interrupt.

tests show using this way will make our bad audio streaming be-
come smooth.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:51:37 +09:00
Qipan Li 86459b0e40 serial: sirf: correct the fifo empty_bit
Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:51:37 +09:00
Qipan Li 326707ed88 serial: sirf: fix system hung on console log output
A corner case exists in the current driver. if an app opens the console
device, and before writing to console device, and there are huge kernel
ogs to print out, system will hang on
sirfsoc_uart_console_putchar:
while (rd_regl(port, ureg->sirfsoc_tx_fifo_status) &
	ufifo_st->ff_full(port->line))
	cpu_relax();
as in sirfsoc_uart_startup(), the driver assigns tx_fifo_op to 0 will stop
TX FIFO, this loop will be endless.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:51:37 +09:00
Masahiro Yamada ba02406e9b serial: 8250: remove return statements from void function
serial8250_set_mctrl() is a void type function.  Returning something
does not look nice.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:48:16 +09:00
Jakub Kicinski 478d1051a0 sc16is7xx: use kworker for RS-485 configuration
RS-485 configuration is also done under the spinlock
so no blocking I/O allowed.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:47:27 +09:00
Jakub Kicinski 059d581530 sc16is7xx: use kworker to update ier bits
.stop_rx/tx() are called in atomic context, we cannot use
blocking I/O. While at it correct the name of RX bit and
'*' placement in pointer declarations.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:47:27 +09:00
Jakub Kicinski a010408536 sc16is7xx: use kworker for md_proc
Convert md_proc into general async reconfiguration procedure.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:47:27 +09:00
Jakub Kicinski dbe5a40cba sc16is7xx: move RTS delay to workqueue
Instead of spinning under port->lock let's just sleep
inside the kthread.  It should be equivalent as TX cannot
proceed when thread is blocked.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:47:27 +09:00
Jakub Kicinski 9e6f4ca3e5 sc16is7xx: use kthread_worker for tx_work and irq
Convert workqueue usage to a real-time kworker.  The problem
with workqueues is that we cannot set real-time priorities on
our work and asynchronous reconfiguration can be blocked by
less important tasks.

We need kthread for the interrupt anyway and because we will
now be using single kthread for all TX-related operations we
can get rid of the port mutex.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:47:27 +09:00
Jakub Kicinski 4ae82e5d23 sc16is7xx: use LSR_TEMT_BIT in .tx_empty()
LSR_TEMT_BIT (LSR bit 6) provides us exactly the information
we need to determine if transmission is finished - FIFO level
and shift register empty.  We can save ourselves reading FIFO
level explicitly if we use this bit.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:47:27 +09:00
Jakub Kicinski 4117a60c8e sc16is7xx: add missing compatible strings
Without matching bus-specific strings driver will not be loaded
automatically.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:47:27 +09:00
Jakub Kicinski 5451bb29f7 sc16is7xx: remove RS-485 delay RTS handling
Users of RS-485 can request via ioctl that RTS signals should
be activated selected number of milliseconds before the actual
data transmission or delay reception certain number of milli-
seconds after the transmission is finished.  In sc16is7xx,
however, RTS signalling is handled by the hardware and driver
has no way of providing this feature.

We still try to provide .delay_rts_before_send by delaying
transmission but without actual effect on the RTS line.

Note: this change will make the driver return -EINVAL when the
      feature is requested (.delay_rts_after_send is set).

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:45:28 +09:00
Rama Kiran Kumar Indrakanti 2c837a8a8f sc16is7xx: spi interface is added
spi interface for sc16is7xx is added along with Kconfig flag
to enable spi or i2c, thus in a instance we can have either
spi or i2c or both, in sync to the hw.

Signed-off-by: Rama Kiran Kumar Indrakanti <indrakanti_ram@hotmail.com>
Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:45:27 +09:00
Graeme Gregory 3db9ab0b6d drivers: PL011: add ACPI probing for SBSA UART
Add the necessary driver boilerplate to let the driver be used when
the respective ACPI table is discovered by the ACPI subsystem.

[Andre: change table name, add MODULE_DEVICE_TABLE entry and improve
	commit message]

Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Naresh Bhat <nbhat@cavium.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:08:51 -07:00
Andre Przywara 0dd1e247fd drivers: PL011: add support for the ARM SBSA generic UART
The ARM Server Base System Architecture[1] document describes a
generic UART which is a subset of the PL011 UART.
It lacks DMA support, baud rate control and modem status line
control, among other things.
The idea is to move the UART initialization and setup into the
firmware (which does this job today already) and let the kernel just
use the UART for sending and receiving characters.

We use the recent refactoring to build a new struct uart_ops
variable which points to some new functions avoiding access to the
missing registers. We reuse as much existing PL011 code as possible.

In contrast to the PL011 the SBSA UART does not define any AMBA or
PrimeCell relations, so we go with a pretty generic probe function
which only uses platform device functions.
A DT binding is provided with this patch, ACPI support is added in a
separate one.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Naresh Bhat <nbhat@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:08:51 -07:00
Andre Przywara cefc2d1d66 drivers: PL011: allow to supply fixed option string
The SBSA UART has a fixed baud rate and flow control setting, which
cannot be changed or queried by software.
Add a vendor specific property to always return fixed values when
trying to read the console options.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Naresh Bhat <nbhat@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:08:51 -07:00
Andre Przywara 71eec4836b drivers: PL011: allow avoiding UART enabling/disabling
The SBSA UART should not be enabled or disabled (it is always on),
and consequently the spec lacks the UART_CR register.
Add a vendor specific property to skip disabling or enabling of the
UART. This will be used later by the SBSA UART support.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Naresh Bhat <nbhat@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:08:51 -07:00
Andre Przywara 9c4ef4b030 drivers: PL011: move cts_event workaround into separate function
To avoid lines with more than 80 characters and to make the
pl011_int() function more readable, move the workaround out into a
separate function.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Naresh Bhat <nbhat@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:08:51 -07:00
Andre Przywara 075167ed71 drivers: PL011: replace UART_MIS reading with _RIS & _IMSC
The PL011 register UART_MIS is actually a bitwise AND of the
UART_RIS and the UART_MISC register.
Since the SBSA UART does not include the _MIS register, use the
two separate registers to get the same behaviour. Since we are
inside the spinlock and we read the _IMSC register only once, there
should be no race issue.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Naresh Bhat <nbhat@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:08:51 -07:00
Andre Przywara 3873e2d7f6 drivers: PL011: refactor pl011_probe()
Currently the pl011_probe() function is relying on some AMBA IDs
and a device tree node to initialize the driver and a port.
Both features are not necessarily required for the driver:
- we lack AMBA IDs in the ARM SBSA generic UART and
- we lack a DT node in ACPI systems.
So lets refactor the function to ease later reuse.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Naresh Bhat <nbhat@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:08:51 -07:00
Andre Przywara ef5a935884 drivers: PL011: refactor pl011_set_termios()
Split the pl011_set_termios() function into smaller chunks to allow
easier reuse later when adding SBSA support.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Naresh Bhat <nbhat@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:08:51 -07:00
Andre Przywara 95166a3fd5 drivers: PL011: refactor pl011_shutdown()
Split the pl011_shutdown() function into smaller chunks to allow
easier reuse later when adding SBSA support.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Naresh Bhat <nbhat@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:08:50 -07:00
Andre Przywara 867b8e8e89 drivers: PL011: refactor pl011_startup()
Split the pl011_startup() function into smaller chunks to allow
easier reuse later when adding SBSA support.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Naresh Bhat <nbhat@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:08:50 -07:00
Andre Przywara 49bb3c862c drivers: PL011: avoid potential unregister_driver call
Although we care about not unregistering the driver if there are
still ports connected during the .remove callback, we do miss this
check in the pl011_probe function. So if the current port allocation
fails, but there are other ports already registered, we will kill
those.
So factor out the port removal into a separate function and use that
in the probe function, too.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Naresh Bhat <nbhat@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:08:50 -07:00
Arnd Bergmann 7798edeebc tty: serial/8250: remove console dependency for mediatek
If the mediatek serial port driver is built-in, but serial
console is disabled in Kconfig (e.g. when the serial driver
itself is a loadable module), we get this build error:

drivers/built-in.o: In function `early_mtk8250_setup':
undefined reference to `early_serial8250_setup'

To avoid that problem, this patch encloses the early_mtk8250_setup
function in #ifdef CONFIG_SERIAL_8250_CONSOLE, the same symbol
that guards the early_serial8250_setup function.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Eddie Huang <eddie.huang@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:06:09 -07:00
Arnd Bergmann 357d561519 serial: samsung: only use earlycon for console
A configuration that enables earlycon but not the core console
code causes a link error:

  drivers/built-in.o: In function `setup_earlycon':
  drivers/tty/serial/earlycon.c:70: undefined reference to `uart_parse_earlycon'

That error can be triggered by the newly added samsung earlycon support,
which is missing a 'select' statement.

As suggested by Peter Hurley, solves the problem by moving the
'select SERIAL_EARLYCON' statement to the samsung console driver
option, as it is done by all other console drivers.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: b94ba0328d ("serial: samsung: Add support for early console")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:06:08 -07:00
Uwe Kleine-König 445df7ff3f serial: mctrl-gpio: drop usages of IS_ERR_OR_NULL
The function mctrl_gpio_init returns failure if the assignment to any
member of the gpio array results in an error pointer.  So there is no
need to check for such error values in the other functions.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 13:06:08 -07:00
Sebastian Andrzej Siewior 9e91597f24 serial: 8250_omap: provide complete custom startup & shutdown callbacks
The currently in-use port->startup and port->shutdown are "okay". The
startup part for instance does the tiny omap extra part and invokes
serial8250_do_startup() for the remaining pieces. The workflow in
serial8250_do_startup() is okay except for the part where UART_RX is
read without a check if there is something to read. I tried to
workaround it in commit 0aa525d118 ("tty: serial: 8250_core: read only
RX if there is something in the FIFO") but then reverted it later in
commit ca8bb4aefb ("serial: 8250: Revert "tty: serial: 8250_core: read
only RX if there is something in the FIFO"").

This is the second attempt to get it to work on older OMAPs without
breaking other chips this time
Peter Hurley suggested to pull in the few needed lines from
serial8250_do_startup() and drop everything else that is not required
including making it simpler like using just request_irq() instead the
chain handler like it is doing now.
So lets try that.

Fixes: ca8bb4aefb ("serial: 8250: Revert "tty: serial: 8250_core:
       read only RX if there is something in the FIFO"")
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 12:54:55 -07:00
Jon Hunter 8f8e48f4d6 serial: tegra: Fix memory leak on DMA setup failure
If the call to dmaengine_slave_config() fails, then the DMA buffer will
not be freed/unmapped. Fix this by moving the code that stores the
address of the buffer in the tegra_uart_port structure to before the
call to dmaengine_slave_config().

Reported-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 12:53:44 -07:00
Qipan Li c35b49b716 serial: sirf: assign console default index if users not set a valid one
it seems this is a more typical behaviour from reviewing other console
drivers.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 12:50:41 -07:00
Qipan Li 7f60f2fe16 serial: sirf: add serial loopback function support
Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 12:50:41 -07:00
Qipan Li d9e8e976fa serial: sirf: add uart receive's some error counter and mark
add overrun error's flag mark and parity's counter, we can show the
statistic from procfs node.

BTW, let the indentation of stick bits configuration look better.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 12:50:41 -07:00
Qipan Li 36c0991089 serial: sirf: fix endless loop bug in uart receive tasklet
In special condition, when cpu schedule into rx_tmo_process_tl or
rx_dma_complete_tl and all the receive dma tasks have done, it will
go into endless loop because no dma task cookie status be changed.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 12:50:41 -07:00
Qipan Li eab192ae56 serial: sirf: fix the issue that HW flow control doesn't work for BT
>From HW spec, when rxfifo's data is less than AFC_RX_THD(RX threshhold), RTS
signal is active. otherwise, RTS signal is inactive.

Crrently the RX threshhold is set as zero, so RTS has no chance to be
active. This patch replaces the default 0 by a positive number.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 12:50:41 -07:00
Qipan Li c1b7ac6f4d serial: sirf: enable ATLAS7 USP serial support
differentiate difference port types by re-defining the status MARCO
or putting HW differences into private data of the related ports.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 12:50:41 -07:00
Nicolas Ferre 8687634b79 tty/serial: at91: RS485 mode: 0 is valid for delay_rts_after_send
In RS485 mode, we may want to set the delay_rts_after_send value to 0.
In the datasheet, the 0 value is said to "disable" the Transmitter Timeguard but
this is exactly the expected behavior if we want no delay...

Moreover, if the value was set to non-zero value by device-tree or earlier
ioctl command, it was impossible to change it back to zero.

Reported-by: Sami Pietikäinen <Sami.Pietikainen@wapice.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: stable@vger.kernel.org  # 3.2+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 12:49:16 -07:00
Philipp Zabel 392bceedb1 serial: imx: Fix DMA handling for IDLE condition aborts
The driver configures the IDLE condition to interrupt the SDMA engine.
Since the SDMA UART ROM script doesn't clear the IDLE bit itself, this
caused repeated 1-byte DMA transfers, regardless of available data in the
RX FIFO. Also, when returning due to the IDLE condition, the UART ROM
script already increased its counter, causing residue to be off by one.

This patch clears the IDLE condition to avoid repeated 1-byte DMA transfers
and decreases count by when the DMA transfer was aborted due to the IDLE
condition, fixing serial transfers using DMA on i.MX6Q.

Reported-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 12:43:29 -07:00
Dave Martin 43dd1f9a5b serial/amba-pl011: Unconditionally poll for FIFO space before each TX char
Commit 734745caeb serial/amba-pl011:
(Activate TX IRQ passively) introduces a race which causes the driver
sometimes to attempt to write a character to the TX FIFO when the FIFO
is already full.

The PL011 does not guarantee its behaviour when the FIFO is overfilled.
In practice, this can cause duplicate and/or dropped characters to be
output on the wire.  The problem is common enough to be readily
observable on the ARM Juno platform when the PL011 UART is used as
the console and DMA is not in use.

This patch fixes this problem by always polling for space before each
character is written to the FIFO.

This will be amended to a less brute-force approach in a later commit,
but this patch should help ensure correct behaviour for now.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24 12:43:29 -07:00
Dave Martin fa8cd0f61f serial/amba-pl011: Fix mismerge between v4.1-rc4 and tty-next
In commit 02730d3c05
(Merge 4.1-rc4 into tty-next), git mismerged some lines,
reintroducing a reference to the removed field
uart_amba_port.tx_irq_seen.  This causes a build failure.

This patch removes the mismerged lines, restoring the code to what
was in tty-next (which was the intention).

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-19 16:42:10 -07:00
Greg Kroah-Hartman 02730d3c05 Merge 4.1-rc4 into tty-next
This resolves some tty driver merge issues.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-18 14:08:58 -07:00
Stephen Boyd 360ee94b47 TTY: msm_smd_tty: Remove unused driver
This code is no longer used now that mach-msm has been removed.
Delete it.

Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:19:06 +02:00
Jon Hunter ad909b3f8b serial: tegra: Correct error handling on DMA setup
Function tegra_uart_dma_channel_allocate() does not check that
dma_map_single() mapped the DMA buffer correctly. Add a check for this
and appropriate error handling.

Furthermore, if dmaengine_slave_config() (called by
tegra_uart_dma_channel_allocate()) fails, then memory allocated/mapped
is not freed/unmapped. Therefore, call tegra_uart_dma_channel_free()
instead of just dma_release_channel() if  dmaengine_slave_config() fails.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:12:19 +02:00
Jon Hunter d92aca3a76 serial: tegra: Correct shutdown of UARTs
There are two issues in the shutdown path of the UARTs which are:
1. The function tegra_uart_shutdown() calls tegra_uart_flush_buffer()
   to stop DMA TX transfers. However, tegra_uart_flush_buffer() is
   called after the DMA channels have already been freed and so actually
   does nothing.
2. The function that frees the DMA channels
   (tegra_uart_dma_channel_free()), unmaps the dma buffer before
   freeing the DMA channel and does not ensure the DMA has been
   stopped.

Resolve this by fixing the code in tegra_uart_dma_channel_free() to
ensure the DMA is stopped, free the DMA channel and then unmap the DMA
buffer. Finally, remove the unnecessary call to tegra_uart_flush_buffer().

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:12:19 +02:00
Jon Hunter 49433c802c serial: tegra: Fix cookie used by TX channel
The DMA cookie for the RX channel is being used by the TX channel.
Therefore, fix driver to use the correct DMA cookie for the TX channel.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:12:19 +02:00
Jon Hunter 0b0c1bdf7a serial: tegra: Use unsigned types for RX and TX byte counts
The function tty_insert_flip_string() takes an argument "size" which is
of type size_t. This is an unsigned type. Update the count,
rx_bytes_requested and tx_bytes_requested in the tegra serial driver to
be unsigned integers so that an unsigned type is passed to
tty_insert_flip_string().

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:12:19 +02:00
Shardar Shariff Md 853a699739 serial: tegra: handle race condition on uart rx side
The tegra serial driver has two paths through which receive data is
copied up to the tty layer. These are:
1. DMA completion callback
2. UART RX interrupt

A UART RX interrupt occurs for either RX_TIMEOUT (data has been sitting
in the Rx FIFO for more than 4 character times without being read
because there is not enough data to reach the trigger level), End of
Receive Data event (receiver detects that data stops coming in for more
than 4 character times) or a receive error.

In the RX interrupt path, the following happens ...
- All RX DMA transfers are stopped
- Any data in the DMA buffer and RX FIFO are copied up to the tty layer.
- DMA is restarted/primed for the RX path

In the DMA completion callback, the DMA buffer is copied up to the tty
layer but there is no check to see if the RX interrupt could have
occurred between the DMA interrupt firing the the DMA callback running.
Hence, if a RX interrupt was to occur shortly after the DMA completion
interrupt, it is possible that the RX interrupt path has already copied
the DMA buffer before the DMA callback has been called. Therefore, when
the DMA callback is called, if the DMA is already in-progress, then this
indicates that the UART RX interrupt has already occurred and there is
nothing to do in the DMA callback. This race condition can cause
duplicated data to be received.

Signed-off-by: Shardar Shariff Md <smohammed@nvidia.com>
[jonathanh@nvidia.com: Moved async_tx_ack() call to after check to see
 if DMA has completed because if the DMA is in progress we do not need
 to ACK yet. Changed the print from dev_info to dev_debug. Updated
 changelog to add more commentary on the race condition based upon
 feedback from author.]
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:12:19 +02:00
Shardar Shariff Md db8e78474e serial: tegra: check the count and read if any from dma
It is only necessary to read data from the dma buffer when the count
value is non-zero and hence, tegra_uart_copy_rx_to_tty() so only be
called when this is the case.

Although, this was being tested for in two places, there is a third
place where this was not tested. However, instead of adding another
if-statement prior to calling tegra_uart_copy_rx_to_tty(), move the test
inside the function.

Signed-off-by: Shardar Shariff Md <smohammed@nvidia.com>
[jonathanh@nvidia.com: Re-worked patch to move the check for the count
 value inside the function tegra_uart_copy_rx_to_tty(). Updated
 changelog with more commentary.]
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:12:18 +02:00
Jon Hunter 11e71007a5 serial: tegra: Add delay after enabling FIFO mode
For all tegra devices (up to t210), there is a hardware issue that
requires software to wait for 3 UART clock periods after enabling
the TX fifo, otherwise data could be lost.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:12:18 +02:00
Jon Hunter 245c0278ab serial: tegra: Correct delay after TX flush
For all tegra devices (up to t210), there is a hardware issue that
requires software to wait for 32 UART clock periods for the flush
to propagate otherwise TX data could be post. Add a helper function
to wait for N UART clock periods and update delay following FIFO
flush to be 32 UART clock cycles.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:12:18 +02:00
Masahiro Yamada 7a7a7e6d9b serial: of_serial: do not set port.type twice
The port.type has already been set by of_platform_serial_setup()
called from a few lines above.
Setting it to the same value is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:10:08 +02:00
Masahiro Yamada 1ed7b84b28 serial: 8250: do not copy port.fifosize member twice
The port.fifosize member has already been copied at 8 lines above.
Maybe the compiler optimization can clean it away, but just in case.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:10:08 +02:00
Masahiro Yamada 54585ba036 serial: xuartps: add __init to earlycon write method
Early console functions are only used during the early boot stage.
This change just saves a small amount of memory footprint.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:10:08 +02:00
Jan Kiszka 59cfc45f17 serial: 8250: Do nothing if nr_uarts=0
When nr_uarts was set to 0 (via config or 8250_core.nr_uarts), we crash
early on x86 because serial8250_isa_init_ports dereferences base_ops
which remains NULL. In fact, there is nothing to do for all the callers
of serial8250_isa_init_ports if there are no uarts.

Based on suggestions by Peter Hurley.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:10:07 +02:00
Krzysztof Kozlowski 24ee4df122 serial: samsung: Constify platform_device_id
The platform_device_id is not modified by the driver and core uses it as
const.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:08:16 +02:00
Krzysztof Kozlowski 75781979f8 serial: samsung: Staticize local symbol
Staticize symbols not exported and not used outside of file.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:08:16 +02:00
Krzysztof Kozlowski 0cd4521fb6 serial: mxs: Constify platform_device_id
The platform_device_id is not modified by the driver and core uses it as
const.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:08:16 +02:00
Krzysztof Kozlowski 31ada04768 serial: imx: Constify platform_device_id
The platform_device_id is not modified by the driver and core uses it as
const.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:08:16 +02:00
Geert Uytterhoeven 99fb215eea serial: sh-sci: Remove obsolete comment about overrun detection
The code it refers to was removed in commit b545e4f406 ("serial:
sh-sci: Compute overrun_bit without using baud rate algo").

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:06:39 +02:00
Geert Uytterhoeven afd66db613 serial: sh-sci: Don't set SCLSR bits in the SCxSR error mask
error_mask is the union of all error indicating bits in the SCxSR
register, while overrun_mask may apply to a different register (SCLSR),
depending on the SCI variant.

Hence overrun_mask should only be ORed into error_mask if it applies to
the SCxSR register.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:06:39 +02:00
Geert Uytterhoeven 2e0842a154 serial: sh-sci: Use the correct register for overrun checks
The various SCI implementations use 3 different methods to signal
overrun errors:
  - Bit SCI_ORER in register SCxSR on SCI,
  - Bit SCIFA_ORER in register SCxSR on SCIFA and SCIFB, and SCIF on
    SH7705/SH7720/SH7721,
  - Bit SCLSR_ORER in (optional!) register SCLSR on (H)SCIF.

However:
  1. sci_handle_fifo_overrun()
       a. handles (H)SCIF and SCIFA/SCIFB only,
       b. treats SCIF on SH7705/SH7720/SH7721 incorrectly,
  2. sci_mpxed_interrupt()
       a. treats SCIF on SH7705/SH7720/SH7721 incorrectly,
       b. ignores that not all SCIFs have the SCLSR register, causing
	  "Invalid register access" WARN()ings.

To fix the above:
  1. Determine and store the correct register enum during
     initialization,
  2. Replace the duplicated buggy switch statements by using the stored
     register enum,
  3. Add the missing existence check to  sci_mpxed_interrupt().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:06:39 +02:00
Geert Uytterhoeven 75c249fd7c serial: sh-sci: Replace hardcoded overrun bit values
Add the missing overrun bit definition for (H)SCIF.
Replace overrun_bit by overrun_mask, so we can use the existing
defines instead of hardcoded values.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:06:39 +02:00
Geert Uytterhoeven 2922598cd9 serial: sh-sci: Replace hardcoded values in SCxSR_*_CLEAR macros
Add the missing overrun error bit in SCxSR on SCIFA/SCIFB and SCIF on
SH7705/SH7720/SH7721.
Document what the corresponding bit(s) on plain SCIF are used for.
Sort the components of SCIF_DEFAULT_ERROR_MASK by reverse definition
order.

Replace the hardcoded values in the SCxSR_*_CLEAR macros by proper
defines. Use bit masks (negations of sets of bits) to make it more
obvious which bits are being cleared.

Assembler output (on sh) was compared before and after this commit:
  - For the first branch of the big "#if defined(...) || ..." construct,
    the code has changed slightly, as 32-bit bitmasks can be loaded in a
    single instruction, unlike the old large 16-bit constants (the SCxSR
    register is 16 bit, so we don't care about the top 16 bits),
  - For the second branch, the generated code is identical.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:06:38 +02:00
Geert Uytterhoeven d94a0a3857 serial: sh-sci: Standardize on using the BIT() macro to define register bits
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:06:38 +02:00
Geert Uytterhoeven 31f90796c6 serial: sh-sci: Document remaining FIFO Control Register bits
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:06:38 +02:00
Geert Uytterhoeven c097abc33f serial: sh-sci: Add SCIFA/B SCPCR register definitions
Add the register definitions for the Serial Port Control and Data
Registers on SCIFA/SCIFB, which are needed for RTS/CTS pin control.

Extracted from patches by Magnus Damm <damm+renesas@opensource.se>.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:06:38 +02:00
Geert Uytterhoeven 76735e9d55 serial: sh-sci: Add (H)SCIF RTS/CTS pin data register bit definitions
Add the missing register bit definitions to set the RTS pin and read the
CTS pin on (H)SCIF.

Extracted from patches by Magnus Damm <damm+renesas@opensource.se>.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:06:38 +02:00
Geert Uytterhoeven c27ffc1080 serial: sh-sci: Move private definitions to private header file
Move private register definitions and enums from the public
<linux/serial_sci.h> header file to the driver private "sh-sci.h" header
file.

The common Serial Control Register definitions are left in the public
header file, as they're needed to fill in plat_sci_port.scscr on legacy
systems not using DT.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:06:38 +02:00
Greg Kroah-Hartman f2908f70c6 tty: mpsc.c: move assignment out of if () block
We should not be doing assignments within an if () block
so fix up the code to not do this.

change was created using Coccinelle.

CC: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:04:17 +02:00
Greg Kroah-Hartman 9a4115ba10 tty: ioc4_serial.c: move assignment out of if () block
We should not be doing assignments within an if () block
so fix up the code to not do this.

change was created using Coccinelle.

CC: Pat Gefre <pfg@sgi.com>
CC: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:04:17 +02:00
Greg Kroah-Hartman a8d087d3dc tty: ioc3_serial.c: move assignment out of if () block
We should not be doing assignments within an if () block
so fix up the code to not do this.

change was created using Coccinelle.

CC: Pat Gefre <pfg@sgi.com>
CC: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:04:17 +02:00
Greg Kroah-Hartman 01e51df546 tty: icom.c: move assignment out of if () block
We should not be doing assignments within an if () block
so fix up the code to not do this.

change was created using Coccinelle.

CC: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:04:17 +02:00
Greg Kroah-Hartman 9ff46047b6 tty: crisv10.c: move assignment out of if () block
We should not be doing assignments within an if () block
so fix up the code to not do this.

change was created using Coccinelle.

CC: Mikael Starvik <starvik@axis.com>
CC: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
2015-05-10 19:04:17 +02:00
Greg Kroah-Hartman ed334c0e3b tty: 68328serial.c: move assignment out of if () block
We should not be doing assignments within an if () block
so fix up the code to not do this.

change was created using Coccinelle.

CC: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:04:16 +02:00
Qipan Li cb4595a215 serial: sirf: use uart_port's fifosize for fifo related operation
In SiRF platform, there are different fifo size of uart and usp,
with the fifosize configuration changes in different chips, we
can not use port line to decide how to check FIFO full,empty and
level.

There is a direct mapping between FIFO HW register layout with
fifo size, so move to use fifosize as the input to check fifo
status.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:01:20 +02:00
Qipan Li a6ffe8966a serial: sirf: use dynamic method allocate uart structure
In different platform of SiRF SoCs, there is no same uart and usp-uart
numbers, it is not convenient to use hard-coded ports array and port
lines.

here we drop the hard-coded ports table , and drop "cell-index". then
move to use alias id to get line.

for example:
	aliases {
		serial0 = &uart0;
		serial1 = &uart1;
		serial2 = &uart2;
		serial3 = &uart3;
		serial4 = &uart4;
		serial5 = &uart5;
		serial6 = &uart6;
		serial9 = &usp2;
	};

at the same, enlarge the max port number according to the chip with the most
UART.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:01:20 +02:00
Eddie Huang 2c40b57dc8 tty: serial: 8250_mtk: Add earlycon
Add 8250 MTK UART driver to support earlycon device tree.
Earlycon take effect by
  add "earlycon" in kernel boot argument
  add "linux,sdtout-path" property in device tree file

Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:00:05 +02:00
Eddie Huang 1c5841e832 tty: serial: 8250: export early_serial8250_setup function
8250-like uart driver may call early_serial8250_setup to
reuse 8250_early.c character output function.

Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 19:00:05 +02:00
Dave Martin ec61847855 Revert "serial/amba-pl011: Leave the TX IRQ alone when the UART is not open"
This reverts commit f2ee6dfa0e.

Jakub Kiciński observed that this patch can cause the pl011
driver to hang if if the only process with a pl011 port open is
killed by a signal, pl011_shutdown() can get called with an
arbitrary amount of data still in the FIFO.

Calling _shutdown() with the TX FIFO non-empty is questionable
behaviour and my itself be a bug.

Since the affected patch was speculative anyway, and brings limited
benefit, the simplest course is to remove the assumption that TXIS
will always be left asserted after the port is shut down.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-09 18:36:36 +02:00
Semen Protsenko 66cf1d8473 serial: omap: Fix error handling in probe
There is pm_qos_add_request() being executed on serial_omap_probe(),
which stores "&up->pm_qos_request" from omap-serial driver to
"pm_qos_array[PM_QOS_CPU_DMA_LATENCY]->constraints". If
serial_omap_probe() fails after pm_qos_add_request() (e.g. on
uart_add_one_port() call), pm_qos_array still keeping pm_qos_request
struct from omap-serial driver, which is not valid anymore (since driver
failed). This leads further to kernel crash on pm_qos_update_target(),
executing from some completely different driver.

We were observing this while trying to run audio playback while having
one of omap-serial driver instances failed on uart_add_one_port() call:
    Unable to handle kernel paging request at virtual address fffffffc
    Backtrace:
    (plist_add) from (pm_qos_update_target)
    (pm_qos_update_target) from (pm_qos_add_request)
    (pm_qos_add_request) from (snd_pcm_hw_params)
    (snd_pcm_hw_params) from (snd_pcm_common_ioctl1)
    (snd_pcm_common_ioctl1) from (snd_pcm_playback_ioctl1)
    (snd_pcm_playback_ioctl1) from (snd_pcm_playback_ioctl)
    (snd_pcm_playback_ioctl) from (do_vfs_ioctl)
    (do_vfs_ioctl) from (SyS_ioctl)
    (SyS_ioctl) from (ret_fast_syscall)

This patch adds pm_qos_remove_request() on fail path in
serial_omap_probe() in order to fix this issue. While at it, free the
wakeup settings on fail path as well, just like it's done in
serial_omap_remove().

Signed-off-by: Semen Protsenko <semen.protsenko@globallogic.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 14:20:50 +02:00
Peter Hurley 66c53aaa9c earlycon: Revert log warnings
Log warnings meant to help diagnose problems setting up earlycon
are reporting false positives for 'console='. Revert to the
previous behavior which reported nothing.

Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Robert Schwebel <r.schwebel@pengutronix.de>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 14:20:50 +02:00
Sascha Hauer c1c325d703 tty: serial: 8250_mtk: Add support for bus clock
The mtk 8250 needs two clocks, one for providing the baudrate and
one that needs to be enabled for register accesses. The latter has
not been supported, this patch adds support for it. It is optional
for now since not all SoCs provide a bus clock.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:27:03 +02:00
Sascha Hauer 68e5fc4a25 tty: serial: 8250_mtk: use pm_runtime callbacks for enabling
The pm_runtime callbacks already enable and disable the device.
Use them in probe() and remove() instead of duplicating the
code. This allows us to concentrate more code for enabling/disabling
the UART in a single place.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:27:02 +02:00
Sascha Hauer a5fd844599 tty: serial: 8250_mtk: Use devm_clk_get
When a struct device * is present clk_get should be used rather
than of_clk_get. Use the devm variant of this function to be able to
drop the clk_put in the error and remove pathes. While at it fix
a wrong error message.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:27:02 +02:00
Sascha Hauer 59f89f21b5 tty: serial: 8250_mtk: remove unnecessary test
When the driver has probed successfully the clk pointer is always valid,
so no need to test for it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:27:02 +02:00
Firo Yang c547630f6b ARM: meson: serial: convert iounmap to devm_iounmap
The function meson_uart_release_port() inappropriately try to
iounmap() a resource managed by devm_ioremap_nocache().
The function meson_uart_release_port() maybe called by uart_ioctl()
that means meson_uart_release_port() is not called from within a
probe or remove function, for safety, I convert iounmap() to
devm_iounmap().

Signed-off-by: Firo Yang <firogm@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:27:02 +02:00
John Ogness eda0cd3546 tty: serial: 8250: omap: synchronize rx_running
The rx_running flag should show if DMA is currently active. However
there is a window between when the flag is set/cleared and when
the DMA is started/stopped. Because the flag is queried from both
hard and soft irq contexts, the driver can make incorrect
decisions and do things like start a DMA transfer using a buffer
that is already setup to be used for a DMA transfer.

This patch adds a spinlock to synchronize the rx_running flag and
close the above mentioned window.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:27:01 +02:00
Geert Uytterhoeven 35a0f950aa serial: SERIAL_IFX6X60 should depend on HAS_DMA
If NO_DMA=y:

    drivers/built-in.o: In function `ifx_spi_free_device':
    ifx6x60.c:(.text+0x96d9a): undefined reference to `dma_free_coherent'
    drivers/built-in.o: In function `ifx_spi_spi_probe':
    ifx6x60.c:(.text+0x978a2): undefined reference to `dma_alloc_coherent'

While DMA is optional in this driver, and is used only if
ifx_modem_platform_data.use_dma is set, there are currently no in-tree
users of ifx_modem_platform_data (and thus of this driver), so just make
it depend on HAS_DMA.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:27:01 +02:00
Geert Uytterhoeven cbbcd1f3b8 serial: ifx6x60: Remove superfluous casts when calling request_irq()
There's no need to cast the last parameter of {request,free}_irq() to
"void *", as any pointer type is accepted.

Remove the superfluous casts to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:27:01 +02:00
Geert Uytterhoeven 9a499db032 serial: ifx6x60: Remove dangerous spi_driver casts
Casting spi_driver pointers to "void *" when calling
spi_{,un}register_driver() bypasses all type checking.

Remove the superfluous casts to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:27:01 +02:00
Qipan Li adeede7319 serial: sirf: move from clk_get to devm_clk_get
Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:27:00 +02:00
Qipan Li 4b8038dca0 Revert "serial: sirf: add a new uart type support"
This reverts commit 52bec4ed4e("serial: sirf: add a new uart type
support").
we misunderstood the clock dependency in atlas7. Actually involved
several clocks are in a tree structure. we still only need to take
the leaf clock node for BT uarts.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Barry.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:27:00 +02:00
Valentin Rothberg 507224aa88 serial: 8250: remove Kconfig indirection
Remove CONFIG_SERIAL_DETECT_IRQ and CONFIG_SERIAL_MANY_PORTS, and
substitute all references to the proper 8250 Kconfig options.  Now, the
actual Kconfig dependencies are not hidden when reading the code and
static analyzers are less confused.

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:27:00 +02:00
Valentin Rothberg bbdfe620b9 drivers/tty/serial/mcf.c: fix typo on SERIAL_MCF_CONSOLE
Correct reference in C-comment after #endif.

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:59 +02:00
Valentin Rothberg 60d0da5168 serial: bfin: ctsrts: enfore Kconfig naming convention
The CONFIG_ prefix is reserved for Kconfig options in Make and CPP
syntax; static analysis tools rely on this convention.  This patch
enforces this behavior for SERIAL_BFIN_{HARD_}CTSRTS.

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Acked-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:59 +02:00
Valentin Rothberg 5b84c967cc drivers/tty/serial/mpc52xx_uart.c: fix typo in C comment
Fix reference on PPC_MPC52xx in C comment after #endif.

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:59 +02:00
Valentin Rothberg 47eb16f68b drivers/tty/serial/8250/8250_core.c: remove CONFIG_HUB6
This file local CPP identifier is not referenced anywhere else, so we
can safely remove it.

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:58 +02:00
Leilei Zhao d033e82db9 tty/serial: at91: handle IRQ status more safely
Handle the changed flag of IRQ status in interruption
instead of handling it in tasklet due to the tasklet
may be scheduled more than once in one interruption.
Otherwise, the changed status may be processed more
than once which will lead to unexpected result. And
seriously, kernel will crash.

Signed-off-by: Leilei Zhao <leilei.zhao@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:58 +02:00
Valentin Rothberg 74a76089d2 drivers/tty/serial/crisv10.c: rename CPP identifier CONFIG_ETRAX_SERX_DTR_RI_DSR_CD_MIXED
The 'CONFIG_' prefix is reserved for Kconfig options in Make and CPP
syntax only.  Remove this prefix from the self-defined CPP identifier to
apply to this convention and make static analysis tools happy.

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:58 +02:00
Valentin Rothberg f52e17e4a7 drivers/tty/serial/crisv10.c: remove dead #ifdef blocks
ETRAX_SERIAL_PROC_ENTRY is not defined in Kconfig.  The affected #ifdef
block has not been compiled for years, and the embedded macro, PROCSTAT,
ended up as a NOOP.  Hence, remove the block and all calls to PROCSTAT.

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:58 +02:00
Valentin Rothberg cc020ea404 drivers/tty/serial/crisv10.c: remove dead #ifdef blocks
ETRAX_RS485_{ON_PORT_G, LTC1387} are not defined in Kconfig.  The
affected #ifdef block have not been compiled for years, so remove them
entirely.

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:58 +02:00
Valentin Rothberg 5a56abc77f drivers/tty/serial/crisv10.c: remove dead #ifdef block
ETRAX_EXTERN_PB6CLK_ENABLED is not defined in Kconfig.  The affected
 #ifdef block has not been compiled for years, so remove it entirely.

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:58 +02:00
Valentin Rothberg 0656b1a9a5 drivers/tty/serial: altera: fix typos in #endif comments
Correct reference on CONFIG_SERIAL_ALTERA_{JTAG}UART_CONSOLE in
C-comment after #endif.

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Acked-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:58 +02:00
Valentin Rothberg bb5f633ab8 drivers/tty/serial/sh-sci.h: remove dead reference on ARCH_SH7372
The Kconfig option ARCH_SH7372 has been removed by commit 59b89af1d5
("ARM: shmobile: sh7372: Remove Legacy C SoC code").  This patch removes
the last reference on this Kconfig option.

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:57 +02:00
Joe Perches cbc7f6bd8f serial: kgdb_nmi: Use bool function return values of true/false not 1/0
Use the normal return values for bool functions

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:57 +02:00
Rasmus Villemoes 429b474990 tty: remove buf parameter from tty_name()
tty_name no longer uses the buf parameter, so remove it along with all
the 64 byte stack buffers that used to be passed in.

Mostly generated by the coccinelle script

@depends on patch@
identifier buf;
constant C;
expression tty;
@@
- char buf[C];
  <+...
- tty_name(tty, buf)
+ tty_name(tty)
  ...+>

allmodconfig compiles, so I'm fairly confident the stack buffers
weren't used for other purposes as well.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:57 +02:00
Fabio Estevam caec172d57 serial: imx: Remove return value from imx_setup_ufcr()
The return value from imx_setup_ufcr() is always 0 and its value is never
checked, so better to remove the return value.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:57 +02:00
Jiada Wang 5379418322 serial: imx: protect Soft Reset of port with lock
Previously Soft Reset (clear of SRST bit in UCR2 register)
of UART in startup is not protected by lock, which may have race
with console_write, as console_write may occur at anytime even
when UART port is shutdown.

To avoid this race, protect Soft reset of UART port with spin_lock.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:56 +02:00
Dave Martin 1e84d22322 serial/amba-pl011: Refactor and simplify TX FIFO handling
Commit 734745c serial/amba-pl011: Activate TX IRQ passively
adds some complexity and overhead in the form of a softirq
mechanism for transmitting in the absence of interrupts.

This patch simplifies the code flow to reduce the reliance on
subtle behaviour and avoid fragility under future maintenance.

To this end, the TX softirq mechanism is removed and instead
pl011_start_tx() will now simply stuff the FIFO until full
(guaranteeing future TX IRQs), or until there are no more chars
to write (in which case we don't care whether an IRQ happens).

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:56 +02:00
Dave Martin f28c1d0a78 Revert "serial/amba-pl011: Leave the TX IRQ alone when the UART is not open"
This reverts commit f2ee6dfa0e.

Jakub Kiciński observed that this patch can cause the pl011
driver to hang if if the only process with a pl011 port open is
killed by a signal, pl011_shutdown() can get called with an
arbitrary amount of data still in the FIFO.

Calling _shutdown() with the TX FIFO non-empty is questionable
behaviour and my itself be a bug.

Since the affected patch was speculative anyway, and brings limited
benefit, the simplest course is to remove the assumption that TXIS
will always be left asserted after the port is shut down.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 22:26:56 +02:00
Soeren Grunewald 96a5d18bc1 serial: 8250_pci: Add support for 16 port Exar boards
The Exar XR17V358 chip usually provides only 8 ports. But two chips can be
combined to act as a single 16 port chip. Therefor one chip is configured
as master the second as slave by connecting the mode pin to VCC (master)
or GND (slave).

Then the master chip is reporting a different device-id depending on
whether a slave is detected or not. The UARTs 8-15 are addressed from
0x2000-0x3fff. So the offset of 0x400 from UART to UART can be used to
address all 16 ports as before.

See: https://www.exar.com/common/content/document.ashx?id=1587 page 11

Signed-off-by: Soeren Grunewald <soeren.grunewald@desy.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-28 20:22:31 +02:00
Robert Baldyga 31c6ba97d1 serial: samsung: fix serial console break
This patch fixes problems with serial console break. When function
s3c64xx_serial_startup() was started while serial console has been working,
it caused lose of characters written to TX FIFO. This effect was particularly
observable with systemd, which closes serial port every time when it's
not currently needed, hence function s3c64xx_serial_startup() is called
quite often there. To fix this problem we avoid resetting TX FIFO if port is
used as serial console.

Example of broken console log:

[ 1086.7         Expecting device dev-ttySAC1.device...
[ 1086.[  OK  ] Reached target Paths.
[ 1086.756416] s[  OK  ] Reached target Swap.
[ 1086.776413] systemd[1]: Reached target Swap.
[ 1086.776642] systemd[1]: Starting Root Slice.
[    5.53403[  OK  ] Created slice Root Slice.
[    5.548433] systemd[1]: Create[  OK  ] Created slice User and Session Slice.
[    5.568414] sys[  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
[    5.588388] s[  OK  ] Listening on Delayed Shutdown Socket.
[    5.608376] sy[  OK  ] Listening on Journal Socket (/dev/log).
[    5.628361] [  OK  ] Listening on udev Kernel Socket.
[    5.648357] s[  OK  ] Listening on udev Control Socket.
[    5.668353] s[  OK  ] Listening on Journal Socket.
[    5.688366] systemd[1]: Listeni[  OK  ] Created slice System Slice.
[    5.708393]          Mounting Temporary Directory...
[ 7139.067436]          Starting prepare device daemon...
[ 7139.091726] sy         Starting Generate environment from /etc/profile.d...
[    5.792867] system         Starting Create Static Device Nodes in /dev...
[ 7848.718         Mounting Debug File System...
[ 7848.7384         Mounting Configuration File System...
[    5.852         Starting Apply Kernel Variables...
[    5.8720         Starting Setup Virtual Console...
[ 7848.798         Starting udev Coldplug all Devices...
[ 7848.817         Starting Journal Service...
[  OK  ] Started Journal Service.
[ 7848.854222] s[  OK  ] Reached target Slices.
         Starting Remount Root and Kernel File Systems...
[  OK  ] Mounted Configuration File System.

Reported-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-28 14:27:38 +02:00
Ludovic Desroches a8d4e01637 tty/serial: at91: maxburst was missing for dma transfers
Maxburst was not set when doing the dma slave configuration. This value
is checked by the recently introduced xdmac. It causes an error when
doing the slave configuration and so prevents from using dma.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Cc: <stable@vger.kernel.org> # 3.12 and later
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-28 14:27:38 +02:00
Michal Simek 6befa9d883 serial: of-serial: Remove device_type = "serial" registration
Do not probe all serial drivers by of_serial.c which are using
device_type = "serial"; property. Only drivers which have valid
compatible strings listed in the driver should be probed.

When PORT_UNKNOWN is setup probe will fail anyway.

Arnd quotation about driver historical background:
"when I wrote that driver initially, the idea was that it would
get used as a stub to hook up all other serial drivers but after
that, the common code learned to create platform devices from DT"

This patch fix the problem with on the system with xilinx_uartps and
16550a where of_serial failed to register for xilinx_uartps and because
of irq_dispose_mapping() removed irq_desc. Then when xilinx_uartps was asking
for irq with request_irq() EINVAL is returned.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
CC: <stable@vger.kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-28 14:27:38 +02:00
Michal Simek 5c90c07b98 serial: xilinx: Use platform_get_irq to get irq description structure
For systems with CONFIG_SERIAL_OF_PLATFORM=y and device_type =
"serial"; property in DT of_serial.c driver maps and unmaps IRQ (because
driver probe fails). Then a driver is called but irq mapping is not
created that's why driver is failing again in again on request_irq().
Based on this use platform_get_irq() instead of platform_get_resource()
which is doing irq_desc allocation and driver itself can request IRQ.

Fix both xilinx serial drivers in the tree.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-28 14:26:21 +02:00
Peter Hurley 10afbe346b serial: core: Fix kernel-doc build warnings
Fix uart_console_write() kernel-doc build warnings.

Warning(drivers/tty/serial/serial_core.c:1778): No description found for parameter 'putchar'
Warning(drivers/tty/serial/serial_core.c:1778): Excess function parameter 'write' description in 'uart_console_write'

Fixes: 1cfe42b7fd ("serial: core: Fix kernel doc for uart_console_write()")
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-28 14:26:21 +02:00
Linus Torvalds d56a669ca5 Devicetree updates for 4.1:
- DT endianness specification bindings
 - Big endian 8250 serial support
 - DT overlay unittest updates
 - Various DT doc updates
 - Compile fixes for OF_IRQ=n
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJVOG5kAAoJEMhvYp4jgsXihDgH/3pmPSjuRG1bhGssmnchHjWh
 SU2eS2MZnlD60UqRt7jd3smCX2qL83tfwpFhOvCT9Mz775E7ggmYq9fS8pCYAbaD
 x98mUrE2GzdUzlrL6RS8Z0ExjyGwbMoW3+cZtyPkmC6CsW0fwqEPmEyk7m+Hk8C3
 w3pWG06o+G8UjiFmwbr8Pki2ykxvucr22NCzH4SS6bAD4QOrQO3v48QkUg7XFlVc
 NHNzQbswL85uOJ7uuAbxg+s8TXkwcxUeMJEKldLrjuyppO3N1MjnOgCptnhVNOOb
 zK+IsS378jMiNjAg2ui/BLH60N5yadkgk4+L4iPPy+y/yR61NCVXxRe11IQJxb0=
 =rtv6
 -----END PGP SIGNATURE-----

Merge tag 'devicetree-for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull second batch of devicetree updates from Rob Herring:
 "As Grant mentioned in the first devicetree pull request, here is the
  2nd batch of DT changes for 4.1.  The main remaining item here is the
  endianness bindings and related 8250 driver support.

   - DT endianness specification bindings

   - big-endian 8250 serial support

   - DT overlay unittest updates

   - various DT doc updates

   - compile fixes for OF_IRQ=n"

* tag 'devicetree-for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  frv: add io{read,write}{16,32}be functions
  mn10300: add io{read,write}{16,32}be functions
  Documentation: DT bindings: add doc for Altera's SoCFPGA platform
  of: base: improve of_get_next_child() kernel-doc
  Doc: dt: arch_timer: discourage clock-frequency use
  of: unittest: overlay: Keep track of created overlays
  of/fdt: fix allocation size for device node path
  serial: of_serial: Support big-endian register accesses
  serial: 8250: Add support for big-endian MMIO accesses
  of: Document {little,big,native}-endian bindings
  of/fdt: Add endianness helper function for early init code
  of: Add helper function to check MMIO register endianness
  of/fdt: Remove "reg" data prints from early_init_dt_scan_memory
  of: add vendor prefix for Artesyn
  of: Add dummy of_irq_to_resource_table() for IRQ_OF=n
  of: OF_IRQ should depend on IRQ_DOMAIN
2015-04-24 08:46:18 -07:00
Linus Torvalds 41d5e08ea8 TTY/Serial patches for 4.1-rc1
Here's the big tty/serial driver update for 4.1-rc1.
 
 It was delayed for a bit due to some questions surrounding some of the
 console command line parsing changes that are in here.  There's still
 one tiny regression for people who were previously putting multiple
 console command lines and expecting them all to be ignored for some odd
 reason, but Peter is working on fixing that.  If not, I'll send a revert
 for the offending patch, but I have faith that Peter can address it.
 
 Other than the console work here, there's the usual serial driver
 updates and changes, and a buch of 8250 reworks to try to make that
 driver easier to maintain over time, and have it support more devices in
 the future.
 
 All of these have been in linux-next for a while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlU2IcUACgkQMUfUDdst+ylFqACcC8LPhFEZg9aHn0hNUoqGK3rE
 5dUAnR4b8r/NYqjVoE9FJZgZfB/TqVi1
 =lyN/
 -----END PGP SIGNATURE-----

Merge tag 'tty-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial updates from Greg KH:
 "Here's the big tty/serial driver update for 4.1-rc1.

  It was delayed for a bit due to some questions surrounding some of the
  console command line parsing changes that are in here.  There's still
  one tiny regression for people who were previously putting multiple
  console command lines and expecting them all to be ignored for some
  odd reason, but Peter is working on fixing that.  If not, I'll send a
  revert for the offending patch, but I have faith that Peter can
  address it.

  Other than the console work here, there's the usual serial driver
  updates and changes, and a buch of 8250 reworks to try to make that
  driver easier to maintain over time, and have it support more devices
  in the future.

  All of these have been in linux-next for a while"

* tag 'tty-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (119 commits)
  n_gsm: Drop unneeded cast on netdev_priv
  sc16is7xx: expose RTS inversion in RS-485 mode
  serial: 8250_pci: port failed after wakeup from S3
  earlycon: 8250: Document kernel command line options
  earlycon: 8250: Fix command line regression
  earlycon: Fix __earlycon_table stride
  tty: clean up the tty time logic a bit
  serial: 8250_dw: only get the clock rate in one place
  serial: 8250_dw: remove useless ACPI ID check
  dmaengine: hsu: move memory allocation to GFP_NOWAIT
  dmaengine: hsu: remove redundant pieces of code
  serial: 8250_pci: add Intel Tangier support
  dmaengine: hsu: add Intel Tangier PCI ID
  serial: 8250_pci: replace switch-case by formula for Intel MID
  serial: 8250_pci: replace switch-case by formula
  tty: cpm_uart: replace CONFIG_8xx by CONFIG_CPM1
  serial: jsm: some off by one bugs
  serial: xuartps: Fix check in console_setup().
  serial: xuartps: Get rid of register access macros.
  serial: xuartps: Fix iobase use.
  ...
2015-04-21 09:33:10 -07:00
Kevin Cernekee ebc5e20082 serial: of_serial: Support big-endian register accesses
If the device node has a "big-endian" property and 32-bit registers, tell
the serial driver to use UPIO_MEM32BE instead of UPIO_MEM32.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rob Herring <robh@kernel.org>
2015-04-14 19:35:45 -05:00
Kevin Cernekee c627f2ceb6 serial: 8250: Add support for big-endian MMIO accesses
Add cases for UPIO_MEM32BE wherever there are currently cases handling
UPIO_MEM32.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rob Herring <robh@kernel.org>
2015-04-14 19:35:45 -05:00
Rafael J. Wysocki 17528b31c5 Merge branch 'pnp'
* pnp:
  PNP: Avoid leaving unregistered device objects in lists
  PNP: Convert pnp_lock into a mutex
  PNP: tty/serial/8250/8250_fintek: Use module_pnp_driver to register driver
  PNP: platform/x86/apple-gmux: Use module_pnp_driver to register driver
  PNP: net/sb1000: Use module_pnp_driver to register driver
  PNP: media/rc: Use module_pnp_driver to register driver
  PNP: ide/ide-pnp: Use module_pnp_driver to register driver
  PNP: ata/pata_isapnp: Use module_pnp_driver to register driver
  PNP: tpm/tpm_infineon: Use module_pnp_driver to register driver
  PNP: Add helper macro for pnp_register_driver boilerplate
  PNP / ACPI: Use ACPI_COMPANION_SET() during initialization
2015-04-13 00:36:15 +02:00
Jakub Kicinski f0e381158a sc16is7xx: expose RTS inversion in RS-485 mode
Hardware is capable of inverting RTS signal when working
in RS-485 mode.  Expose this functionality to user space.
Relay on a matching combination of standard flags
(SER_RS485_RTS_ON_SEND and SER_RS485_RTS_AFTER_SEND) to
detect when user space is requesting inverted RTS mode.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Jon Ringle <jringle@gridpoint.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-10 14:43:48 +02:00
Peter Hung 6a8bc239a8 serial: 8250_pci: port failed after wakeup from S3
Serial ports of F81504/F81508/F81512 will failed when wakeup from S3(STR).

It's due to when the system wakeup from S3(STR), this PCI device's
configuration space from 0x40 to 0x40 + max_port * 0x08 should be
re-configured.

We move all initialization from pci_fintek_setup() to pci_fintek_init() and
set it to pci_serial_quirks .init section. It's will re-init this device when
system wakeup from pciserial_resume_ports().

Signed-off-by: Peter Hung <hpeter+linux_kernel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-10 14:43:48 +02:00
Peter Hurley ca782f16ce earlycon: 8250: Document kernel command line options
Document the expected behavior of kernel command lines of the forms:
    console=uart[8250],io|mmio|mmio32,<addr>[,options]
    console=uart[8250],<addr>[,options]
and
    earlycon=uart[8250],io|mmio|mmio32,<addr>[,options]
    earlycon=uart[8250],<addr>[,options]

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-10 14:39:54 +02:00
Peter Hurley 87515772c3 earlycon: 8250: Fix command line regression
Restore undocumented behavior of kernel command line parameters of
the forms:
    console=uart[8250],io|mmio|mmio32,<addr>[,options]
    console=uart[8250],<addr>[,options]
where 'options' have not been specified; in this case, the hardware
is assumed to be initialized.

Fixes: c7cef0a849 ("console: Add extensible console matching")
Reported-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-10 14:39:54 +02:00
Greg Kroah-Hartman b3e3bf2ef2 Merge 4.0-rc7 into tty-next
We want the fixes in here as well, also to help out with merge issues.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-07 11:07:20 +02:00
Stefan Agner 8e4934c6d6 tty: serial: fsl_lpuart: clear receive flag on FIFO flush
When the receiver was enabled during startup, a character could
have been in the FIFO when the UART get initially used. The
driver configures the (receive) watermark level, and flushes the
FIFO. However, the receive flag (RDRF) could still be set at that
stage (as mentioned in the register description of UARTx_RWFIFO).
This leads to an interrupt which won't be handled properly in
interrupt mode: The receive interrupt function lpuart_rxint checks
the FIFO count, which is 0 at that point (due to the flush
during initialization). The problem does not manifest when using
DMA to receive characters.

Fix this situation by explicitly read the status register, which
leads to clearing of the RDRF flag. Due to the flush just after
the status flag read, a explicit data read is not to required.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 23:13:14 +01:00
Stefan Agner 4e8f245937 tty: serial: fsl_lpuart: specify transmit FIFO size
Specify transmit FIFO size which might be different depending on
LPUART instance. This makes sure uart_wait_until_sent in serial
core getting called, which in turn waits and checks if the FIFO
is really empty on shutdown by using the tx_empty callback.
Without the call of this callback, the last several characters
might not yet be transmitted when closing the serial port. This
can be reproduced by simply using echo and redirect the output to
a ttyLP device.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 23:13:14 +01:00
Javier Martinez Canillas e91d863d1a serial: samsung: Clear operation mode on UART shutdown
Exynos serial ports operate either in a DMA-based or interrupt-based
modes. In DMA-based mode, the UART generates a transfer data request
and a Transmission (Tx) interrupt in interrupt-based mode.

The Tx IRQ is only unmasked in interrupt-based mode and it was done
in s3c24xx_serial_start_tx(). Commit ba019a3e2a ("serial: samsung:
remove redundant interrupt enabling") removed the IRQ enable on that
function since it is enabled when the mode is set in enable_tx_pio().

The problem is that enable_tx_pio() is only called if the port mode
has not been set before but the mode was not cleared on .shutdown().

So if the UART was shutdown and then started up again, the mode set
will remain and the Tx IRQ won't be unmasked.

This caused a hang on at least Exynos5250, Exynos5420 and Exynos5800
when the system is rebooted or powered off.

Fixes: ba019a3e2a ("serial: samsung: remove redundant interrupt enabling")
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 23:13:14 +01:00
Heikki Krogerus 23f5b3fdd0 serial: 8250_dw: only get the clock rate in one place
The clock rate is requested from a property called
"clock-frequency" in both dw8250_probe_of and
dw8250_probe_acpi. Moving the requests to dw8250_probe.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 23:04:42 +01:00
Heikki Krogerus 9001c07995 serial: 8250_dw: remove useless ACPI ID check
Having ACPI handle does not mean the same as having ACPI
identifier. The check is in any case useless, but having it
prevents this driver from being used for example with
multifunctional PCI devices, such as the newer Intel LPSS
devices.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 23:04:42 +01:00
Andy Shevchenko 90b9aacf91 serial: 8250_pci: add Intel Tangier support
Intel Tangier contains 4 HSUART ports as found on Intel Edison board which are
8250 compatible. The patch adds necessary bits to the driver.

Note that the HSU port0 is currently unavailable and thus not supported.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 23:01:37 +01:00
Andy Shevchenko c1a67b48f6 serial: 8250_pci: replace switch-case by formula for Intel MID
This patch replaces a switch-case by a formula using rational best
approximation that does necessary calculations for intel_mid_set_termios().

Below is a list of the calculations done for all defined baud rates. Each line
in a format: 1) nominator, 2) denominator, 3) prescaler, 4) Fuart, 5) port UART
clock, 6) list of baud rates with DLAB values.

24       25       12 48000000   64000000   4000000(1)
49       50       14 49000000   56000000   3500000(1)
4        5        16 40000000   40000000   2500000(1)
16       25       16 32000000   32000000   500000(4),1000000(2),2000000(1)
24       25       16 48000000   48000000   1500000(2),3000000(1)
2304     3125     16 36864000   36864000   576000(4),1152000(2)
8192     15625    16 26214400   26214400   50(32768),200(8192)
9216     15625    16 29491200   29491200   1800(1024),57600(32),115200(16),
					230400(8),460800(4),921600(2),1843200(1)
12288    15625    16 39321600   39321600   75(32768),150(16384),300(8192),
					600(4096),1200(2048),2400(1024),4800(512),
					9600(256),19200(128),38400(64)
45056    78125    16 28835840   28835840   110(16384)
274432   390625   16 35127296   35127296   134(16384)

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 23:00:36 +01:00
Andy Shevchenko 21947ba654 serial: 8250_pci: replace switch-case by formula
This patch replaces a switch-case by a formula using rational best
approximation that does necessary calculations for byt_set_termios().

Below is a list of the calculations done for all defined baud rates. Each line
in a format: 1) numerator, 2) denominator, 3) prescaler, 4) Fuart, 5) port UART
clock, 6) list of baud rates with DLAB values.

4        5        16 80000000   80000000   2500000(2)
14       25       16 56000000   56000000   3500000(1)
16       25       16 64000000   64000000   500000(8),1000000(4),2000000(2),
					4000000(1)
24       25       16 96000000   96000000   1500000(4),3000000(2)
2180     3103     16 70254592   70254592   134(32768)
2304     3125     16 73728000   73728000   576000(8),1152000(4)
8192     15625    16 52428800   52428800   50(65536),200(16384)
9216     15625    16 58982400   58982400   1800(2048),57600(64),115200(32),
					230400(16),460800(8),921600(4),1843200(2)
12288    15625    16 78643200   78643200   75(65536),150(32768),300(16384),
					600(8192),1200(4096),2400(2048),
					4800(1024),9600(512),19200(256),38400(128)
9893     17154    16 57671680   57671680   110(32768)

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 23:00:36 +01:00
Christophe Leroy 49708c9e6c tty: cpm_uart: replace CONFIG_8xx by CONFIG_CPM1
Two config options exist to define powerpc MPC8xx:
* CONFIG_PPC_8xx
* CONFIG_8xx
In addition, CONFIG_PPC_8xx also defines CONFIG_CPM1 as
communication co-processor

arch/powerpc/platforms/Kconfig.cputype has contained the following
comment about CONFIG_8xx item for some years:
"# this is temp to handle compat with arch=ppc"

It looks like not many places still have that old CONFIG_8xx used,
so it is likely to be a good time to get rid of it completely ?

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 23:00:36 +01:00
Dan Carpenter a666b54ada serial: jsm: some off by one bugs
"brd->nasync" amd "brd->maxports" are the same.  They hold the number of
filled out channels in the brd->channels[] array.  These tests should
be ">=" instead of ">" so that we don't read one element past the end.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 23:00:36 +01:00
Thomas Betker 136debf707 serial: xuartps: Fix check in console_setup().
cdns_uart_console_setup() checks port->mapbase != 0, but the port may
not be initialized yet even if this condition is met [e.g., ioremap()
may have failed]. Check port->membase != NULL instead, similar to
cdns_early_console_setup().

Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:55:18 +01:00
Thomas Betker 19f22efdb6 serial: xuartps: Get rid of register access macros.
Get rid of cdns_uart_readl() and cdns_uart_writel() and just call
readl() and writel() directly.

Most of the patch was created by search-and-replace (I had to convert a
few lines manually, and break some lines longer than 80 columns):
* s/cdns_uart_readl(/readl(port->membase + /g
* s/cdns_uart_writel(\([^,]*\),/writel(\1, port->membase +/g

Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com>
Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:54:07 +01:00
Thomas Betker 0c39a467e7 serial: xuartps: Fix iobase use.
cdns_uart_get_port() sets port->iobase = 1 to "mark port in use", but
this "in use" condition is not checked anywhere else in the code. So
remove the line, keeping port->iobase = 0 (which also makes more sense).

Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:52:30 +01:00
Thomas Betker 6db6df0e4a serial: xuartps: Fix cdns_uart_port[] definition.
The code assumes that the array cdns_uart_port[] has dimension
CDNS_UART_NR_PORTS, so let us define it this way.

Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:52:29 +01:00
Thomas Betker 9646e4fee4 serial: xuartps: Fix register space size.
The register space size is 0x1000, and this value [not 0xfff] should be
provided to request_mem_region(), ioremap(), etc.

Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:52:29 +01:00
Mans Rullgard 0787691230 serial: of: set port iomem size from devicetree
Make the 8250 driver reserve exactly the mmio region specified
in the devicetree. This prevents conflicts between UPIO_AU type
UARTs and other devices mapped closer than the default size of
0x1000 (or 0x100 for RT2880).

Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:50:33 +01:00
Mans Rullgard ee97d0e3f0 serial: 8250: allow specifying iomem size in addition to address
This adds a mapsize field to struct uart_port to be used in
conjunction with mapbase. If set, it overrides whatever value
serial8250_port_size() would otherwise report.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:50:15 +01:00
Ken Xue 5ef86b7420 serial: 8250_dw: add support for AMD SOC Carrizo
Add ACPI identifier for UART on AMD SOC Carrizo.

Signed-off-by: Ken Xue <Ken.Xue@amd.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:49:11 +01:00
Fabian Frederick ed0bb2323c tty: constify of_device_id array
of_device_id is always used as const.
(See driver.of_match_table and open firmware functions)

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Acked-by: Peter Korsgaard <peter@korsgaard.com>
Acked-by: Timur Tabi <timur@tabi.org>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:49:10 +01:00
Nobuhiro Iwamatsu 5f6d851564 serial: sh-sci: Update calculation of timeout for DMA
The current calculation method in the case of 9600bps, rounding error occurs
has become setting that occur timeout faster than the required time. When we
use 9600bps, 32byte buffer, 10 bit (CS8) and 100 HZ, it becomes 3 jiffies
(30msec). In fact it is necessary 33msec. This updates to the calculation
that are not actually less than the value set by the rounding error.
Also, this is nothing will be calculated value when there is no load. If there
are a lot of case load, overrun error will occur immediately.
This is by the buffer size to be calculated twice the DMA buffer, and add the
change of setting a sufficient time-out value.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:42:27 +01:00
Nobuhiro Iwamatsu cb772fe75f serial: sh-sci: Add overrun handling of SCIFA and SCIFB
SCIFA and SCIFB can detect the overrun, but it does not support.
This adds overrun handling of SCIFA and SCIFB.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:42:27 +01:00
Jakub Kicinski 0814e8d5da sc16is7xx: enable the clock
Although clk_disable_unprepare() is called both on .remove()
and in .probe() error path, the clock is never actually enabled.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Jon Ringle <jringle@gridpoint.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:38:36 +01:00
Jakub Kicinski 9764e7a0f6 sc16is7xx: don't wipe out port configuration on shutdown
EFCR register contains RS-485 configuration which should not
be changed by shutdown.  Instead of doing a write only update
the appropriate bits.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Jon Ringle <jringle@gridpoint.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:38:36 +01:00
Jakub Kicinski 11b03ea0c1 sc16is7xx: remove ports on probe error path
If ports are not explicitly removed on the error path
the device will not get properly unregistered leaving
/dev/ttySC* nodes in the filesystem.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Jon Ringle <jringle@gridpoint.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:38:36 +01:00
Doug Kehn 1cf94d3a11 tty/serial: omap: fix !wakeirq message
When wakeirq is not used/enabled, "no wakeirq for uart0" is output for
all TTY as the log message is generated before the port line is
initialized.
[    0.802656] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.811700] omap_uart 44e09000.serial: no wakeirq for uart0
[    0.812379] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 88, base_baud = 3000000) is a OMAP UART0
[    1.503622] console [ttyO0] enabled
[    1.509836] omap_uart 48022000.serial: no wakeirq for uart0
[    1.516118] 48022000.serial: ttyO1 at MMIO 0x48022000 (irq = 89, base_baud = 3000000) is a OMAP UART1
[    1.527711] omap_uart 48024000.serial: no wakeirq for uart0
[    1.533881] 48024000.serial: ttyO2 at MMIO 0x48024000 (irq = 90, base_baud = 3000000) is a OMAP UART2
[    1.545324] omap_uart 481a6000.serial: no wakeirq for uart0
[    1.551410] 481a6000.serial: ttyO3 at MMIO 0x481a6000 (irq = 60, base_baud = 3000000) is a OMAP UART3
[    1.562946] omap_uart 481a8000.serial: no wakeirq for uart0
[    1.569036] 481a8000.serial: ttyO4 at MMIO 0x481a8000 (irq = 61, base_baud = 3000000) is a OMAP UART4

Fix by moving wakeirq initialization, check, and dev_info() call to
after port line initialization and validation.

Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:38:36 +01:00
Stephen Boyd 0fea53e255 tty: serial: Remove orphaned serial driver
This driver is orphaned now that mach-msm has been removed.
Delete it.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:31:09 +01:00
Stephen Boyd e23407d8b3 tty: serial: msm_serial: Remove dead code
This config no longer exists now that mach-msm has been removed.
Delete it and the associated code.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:31:09 +01:00
Peter Hung 77002c6f95 serial: 8250_pci: remove non-used var for F81504
Remove pci_fintek_setup() non-used var with calculation ciobase

Signed-off-by: Peter Hung <hpeter+linux_kernel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:23:26 +01:00
Wang Long e4228d7cf5 serial: 8250: remove the redundant include
The serial_core.h file have been included in header file
serial_8250.h. so remove the "#include <serial_core.h>" in
some 8250 serial drivers, because they have included the header file
serial_8250.h.

Signed-off-by: Wang Long <long.wanglong@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:21:08 +01:00
Peter Hurley f01a0bd892 serial: 8250: Check UART_SCR is writable
Au1x00/RT2800+ doesn't implement the 8250 scratch register (and
this may be true of other h/w currently supported by the 8250 driver);
read back the canary value written to the scratch register to enable
the console h/w restart after resume from system suspend.

Fixes: 4516d50aab ("serial: 8250: Use canary to restart console ...")
Reported-by: Mason <slash.tmp@free.fr>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 22:21:08 +01:00