1. 08 11月, 2017 1 次提交
    • G
      tty: add SPDX identifiers to all remaining files in drivers/tty/ · e3b3d0f5
      Greg Kroah-Hartman 提交于
      It's good to have SPDX identifiers in all files to make it easier to
      audit the kernel tree for correct licenses.
      
      Update the drivers/tty files files with the correct SPDX license
      identifier based on the license text in the file itself.  The SPDX
      identifier is a legally binding shorthand, which can be used instead of
      the full boiler plate text.
      
      This work is based on a script and data from Thomas Gleixner, Philippe
      Ombredanne, and Kate Stewart.
      
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Chris Metcalf <cmetcalf@mellanox.com>
      Cc: Jiri Kosina <jikos@kernel.org>
      Cc: David Sterba <dsterba@suse.com>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Stefan Wahren <stefan.wahren@i2se.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Ray Jui <rjui@broadcom.com>
      Cc: Scott Branden <sbranden@broadcom.com>
      Cc: bcm-kernel-feedback-list@broadcom.com
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Joachim Eastwood <manabian@gmail.com>
      Cc: Matthias Brugger <matthias.bgg@gmail.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Tobias Klauser <tklauser@distanz.ch>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Richard Genoud <richard.genoud@gmail.com>
      Cc: Alexander Shiyan <shc_work@mail.ru>
      Cc: Baruch Siach <baruch@tkos.co.il>
      Cc: "Maciej W. Rozycki" <macro@linux-mips.org>
      Cc: "Uwe Kleine-König" <kernel@pengutronix.de>
      Cc: Pat Gefre <pfg@sgi.com>
      Cc: "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: Vladimir Zapolskiy <vz@mleia.com>
      Cc: Sylvain Lemieux <slemieux.tyco@gmail.com>
      Cc: Carlo Caione <carlo@caione.org>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: Liviu Dudau <liviu.dudau@arm.com>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Andy Gross <andy.gross@linaro.org>
      Cc: David Brown <david.brown@linaro.org>
      Cc: "Andreas Färber" <afaerber@suse.de>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Laxman Dewangan <ldewangan@nvidia.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Jonathan Hunter <jonathanh@nvidia.com>
      Cc: Barry Song <baohua@kernel.org>
      Cc: Patrice Chotard <patrice.chotard@st.com>
      Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Peter Korsgaard <jacmet@sunsite.dk>
      Cc: Timur Tabi <timur@tabi.org>
      Cc: Tony Prisk <linux@prisktech.co.nz>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Cc: Jiri Slaby <jslaby@suse.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e3b3d0f5
  2. 29 8月, 2017 1 次提交
  3. 12 1月, 2017 1 次提交
  4. 26 6月, 2016 6 次提交
  5. 01 5月, 2016 2 次提交
    • S
      tty: serial: msm: Support more bauds · 98952bf5
      Stephen Boyd 提交于
      The msm_find_best_baud() function is written with the assumption
      that the port->uartclk rate is fixed to a particular rate at boot
      time, but now this driver changes that clk rate at runtime when
      the baud is changed.
      
      The way the hardware works is that an input clk rate comes from
      the clk controller into the uart hw block. That rate is typically
      1843200 or 3686400 Hz. That rate can then be divided by an
      internal divider in the hw block to achieve a particular baud on
      the serial wire. msm_find_best_baud() is looking for that divider
      value.
      
      A few things are wrong with the way the code is written. First,
      it assumes that the maximum baud that the uart can support if the
      clk rate is fixed at boot is 460800, which would correspond to an
      input clk rate of 230400 * 16 == 3686400 Hz.  Except some devices
      have a boot rate of 1843200 Hz or max baud of 115200, so
      achieving 230400 on those devices doesn't work at all because we
      don't increase the clk rate unless max baud is 460800.
      
      Second, we can't achieve bauds higher than 460800 that require
      anything besides a divisor of 1, because we always call
      msm_find_best_baud() with a fixed port->uartclk rate that will
      eventually be changed after we calculate the divisor. So if we
      need to get a baud of 500000, we'll just multiply that by 16 and
      hope that the clk can give us 500000 * 16 == 8000000 Hz, which it
      typically can't do. To really achieve 500000 baud, we need to get
      an input clk rate of 24000000 Hz and then divide that by 3 inside
      the uart hardware.
      
      Finally, we return success for bauds even when we can't actually
      achieve them. This means that when the user asks for 500000 baud,
      we actually get 921600 right now, but the user doesn't know that.
      
      Fix all of this by searching through the divisor and clk rate
      space with a combination of clk_round_rate() and baud
      calculations, keeping track of the best clk rate and divisor we
      find if we can't get an exact match. Typically we can get an
      exact match with a divisor of 1, but sometimes we need to keep
      track and try more frequencies. On my msm8916 device, this
      results in all standard bauds in baud_table being supported
      except for 1800, 576000, 1152000, and 4000000.
      
      Fixes: 850b37a7 ("tty: serial: msm: Remove 115.2 Kbps maximum baud rate limitation")
      Cc: "Ivan T. Ivanov" <iivanov.xz@gmail.com>
      Cc: Matthew McClintock <mmcclint@codeaurora.org>
      Signed-off-by: NStephen Boyd <stephen.boyd@linaro.org>
      Tested-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Acked-by: NAndy Gross <andy.gross@linaro.org>
      Acked-by: NBjorn Andersson <bjorn.andersson@linaro.org>
      Tested-by: NCristian Prundeanu <cprundea@codeaurora.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      98952bf5
    • S
      tty: msm_serial: remove static clk rate setting in probe · 79c9473f
      Srinivas Kandagatla 提交于
      The issue with setting up a fixed clock rate at probe is that it would
      overwrite the console rate set by the bootloader for its console device.
      This would result in serial out corruption or missing log when we system
      is booted with earlycon. This is not a issue if we boot system without
      earlycon.
      
      This setup is at least not required with the mainline driver, this code
      used to be required because the clk_enable() call would fail if
      clk_set_rate() wasn't called first.
      
      Originally the issue was noticed on DB410c which is based on APQ8016
      chipset.
      
      Without this patch the console log with earlycon would look like:
      ...
      [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=1
      [    0.000000] NR_IRQS:64 nr_irqs:64 0
      ����+HH��0.699378] console [ttyMSM0] enabled
      [    0.699378] console [ttyMSM0] enabled
      [    0.702003] bootconsole [uart0] disabled
      [    0.702003] bootconsole [uart0] disabled
      ...
      
      with this patch I can see all the skipped lines on the console
      Reviewed-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Acked-by: NAndy Gross <andy.gross@linaro.org>
      Tested-by: NPramod Gurav <gpramod@codeaurora.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      79c9473f
  6. 07 2月, 2016 1 次提交
    • P
      earlycon: Use common framework for earlycon declarations · 2eaa7909
      Peter Hurley 提交于
      Use a single common table of struct earlycon_id for both command line
      and devicetree. Re-define OF_EARLYCON_DECLARE() macro to instance a
      unique earlycon declaration (the declaration is only guaranteed to be
      unique within a compilation unit; separate compilation units must still
      use unique earlycon names).
      
      The semantics of OF_EARLYCON_DECLARE() is different; it declares an
      earlycon which can matched either on the command line or by devicetree.
      EARLYCON_DECLARE() is semantically unchanged; it declares an earlycon
      which is matched by command line only. Remove redundant instances of
      EARLYCON_DECLARE().
      
      This enables all earlycons to properly initialize struct console
      with the appropriate name and index, which improves diagnostics and
      enables direct earlycon-to-console handoff.
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2eaa7909
  7. 05 10月, 2015 5 次提交
  8. 03 2月, 2015 2 次提交
  9. 25 11月, 2014 1 次提交
  10. 07 11月, 2014 4 次提交
    • S
      tty: serial: msm_serial: Use DT aliases · 97f75471
      Stephen Boyd 提交于
      We rely on probe order of this driver to determine the line number for
      the uart port. This makes it impossible to know the line number
      when these devices are populated via DT. Use the DT alias
      mechanism to assign the line based on the aliases node.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      97f75471
    • S
      tty: serial: msm: Reset uartdm after baud rate change · a12f1b40
      Stephen Boyd 提交于
      We need to issue a reset if we ever change the value of the IPR
      register on DM hardware. If we don't reset the hardware the RX
      stale interrupt never triggers and the only way to trigger an RX
      handling event is by filling up the fifo. This causes things like
      getty to not work so well considering it might change the baud
      rate a few times. Fix this by moving the reset on startup and any
      reprogramming required after the reset to be after we change the
      baud rate.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a12f1b40
    • S
      tty: serial: msm: Support sysrq on uartDM devices · 0896d4d4
      Stephen Boyd 提交于
      To properly support sysrq on uartDM hardware we need to properly
      handle break characters. With the DM hardware the fifo can pack 4
      characters at a time, where a break is indicated by an all zero
      byte. Unfortunately, we can't differentiate between an all zero
      byte for a break and an all zero byte of data, so try and do as
      best we can. First unmask the RX break start interrupt and record
      the interrupt when it arrives. Then while processing the fifo,
      detect the break by searching for an all zero character as long
      as we recently received an RX break start interrupt. This should
      make sysrq work fairly well.
      
      Cc: Frank Rowand <frank.rowand@sonymobile.com>
      Cc: Daniel Thompson <daniel.thompson@linaro.org>
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0896d4d4
    • S
      tty: serial: msm: Fix sysrq spinlock recursion on non-DM · 660beb0e
      Stephen Boyd 提交于
      The handle_rx() path calls uart_handle_sysrq_char() with the port
      lock held. This causes a spinlock recursion. Release and
      reacquire the lock here to avoid this.
      
      BUG: spinlock recursion on CPU#0, swapper/0
       lock: msm_uart_ports+0x1e0/0x2d0, .magic: dead4ead, .owner: swapper/0, .owner_cpu: 0
      CPU: 0 PID: 0 Comm: swapper Not tainted 3.17.0-rc7-00012-gb38ee8265941 #69
      [<c0013964>] (unwind_backtrace) from [<c0011f74>] (show_stack+0x10/0x14)
      [<c0011f74>] (show_stack) from [<c004ed1c>] (do_raw_spin_lock+0x11c/0x13c)
      [<c004ed1c>] (do_raw_spin_lock) from [<c02d44c0>] (msm_console_write+0x78/0x188)
      [<c02d44c0>] (msm_console_write) from [<c0052880>] (call_console_drivers.constprop.22+0xb4/0x144)
      [<c0052880>] (call_console_drivers.constprop.22) from [<c0053570>] (console_unlock+0x27c/0x4ac)
      [<c0053570>] (console_unlock) from [<c0053bb4>] (vprintk_emit+0x1f4/0x5a8)
      [<c0053bb4>] (vprintk_emit) from [<c04ad0ac>] (printk+0x30/0x40)
      [<c04ad0ac>] (printk) from [<c02c2990>] (__handle_sysrq+0x58/0x1b8)
      [<c02c2990>] (__handle_sysrq) from [<c02d41b0>] (msm_irq+0x694/0x6f8)
      [<c02d41b0>] (msm_irq) from [<c0055740>] (handle_irq_event_percpu+0x58/0x270)
      [<c0055740>] (handle_irq_event_percpu) from [<c0055994>] (handle_irq_event+0x3c/0x5c)
      [<c0055994>] (handle_irq_event) from [<c0057e84>] (handle_level_irq+0x9c/0x138)
      [<c0057e84>] (handle_level_irq) from [<c005509c>] (generic_handle_irq+0x24/0x38)
      [<c005509c>] (generic_handle_irq) from [<c000f730>] (handle_IRQ+0x44/0xb0)
      [<c000f730>] (handle_IRQ) from [<c0008518>] (msm_vic_handle_irq+0x44/0x64)
      [<c0008518>] (msm_vic_handle_irq) from [<c04b5ac4>] (__irq_svc+0x44/0x7c)
      Exception stack(0xc0719f68 to 0xc0719fb0)
      9f60:                   00000001 00000001 00000000 c0722938 c0718000 c0769acc
      9f80: 00000000 c0720098 c0769305 4117b362 c0769acc 00000000 01000000 c0719fb0
      9fa0: c004cab0 c000f880 20000013 ffffffff
      [<c04b5ac4>] (__irq_svc) from [<c000f880>] (arch_cpu_idle+0x20/0x30)
      [<c000f880>] (arch_cpu_idle) from [<c004691c>] (cpu_startup_entry+0xf4/0x23c)
      [<c004691c>] (cpu_startup_entry) from [<c06d8b70>] (start_kernel+0x32c/0x394)
      
      Cc: Frank Rowand <frank.rowand@sonymobile.com>
      Cc: Daniel Thompson <daniel.thompson@linaro.org>
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      660beb0e
  11. 20 10月, 2014 1 次提交
  12. 29 9月, 2014 1 次提交
  13. 09 9月, 2014 6 次提交
  14. 24 7月, 2014 1 次提交
  15. 11 7月, 2014 1 次提交
  16. 10 7月, 2014 1 次提交
  17. 20 6月, 2014 1 次提交
    • P
      serial: Fix IGNBRK handling · ef8b9ddc
      Peter Hurley 提交于
      If IGNBRK is set without either BRKINT or PARMRK set, some uart
      drivers send a 0x00 byte for BREAK without the TTYBREAK flag to the
      line discipline, when it should send either nothing or the TTYBREAK flag
      set. This happens because the read_status_mask masks out the BI
      condition, which uart_insert_char() then interprets as a normal 0x00 byte.
      
      SUS v3 is clear regarding the meaning of IGNBRK; Section 11.2.2, General
      Terminal Interface - Input Modes, states:
        "If IGNBRK is set, a break condition detected on input shall be ignored;
         that is, not put on the input queue and therefore not read by any
         process."
      
      Fix read_status_mask to include the BI bit if IGNBRK is set; the
      lsr status retains the BI bit if a BREAK is recv'd, which is
      subsequently ignored in uart_insert_char() when masked with the
      ignore_status_mask.
      
      Affected drivers:
      8250 - all
      serial_txx9
      mfd
      amba-pl010
      amba-pl011
      atmel_serial
      bfin_uart
      dz
      ip22zilog
      max310x
      mxs-auart
      netx-serial
      pnx8xxx_uart
      pxa
      sb1250-duart
      sccnxp
      serial_ks8695
      sirfsoc_uart
      st-asc
      vr41xx_siu
      zs
      sunzilog
      fsl_lpuart
      sunsab
      ucc_uart
      bcm63xx_uart
      sunsu
      efm32-uart
      pmac_zilog
      mpsc
      msm_serial
      m32r_sio
      
      Unaffected drivers:
      omap-serial
      rp2
      sa1100
      imx
      icom
      
      Annotated for fixes:
      altera_uart
      mcf
      
      Drivers without break detection:
      21285
      xilinx-uartps
      altera_jtaguart
      apbuart
      arc-uart
      clps711x
      max3100
      uartlite
      msm_serial_hs
      nwpserial
      lantiq
      vt8500_serial
      
      Unknown:
      samsung
      mpc52xx_uart
      bfin_sport_uart
      cpm_uart/core
      
      Fixes: Bugzilla #71651, '8250_core.c incorrectly handles IGNBRK flag'
      Reported-by: NIvan <athlon_@mail.ru>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ef8b9ddc
  18. 18 6月, 2014 1 次提交
    • K
      tty: serial: msm: Fix section mismatch warning · 4cc29462
      Kumar Gala 提交于
      WARNING: drivers/tty/built-in.o(.data+0x3544): Section mismatch in
      reference from the variable msm_platform_driver to the function
      .init.text:msm_serial_probe()
      The variable msm_platform_driver references
      the function __init msm_serial_probe()
      If the reference is valid then annotate the
      variable with __init* or __refdata (see linux/init.h) or name the variable:
      *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
      Signed-off-by: NKumar Gala <galak@codeaurora.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      4cc29462
  19. 30 5月, 2014 1 次提交
  20. 13 2月, 2014 1 次提交
  21. 28 8月, 2013 1 次提交