1. 27 3月, 2015 2 次提交
  2. 26 3月, 2015 6 次提交
  3. 07 3月, 2015 2 次提交
  4. 07 2月, 2015 1 次提交
  5. 03 2月, 2015 8 次提交
  6. 10 1月, 2015 2 次提交
    • V
      tty: 8250: Add 64byte UART support for FSL platforms · fddceb8b
      Vijay Rai 提交于
      Some of FSL SoCs like T1040 has new version of UART controller which
      can support 64byte FiFo.
      To enable 64 byte support, following needs to be done:
      -FCR[EN64] needs to be programmed to 1 to enable it.
      -Also, when FCR[EN64]==1, RTL bits to be used as below
      to define various Receive Trigger Levels:
              -FCR[RTL] = 00  1 byte
              -FCR[RTL] = 01  16 bytes
              -FCR[RTL] = 10  32 bytes
              -FCR[RTL] = 11  56 bytes
      -tx_loadsz is set to 63-bytes instead of 64-bytes to implement
       workaround of errata A-008006 which states that tx_loadsz should
       be configured less than Maximum supported fifo bytes
      Signed-off-by: NVijay Rai <vijay.rai@freescale.com>
      Signed-off-by: NPriyanka Jain <Priyanka.Jain@freescale.com>
      Signed-off-by: NPoonam Aggrwal <poonam.aggrwal@freescale.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fddceb8b
    • P
      serial: omap_8250: Fix RTS handling · 4bf4ea9d
      Peter Hurley 提交于
      The OMAP3 UART ignores MCR[1] (ie., UART_MCR_RTS) when in autoRTS
      mode (UPF_HARD_FLOW + CRTSCTS). This makes it impossible for either
      the serial core or userspace to manually flow control the sender.
      
      Disable autoRTS mode when RTS is lowered and restore the previous
      mode when RTS is raised.
      
      Note that the OMAP3 UART provides no mechanism for switching from
      autoRTS mode without corrupting incoming data; to access the
      necessary register, the line control settings must be set to 8-e-2
      and thus any data received during that time will be interpreted with
      those settings. This corruption has been observed in practice.
      
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4bf4ea9d
  7. 26 11月, 2014 1 次提交
    • R
      serial: 8250: don't attempt a trylock if in sysrq · 6fad18fa
      Rabin Vincent 提交于
      Attempting to use SysRq via the 8250 serial port with spin lock
      debugging on on a uniprocessor system results in the following splat:
      
       SysRq :
       BUG: spinlock trylock failure on UP on CPU#0, swapper/0
        lock: serial8250_ports+0x0/0x8c0, .magic: dead4ead, .owner: swapper/0, .owner_cpu: 0
       CPU: 0 PID: 0 Comm: swapper Not tainted 3.18.0-rc4+ #37
       Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
        ffffffff8245ba00 ffffffff81628b28 ffffffff812c8d27 ffffffff81628b48
        ffffffff8106812e ffffffff8245ba00 ffffffff814e22ed ffffffff81628b68
        ffffffff810681a6 0000000000000000 0000000000000000 ffffffff81628b88
       Call Trace:
        <IRQ>  [<ffffffff812c8d27>] dump_stack+0x19/0x1b
        [<ffffffff8106812e>] spin_dump+0x7e/0xd0
        [<ffffffff810681a6>] spin_bug+0x26/0x30
        [<ffffffff8106843c>] do_raw_spin_trylock+0x4c/0x60
        [<ffffffff812cdb1d>] _raw_spin_trylock+0x1d/0x60
        [<ffffffff812336d8>] serial8250_console_write+0x68/0x190
        [<ffffffff811eb0b0>] ? sprintf+0x40/0x50
        [<ffffffff8106ab5e>] call_console_drivers.constprop.11+0x9e/0xf0
        [<ffffffff8106b276>] console_unlock+0x3e6/0x490
        [<ffffffff8106b595>] vprintk_emit+0x275/0x530
        [<ffffffff812c869a>] printk+0x4d/0x4f
        [<ffffffff8121e612>] __handle_sysrq+0x62/0x1b0
        [<ffffffff8121e5b5>] ? __handle_sysrq+0x5/0x1b0
        [<ffffffff8121ebc6>] handle_sysrq+0x26/0x30
        [<ffffffff81233157>] serial8250_rx_chars+0x1d7/0x250
        [<ffffffff812338bb>] serial8250_handle_irq+0x7b/0x90
        [<ffffffff812338f3>] serial8250_default_handle_irq+0x23/0x30
        [<ffffffff812318b3>] serial8250_interrupt+0x63/0xe0
        [<ffffffff8106d80e>] handle_irq_event_percpu+0x4e/0x200
        [<ffffffff8106da01>] handle_irq_event+0x41/0x70
        [<ffffffff810701ee>] ? handle_edge_irq+0x1e/0x110
        [<ffffffff8107026e>] handle_edge_irq+0x9e/0x110
        [<ffffffff810041c2>] handle_irq+0x22/0x40
        [<ffffffff812d096e>] do_IRQ+0x4e/0xf0
        [<ffffffff812cf4ed>] common_interrupt+0x6d/0x6d
        <EOI>  [<ffffffff8100acbf>] ? default_idle+0x1f/0xd0
        [<ffffffff8100acbd>] ? default_idle+0x1d/0xd0
        [<ffffffff8100b61f>] arch_cpu_idle+0xf/0x20
        [<ffffffff8105c1db>] cpu_startup_entry+0x25b/0x360
        [<ffffffff812c726e>] rest_init+0xbe/0xd0
        [<ffffffff816a4dcb>] start_kernel+0x339/0x346
        [<ffffffff816a4495>] x86_64_start_reservations+0x2a/0x2c
        [<ffffffff816a4589>] x86_64_start_kernel+0xf2/0xf6
       HELP : loglevel(0-9) reboot(b) crash(c) show-all-locks(d) te...
      
      Before ebade5e8 ("serial: 8250: Clean up the locking for -rt")
      this was handled by not even attempting to try the lock if port->sysrq,
      since it is known to be taken by the interrupt handler; see
      https://bugzilla.kernel.org/show_bug.cgi?id=6716#c1.  Restore that
      behavior.
      Signed-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6fad18fa
  8. 07 11月, 2014 7 次提交
  9. 06 11月, 2014 6 次提交
  10. 20 10月, 2014 1 次提交
  11. 27 9月, 2014 4 次提交
    • S
      tty: serial: 8250_core: remove UART_IER_RDI in serial8250_stop_rx() · 9137568e
      Sebastian Andrzej Siewior 提交于
      serial8250_do_startup() adds UART_IER_RDI and UART_IER_RLSI to ier.
      serial8250_stop_rx() should remove both.
      This is what the serial-omap driver has been doing and is now moved to
      the 8250-core since it does no look to be *that* omap specific.
      Reviewed-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Reviewed-by: NTony Lindgren <tony@atomide.com>
      Tested-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9137568e
    • S
      tty: serial: 8250_core: use the ->line argument as a hint in serial8250_find_match_or_unused() · 59b3e898
      Sebastian Andrzej Siewior 提交于
      Tony noticed that the old omap-serial driver picked the uart "number"
      based on the hint given from device tree or platform device's id.
      The 8250 based omap driver doesn't do this because the core code does
      not honour the ->line argument which is passed by the driver.
      
      This patch aims to keep the same behaviour as with omap-serial. The
      function will first try to use the line suggested ->line argument and
      then fallback to the old strategy in case the port is taken.
      
      That means the the third uart will always be ttyS2 even if the previous
      two have not been enabled in DT.
      Reviewed-by: NTony Lindgren <tony@atomide.com>
      Tested-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      59b3e898
    • S
      tty: serial: 8250_core: read only RX if there is something in the FIFO · 0aa525d1
      Sebastian Andrzej Siewior 提交于
      The serial8250_do_startup() function unconditionally clears the
      interrupts and for that it reads from the RX-FIFO without checking if
      there is a byte in the FIFO or not. This works fine on OMAP4+ HW like
      AM335x or DRA7.
      OMAP3630 ES1.1 (which means probably all OMAP3 and earlier) does not like
      this:
      
      |Unhandled fault: external abort on non-linefetch (0x1028) at 0xfb020000
      |Internal error: : 1028 [#1] ARM
      |Modules linked in:
      |CPU: 0 PID: 1 Comm: swapper Not tainted 3.16.0-00022-g7edcb57-dirty #1213
      |task: de0572c0 ti: de058000 task.ti: de058000
      |PC is at mem32_serial_in+0xc/0x1c
      |LR is at serial8250_do_startup+0x220/0x85c
      |Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      |Control: 10c5387d  Table: 80004019  DAC: 00000015
      |[<c03051d4>] (mem32_serial_in) from [<c0307fe8>] (serial8250_do_startup+0x220/0x85c)
      |[<c0307fe8>] (serial8250_do_startup) from [<c0309e00>] (omap_8250_startup+0x5c/0xe0)
      |[<c0309e00>] (omap_8250_startup) from [<c030863c>] (serial8250_startup+0x18/0x2c)
      |[<c030863c>] (serial8250_startup) from [<c030394c>] (uart_startup+0x78/0x1d8)
      |[<c030394c>] (uart_startup) from [<c0304678>] (uart_open+0xe8/0x114)
      |[<c0304678>] (uart_open) from [<c02e9e10>] (tty_open+0x1a8/0x5a4)
      Reviewed-by: NTony Lindgren <tony@atomide.com>
      Tested-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0aa525d1
    • S
      tty: serial: 8250_core: add run time pm · d74d5d1b
      Sebastian Andrzej Siewior 提交于
      While comparing the OMAP-serial and the 8250 part of this I noticed that
      the latter does not use run time-pm. Here are the pieces. It is
      basically a get before first register access and a last_busy + put after
      last access. This has to be enabled from userland _and_ UART_CAP_RPM is
      required for this.
      The runtime PM can usually work transparently in the background however
      there is one exception to this: After serial8250_tx_chars() completes
      there still may be unsent bytes in the FIFO (depending on CPU speed vs
      baud rate + flow control). Even if the TTY-buffer is empty we do not
      want RPM to disable the device because it won't send the remaining
      bytes. Instead we leave serial8250_tx_chars() with RPM enabled and wait
      for the FIFO empty interrupt. Once we enter serial8250_tx_chars() with
      an empty buffer we know that the FIFO is empty and since we are not going
      to send anything, we can disable the device.
      That xchg() is to ensure that serial8250_tx_chars() can be called
      multiple times and only the first invocation will actually invoke the
      runtime PM function. So that the last invocation of __stop_tx() will
      disable runtime pm.
      
      NOTE: do not enable RPM on the device unless you know what you do! If
      the device goes idle, it won't be woken up by incomming RX data _unless_
      there is a wakeup irq configured which is usually the RX pin configure
      for wakeup via the reset module. The RX activity will then wake up the
      device from idle. However the first character is garbage and lost. The
      following bytes will be received once the device is up in time. On the
      beagle board xm (omap3) it takes approx 13ms from the first wakeup byte
      until the first byte that is received properly if the device was in
      core-off.
      
      v5…v8:
      	- drop RPM from serial8250_set_mctrl() it will be used in
      	  restore path which already has RPM active and holds
      	  dev->power.lock
      v4…v5:
      	- add a wrapper around rpm function and introduce UART_CAP_RPM
      	  to ensure RPM put is invoked after the TX FIFO is empty.
      v3…v4:
      	- added runtime to the console code
      	- removed device_may_wakeup() from serial8250_set_sleep()
      
      Cc: mika.westerberg@linux.intel.com
      Reviewed-by: NTony Lindgren <tony@atomide.com>
      Tested-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d74d5d1b