1. 16 5月, 2018 1 次提交
  2. 23 4月, 2018 1 次提交
  3. 23 3月, 2018 1 次提交
  4. 28 2月, 2018 1 次提交
  5. 22 1月, 2018 1 次提交
    • S
      serial: core: mark port as initialized after successful IRQ change · 44117a1d
      Sebastian Andrzej Siewior 提交于
      setserial changes the IRQ via uart_set_info(). It invokes
      uart_shutdown() which free the current used IRQ and clear
      TTY_PORT_INITIALIZED. It will then update the IRQ number and invoke
      uart_startup() before returning to the caller leaving
      TTY_PORT_INITIALIZED cleared.
      
      The next open will crash with
      |  list_add double add: new=ffffffff839fcc98, prev=ffffffff839fcc98, next=ffffffff839fcc98.
      since the close from the IOCTL won't free the IRQ (and clean the list)
      due to the TTY_PORT_INITIALIZED check in uart_shutdown().
      
      There is same pattern in uart_do_autoconfig() and I *think* it also
      needs to set TTY_PORT_INITIALIZED there.
      Is there a reason why uart_startup() does not set the flag by itself
      after the IRQ has been acquired (since it is cleared in uart_shutdown)?
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      44117a1d
  6. 09 1月, 2018 1 次提交
  7. 28 11月, 2017 2 次提交
    • L
      serial: core: Support common rs485 binding for RTS polarity · f1e5b618
      Lukas Wunner 提交于
      When a driver invokes the uart_get_rs485_mode() helper, set the RTS
      polarity to active high by default unless the newly introduced
      "rs485-rts-active-low" property was specified.
      
      imx contains a line to set the default RTS polarity to active high,
      it is now superfluous and hence deleted.
      
      omap-serial historically defaults to active low and supports an
      "rs485-rts-active-high" property to inverse the polarity.
      Retain that behavior for compatibility.
      
      Cc: Mark Jackson <mpfj@newflow.co.uk>
      Cc: Michał Oleszczyk <oleszczyk.m@gmail.com>
      Cc: Rafael Gago Castano <rgc@hms.se>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f1e5b618
    • L
      serial: Make retrieval of rs485 properties platform-agnostic · 743f93f8
      Lukas Wunner 提交于
      Commit ef838a81 ("serial: Add common rs485 device tree parsing
      function") consolidated retrieval of rs485 OF properties in a common
      helper function but did not #ifdef it to CONFIG_OF.  The function is
      therefore included on ACPI platforms as well even though it's not used.
      
      On the other hand ACPI platforms with rs485 do exist (e.g. Siemens
      IOT2040) and they may leverage _DSD to store rs485 properties.  Likewise,
      UART platform devices instantiated from an MFD should be able to specify
      rs485 properties.  In fact, the tty subsystem maintainer had asked for
      a "generic" function during review of commit ef838a81:
      https://marc.info/?l=linux-serial&m=150143441725194&w=4
      
      Thus, instead of constraining the helper to OF platforms, make it
      platform-agnostic by converting it to device_property_*() functions
      and renaming it accordingly.
      
      In imx.c, move the invocation of uart_get_rs485_mode() from
      serial_imx_probe_dt() to serial_imx_probe() so that it also gets called
      for non-OF devices.
      
      In omap-serial.c, move its invocation further up within
      serial_omap_probe_rs485() so that the RTS polarity can be overridden
      with the driver-specific "rs485-rts-active-high" property once we
      introduce a generic "rs485-rts-active-low" property.
      
      Cc: Jan Kiszka <jan.kiszka@siemens.com>
      Cc: Richard Genoud <richard.genoud@gmail.com>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      743f93f8
  8. 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
  9. 04 11月, 2017 1 次提交
  10. 19 9月, 2017 1 次提交
  11. 29 8月, 2017 2 次提交
  12. 30 7月, 2017 1 次提交
    • A
      serial: core: enforce type for upf_t when copying · a17e74c5
      Andy Shevchenko 提交于
      upf_t is a bitwise defined type and any assignment from different, but
      compatible, types makes static analyzer unhappy.
      
      drivers/tty/serial/serial_core.c:793:29: warning: incorrect type in assignment (different base types)
      drivers/tty/serial/serial_core.c:793:29:    expected int [signed] flags
      drivers/tty/serial/serial_core.c:793:29:    got restricted upf_t [usertype] flags
      drivers/tty/serial/serial_core.c:867:19: warning: incorrect type in assignment (different base types)
      drivers/tty/serial/serial_core.c:867:19:    expected restricted upf_t [usertype] new_flags
      drivers/tty/serial/serial_core.c:867:19:    got int [signed] flags
      
      Enforce corresponding types when upf_t being assigned.
      
      Note, we need __force attribute due to the scope of variable. It's being
      used in user space with plain old type while kernel uses bitwise one.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a17e74c5
  13. 13 6月, 2017 1 次提交
  14. 18 5月, 2017 2 次提交
  15. 09 4月, 2017 1 次提交
  16. 31 3月, 2017 1 次提交
  17. 17 3月, 2017 1 次提交
    • J
      tty: serial_core, remove state checks in uart_poll* · 22077b09
      Jiri Slaby 提交于
      Coverity complains about uart_state checks in polling functions. And it
      is indeed correct. We do something like this:
      	struct uart_state *state = drv->state + line;
      	if (!state)
      		return;
      
      Adding 'line' to drv->state would move the potential NULL pointer to
      something near NULL and the check is useless. Even if we checked pure
      drv->state, nothing guarantees it is not freed and NULLed after the
      check. So if the only user of this interface (kgdboc) needs to assure
      something, this is neither the correct thing, nor place to do so.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: linux-serial@vger.kernel.org
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: kgdb-bugreport@lists.sourceforge.net
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      22077b09
  18. 02 3月, 2017 1 次提交
  19. 25 12月, 2016 1 次提交
  20. 28 11月, 2016 1 次提交
  21. 28 10月, 2016 2 次提交
    • R
      tty: serial_core: fix NULL struct tty pointer access in uart_write_wakeup · d0f4bce2
      Rob Herring 提交于
      Since commit 761ed4a9 ("tty: serial_core: convert uart_close to
      use tty_port_close"), the serial console is broken on various systems
      and typing "reboot" splats the following on the serial console:
      
      INIT: Sending p[  427.863916] BUG: unable to handle kernel NULL pointer dereference at 00000000000001e0
      [  427.885156] IP: [] tty_wakeup+0xc/0x70
      [  427.898337] PGD 0 [  427.902051]
      [  427.907498] Oops: 0000 [#1] PREEMPT SMP
      [  427.917635] Modules linked in: nfsv3 nfs_acl nfs fscache lockd
      sunrpc grace edd af_packet cpufreq_conservative cpufreq_userspace
      cpufreq_powersave fuse loop md_mod dm_mod joydev hid_generic usbhid
      ipmi_ssif ohci_pci ohci_hcd ehci_pci ehci_hcd e1000e ptp firewire_ohci
      edac_core pps_core tpm_infineon sp5100_tco firewire_core acpi_cpufreq
      serio_raw pcspkr fjes usbcore shpchp edac_mce_amd tpm_tis ipmi_si
      tpm_tis_core i2c_piix4 k10temp sg ipmi_msghandler tpm sr_mod button
      cdrom kvm_amd kvm irqbypass crc_itu_t ast ttm drm_kms_helper drm
      fb_sys_fops sysimgblt sysfillrect syscopyarea i2c_algo_bit scsi_dh_rdac
      scsi_dh_alua scsi_dh_emc scsi_dh_hp_sw ata_generic pata_atiixp
      [  428.054179] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.0-rc1-1.g73e3f23-default #1
      [  428.072868] Hardware name: System manufacturer System Product Name/KGP(M)E-D16, BIOS 0902    12/03/2010
      [  428.094755] task: ffffffffa2c0d500 task.stack: ffffffffa2c00000
      [  428.109717] RIP: 0010:[]  [] tty_wakeup+0xc/0x70
      [  428.128407] RSP: 0018:ffff9a1a5fc03df8  EFLAGS: 00010086
      [  428.142184] RAX: ffff9a1857258000 RBX: ffffffffa3050ea0 RCX: 0000000000000000
      [  428.159649] RDX: 000000000000001b RSI: 0000000000000000 RDI: 0000000000000000
      [  428.177109] RBP: ffff9a1a5fc03e08 R08: 0000000000000000 R09: 0000000000000000
      [  428.194547] R10: 0000000000021c77 R11: 0000000000000000 R12: ffff9a1857258000
      [  428.212002] R13: 0000000000000000 R14: 0000000000000020 R15: 0000000000000020
      [  428.229481] FS:  0000000000000000(0000) GS:ffff9a1a5fc00000(0000) knlGS:0000000000000000
      [  428.248938] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  428.263726] CR2: 00000000000001e0 CR3: 0000000390c06000 CR4: 00000000000006f0
      [  428.281331] Stack:
      [  428.288696]  ffffffffa3050ea0 ffff9a1857258000 ffff9a1a5fc03e18 ffffffffa24e0ab1
      [  428.307064]  ffff9a1a5fc03e40 ffffffffa24e8865 ffffffffa3050ea0 00000000000000c2
      [  428.325456]  0000000000000046 ffff9a1a5fc03e78 ffffffffa24e8a5f ffffffffa3050ea0
      [  428.343905] Call Trace:
      [  428.352319]   [  428.356216]  [] uart_write_wakeup+0x21/0x30
      
      The problem is for console ports, the serial port is not shutdown and
      interrupts may fire after the struct tty is gone. Simply calling the
      tty_port helper tty_port_tty_wakeup instead of tty_wakeup directly will
      ensure there is a valid struct tty.
      
      Fixes: 761ed4a9 ("tty: serial_core: convert uart_close to use tty_port_close")
      Reported-by: NBorislav Petkov <bp@alien8.de>
      Reported-by: NMike Galbraith <mgalbraith@suse.de>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: linux-serial@vger.kernel.org
      Signed-off-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d0f4bce2
    • G
      tty: serial_core: Fix serial console crash on port shutdown · 4dda864d
      Geert Uytterhoeven 提交于
      The port->console flag is always false, as uart_console() is called
      before the serial console has been registered.
      
      Hence for a serial port used as the console, uart_tty_port_shutdown()
      will still be called when userspace closes the port, powering it down.
      This may lead to a system lock up when the serial console driver writes
      to the serial port's registers.
      
      To fix this, move the setting of port->console after the call to
      uart_configure_port(), which registers the serial console.
      
      Fixes: 761ed4a9 ("tty: serial_core: convert uart_close to use tty_port_close")
      Reported-by: NNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: NRob Herring <robh@kernel.org>
      Tested-by: NMugunthan V N <mugunthanvnm@ti.com>
      Tested-by: NNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      [robh: rebased on tty-linus]
      Signed-off-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4dda864d
  22. 27 10月, 2016 1 次提交
  23. 15 9月, 2016 1 次提交
  24. 14 9月, 2016 1 次提交
  25. 02 9月, 2016 1 次提交
  26. 31 8月, 2016 2 次提交
  27. 26 6月, 2016 1 次提交
  28. 04 5月, 2016 1 次提交
  29. 01 5月, 2016 6 次提交