1. 30 Nov, 2016 1 commit
    • Liwei Song's avatar
      serial: 8250_mid fix calltrace when hotplug 8250 serial controller · a9b01b58
      Liwei Song authored
      Fix the following Calltrace:
      [   77.768221] WARNING: CPU: 5 PID: 645 at drivers/dma/dmaengine.c:1069 dma_async_device_unregister+0xe2/0xf0
      [   77.775058] dma_async_device_unregister called while 1 clients hold a reference
      [   77.825048] CPU: 5 PID: 645 Comm: sh Not tainted 4.8.8-WR9.0.0.0_standard+ #3
      [   77.832550] Hardware name: Intel Corp. Aspen Cove/Server, BIOS HAVLCRB1.X64.0012.D58.1604140405 04/14/2016
      [   77.840396]  0000000000000000 ffffc90008adbc80 ffffffff81403456 ffffc90008adbcd0
      [   77.848245]  0000000000000000 ffffc90008adbcc0 ffffffff8105e2e1 0000042d08adbf20
      [   77.855934]  ffff88046a861c18 ffff88046a85c420 ffffffff820d4200 ffff88046ae92318
      [   77.863601] Call Trace:
      [   77.871113]  [<ffffffff81403456>] dump_stack+0x4f/0x69
      [   77.878655]  [<ffffffff8105e2e1>] __warn+0xd1/0xf0
      [   77.886102]  [<ffffffff8105e34f>] warn_slowpath_fmt+0x4f/0x60
      [   77.893508]  [<ffffffff814187a9>] ? find_next_bit+0x19/0x20
      [   77.900730]  [<ffffffff814bf83e>] ? dma_channel_rebalance+0x23e/0x270
      [   77.907814]  [<ffffffff814bfee2>] dma_async_device_unregister+0xe2/0xf0
      [   77.914992]  [<ffffffff814c53aa>] hsu_dma_remove+0x1a/0x60
      [   77.921977]  [<ffffffff814ee14c>] dnv_exit+0x1c/0x20
      [   77.928752]  [<ffffffff814edff6>] mid8250_remove+0x26/0x40
      [   77.935607]  [<ffffffff8144f1b9>] pci_device_remove+0x39/0xc0
      [   77.942292]  [<ffffffff8160cfea>] __device_release_driver+0x9a/0x140
      [   77.948836]  [<ffffffff8160d0b3>] device_release_driver+0x23/0x30
      [   77.955364]  [<ffffffff81447dcc>] pci_stop_bus_device+0x8c/0xa0
      [   77.961769]  [<ffffffff81447f0a>] pci_stop_and_remove_bus_device_locked+0x1a/0x30
      [   77.968113]  [<ffffffff81450d4e>] remove_store+0x5e/0x70
      [   77.974267]  [<ffffffff81607ed8>] dev_attr_store+0x18/0x30
      [   77.980243]  [<ffffffff8123006a>] sysfs_kf_write+0x3a/0x50
      [   77.986180]  [<ffffffff8122f5ab>] kernfs_fop_write+0x10b/0x190
      [   77.992118]  [<ffffffff811bf1c8>] __vfs_write+0x18/0x40
      [   77.998032]  [<ffffffff811bfdee>] vfs_write+0xae/0x190
      [   78.003747]  [<ffffffff811c1016>] SyS_write+0x46/0xb0
      [   78.009234]  [<ffffffff81a4c31b>] entry_SYSCALL_64_fastpath+0x13/0x8f
      [   78.014809] ---[ end trace 0c36dd73b7408eb2 ]---
      
      This happens when the 8250 serial controller is hotplugged as follows:
      echo 1 > /sys/bus/pci/devices/0000:00:1a.0/remove
      
      This trace happens due to the serial port still holding a reference when
      the dma device is unregistered.
      The dma unregister routine will check if there is still a reference exist,
      if so it will give the WARNING(here serial port still was not unregister).
      
      To fix this, We need to unregister the serial port first, then do DMA
      device unregister to make sure there is no reference when to DMA routine.
      Signed-off-by: default avatarLiwei Song <liwei.song@windriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a9b01b58
  2. 29 Nov, 2016 3 commits
    • Waiman Long's avatar
      console: Move userspace I/O out of console_lock to fix lockdep warning · 7edd7e82
      Waiman Long authored
      When running certain workload on a debug kernel with lockdep turned on,
      a ppc64 kvm guest could sometimes hit the following lockdep warning:
      
        [ INFO: possible circular locking dependency detected ]
        Possible unsafe locking scenario:
      
              CPU0                    CPU1
              ----                    ----
         lock(&mm->mmap_sem);
                                      lock(console_lock);
                                      lock(&mm->mmap_sem);
         lock(cpu_hotplug.lock);
      
        *** DEADLOCK ***
      
      Looking at the console code, the console_lock-->mmap_sem scenario will
      only happen when reading or writing the console unicode map leading to
      a page fault.
      
      To break this circular locking dependency, all the userspace I/O
      operations in consolemap.c are now moved outside of the console_lock
      critical sections so that the mmap_sem won't be acquired when holding
      the console_lock.
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7edd7e82
    • Arnd Bergmann's avatar
      tty: nozomi: avoid sprintf buffer overflow · 5020ded7
      Arnd Bergmann authored
      Testing with a gcc-7 snapshot produced an internal compiler error
      for this file:
      
      drivers/tty/nozomi.c: In function 'receive_flow_control':
      drivers/tty/nozomi.c:919:12: internal compiler error: in get_substring_ranges_for_loc, at input.c:1388
       static int receive_flow_control(struct nozomi *dc)
      
      I've reported this at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78569
      but also noticed that the code line contains a stack overflow, as it prints
      a string into a slightly shorter fixed-length 'tmp' variable.
      
      A lot of the code here is unnecessary and can be expressed in a simpler
      way, relying on the fact that removing the 'DEBUG' macro will also get
      rid of all pr_debug() calls. This change should not change any of the
      output but avoids both the stack overflow and the gcc crash.
      
      The stack overflow will not happen unless a module load parameter is
      also set to enable the debug messages.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5020ded7
    • Gabriel Krisman Bertazi's avatar
      serial: 8250_pci: Detach low-level driver during PCI error recovery · f209fa03
      Gabriel Krisman Bertazi authored
      During a PCI error recovery, like the ones provoked by EEH in the ppc64
      platform, all IO to the device must be blocked while the recovery is
      completed.  Current 8250_pci implementation only suspends the port
      instead of detaching it, which doesn't prevent incoming accesses like
      TIOCMGET and TIOCMSET calls from reaching the device.  Those end up
      racing with the EEH recovery, crashing it.  Similar races were also
      observed when opening the device and when shutting it down during
      recovery.
      
      This patch implements a more robust IO blockage for the 8250_pci
      recovery by unregistering the port at the beginning of the procedure and
      re-adding it afterwards.  Since the port is detached from the uart
      layer, we can be sure that no request will make through to the device
      during recovery.  This is similar to the solution used by the JSM serial
      driver.
      
      I thank Peter Hurley <peter@hurleysoftware.com> for valuable input on
      this one over one year ago.
      Signed-off-by: default avatarGabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f209fa03
  3. 28 Nov, 2016 1 commit
  4. 16 Nov, 2016 9 commits
  5. 10 Nov, 2016 17 commits
  6. 30 Oct, 2016 1 commit
  7. 29 Oct, 2016 8 commits
    • Linus Torvalds's avatar
      Linux 4.9-rc3 · a909d3e6
      Linus Torvalds authored
      a909d3e6
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 42fd2b50
      Linus Torvalds authored
      Pull x86 bugfix from Thomas Gleixner:
       "A single bugfix for the recent changes related to registering the boot
        cpu when this has not happened before prefill_possible_map().
      
        The main problem with this change got fixed already, but we missed the
        case where the local APIC is not yet mapped, when prefill_possible_map()
        is invoked, so the registration of the boot cpu which has the APIC bit
        set in CPUID will explode.
      
        I should have seen that issue earlier, but all I can do now is feeling
        embarassed"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/smpboot: Init apic mapping before usage
      42fd2b50
    • Linus Torvalds's avatar
      Merge tag 'upstream-4.9-rc3' of git://git.infradead.org/linux-ubifs · efa56375
      Linus Torvalds authored
      Pull ubi/ubifs fixes from Richard Weinberger:
       "This contains fixes for issues in both UBI and UBIFS:
      
         - A regression wrt overlayfs, introduced in -rc2.
         - An UBI issue, found by Dan Carpenter's static checker"
      
      * tag 'upstream-4.9-rc3' of git://git.infradead.org/linux-ubifs:
        ubifs: Fix regression in ubifs_readdir()
        ubi: fastmap: Fix add_vol() return value test in ubi_attach_fastmap()
      efa56375
    • Linus Torvalds's avatar
      Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 2674235f
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "We haven't seen a whole lot of fixes for the first two weeks since the
        merge window, but here is the batch that we have at the moment.
      
        Nothing sticks out as particularly bad or scary, it's mostly a handful
        of smaller fixes to several platforms. The Uniphier reset controller
        changes could probably have been delayed to 4.10, but they're not
        scary and just plumbing up driver changes that went in during the
        merge window.
      
        We're also adding another maintainer to Marvell Berlin platforms, to
        help out when Sebastian is too busy. Yay teamwork!"
      
      * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: imx: mach-imx6q: Fix the PHY ID mask for AR8031
        ARM: dts: vf610: fix IRQ flag of global timer
        ARM: imx: gpc: Fix the imx_gpc_genpd_init() error path
        ARM: imx: gpc: Initialize all power domains
        arm64: dts: Updated NAND DT properties for NS2 SVK
        arm64: dts: uniphier: change MIO node to SD control node
        ARM: dts: uniphier: change MIO node to SD control node
        reset: uniphier: rename MIO reset to SD reset for Pro5, PXs2, LD20 SoCs
        arm64: uniphier: select ARCH_HAS_RESET_CONTROLLER
        ARM: uniphier: select ARCH_HAS_RESET_CONTROLLER
        arm64: dts: Add timer erratum property for LS2080A and LS1043A
        arm64: dts: rockchip: remove the abuse of keep-power-in-suspend
        ARM: multi_v7_defconfig: Enable Intel e1000e driver
        MAINTAINERS: add myself as Marvell berlin SoC maintainer
        bus: qcom-ebi2: depend on ARCH_QCOM or COMPILE_TEST
        ARM: dts: fix the SD card on the Snowball
        arm64: dts: rockchip: remove always-on and boot-on from vcc_sd
        arm64: dts: marvell: fix clocksource for CP110 master SPI0
        ARM: mvebu: Select corediv clk for all mvebu v7 SoC
      2674235f
    • Linus Torvalds's avatar
      Merge tag 'char-misc-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 2a290036
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are a few small char/misc driver fixes for reported issues.
      
        The "biggest" are two binder fixes for reported issues that have been
        shipping in Android phones for a while now, the others are various
        fixes for reported problems.
      
        And there's a MAINTAINERS update for good measure.
      
        All have been in linux-next with no reported issues"
      
      * tag 'char-misc-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        MAINTAINERS: Add entry for genwqe driver
        VMCI: Doorbell create and destroy fixes
        GenWQE: Fix bad page access during abort of resource allocation
        vme: vme_get_size potentially returning incorrect value on failure
        extcon: qcom-spmi-misc: Sync the extcon state on interrupt
        hv: do not lose pending heartbeat vmbus packets
        mei: txe: don't clean an unprocessed interrupt cause.
        ANDROID: binder: Clear binder and cookie when setting handle in flat binder struct
        ANDROID: binder: Add strong ref checks
      2a290036
    • Olof Johansson's avatar
      Merge tag 'v4.9-rockchip-dts64-fixes1' of... · b70e8beb
      Olof Johansson authored
      Merge tag 'v4.9-rockchip-dts64-fixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into fixes
      
      Correct regulator handling on Rockchip arm64 boards to make
      bind/unbind calls work correctly and remove a sdio-only
      property from non-sdio mmc hosts, that accidentially was
      added there.
      
      * tag 'v4.9-rockchip-dts64-fixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
        arm64: dts: rockchip: remove the abuse of keep-power-in-suspend
        arm64: dts: rockchip: remove always-on and boot-on from vcc_sd
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      b70e8beb
    • Olof Johansson's avatar
      Merge tag 'arm-soc/for-4.9/devicetree-arm64-fixes' of... · bb70e53e
      Olof Johansson authored
      Merge tag 'arm-soc/for-4.9/devicetree-arm64-fixes' of http://github.com/Broadcom/stblinux into fixes
      
      This pull request contains a single fix for Broadcom ARM64-based SoCs:
      
      - Ray adds the required bus width and OOB sector size properties to the
        Northstar 2 SVK reference board in order for the NAND controller to work
        properly
      
      * tag 'arm-soc/for-4.9/devicetree-arm64-fixes' of http://github.com/Broadcom/stblinux:
        arm64: dts: Updated NAND DT properties for NS2 SVK
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      bb70e53e
    • Olof Johansson's avatar
      Merge tag 'imx-fixes-4.9' of... · fbaff059
      Olof Johansson authored
      Merge tag 'imx-fixes-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into fixes
      
      The i.MX fixes for 4.9:
       - A couple of patches from Fabio to fix the GPC power domain regression
         which is caused by PM Domain core change 0159ec67
         ("PM / Domains: Verify the PM domain is present when adding a
         provider"), and a related kernel crash seen with multi_v7_defconfig
         build.
       - Correct the PHY ID mask for AR8031 to match phy driver code.
       - Apply new added timer erratum A008585 for LS1043A and LS2080A SoC.
       - Correct vf610 global timer IRQ flag to avoid warning from gic driver
         after commit 992345a5 ("irqchip/gic: WARN if setting the
         interrupt type for a PPI fails").
      
      * tag 'imx-fixes-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
        ARM: imx: mach-imx6q: Fix the PHY ID mask for AR8031
        ARM: dts: vf610: fix IRQ flag of global timer
        ARM: imx: gpc: Fix the imx_gpc_genpd_init() error path
        ARM: imx: gpc: Initialize all power domains
        arm64: dts: Add timer erratum property for LS2080A and LS1043A
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      fbaff059