1. 18 8月, 2020 2 次提交
    • L
      serial: pl011: Fix oops on -EPROBE_DEFER · 27afac93
      Lukas Wunner 提交于
      If probing of a pl011 gets deferred until after free_initmem(), an oops
      ensues because pl011_console_match() is called which has been freed.
      
      Fix by removing the __init attribute from the function and those it
      calls.
      
      Commit 10879ae5 ("serial: pl011: add console matching function")
      introduced pl011_console_match() not just for early consoles but
      regular preferred consoles, such as those added by acpi_parse_spcr().
      Regular consoles may be registered after free_initmem() for various
      reasons, one being deferred probing, another being dynamic enablement
      of serial ports using a DeviceTree overlay.
      
      Thus, pl011_console_match() must not be declared __init and the
      functions it calls mustn't either.
      
      Stack trace for posterity:
      
      Unable to handle kernel paging request at virtual address 80c38b58
      Internal error: Oops: 8000000d [#1] PREEMPT SMP ARM
      PC is at pl011_console_match+0x0/0xfc
      LR is at register_console+0x150/0x468
      [<80187004>] (register_console)
      [<805a8184>] (uart_add_one_port)
      [<805b2b68>] (pl011_register_port)
      [<805b3ce4>] (pl011_probe)
      [<80569214>] (amba_probe)
      [<805ca088>] (really_probe)
      [<805ca2ec>] (driver_probe_device)
      [<805ca5b0>] (__device_attach_driver)
      [<805c8060>] (bus_for_each_drv)
      [<805c9dfc>] (__device_attach)
      [<805ca630>] (device_initial_probe)
      [<805c90a8>] (bus_probe_device)
      [<805c95a8>] (deferred_probe_work_func)
      
      Fixes: 10879ae5 ("serial: pl011: add console matching function")
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Cc: stable@vger.kernel.org # v4.10+
      Cc: Aleksey Makarov <amakarov@marvell.com>
      Cc: Peter Hurley <peter@hurleysoftware.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Christopher Covington <cov@codeaurora.org>
      Link: https://lore.kernel.org/r/f827ff09da55b8c57d316a1b008a137677b58921.1597315557.git.lukas@wunner.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      27afac93
    • L
      serial: pl011: Don't leak amba_ports entry on driver register error · 89efbe70
      Lukas Wunner 提交于
      pl011_probe() calls pl011_setup_port() to reserve an amba_ports[] entry,
      then calls pl011_register_port() to register the uart driver with the
      tty layer.
      
      If registration of the uart driver fails, the amba_ports[] entry is not
      released.  If this happens 14 times (value of UART_NR macro), then all
      amba_ports[] entries will have been leaked and driver probing is no
      longer possible.  (To be fair, that can only happen if the DeviceTree
      doesn't contain alias IDs since they cause the same entry to be used for
      a given port.)   Fix it.
      
      Fixes: ef2889f7 ("serial: pl011: Move uart_register_driver call to device")
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Cc: stable@vger.kernel.org # v3.15+
      Cc: Tushar Behera <tushar.behera@linaro.org>
      Link: https://lore.kernel.org/r/138f8c15afb2f184d8102583f8301575566064a6.1597316167.git.lukas@wunner.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      89efbe70
  2. 22 7月, 2020 1 次提交
  3. 02 6月, 2020 1 次提交
  4. 05 5月, 2020 1 次提交
    • J
      serial: amba-pl011: Make sure we initialize the port.lock spinlock · 8508f4cb
      John Stultz 提交于
      Valentine reported seeing:
      
      [    3.626638] INFO: trying to register non-static key.
      [    3.626639] the code is fine but needs lockdep annotation.
      [    3.626640] turning off the locking correctness validator.
      [    3.626644] CPU: 7 PID: 51 Comm: kworker/7:1 Not tainted 5.7.0-rc2-00115-g8c2e9790f196 #116
      [    3.626646] Hardware name: HiKey960 (DT)
      [    3.626656] Workqueue: events deferred_probe_work_func
      [    3.632476] sd 0:0:0:0: [sda] Optimal transfer size 8192 bytes not a multiple of physical block size (16384 bytes)
      [    3.640220] Call trace:
      [    3.640225]  dump_backtrace+0x0/0x1b8
      [    3.640227]  show_stack+0x20/0x30
      [    3.640230]  dump_stack+0xec/0x158
      [    3.640234]  register_lock_class+0x598/0x5c0
      [    3.640235]  __lock_acquire+0x80/0x16c0
      [    3.640236]  lock_acquire+0xf4/0x4a0
      [    3.640241]  _raw_spin_lock_irqsave+0x70/0xa8
      [    3.640245]  uart_add_one_port+0x388/0x4b8
      [    3.640248]  pl011_register_port+0x70/0xf0
      [    3.640250]  pl011_probe+0x184/0x1b8
      [    3.640254]  amba_probe+0xdc/0x180
      [    3.640256]  really_probe+0xe0/0x338
      [    3.640257]  driver_probe_device+0x60/0xf8
      [    3.640259]  __device_attach_driver+0x8c/0xd0
      [    3.640260]  bus_for_each_drv+0x84/0xd8
      [    3.640261]  __device_attach+0xe4/0x140
      [    3.640263]  device_initial_probe+0x1c/0x28
      [    3.640265]  bus_probe_device+0xa4/0xb0
      [    3.640266]  deferred_probe_work_func+0x7c/0xb8
      [    3.640269]  process_one_work+0x2c0/0x768
      [    3.640271]  worker_thread+0x4c/0x498
      [    3.640272]  kthread+0x14c/0x158
      [    3.640275]  ret_from_fork+0x10/0x1c
      
      Which seems to be due to the fact that after allocating the uap
      structure, nothing initializes the spinlock.
      
      Its a little confusing, as uart_port_spin_lock_init() is one
      place where the lock is supposed to be initialized, but it has
      an exception for the case where the port is a console.
      
      This makes it seem like a deeper fix is needed to properly
      register the console, but I'm not sure what that entails, and
      Andy suggested that this approach is less invasive.
      
      Thus, this patch resolves the issue by initializing the spinlock
      in the driver, and resolves the resulting warning.
      
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: linux-serial@vger.kernel.org
      Reported-by: NValentin Schneider <valentin.schneider@arm.com>
      Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      Reviewed-and-tested-by: NValentin Schneider <valentin.schneider@arm.com>
      Link: https://lore.kernel.org/r/20200428184050.6501-1-john.stultz@linaro.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8508f4cb
  5. 18 12月, 2019 1 次提交
  6. 12 12月, 2019 2 次提交
  7. 18 11月, 2019 1 次提交
    • V
      serial: pl011: Fix DMA ->flush_buffer() · f6a19647
      Vincent Whitchurch 提交于
      PL011's ->flush_buffer() implementation releases and reacquires the port
      lock.  Due to a race condition here, data can end up being added to the
      circular buffer but neither being discarded nor being sent out.  This
      leads to, for example, tcdrain(2) waiting indefinitely.
      
      Process A                       Process B
      
      uart_flush_buffer()
       - acquire lock
       - circ_clear
       - pl011_flush_buffer()
       -- release lock
       -- dmaengine_terminate_all()
      
                                      uart_write()
                                      - acquire lock
                                      - add chars to circ buffer
                                      - start_tx()
                                      -- start DMA
                                      - release lock
      
       -- acquire lock
       -- turn off DMA
       -- release lock
      
                                      // Data in circ buffer but DMA is off
      
      According to the comment in the code, the releasing of the lock around
      dmaengine_terminate_all() is to avoid a deadlock with the DMA engine
      callback.  However, since the time this code was written, the DMA engine
      API documentation seems to have been clarified to say that
      dmaengine_terminate_all() (in the identically implemented but
      differently named dmaengine_terminate_async() variant) does not wait for
      any running complete callback to be completed and can even be called
      from a complete callback.  So there is no possibility of deadlock if the
      DMA engine driver implements this API correctly.
      
      So we should be able to just remove this release and reacquire of the
      lock to prevent the aforementioned race condition.
      Signed-off-by: NVincent Whitchurch <vincent.whitchurch@axis.com>
      Cc: stable <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20191118092547.32135-1-vincent.whitchurch@axis.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f6a19647
  8. 13 11月, 2019 1 次提交
  9. 04 10月, 2019 1 次提交
  10. 04 9月, 2019 1 次提交
  11. 21 5月, 2019 1 次提交
  12. 10 11月, 2018 1 次提交
    • A
      serial: set suppress_bind_attrs flag only if builtin · 64609794
      Anders Roxell 提交于
      When the test 'CONFIG_DEBUG_TEST_DRIVER_REMOVE=y' is enabled,
      arch_initcall(pl011_init) came before subsys_initcall(default_bdi_init).
      devtmpfs gets killed because we try to remove a file and decrement the
      wb reference count before the noop_backing_device_info gets initialized.
      
      [    0.332075] Serial: AMBA PL011 UART driver
      [    0.485276] 9000000.pl011: ttyAMA0 at MMIO 0x9000000 (irq = 39, base_baud = 0) is a PL011 rev1
      [    0.502382] console [ttyAMA0] enabled
      [    0.515710] Unable to handle kernel paging request at virtual address 0000800074c12000
      [    0.516053] Mem abort info:
      [    0.516222]   ESR = 0x96000004
      [    0.516417]   Exception class = DABT (current EL), IL = 32 bits
      [    0.516641]   SET = 0, FnV = 0
      [    0.516826]   EA = 0, S1PTW = 0
      [    0.516984] Data abort info:
      [    0.517149]   ISV = 0, ISS = 0x00000004
      [    0.517339]   CM = 0, WnR = 0
      [    0.517553] [0000800074c12000] user address but active_mm is swapper
      [    0.517928] Internal error: Oops: 96000004 [#1] PREEMPT SMP
      [    0.518305] Modules linked in:
      [    0.518839] CPU: 0 PID: 13 Comm: kdevtmpfs Not tainted 4.19.0-rc5-next-20180928-00002-g2ba39ab0cd01-dirty #82
      [    0.519307] Hardware name: linux,dummy-virt (DT)
      [    0.519681] pstate: 80000005 (Nzcv daif -PAN -UAO)
      [    0.519959] pc : __destroy_inode+0x94/0x2a8
      [    0.520212] lr : __destroy_inode+0x78/0x2a8
      [    0.520401] sp : ffff0000098c3b20
      [    0.520590] x29: ffff0000098c3b20 x28: 00000000087a3714
      [    0.520904] x27: 0000000000002000 x26: 0000000000002000
      [    0.521179] x25: ffff000009583000 x24: 0000000000000000
      [    0.521467] x23: ffff80007bb52000 x22: ffff80007bbaa7c0
      [    0.521737] x21: ffff0000093f9338 x20: 0000000000000000
      [    0.522033] x19: ffff80007bbb05d8 x18: 0000000000000400
      [    0.522376] x17: 0000000000000000 x16: 0000000000000000
      [    0.522727] x15: 0000000000000400 x14: 0000000000000400
      [    0.523068] x13: 0000000000000001 x12: 0000000000000001
      [    0.523421] x11: 0000000000000000 x10: 0000000000000970
      [    0.523749] x9 : ffff0000098c3a60 x8 : ffff80007bbab190
      [    0.524017] x7 : ffff80007bbaa880 x6 : 0000000000000c88
      [    0.524305] x5 : ffff0000093d96c8 x4 : 61c8864680b583eb
      [    0.524567] x3 : ffff0000093d6180 x2 : ffffffffffffffff
      [    0.524872] x1 : 0000800074c12000 x0 : 0000800074c12000
      [    0.525207] Process kdevtmpfs (pid: 13, stack limit = 0x(____ptrval____))
      [    0.525529] Call trace:
      [    0.525806]  __destroy_inode+0x94/0x2a8
      [    0.526108]  destroy_inode+0x34/0x88
      [    0.526370]  evict+0x144/0x1c8
      [    0.526636]  iput+0x184/0x230
      [    0.526871]  dentry_unlink_inode+0x118/0x130
      [    0.527152]  d_delete+0xd8/0xe0
      [    0.527420]  vfs_unlink+0x240/0x270
      [    0.527665]  handle_remove+0x1d8/0x330
      [    0.527875]  devtmpfsd+0x138/0x1c8
      [    0.528085]  kthread+0x14c/0x158
      [    0.528291]  ret_from_fork+0x10/0x18
      [    0.528720] Code: 92800002 aa1403e0 d538d081 8b010000 (c85f7c04)
      [    0.529367] ---[ end trace 5a3dee47727f877c ]---
      
      Rework to set suppress_bind_attrs flag to avoid removing the device when
      CONFIG_DEBUG_TEST_DRIVER_REMOVE=y. This applies for pic32_uart and
      xilinx_uartps as well.
      Co-developed-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAnders Roxell <anders.roxell@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      64609794
  13. 14 5月, 2018 1 次提交
    • D
      tty: pl011: Avoid spuriously stuck-off interrupts · 4a7e625c
      Dave Martin 提交于
      Commit 9b96fbac ("serial: PL011: clear pending interrupts")
      clears the RX and receive timeout interrupts on pl011 startup, to
      avoid a screaming-interrupt scenario that can occur when the
      firmware or bootloader leaves these interrupts asserted.
      
      This has been noted as an issue when running Linux on qemu [1].
      
      Unfortunately, the above fix seems to lead to potential
      misbehaviour if the RX FIFO interrupt is asserted _non_ spuriously
      on driver startup, if the RX FIFO is also already full to the
      trigger level.
      
      Clearing the RX FIFO interrupt does not change the FIFO fill level.
      In this scenario, because the interrupt is now clear and because
      the FIFO is already full to the trigger level, no new assertion of
      the RX FIFO interrupt can occur unless the FIFO is drained back
      below the trigger level.  This never occurs because the pl011
      driver is waiting for an RX FIFO interrupt to tell it that there is
      something to read, and does not read the FIFO at all until that
      interrupt occurs.
      
      Thus, simply clearing "spurious" interrupts on startup may be
      misguided, since there is no way to be sure that the interrupts are
      truly spurious, and things can go wrong if they are not.
      
      This patch instead clears the interrupt condition by draining the
      RX FIFO during UART startup, after clearing any potentially
      spurious interrupt.  This should ensure that an interrupt will
      definitely be asserted if the RX FIFO subsequently becomes
      sufficiently full.
      
      The drain is done at the point of enabling interrupts only.  This
      means that it will occur any time the UART is newly opened through
      the tty layer.  It will not apply to polled-mode use of the UART by
      kgdboc: since that scenario cannot use interrupts by design, this
      should not matter.  kgdboc will interact badly with "normal" use of
      the UART in any case: this patch makes no attempt to paper over
      such issues.
      
      This patch does not attempt to address the case where the RX FIFO
      fills faster than it can be drained: that is a pathological
      hardware design problem that is beyond the scope of the driver to
      work around.  As a failsafe, the number of poll iterations for
      draining the FIFO is limited to twice the FIFO size.  This will
      ensure that the kernel at least boots even if it is impossible to
      drain the FIFO for some reason.
      
      [1] [Qemu-devel] [Qemu-arm] [PATCH] pl011: do not put into fifo
      before enabled the interruption
      https://lists.gnu.org/archive/html/qemu-devel/2018-01/msg06446.htmlReported-by: NWei Xu <xuwei5@hisilicon.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Fixes: 9b96fbac ("serial: PL011: clear pending interrupts")
      Signed-off-by: NDave Martin <Dave.Martin@arm.com>
      Cc: stable <stable@vger.kernel.org>
      Tested-by: NWei Xu <xuwei5@hisilicon.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4a7e625c
  14. 28 11月, 2017 2 次提交
    • L
      serial: pl011: Use cached copy of IMSC register · d3a96c94
      Lukas Wunner 提交于
      Commit 075167ed ("drivers: PL011: replace UART_MIS reading with
      _RIS & _IMSC") amended this driver's interrupt handler to read the
      Raw Interrupt Status (RIS) and Interrupt Mask Set/Clear (IMSC) registers
      instead of the Masked Interrupt Status (MIS) register.  The change was
      made to attain compatibility with SBSA UARTs which lack the MIS register.
      
      However the IMSC register is cached by the driver.  Using the cached
      copy saves one register read per interrupt.
      
      I've tested this change successfully on a BCM2837 (Raspberry Pi CM3).
      
      Cc: Mathias Duckeck <m.duckeck@kunbus.de>
      Cc: Phil Elwell <phil@raspberrypi.org>
      Cc: Stefan Wahren <stefan.wahren@i2se.com>
      Cc: Andre Przywara <andre.przywara@arm.com>
      Cc: Mark Langsdorf <mlangsdo@redhat.com>
      Cc: Naresh Bhat <nbhat@cavium.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d3a96c94
    • L
      serial: pl011: Drop duplicate loop counter · e73be92d
      Lukas Wunner 提交于
      pl011_fifo_to_tty() has two counters (max_count and fifotaken) for the
      same loop.  One counter should suffice.  This saves one subtraction per
      character read from the RX FIFO.
      
      Cc: Mathias Duckeck <m.duckeck@kunbus.de>
      Cc: Phil Elwell <phil@raspberrypi.org>
      Cc: Stefan Wahren <stefan.wahren@i2se.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e73be92d
  15. 08 11月, 2017 2 次提交
    • G
      tty: serial: Remove redundant license text · 4793f2eb
      Greg Kroah-Hartman 提交于
      Now that the SPDX tag is in all tty files, that identifies the license
      in a specific and legally-defined manner.  So the extra GPL text wording
      can be removed as it is no longer needed at all.
      
      This is done on a quest to remove the 700+ different ways that files in
      the kernel describe the GPL license text.  And there's unneeded stuff
      like the address (sometimes incorrect) for the FSF which is never
      needed.
      
      No copyright headers or other non-license-description text was removed.
      
      Cc: Jiri Slaby <jslaby@suse.com>
      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: 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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      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: Chris Metcalf <cmetcalf@mellanox.com>
      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>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4793f2eb
    • 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
  16. 04 11月, 2017 1 次提交
  17. 20 10月, 2017 1 次提交
  18. 29 8月, 2017 2 次提交
  19. 30 7月, 2017 1 次提交
    • T
      tty: pl011: fix initialization order of QDF2400 E44 · 37ef38f3
      Timur Tabi 提交于
      The work-around for Qualcomm Technologies QDF2400 Erratum 44 hinges on a
      global variable defined in the pl011 driver.  The ACPI SPCR parsing code
      determines whether the work-around is needed, and if so, it changes the
      console name from "pl011" to "qdf2400_e44".  The expectation is that
      the pl011 driver will implement the work-around when it sees the console
      name.  The global variable qdf2400_e44_present is set when that happens.
      
      The problem is that work-around needs to be enabled when the pl011
      driver probes, not when the console name is queried.  However, sbsa_probe()
      is called before pl011_console_match().  The work-around appeared to work
      previously because the default console on QDF2400 platforms was always
      ttyAMA1.  The first time sbsa_probe() is called (for ttyAMA0),
      qdf2400_e44_present is still false.  Then pl011_console_match() is called,
      and it sets qdf2400_e44_present to true.  All subsequent calls to
      sbsa_probe() enable the work-around.
      
      The solution is to move the global variable into spcr.c and let the
      pl011 driver query it during probe time.  This works because all QDF2400
      platforms require SPCR, so parse_spcr() will always be called.
      pl011_console_match still checks for the "qdf2400_e44" console name,
      but it doesn't do anything else special.
      
      Fixes: 5a0722b8 ("tty: pl011: use "qdf2400_e44" as the earlycon name for QDF2400 E44")
      Tested-by: NJeffrey Hugo <jhugo@codeaurora.org>
      Signed-off-by: NTimur Tabi <timur@codeaurora.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      37ef38f3
  20. 18 4月, 2017 1 次提交
  21. 09 4月, 2017 1 次提交
    • J
      tty: amba-pl011: Fix spurious TX interrupts · 7d05587c
      Jayachandran C 提交于
      On SMP systems, we see a lot of spurious TX interrupts when a
      program generates a steady stream of output to the pl011 UART.
      
      The problem can be easily seen when one CPU generates the output
      while another CPU handles the pl011 interrupts, and the rate of
      output is low enough not to fill the TX FIFO. The problem seems
      to be:
      
          -- CPU a --                        -- CPU b --
         (take port lock)
         pl011_start_tx
            pl011_start_tx_pio
               enable TXIM in REG_IMSC   ->  causes uart tx intr (pl011_int)
               pl011_tx_chars                pl011_int
                  ...tx chars, all done...       (wait for port lock)
                  pl011_stop_tx                   .
                     disable TXIM                 .
          (release port lock)            ->      (take port lock)
                                                 check for TXIM, not enabled
                                                 (release port lock)
                                                 return IRQ_NONE
      
      Enabling the TXIM in pl011_start_tx_pio() causes the interrupt
      to be generated and delivered to CPU b, even though pl011_tx_chars()
      is able to complete the TX and then disable the tx interrupt.
      
      Fix this by enabling TXIM only after pl011_tx_chars, if it is needed.
      pl011_tx_chars will return a boolean indicating whether the TX
      interrupts have to be enabled.
      Debugged-by: NVijaya Kumar <Vijaya.Kumar@cavium.com>
      Signed-off-by: NJayachandran C <jnair@caviumnetworks.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7d05587c
  22. 01 4月, 2017 1 次提交
  23. 17 3月, 2017 1 次提交
  24. 14 3月, 2017 1 次提交
  25. 16 2月, 2017 1 次提交
  26. 03 2月, 2017 1 次提交
    • S
      tty: serial: pl011: add ttyAMA for matching pl011 console · aea9a80b
      Sudeep Holla 提交于
      Commit c7cef0a8 ("console: Add extensible console matching") added
      match() method to struct console which allows the console to perform
      console command line matching instead of (or in addition to) default
      console matching (ie., by fixed name and index).
      
      Commit ad1696f6 ("ACPI: parse SPCR and enable matching console")
      introduced support for SPCR as matching console.
      
      Commit 10879ae5 ("serial: pl011: add console matching function")
      added the match method for pl011 console which checks for the console
      string to be "pl011"
      
      Now on a platform which has both SPCR in the ACPI tables and ttyAMA in
      the command line, the ttyAMA is chosen as "selected console" but it
      doesn't pass the matching console method which results in CON_CONSDEV
      not being set on the "selected console".
      
      As a result of that, the bootconsole(SPCR in the above case) is not
      unregistered and all the beginning boot messages are seen twice.
      
      This patch adds "ttyAMA" so that it's considered to match pl011 console.
      
      Fixes: 10879ae5 ("serial: pl011: add console matching function")
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Peter Hurley <peter@hurleysoftware.com>
      Cc: Aleksey Makarov <aleksey.makarov@linaro.org>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aea9a80b
  27. 27 1月, 2017 1 次提交
    • B
      tty: serial: constify uart_ops structures · 2331e068
      Bhumika Goyal 提交于
      Declare uart_ops structures as const as they are only stored in the ops
      field of an uart_port structure. This field is of type const, so
      uart_ops structures having this property can be made const too.
      
      File size details before and after patching.
      First line of every .o file shows the file size before patching
      and second line shows the size after patching.
      
         text	   data	    bss	    dec	    hex	filename
      
         2977	    456	     64	   3497	    da9	drivers/tty/serial/amba-pl010.o
         3169	    272	     64	   3505	    db1	drivers/tty/serial/amba-pl010.o
      
         3109	    456	      0	   3565	    ded	drivers/tty/serial/efm32-uart.o
         3301	    272	      0	   3573	    df5	drivers/tty/serial/efm32-uart.o
      
        10668	    753	      1	  11422	   2c9e	drivers/tty/serial/icom.o
        10860	    561	      1	  11422	   2c9e	drivers/tty/serial/icom.o
      
        23904	    408	      8	  24320	   5f00	drivers/tty/serial/ioc3_serial.o
        24088	    224	      8	  24320	   5f00	drivers/tty/serial/ioc3_serial.o
      
        10516	    560	      4	  11080	   2b48	drivers/tty/serial/ioc4_serial.o
        10709	    368	      4	  11081	   2b49	drivers/tty/serial/ioc4_serial.o
      
         7853	    648	   1216	   9717	   25f5	drivers/tty/serial/mpsc.o
         8037	    456	   1216	   9709	   25ed	drivers/tty/serial/mpsc.o
      
        10248	    456	      0	  10704	   29d0	drivers/tty/serial/omap-serial.o
        10440	    272	      0	  10712	   29d8	drivers/tty/serial/omap-serial.o
      
         8122	    532	   1984	  10638	   298e	drivers/tty/serial/pmac_zilog.o
         8306	    340	   1984	  10630	   2986	drivers/tty/serial/pmac_zilog.o
      
         3808	    456	      0	   4264	   10a8	drivers/tty/serial/pxa.o
         4000	    264	      0	   4264	   10a8	drivers/tty/serial/pxa.o
      
        21781	   3864	      0	  25645	   642d	drivers/tty/serial/serial-tegra.o
        22037	   3608	      0	  25645	   642d	drivers/tty/serial/serial-tegra.o
      
         2481	    456	     96	   3033	    bd9	drivers/tty/serial/sprd_serial.o
         2673	    272	     96	   3041	    be1	drivers/tty/serial/sprd_serial.o
      
         5534	    300	    512	   6346	   18ca	drivers/tty/serial/vr41xx_siu.o
         5630	    204	    512	   6346	   18ca	drivers/tty/serial/vr41xx_siu.o
      
         6730	   1576	    128	   8434	   20f2	drivers/tty/serial/vt8500_serial.o
         6986	   1320	    128	   8434	   20f2	drivers/tty/serial/vt8500_serial.o
      
      Cross compiled for mips architecture.
      
         3005	    488	      0	   3493	    da5	drivers/tty/serial/pnx8xxx_uart.o
         3189	    304	      0	   3493	    da5	drivers/tty/serial/pnx8xxx_uart.o
      
         4272	    196	   1056	   5524	   1594	drivers/tty/serial/dz.o
         4368	    100	   1056	   5524	   1594	drivers/tty/serial/dz.o
      
         6551	    144	     16	   6711	   1a37	drivers/tty/serial/ip22zilog.o
         6647	     48	     16	   6711	   1a37	drivers/tty/serial/ip22zilog.o
      
         9612	    428	   1520	  11560	   2d28	drivers/tty/serial/serial_txx9.o
         9708	    332	   1520	  11560	   2d28	drivers/tty/serial/serial_txx9.o
      
         4156	    296	     16	   4468	   1174	drivers/tty/serial/ar933x_uart.o
         4252	    200	     16	   4468	   1174	drivers/tty/serial/ar933x_uart.o
      
      Cross compiled for arm archiecture.
      
        11716	   1780	     44	  13540	   34e4	drivers/tty/serial/sirfsoc_uart.o
        11808	   1688	     44	  13540	   34e4	drivers/tty/serial/sirfsoc_uart.o
      
        13352	    596	     56	  14004	   36b4	drivers/tty/serial/amba-pl011.o
        13444	    504	     56	  14004	   36b4	drivers/tty/serial/amba-pl011.o
      
      Cross compiled for sparc architecture.
      
         4664	    528	     32	   5224	   1468	drivers/tty/serial/sunhv.o
         4848	    344	     32	   5224	   1468	drivers/tty/serial/sunhv.o
      
         8080	    332	     28	   8440	   20f8	drivers/tty/serial/sunzilog.o
         8184	    228	     28	   8440	   20f8	drivers/tty/serial/sunzilog.o
      
      Cross compiled for ia64 architecture.
      
        10226	    549	    472	  11247	   2bef	drivers/tty/serial/sn_console.o
        10414	    365	    472	  11251	   2bf3	drivers/tty/serial/sn_console.o
      
      The files drivers/tty/serial/zs.o, drivers/tty/serial/lpc32xx_hs.o and
      drivers/tty/serial/lantiq.o did not compile.
      Signed-off-by: NBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2331e068
  28. 19 1月, 2017 1 次提交
  29. 10 11月, 2016 1 次提交
  30. 27 10月, 2016 1 次提交
  31. 30 9月, 2016 1 次提交
  32. 28 9月, 2016 1 次提交
  33. 27 9月, 2016 1 次提交
  34. 22 9月, 2016 1 次提交
  35. 31 8月, 2016 1 次提交
    • S
      tty: amba-pl011: probe ZTE device from AMBA bus with a pseudo-ID · 2426fbc7
      Shawn Guo 提交于
      There is no Peripheral Identification Registers on ZTE PL011 device, so
      although the driver amba-pl011 is ready to work for ZTE device, the
      device cannot be probed by the driver at all.
      
      With arm,primecell-periphid DT bindings (bindings/arm/primecell.txt) in
      place, it should be the cleanest the way to use a pseudo-ID to probe the
      device from AMBA bus.  We create an unofficial vendor number
      AMBA_VENDOR_LINUX, which will practically never become an official
      vendor ID, and takes Configuration, Revision number, and Part number as
      input to compose a pseudo-ID for ZTE device.
      
      Also, since we start using vendor_zte to probe ZTE device, the
      __maybe_unused for vendor_zte is removed.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NShawn Guo <shawn.guo@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2426fbc7