1. 21 6月, 2019 1 次提交
  2. 18 1月, 2019 1 次提交
    • H
      serial: 8250: Fix serial8250 initialization crash · 352c4cf4
      He Zhe 提交于
      The initialization code of interrupt backoff work might reference NULL
      pointer and cause the following crash, if no port was found.
      
      [   10.017727] CPU 0 Unable to handle kernel paging request at virtual address 000001b0, epc == 807088e0, ra == 8070863c
      ---- snip ----
      [   11.704470] [<807088e0>] serial8250_register_8250_port+0x318/0x4ac
      [   11.747251] [<80708d74>] serial8250_probe+0x148/0x1c0
      [   11.789301] [<80728450>] platform_drv_probe+0x40/0x94
      [   11.830515] [<807264f8>] really_probe+0xf8/0x318
      [   11.870876] [<80726b7c>] __driver_attach+0x110/0x12c
      [   11.910960] [<80724374>] bus_for_each_dev+0x78/0xcc
      [   11.951134] [<80725958>] bus_add_driver+0x200/0x234
      [   11.989756] [<807273d8>] driver_register+0x84/0x148
      [   12.029832] [<80d72f84>] serial8250_init+0x138/0x198
      [   12.070447] [<80100e6c>] do_one_initcall+0x5c/0x2a0
      [   12.110104] [<80d3a208>] kernel_init_freeable+0x370/0x484
      [   12.150722] [<80a49420>] kernel_init+0x10/0xf8
      [   12.191517] [<8010756c>] ret_from_kernel_thread+0x14/0x1c
      
      This patch makes sure the initialization code can be reached only if a port
      is found.
      
      Fixes: 6d7f677a ("serial: 8250: Rate limit serial port rx interrupts during input overruns")
      Signed-off-by: NHe Zhe <zhe.he@windriver.com>
      Reviewed-by: NDarwin Dingel <darwin.dingel@alliedtelesis.co.nz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      352c4cf4
  3. 17 12月, 2018 1 次提交
    • D
      serial: 8250: Rate limit serial port rx interrupts during input overruns · 6d7f677a
      Darwin Dingel 提交于
      When a serial port gets faulty or gets flooded with inputs, its interrupt
      handler starts to work double time to get the characters to the workqueue
      for the tty layer to handle them. When this busy time on the serial/tty
      subsystem happens during boot, where it is also busy on the userspace
      trying to initialise, some processes can continuously get preempted
      and will be on hold until the interrupts subside.
      
      The fix is to backoff on processing received characters for a specified
      amount of time when an input overrun is seen (received a new character
      before the previous one is processed). This only stops receive and will
      continue to transmit characters to serial port. After the backoff period
      is done, it receive will be re-enabled. This is optional and will only
      be enabled by setting 'overrun-throttle-ms' in the dts.
      Signed-off-by: NDarwin Dingel <darwin.dingel@alliedtelesis.co.nz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6d7f677a
  4. 18 9月, 2018 1 次提交
    • S
      serial: 8250: drop the printk from serial8250_interrupt() · 9d7c249a
      Sebastian Andrzej Siewior 提交于
      The printk() in serial8250_interrupt() was once hidden behind a debug
      macro in commit f4f653e9 ("serial: 8250, disable "too much work"
      messages") and reverted back in commit 12de375e ("Revert "serial:
      8250, disable "too much work" messages"").
      
      This was introduced first in 0.99.13k with the "serial" driver itself
      (and called pass_number with a limit of 64 and no print). In 1.1.13 it
      was renamed to pass_counter and the printk was behind #if 0. In 1.1.94
      the limit of 64 was increased to 256 and hidden behind
      RS_ISR_PASS_LIMIT. With this change the #if 0 turned into #if 1. It
      slowly become what we have today with a loop limit of 512.
      
      Usually, that printk isn't hit. However on KVM with a busy UART and
      overloaded host it might happen. It is also likely with threaded
      interrupts and a task which preempts the interrupt handler.
      
      If the UART has (legitimate) work to do and we break out of the loop,
      nothing changes: the interrupt is most likely already pending in the
      interrupt controller and we end up in the handler anyway. This printk is
      hardly helping.
      
      Older kernels also had a comment saying that a bad configuration might
      lead to this but I don't see how that should happen because a wrongly
      configured interrupt number would let the handler leave "early" with
      IRQ_NONE and the spurious detected will handle that (weill since 2.6.11,
      before that we had no spurious detector). In that case, we would never
      loop that often here.
      
      This loop looks like an optimisation in order to pull the bytes from the
      FIFO which were received while we were already here instead of waiting
      for the interrupt. This might have been a good idea while the CPUs were
      slow and FIFOs small.
      There are other serial driver in tree, like the amba-pl*, which also
      have this kind of a loop but without the printk (and were based on this
      driver).
      
      Remove the printk which might trigger in otherwise valid situtations.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9d7c249a
  5. 25 7月, 2018 1 次提交
  6. 12 7月, 2018 1 次提交
  7. 22 11月, 2017 1 次提交
    • K
      treewide: Remove TIMER_FUNC_TYPE and TIMER_DATA_TYPE casts · 841b86f3
      Kees Cook 提交于
      With all callbacks converted, and the timer callback prototype
      switched over, the TIMER_FUNC_TYPE cast is no longer needed,
      so remove it. Conversion was done with the following scripts:
      
          perl -pi -e 's|\(TIMER_FUNC_TYPE\)||g' \
              $(git grep TIMER_FUNC_TYPE | cut -d: -f1 | sort -u)
      
          perl -pi -e 's|\(TIMER_DATA_TYPE\)||g' \
              $(git grep TIMER_DATA_TYPE | cut -d: -f1 | sort -u)
      
      The now unused macros are also dropped from include/linux/timer.h.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      841b86f3
  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. 04 10月, 2017 1 次提交
  11. 02 8月, 2017 1 次提交
  12. 30 7月, 2017 1 次提交
  13. 20 6月, 2017 1 次提交
  14. 20 4月, 2017 1 次提交
    • D
      Annotate hardware config module parameters in drivers/tty/ · 3b60daf8
      David Howells 提交于
      When the kernel is running in secure boot mode, we lock down the kernel to
      prevent userspace from modifying the running kernel image.  Whilst this
      includes prohibiting access to things like /dev/mem, it must also prevent
      access by means of configuring driver modules in such a way as to cause a
      device to access or modify the kernel image.
      
      To this end, annotate module_param* statements that refer to hardware
      configuration and indicate for future reference what type of parameter they
      specify.  The parameter parser in the core sees this information and can
      skip such parameters with an error message if the kernel is locked down.
      The module initialisation then runs as normal, but just sees whatever the
      default values for those parameters is.
      
      Note that we do still need to do the module initialisation because some
      drivers have viable defaults set in case parameters aren't specified and
      some drivers support automatic configuration (e.g. PNP or PCI) in addition
      to manually coded parameters.
      
      This patch annotates drivers in drivers/tty/.
      Suggested-by: NAlan Cox <gnomes@lxorguk.ukuu.org.uk>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cc: Jiri Slaby <jslaby@suse.com>
      cc: linux-serial@vger.kernel.org
      3b60daf8
  15. 31 3月, 2017 1 次提交
  16. 14 3月, 2017 1 次提交
  17. 11 1月, 2017 1 次提交
    • H
      Revert "tty: serial: 8250: add CON_CONSDEV to flags" · 6741f551
      Herbert Xu 提交于
      This commit needs to be reverted because it prevents people from
      using the serial console as a secondary console with input being
      directed to tty0.
      
      IOW, if you boot with console=ttyS0 console=tty0 then all kernels
      prior to this commit will produce output on both ttyS0 and tty0
      but input will only be taken from tty0.  With this patch the serial
      console will always be the primary console instead of tty0,
      potentially preventing people from getting into their machines in
      emergency situations.
      
      Fixes: d03516df ("tty: serial: 8250: add CON_CONSDEV to flags")
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6741f551
  18. 16 11月, 2016 2 次提交
  19. 02 9月, 2016 1 次提交
  20. 31 8月, 2016 1 次提交
  21. 26 6月, 2016 2 次提交
  22. 25 6月, 2016 2 次提交
  23. 01 5月, 2016 1 次提交
  24. 08 3月, 2016 1 次提交
  25. 07 2月, 2016 4 次提交
  26. 29 1月, 2016 1 次提交
  27. 14 12月, 2015 1 次提交
  28. 05 10月, 2015 1 次提交
    • M
      serial: don't register CIR serial ports · e4fda3a0
      Maciej S. Szmigiero 提交于
      CIR type serial ports aren't real serial ports.
      
      This is just a way to prevent legacy 8250 serial
      driver from probing and eventually binding some
      resources.
      
      Since in current state such ports aren't providing
      any real functionality and it is not possible
      to change their type via setserial/ioctl(TIOCSSERIAL)
      (due to UPF_FIXED_PORT flag set on them)
      it is simpler and cleaner to not register them at all
      with serial core.
      
      Print a short message in this case so it is known
      to user what has happened.
      
      This way checks for PORT_8250_CIR in serial port
      callbacks can be removed too, since they won't
      ever be called.
      Signed-off-by: NMaciej Szmigiero <mail@maciej.szmigiero.name>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e4fda3a0
  29. 11 8月, 2015 1 次提交
  30. 24 7月, 2015 1 次提交
  31. 01 6月, 2015 1 次提交
  32. 11 5月, 2015 2 次提交