Skip to content
Snippets Groups Projects
  1. Nov 18, 2014
  2. Nov 17, 2014
  3. Nov 12, 2014
  4. Nov 10, 2014
  5. Nov 07, 2014
  6. Nov 06, 2014
    • Johan Hovold's avatar
      USB: cdc-acm: add quirk for control-line state requests · 2a8cdfde
      Johan Hovold authored
      
      Add new quirk for devices that cannot handle control-line state
      requests.
      
      Note that we currently send these requests to all devices, regardless of
      whether they claim to support it, but that errors are only logged if
      support is claimed.
      
      Since commit 0943d8ea ("USB: cdc-acm: use tty-port dtr_rts"), which
      only changed the timings for these requests slightly, this has been
      reported to cause occasional firmware crashes on Simtec Electronics
      Entropy Key devices after re-enumeration. Enable the quirk for this
      device.
      
      Reported-by: default avatarNix <nix@esperi.org.uk>
      Tested-by: default avatarNix <nix@esperi.org.uk>
      Cc: stable <stable@vger.kernel.org>	# v3.16
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2a8cdfde
    • Francesco Ruggeri's avatar
      tty: Fix pty master poll() after slave closes v2 · c4dc3046
      Francesco Ruggeri authored
      
      Commit f95499c3 ("n_tty: Don't wait for buffer work in read() loop")
      introduces a race window where a pty master can be signalled that the pty
      slave was closed before all the data that the slave wrote is delivered.
      Commit f8747d4a ("tty: Fix pty master read() after slave closes") fixed the
      problem in case of n_tty_read, but the problem still exists for n_tty_poll.
      This can be seen by running 'for ((i=0; i<100;i++));do ./test.py ;done'
      where test.py is:
      
      import os, select, pty
      
      (pid, pty_fd) = pty.fork()
      
      if pid == 0:
         os.write(1, 'This string should be received by parent')
      else:
         poller = select.epoll()
         poller.register( pty_fd, select.EPOLLIN )
         ready = poller.poll( 1 * 1000 )
         for fd, events in ready:
            if not events & select.EPOLLIN:
               print 'missed POLLIN event'
            else:
               print os.read(fd, 100)
         poller.close()
      
      The string from the slave is missed several times.
      This patch takes the same approach as the fix for read and special cases
      this condition for poll.
      Tested on 3.16.
      
      Signed-off-by: default avatarFrancesco Ruggeri <fruggeri@arista.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c4dc3046
    • Dmitry Eremin-Solenikov's avatar
      spi: pxa2xx: toggle clocks on suspend if not disabled by runtime PM · 2b9375b9
      Dmitry Eremin-Solenikov authored
      
      If PM_RUNTIME is enabled, it is easy to trigger the following backtrace
      on pxa2xx hosts:
      
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 1 at /home/lumag/linux/arch/arm/mach-pxa/clock.c:35 clk_disable+0xa0/0xa8()
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper Not tainted 3.17.0-00007-g1b3d2ee-dirty #104
      [<c000de68>] (unwind_backtrace) from [<c000c078>] (show_stack+0x10/0x14)
      [<c000c078>] (show_stack) from [<c001d75c>] (warn_slowpath_common+0x6c/0x8c)
      [<c001d75c>] (warn_slowpath_common) from [<c001d818>] (warn_slowpath_null+0x1c/0x24)
      [<c001d818>] (warn_slowpath_null) from [<c0015e80>] (clk_disable+0xa0/0xa8)
      [<c0015e80>] (clk_disable) from [<c02507f8>] (pxa2xx_spi_suspend+0x2c/0x34)
      [<c02507f8>] (pxa2xx_spi_suspend) from [<c0200360>] (platform_pm_suspend+0x2c/0x54)
      [<c0200360>] (platform_pm_suspend) from [<c0207fec>] (dpm_run_callback.isra.14+0x2c/0x74)
      [<c0207fec>] (dpm_run_callback.isra.14) from [<c0209254>] (__device_suspend+0x120/0x2f8)
      [<c0209254>] (__device_suspend) from [<c0209a94>] (dpm_suspend+0x50/0x208)
      [<c0209a94>] (dpm_suspend) from [<c00455ac>] (suspend_devices_and_enter+0x8c/0x3a0)
      [<c00455ac>] (suspend_devices_and_enter) from [<c0045ad4>] (pm_suspend+0x214/0x2a8)
      [<c0045ad4>] (pm_suspend) from [<c04b5c34>] (test_suspend+0x14c/0x1dc)
      [<c04b5c34>] (test_suspend) from [<c000880c>] (do_one_initcall+0x8c/0x1fc)
      [<c000880c>] (do_one_initcall) from [<c04aecfc>] (kernel_init_freeable+0xf4/0x1b4)
      [<c04aecfc>] (kernel_init_freeable) from [<c0378078>] (kernel_init+0x8/0xec)
      [<c0378078>] (kernel_init) from [<c0009590>] (ret_from_fork+0x14/0x24)
      ---[ end trace 46524156d8faa4f6 ]---
      
      This happens because suspend function tries to disable a clock that is
      already disabled by runtime_suspend callback. Add if
      (!pm_runtime_suspended()) checks to suspend/resume path.
      
      Fixes: 7d94a505 (spi/pxa2xx: add support for runtime PM)
      Signed-off-by: default avatarDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      Reported-by: default avatarAndrea Adami <andrea.adami@gmail.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      2b9375b9
    • Jingchang Lu's avatar
      serial: of-serial: fix uninitialized kmalloc variable · 7e12e675
      Jingchang Lu authored
      
      The info pointer points to an uninitialized kmalloced space.
      If a device doesn't have clk property, then info->clk may
      have unpredicated value and cause call trace. So use kzalloc
      to make sure it is NULL initialized.
      
      Signed-off-by: default avatarJingchang Lu <jingchang.lu@freescale.com>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7e12e675
    • Imre Deak's avatar
      tty/vt: don't set font mappings on vc not supporting this · 9e326f78
      Imre Deak authored
      We can call this function for a dummy console that doesn't support
      setting the font mapping, which will result in a null ptr BUG. So check
      for this case and return error for consoles w/o font mapping support.
      
      Reference: https://bugzilla.kernel.org/show_bug.cgi?id=59321
      
      
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9e326f78
    • Matthias Brugger's avatar
      tty: serial: 8250_mtk: Fix quot calculation · cd92208f
      Matthias Brugger authored
      
      The calculation of value quot for highspeed register set to three
      was wrong. This patch fixes the calculation so that the serial port
      for baudrates bigger then 576000 baud is working correctly.
      
      Signed-off-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cd92208f
    • Arnd Bergmann's avatar
      dma: edma: move device registration to platform code · 5305e4d6
      Arnd Bergmann authored
      
      The horrible split between the low-level part of the edma support
      and the dmaengine front-end driver causes problems on multiplatform
      kernels. This is an attempt to improve the situation slightly
      by only registering the dmaengine devices that are actually
      present.
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      [olof: add missing include of linux/dma-mapping.h]
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      5305e4d6
    • Peter Hurley's avatar
      tty: Prevent "read/write wait queue active!" log flooding · 494c1eac
      Peter Hurley authored
      
      Only print one warning when a task is on the read_wait or write_wait
      wait queue at final tty release.
      
      Cc: <stable@vger.kernel.org> # 3.4.x+
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      494c1eac
    • Peter Hurley's avatar
      tty: Fix high cpu load if tty is unreleaseable · 37b16457
      Peter Hurley authored
      
      Kernel oops can cause the tty to be unreleaseable (for example, if
      n_tty_read() crashes while on the read_wait queue). This will cause
      tty_release() to endlessly loop without sleeping.
      
      Use a killable sleep timeout which grows by 2n+1 jiffies over the interval
      [0, 120 secs.) and then jumps to forever (but still killable).
      
      NB: killable just allows for the task to be rewoken manually, not
      to be terminated.
      
      Cc: <stable@vger.kernel.org> # since before 2.6.32
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      37b16457
    • Peter Hurley's avatar
      serial: Fix divide-by-zero fault in uart_get_divisor() · 547039ec
      Peter Hurley authored
      
      uart_get_baud_rate() will return baud == 0 if the max rate is set
      to the "magic" 38400 rate and the SPD_* flags are also specified.
      On the first iteration, if the current baud rate is higher than the
      max, the baud rate is clamped at the max (which in the degenerate
      case is 38400). On the second iteration, the now-"magic" 38400 baud
      rate selects the possibly higher alternate baud rate indicated by
      the SPD_* flag. Since only two loop iterations are performed, the
      loop is exited, a kernel WARNING is generated and a baud rate of
      0 is returned.
      
      Reproducible with:
       setserial /dev/ttyS0 spd_hi base_baud 38400
      
      Only perform the "magic" 38400 -> SPD_* baud transform on the first
      loop iteration, which prevents the degenerate case from recognizing
      the clamped baud rate as the "magic" 38400 value.
      
      Reported-by: default avatarRobert Święcki <robert@swiecki.net>
      Cc: <stable@vger.kernel.org> # all
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      547039ec
Loading