1. 09 Jan, 2017 28 commits
    • Hans de Goede's avatar
      ACPI / video: Add force_native quirk for Dell XPS 17 L702X · 6d46601e
      Hans de Goede authored
      commit 350fa038 upstream.
      
      The Dell XPS 17 L702X has a non-working acpi_video0 backlight interface
      and an intel_backlight interface which works fine. Add a force_native
      quirk for it so that the non-working acpi_video0 interface does not get
      registered.
      
      Note that there also is an issue with the brightnesskeys on this laptop,
      they do not generate key-press events in anyway. That is not solved by
      this patch.
      
      Link: https://bugzilla.redhat.com/show_bug.cgi?id=1123661Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6d46601e
    • Ian Abbott's avatar
      staging: comedi: ni_mio_common: fix E series ni_ai_insn_read() data · 745f7d0d
      Ian Abbott authored
      commit 857a6610 upstream.
      
      Commit 0557344e ("staging: comedi: ni_mio_common: fix local var for
      32-bit read") changed the type of local variable `d` from `unsigned
      short` to `unsigned int` to fix a bug introduced in
      commit 9c340ac9 ("staging: comedi: ni_stc.h: add read/write
      callbacks to struct ni_private") when reading AI data for NI PCI-6110
      and PCI-6111 cards.  Unfortunately, other parts of the function rely on
      the variable being `unsigned short` when an offset value in local
      variable `signbits` is added to `d` before writing the value to the
      `data` array:
      
      			d += signbits;
      		  	data[n] = d;
      
      The `signbits` variable will be non-zero in bipolar mode, and is used to
      convert the hardware's 2's complement, 16-bit numbers to Comedi's
      straight binary sample format (with 0 representing the most negative
      voltage).  This breaks because `d` is now 32 bits wide instead of 16
      bits wide, so after the addition of `signbits`, `data[n]` ends up being
      set to values above 65536 for negative voltages.  This affects all
      supported "E series" cards except PCI-6143 (and PXI-6143). Fix it by
      ANDing the value written to the `data[n]` with the mask 0xffff.
      
      Fixes: 0557344e ("staging: comedi: ni_mio_common: fix local var for 32-bit read")
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      745f7d0d
    • Ian Abbott's avatar
      staging: comedi: ni_mio_common: fix M Series ni_ai_insn_read() data mask · bd1692be
      Ian Abbott authored
      commit 655c4d44 upstream.
      
      For NI M Series cards, the Comedi `insn_read` handler for the AI
      subdevice is broken due to ANDing the value read from the AI FIFO data
      register with an incorrect mask.  The incorrect mask clears all but the
      most significant bit of the sample data.  It should preserve all the
      sample data bits.  Correct it.
      
      Fixes: 817144ae ("staging: comedi: ni_mio_common: remove unnecessary use of 'board->adbits'")
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bd1692be
    • Arnd Bergmann's avatar
      staging: lustre: ldlm: pl_recalc time handling is wrong · 3b2f287b
      Arnd Bergmann authored
      commit b8cb86fd upstream.
      
      James Simmons reports:
      > The ldlm_pool field pl_recalc_time is set to the current
      > monotonic clock value but the interval period is calculated
      > with the wall clock. This means the interval period will
      > always be far larger than the pl_recalc_period, which is
      > just a small interval time period. The correct thing to
      > do is to use monotomic clock current value instead of the
      > wall clocks value when calculating recalc_interval_sec.
      
      This broke when I converted the 32-bit get_seconds() into
      ktime_get_{real_,}seconds() inconsistently. Either
      one of those two would have worked, but mixing them
      does not.
      
      Staying with the original intention of the patch, this
      changes the ktime_get_seconds() calls into ktime_get_real_seconds(),
      using real time instead of mononic time.
      
      Fixes: 8f83409c ("staging/lustre: use 64-bit time for pl_recalc")
      Reported-by: default avatarJames Simmons <jsimmons@infradead.org>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarJames Simmons <jsimmons@infradead.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3b2f287b
    • Oleg Drokin's avatar
      staging/lustre/osc: Revert erroneous list_for_each_entry_safe use · 38b2dc0b
      Oleg Drokin authored
      commit cd15dd6e upstream.
      
      I have been having a lot of unexplainable crashes in osc_lru_shrink
      lately that I could not see a good explanation for and then I found
      this patch that slip under the radar somehow that incorrectly
      converted while loop for lru list iteration into
      list_for_each_entry_safe totally ignoring that in the body of
      the loop we drop spinlocks guarding this list and move list entries
      around.
      Not sure why it was not showing up right away, perhaps some of the
      more recent LRU changes committed caused some extra pressure on this
      code that finally highlighted the breakage.
      
      Reverts: 8adddc36 ("staging: lustre: osc: Use list_for_each_entry_safe")
      CC: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
      Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      38b2dc0b
    • Vitaly Kuznetsov's avatar
      hv: acquire vmbus_connection.channel_mutex in vmbus_free_channels() · bf6a9b31
      Vitaly Kuznetsov authored
      commit abd1026d upstream.
      
      "kernel BUG at drivers/hv/channel_mgmt.c:350!" is observed when hv_vmbus
      module is unloaded. BUG_ON() was introduced in commit 85d9aa70
      ("Drivers: hv: vmbus: add an API vmbus_hvsock_device_unregister()") as
      vmbus_free_channels() codepath was apparently forgotten.
      
      Fixes: 85d9aa70 ("Drivers: hv: vmbus: add an API vmbus_hvsock_device_unregister()")
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bf6a9b31
    • Dmitry Shachnev's avatar
      docs: sphinx-extensions: make rstFlatTable work with docutils 0.13 · 5bd6ccd9
      Dmitry Shachnev authored
      commit 217e2bfa upstream.
      
      In docutils 0.13, the return type of get_column_widths method of the
      Table directive has changed [1], which breaks our flat-table directive
      and leads to a TypeError when trying to build the docs [2].
      
      This patch adds support for the new return type, while keeping support
      for older docutils versions too.
      
      [1] https://sourceforge.net/p/docutils/patches/120/
      [2] https://sourceforge.net/p/docutils/bugs/303/Signed-off-by: default avatarDmitry Shachnev <mitya57@debian.org>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5bd6ccd9
    • Krzysztof Kozlowski's avatar
      thermal: hwmon: Properly report critical temperature in sysfs · fab303ba
      Krzysztof Kozlowski authored
      commit f37fabb8 upstream.
      
      In the critical sysfs entry the thermal hwmon was returning wrong
      temperature to the user-space.  It was reporting the temperature of the
      first trip point instead of the temperature of critical trip point.
      
      For example:
      	/sys/class/hwmon/hwmon0/temp1_crit:50000
      	/sys/class/thermal/thermal_zone0/trip_point_0_temp:50000
      	/sys/class/thermal/thermal_zone0/trip_point_0_type:active
      	/sys/class/thermal/thermal_zone0/trip_point_3_temp:120000
      	/sys/class/thermal/thermal_zone0/trip_point_3_type:critical
      
      Since commit e68b16ab ("thermal: add hwmon sysfs I/F") the driver
      have been registering a sysfs entry if get_crit_temp() callback was
      provided.  However when accessed, it was calling get_trip_temp() instead
      of the get_crit_temp().
      
      Fixes: e68b16ab ("thermal: add hwmon sysfs I/F")
      Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
      Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fab303ba
    • Boris Brezillon's avatar
      clk: bcm2835: Avoid overwriting the div info when disabling a pll_div clk · 05bc2071
      Boris Brezillon authored
      commit 68af4fa8 upstream.
      
      bcm2835_pll_divider_off() is resetting the divider field in the A2W reg
      to zero when disabling the clock.
      
      Make sure we preserve this value by reading the previous a2w_reg value
      first and ORing the result with A2W_PLL_CHANNEL_DISABLE.
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
      Fixes: 41691b88 ("clk: bcm2835: Add support for programming the audio domain clocks")
      Reviewed-by: default avatarEric Anholt <eric@anholt.net>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      05bc2071
    • Alexandre Courbot's avatar
      arm64: tegra: Add VDD_GPU regulator to Jetson TX1 · b6d66631
      Alexandre Courbot authored
      commit 5e6b9a89 upstream.
      
      Add the VDD_GPU regulator (a GPIO-enabled PWM regulator) to the Jetson
      TX1 board. This addition allows the GPU to be used provided the
      bootloader properly enabled the GPU node.
      Signed-off-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      [as pointed out by Thierry on IRC, nobody has reported a bug
       in the field, but using a new bootloader with a .dtb that
       has the incorrect data, it will crash on boot]
      Fixes: 336f79c7 ("arm64: tegra: Add NVIDIA Jetson TX1 Developer Kit support")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b6d66631
    • Lars-Peter Clausen's avatar
      gpio: chardev: Return error for seek operations · 5f654078
      Lars-Peter Clausen authored
      commit f4e81c52 upstream.
      
      The GPIO chardev is used for management tasks (allocating line and event
      handles) and does neither support read() nor write() operations. Hence it
      does not make much sense to allow seek operations.
      
      Currently the chardev uses noop_llseek() for its seek implementation. This
      function does not move the pointer and simply returns the current position
      (always 0 for the GPIO chardev). noop_llseek() is primarily meant for
      devices that can not support seek, but where there might be a user that
      depends on the seek() operation succeeding. For newly added devices that
      can not support seek operations it is recommended to use no_llseek(), which
      will return an error. For more information see commit 6038f373
      ("llseek: automatically add .llseek fop").
      
      Unfortunately this was overlooked when the GPIO chardev ABI was introduced.
      But it is highly unlikely that since then userspace applications have
      appeared that rely on being able to perform non-failing seek operations on
      a GPIO chardev file descriptor. So it should be safe to change from
      noop_llseel() to no_seek(). Also use nonseekable_open() in the chardev
      open() callback to clear the FMODE_SEEK, FMODE_PREAD and FMODE_PWRITE flags
      from the file. Neither of these should be set on a file that does not
      support seek operations.
      
      Fixes: 3c702e99 ("gpio: add a userspace chardev ABI for GPIOs")
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5f654078
    • Linus Walleij's avatar
      gpio: stmpe: fix interrupt handling bug · acd0993f
      Linus Walleij authored
      commit 1516c635 upstream.
      
      commit 43db289d ("gpio: stmpe: Rework registers access")
      reworked the STMPE register access so as to use
      [STMPE_IDX_*_LSB + i] to access the 8bit register for a
      certain bank, assuming the CSB and MSB will follow after
      the enumerator. For this to work the index needs to go from
      (size-1) to 0 not 0 to (size-1).
      
      However for the GPIO IRQ handler, the status registers we read
      register MSB + 3 bytes ahead for the 24 bit GPIOs and index
      registers from MSB upwards and run an index i over the
      registers UNLESS we are STMPE1600.
      
      This is not working when we get to clearing the interrupt
      EDGE status register STMPE_IDX_GPEDR_[LCM]SB: it is indexed
      like all other registers [STMPE_IDX_*_LSB + i] but in this
      loop we index from 0 to get the right bank index for the
      calculations, and we need to just add i to the MSB.
      
      Before this, interrupts on the STMPE2401 were broken, this
      patch fixes it so it works again.
      
      Cc: Patrice Chotard <patrice.chotard@st.com>
      Fixes: 43db289d ("gpio: stmpe: Rework registers access")
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      acd0993f
    • Thomas Gleixner's avatar
      timekeeping_Force_unsigned_clocksource_to_nanoseconds_conversion · ca22975a
      Thomas Gleixner authored
      commit 9c164572 upstream.
      
      The clocksource delta to nanoseconds conversion is using signed math, but
      the delta is unsigned. This makes the conversion space smaller than
      necessary and in case of a multiplication overflow the conversion can
      become negative. The conversion is done with scaled math:
      
          s64 nsec_delta = ((s64)clkdelta * clk->mult) >> clk->shift;
      
      Shifting a signed integer right obvioulsy preserves the sign, which has
      interesting consequences:
      
       - Time jumps backwards
      
       - __iter_div_u64_rem() which is used in one of the calling code pathes
         will take forever to piecewise calculate the seconds/nanoseconds part.
      
      This has been reported by several people with different scenarios:
      
      David observed that when stopping a VM with a debugger:
      
       "It was essentially the stopped by debugger case.  I forget exactly why,
        but the guest was being explicitly stopped from outside, it wasn't just
        scheduling lag.  I think it was something in the vicinity of 10 minutes
        stopped."
      
       When lifting the stop the machine went dead.
      
      The stopped by debugger case is not really interesting, but nevertheless it
      would be a good thing not to die completely.
      
      But this was also observed on a live system by Liav:
      
       "When the OS is too overloaded, delta will get a high enough value for the
        msb of the sum delta * tkr->mult + tkr->xtime_nsec to be set, and so
        after the shift the nsec variable will gain a value similar to
        0xffffffffff000000."
      
      Unfortunately this has been reintroduced recently with commit 6bd58f09
      ("time: Add cycles to nanoseconds translation"). It had been fixed a year
      ago already in commit 35a4933a ("time: Avoid signed overflow in
      timekeeping_get_ns()").
      
      Though it's not surprising that the issue has been reintroduced because the
      function itself and the whole call chain uses s64 for the result and the
      propagation of it. The change in this recent commit is subtle:
      
         s64 nsec;
      
      -  nsec = (d * m + n) >> s:
      +  nsec = d * m + n;
      +  nsec >>= s;
      
      d being type of cycle_t adds another level of obfuscation.
      
      This wouldn't have happened if the previous change to unsigned computation
      would have made the 'nsec' variable u64 right away and a follow up patch
      had cleaned up the whole call chain.
      
      There have been patches submitted which basically did a revert of the above
      patch leaving everything else unchanged as signed. Back to square one. This
      spawned a admittedly pointless discussion about potential users which rely
      on the unsigned behaviour until someone pointed out that it had been fixed
      before. The changelogs of said patches added further confusion as they made
      finally false claims about the consequences for eventual users which expect
      signed results.
      
      Despite delta being cycle_t, aka. u64, it's very well possible to hand in
      a signed negative value and the signed computation will happily return the
      correct result. But nobody actually sat down and analyzed the code which
      was added as user after the propably unintended signed conversion.
      
      Though in sensitive code like this it's better to analyze it proper and
      make sure that nothing relies on this than hunting the subtle wreckage half
      a year later. After analyzing all call chains it stands that no caller can
      hand in a negative value (which actually would work due to the s64 cast)
      and rely on the signed math to do the right thing.
      
      Change the conversion function to unsigned math. The conversion of all call
      chains is done in a follow up patch.
      
      This solves the starvation issue, which was caused by the negative result,
      but it does not solve the underlying problem. It merily procrastinates
      it. When the timekeeper update is deferred long enough that the unsigned
      multiplication overflows, then time going backwards is observable again.
      
      It does neither solve the issue of clocksources with a small counter width
      which will wrap around possibly several times and cause random time stamps
      to be generated. But those are usually not found on systems used for
      virtualization, so this is likely a non issue.
      
      I took the liberty to claim authorship for this simply because
      analyzing all callsites and writing the changelog took substantially
      more time than just making the simple s/s64/u64/ change and ignore the
      rest.
      
      Fixes: 6bd58f09 ("time: Add cycles to nanoseconds translation")
      Reported-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Reported-by: default avatarLiav Rehana <liavr@mellanox.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Parit Bhargava <prarit@redhat.com>
      Cc: Laurent Vivier <lvivier@redhat.com>
      Cc: "Christopher S. Hall" <christopher.s.hall@intel.com>
      Cc: Chris Metcalf <cmetcalf@mellanox.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Link: http://lkml.kernel.org/r/20161208204228.688545601@linutronix.deSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ca22975a
    • Paul Burton's avatar
      mmc: sd: Meet alignment requirements for raw_ssr DMA · efd16f76
      Paul Burton authored
      commit e85baa88 upstream.
      
      The mmc_read_ssr() function results in DMA to the raw_ssr member of
      struct mmc_card, which is not guaranteed to be cache line aligned & thus
      might not meet the requirements set out in Documentation/DMA-API.txt:
      
        Warnings:  Memory coherency operates at a granularity called the cache
        line width.  In order for memory mapped by this API to operate
        correctly, the mapped region must begin exactly on a cache line
        boundary and end exactly on one (to prevent two separately mapped
        regions from sharing a single cache line).  Since the cache line size
        may not be known at compile time, the API will not enforce this
        requirement.  Therefore, it is recommended that driver writers who
        don't take special care to determine the cache line size at run time
        only map virtual regions that begin and end on page boundaries (which
        are guaranteed also to be cache line boundaries).
      
      On some systems where DMA is non-coherent this can lead to us losing
      data that shares cache lines with the raw_ssr array.
      
      Fix this by kmalloc'ing a temporary buffer to perform DMA into. kmalloc
      will ensure the buffer is suitably aligned, allowing the DMA to be
      performed without any loss of data.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Fixes: 5275a652 ("mmc: sd: Export SD Status via “ssr” device attribute")
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      efd16f76
    • Linus Walleij's avatar
      regulator: stw481x-vmmc: fix ages old enable error · dbcde92b
      Linus Walleij authored
      commit 295070e9 upstream.
      
      The regulator has never been properly enabled, it has been
      dormant all the time. It's strange that MMC was working
      at all, but it likely worked by the signals going through
      the levelshifter and reaching the card anyways.
      
      Fixes: 3615a34e ("regulator: add STw481x VMMC driver")
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dbcde92b
    • Adrian Hunter's avatar
      mmc: sdhci: Fix recovery from tuning timeout · cee93584
      Adrian Hunter authored
      commit 61e53bd0 upstream.
      
      Clearing the tuning bits should reset the tuning circuit. However there is
      more to do. Reset the command and data lines for good measure, and then
      for eMMC ensure the card is not still trying to process a tuning command by
      sending a stop command.
      
      Note the JEDEC eMMC specification says the stop command (CMD12) can be used
      to stop a tuning command (CMD21) whereas the SD specification is silent on
      the subject with respect to the SD tuning command (CMD19). Considering that
      CMD12 is not a valid SDIO command, the stop command is sent only when the
      tuning command is CMD21 i.e. for eMMC. That addresses cases seen so far
      which have been on eMMC.
      
      Note that this replaces the commit fe5fb2e3 ("mmc: sdhci: Reset cmd and
      data circuits after tuning failure") which is being reverted for v4.9+.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Tested-by: default avatarDan O'Donovan <dan@emutex.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cee93584
    • Adrian Hunter's avatar
      Revert "mmc: sdhci: Reset cmd and data circuits after tuning failure" · 5bb42503
      Adrian Hunter authored
      commit 2ca71c27 upstream.
      
      This reverts commit fe5fb2e3 ("mmc: sdhci: Reset cmd and data circuits
      after tuning failure").
      
      A better fix is available, and it will be applied to older stable releases,
      so get this out of the way by reverting it.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5bb42503
    • Tobias Klausmann's avatar
      ath9k: do not return early to fix rcu unlocking · 71717a3e
      Tobias Klausmann authored
      commit d1f1c0e2 upstream.
      
      Starting with commit d94a461d ("ath9k: use ieee80211_tx_status_noskb
      where possible") the driver uses rcu_read_lock() && rcu_read_unlock(), yet on
      returning early in ath_tx_edma_tasklet() the unlock is missing leading to stalls
      and suspicious RCU usage:
      
       ===============================
       [ INFO: suspicious RCU usage. ]
       4.9.0-rc8 #11 Not tainted
       -------------------------------
       kernel/rcu/tree.c:705 Illegal idle entry in RCU read-side critical section.!
      
       other info that might help us debug this:
      
       RCU used illegally from idle CPU!
       rcu_scheduler_active = 1, debug_locks = 0
       RCU used illegally from extended quiescent state!
       1 lock held by swapper/7/0:
       #0:
        (
       rcu_read_lock
       ){......}
       , at:
       [<ffffffffa06ed110>] ath_tx_edma_tasklet+0x0/0x450 [ath9k]
      
       stack backtrace:
       CPU: 7 PID: 0 Comm: swapper/7 Not tainted 4.9.0-rc8 #11
       Hardware name: Acer Aspire V3-571G/VA50_HC_CR, BIOS V2.21 12/16/2013
        ffff88025efc3f38 ffffffff8132b1e5 ffff88017ede4540 0000000000000001
        ffff88025efc3f68 ffffffff810a25f7 ffff88025efcee60 ffff88017edebdd8
        ffff88025eeb5400 0000000000000091 ffff88025efc3f88 ffffffff810c3cd4
       Call Trace:
        <IRQ>
        [<ffffffff8132b1e5>] dump_stack+0x68/0x93
        [<ffffffff810a25f7>] lockdep_rcu_suspicious+0xd7/0x110
        [<ffffffff810c3cd4>] rcu_eqs_enter_common.constprop.85+0x154/0x200
        [<ffffffff810c5a54>] rcu_irq_exit+0x44/0xa0
        [<ffffffff81058631>] irq_exit+0x61/0xd0
        [<ffffffff81018d25>] do_IRQ+0x65/0x110
        [<ffffffff81672189>] common_interrupt+0x89/0x89
        <EOI>
        [<ffffffff814ffe11>] ? cpuidle_enter_state+0x151/0x200
        [<ffffffff814ffee2>] cpuidle_enter+0x12/0x20
        [<ffffffff8109a6ae>] call_cpuidle+0x1e/0x40
        [<ffffffff8109a8f6>] cpu_startup_entry+0x146/0x220
        [<ffffffff810336f8>] start_secondary+0x148/0x170
      Signed-off-by: default avatarTobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
      Fixes: d94a461d ("ath9k: use ieee80211_tx_status_noskb where possible")
      Acked-by: default avatarFelix Fietkau <nbd@nbd.name>
      Acked-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Tested-by: default avatarGabriel Craciunescu <nix.or.die@gmail.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      71717a3e
    • Vittorio Gambaletta (VittGam)'s avatar
      ath9k: Really fix LED polarity for some Mini PCI AR9220 MB92 cards. · de5d62f8
      Vittorio Gambaletta (VittGam) authored
      commit 79e57dd1 upstream.
      
      The active_high LED of my Wistron DNMA-92 is still being recognized as
      active_low on 4.7.6 mainline. When I was preparing my former commit
      0f9edcdd ("ath9k: Fix LED polarity for some Mini PCI AR9220 MB92
      cards.") to fix that I must have somehow messed up with testing, because
      I tested the final version of that patch before sending it, and it was
      apparently working; but now it is not working on 4.7.6 mainline.
      
      I initially added the PCI_DEVICE_SUB section for 0x0029/0x2096 above the
      PCI_VDEVICE section for 0x0029; but then I moved the former below the
      latter after seeing how 0x002A sections were sorted in the file.
      
      This turned out to be wrong: if a generic PCI_VDEVICE entry (that has
      both subvendor and subdevice IDs set to PCI_ANY_ID) is put before a more
      specific one (PCI_DEVICE_SUB), then the generic PCI_VDEVICE entry will
      match first and will be used.
      
      With this patch, 0x0029/0x2096 has finally got active_high LED on 4.7.6.
      
      While I'm at it, let's fix 0x002A too by also moving its generic definition
      below its specific ones.
      
      Fixes: 0f9edcdd ("ath9k: Fix LED polarity for some Mini PCI AR9220 MB92 cards.")
      Signed-off-by: default avatarVittorio Gambaletta <linuxbugs@vittgam.net>
      [kvalo@qca.qualcomm.com: improve the commit log based on email discussions]
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      de5d62f8
    • Matthias Schiffer's avatar
      ath9k: fix ath9k_hw_gpio_get() to return 0 or 1 on success · 072ebf89
      Matthias Schiffer authored
      commit 91851cc7 upstream.
      
      Commit b2d70d49 ("ath9k: make GPIO API to support both of WMAC and
      SOC") refactored ath9k_hw_gpio_get() to support both WMAC and SOC GPIOs,
      changing the return on success from 1 to BIT(gpio). This broke some callers
      like ath_is_rfkill_set(). This doesn't fix any known bug in mainline at the
      moment, but should be fixed anyway.
      
      Instead of fixing all callers, change ath9k_hw_gpio_get() back to only
      return 0 or 1.
      
      Fixes: b2d70d49 ("ath9k: make GPIO API to support both of WMAC and SOC")
      Signed-off-by: default avatarMatthias Schiffer <mschiffer@universe-factory.net>
      [kvalo@qca.qualcomm.com: mention that doesn't fix any known bug]
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      072ebf89
    • Johannes Berg's avatar
      cfg80211/mac80211: fix BSS leaks when abandoning assoc attempts · 1976c768
      Johannes Berg authored
      commit e6f462df upstream.
      
      When mac80211 abandons an association attempt, it may free
      all the data structures, but inform cfg80211 and userspace
      about it only by sending the deauth frame it received, in
      which case cfg80211 has no link to the BSS struct that was
      used and will not cfg80211_unhold_bss() it.
      
      Fix this by providing a way to inform cfg80211 of this with
      the BSS entry passed, so that it can clean up properly, and
      use this ability in the appropriate places in mac80211.
      
      This isn't ideal: some code is more or less duplicated and
      tracing is missing. However, it's a fairly small change and
      it's thus easier to backport - cleanups can come later.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1976c768
    • Jes Sorensen's avatar
      rtl8xxxu: Work around issue with 8192eu and 8723bu devices not reconnecting · 3f23f7f2
      Jes Sorensen authored
      commit c59f13bb upstream.
      
      The H2C MEDIA_STATUS_RPT command for some reason causes 8192eu and
      8723bu devices not being able to reconnect.
      Reported-by: default avatarBarry Day <briselec@gmail.com>
      Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3f23f7f2
    • Thomas Gleixner's avatar
      perf/x86/intel/cstate: Prevent hotplug callback leak · 19d55b9f
      Thomas Gleixner authored
      commit 834fcd29 upstream.
      
      If the pmu registration fails the registered hotplug callbacks are not
      removed. Wrong in any case, but fatal in case of a modular driver.
      
      Replace the nonsensical state names with proper ones while at it.
      
      Fixes: 77c34ef1 ("perf/x86/intel/cstate: Convert Intel CSTATE to hotplug state machine")
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Sebastian Siewior <bigeasy@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      19d55b9f
    • Ravi Bangoria's avatar
      perf annotate: Don't throw error for zero length symbols · ba12b35f
      Ravi Bangoria authored
      commit edee44be upstream.
      
      'perf report --tui' exits with error when it finds a sample of zero
      length symbol (i.e. addr == sym->start == sym->end). Actually these are
      valid samples. Don't exit TUI and show report with such symbols.
      Reported-and-Tested-by: default avatarAnton Blanchard <anton@samba.org>
      Link: https://lkml.org/lkml/2016/10/8/189Signed-off-by: default avatarRavi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Chris Riyder <chris.ryder@arm.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Nicholas Piggin <npiggin@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1479804050-5028-1-git-send-email-ravi.bangoria@linux.vnet.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ba12b35f
    • Andi Kleen's avatar
      perf/x86: Fix exclusion of BTS and LBR for Goldmont · 54fa190d
      Andi Kleen authored
      commit b0c1ef52 upstream.
      
      An earlier patch allowed enabling PT and LBR at the same
      time on Goldmont. However it also allowed enabling BTS and LBR
      at the same time, which is still not supported. Fix this by
      bypassing the check only for PT.
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: alexander.shishkin@intel.com
      Cc: kan.liang@intel.com
      Fixes: ccbebba4 ("perf/x86/intel/pt: Bypass PT vs. LBR exclusivity if the core supports it")
      Link: http://lkml.kernel.org/r/20161209001417.4713-1-andi@firstfloor.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      54fa190d
    • Larry Finger's avatar
      rtlwifi: Fix enter/exit power_save · 98068574
      Larry Finger authored
      commit ba9f93f8 upstream.
      
      In commit a5ffbe0a ("rtlwifi: Fix scheduling while atomic bug") and
      commit a269913c ("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter()
      to use work queue"), an error was introduced in the power-save routines
      due to the fact that leaving PS was delayed by the use of a work queue.
      
      This problem is fixed by detecting if the enter or leave routines are
      in interrupt mode. If so, the workqueue is used to place the request.
      If in normal mode, the enter or leave routines are called directly.
      
      Fixes: a269913c ("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter() to use work queue")
      Reported-by: default avatarPing-Ke Shih <pkshih@realtek.com>
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      98068574
    • Mohammed Shafi Shajakhan's avatar
      ath10k: fix soft lockup during firmware crash/hw-restart · ea23fca0
      Mohammed Shafi Shajakhan authored
      commit c2cac2f7 upstream.
      
      During firmware crash (or) user requested manual restart
      the system gets into a soft lock up state because of the
      below root cause.
      
      During user requested hardware restart / firmware crash
      the system goes into a soft lockup state as 'napi_synchronize'
      is called after 'napi_disable' (which sets 'NAPI_STATE_SCHED'
      bit) and it sleeps into infinite loop as it waits for
      'NAPI_STATE_SCHED' to be cleared. This condition is hit because
      'ath10k_hif_stop' is called twice as below (resulting in calling
      'napi_synchronize' after 'napi_disable')
      
      'ath10k_core_restart' -> 'ath10k_hif_stop' (ATH10K_STATE_ON) ->
      -> 'ieee80211_restart_hw' -> 'ath10k_start' -> 'ath10k_halt' ->
      'ath10k_core_stop' -> 'ath10k_hif_stop' (ATH10K_STATE_RESTARTING)
      
      Fix this by calling 'ath10k_halt' in ath10k_core_restart itself
      as it makes more sense before informing mac80211 to restart h/w
      Also remove 'ath10k_halt' in ath10k_start for the state of 'restarting'
      
      Fixes: 3c97f5de ("ath10k: implement NAPI support")
      Signed-off-by: default avatarMohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ea23fca0
    • Larry Finger's avatar
      ssb: Fix error routine when fallback SPROM fails · b8425f41
      Larry Finger authored
      commit 8052d724 upstream.
      
      When there is a CRC error in the SPROM read from the device, the code
      attempts to handle a fallback SPROM. When this also fails, the driver
      returns zero rather than an error code.
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b8425f41
  2. 06 Jan, 2017 12 commits
    • Greg Kroah-Hartman's avatar
      Linux 4.9.1 · 6437abdb
      Greg Kroah-Hartman authored
      6437abdb
    • Adam Borowski's avatar
      x86/kbuild: enable modversions for symbols exported from asm · 705df55b
      Adam Borowski authored
      commit 334bb773 upstream.
      
      Commit 4efca4ed ("kbuild: modversions for EXPORT_SYMBOL() for asm") adds
      modversion support for symbols exported from asm files. Architectures
      must include C-style declarations for those symbols in asm/asm-prototypes.h
      in order for them to be versioned.
      
      Add these declarations for x86, and an architecture-independent file that
      can be used for common symbols.
      
      With f27c2f69 reverting 8ab2ae65 ("default exported asm symbols to zero") we
      produce a scary warning on x86, this commit fixes that.
      Signed-off-by: default avatarAdam Borowski <kilobyte@angband.pl>
      Tested-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Acked-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Tested-by: default avatarPeter Wu <peter@lekensteyn.nl>
      Tested-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: default avatarMichal Marek <mmarek@suse.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      705df55b
    • Adam Borowski's avatar
      builddeb: fix cross-building to arm64 producing host-arch debs · c728f2b5
      Adam Borowski authored
      commit 152b695d upstream.
      
      Both Debian and kernel archs are "arm64" but UTS_MACHINE and gcc say
      "aarch64".  Recognizing just the latter should be enough but let's
      accept both in case something regresses again or an user sets
      UTS_MACHINE=arm64.
      
      Regressed in cfa88c79: arm64: Set UTS_MACHINE in the Makefile.
      Signed-off-by: default avatarAdam Borowski <kilobyte@angband.pl>
      Acked-by: default avatarRiku Voipio <riku.voipio@linaro.org>
      Signed-off-by: default avatarMichal Marek <mmarek@suse.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c728f2b5
    • Eric Sandeen's avatar
      xfs: set AGI buffer type in xlog_recover_clear_agi_bucket · e1209629
      Eric Sandeen authored
      commit 6b10b23c upstream.
      
      xlog_recover_clear_agi_bucket didn't set the
      type to XFS_BLFT_AGI_BUF, so we got a warning during log
      replay (or an ASSERT on a debug build).
      
          XFS (md0): Unknown buffer type 0!
          XFS (md0): _xfs_buf_ioapply: no ops on block 0xaea8802/0x1
      
      Fix this, as was done in f19b872b for 2 other locations
      with the same problem.
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e1209629
    • Eric Sandeen's avatar
      xfs: fix up xfs_swap_extent_forks inline extent handling · c11a13d6
      Eric Sandeen authored
      commit 4dfce57d upstream.
      
      There have been several reports over the years of NULL pointer
      dereferences in xfs_trans_log_inode during xfs_fsr processes,
      when the process is doing an fput and tearing down extents
      on the temporary inode, something like:
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
      PID: 29439  TASK: ffff880550584fa0  CPU: 6   COMMAND: "xfs_fsr"
          [exception RIP: xfs_trans_log_inode+0x10]
       #9 [ffff8800a57bbbe0] xfs_bunmapi at ffffffffa037398e [xfs]
      #10 [ffff8800a57bbce8] xfs_itruncate_extents at ffffffffa0391b29 [xfs]
      #11 [ffff8800a57bbd88] xfs_inactive_truncate at ffffffffa0391d0c [xfs]
      #12 [ffff8800a57bbdb8] xfs_inactive at ffffffffa0392508 [xfs]
      #13 [ffff8800a57bbdd8] xfs_fs_evict_inode at ffffffffa035907e [xfs]
      #14 [ffff8800a57bbe00] evict at ffffffff811e1b67
      #15 [ffff8800a57bbe28] iput at ffffffff811e23a5
      #16 [ffff8800a57bbe58] dentry_kill at ffffffff811dcfc8
      #17 [ffff8800a57bbe88] dput at ffffffff811dd06c
      #18 [ffff8800a57bbea8] __fput at ffffffff811c823b
      #19 [ffff8800a57bbef0] ____fput at ffffffff811c846e
      #20 [ffff8800a57bbf00] task_work_run at ffffffff81093b27
      #21 [ffff8800a57bbf30] do_notify_resume at ffffffff81013b0c
      #22 [ffff8800a57bbf50] int_signal at ffffffff8161405d
      
      As it turns out, this is because the i_itemp pointer, along
      with the d_ops pointer, has been overwritten with zeros
      when we tear down the extents during truncate.  When the in-core
      inode fork on the temporary inode used by xfs_fsr was originally
      set up during the extent swap, we mistakenly looked at di_nextents
      to determine whether all extents fit inline, but this misses extents
      generated by speculative preallocation; we should be using if_bytes
      instead.
      
      This mistake corrupts the in-memory inode, and code in
      xfs_iext_remove_inline eventually gets bad inputs, causing
      it to memmove and memset incorrect ranges; this became apparent
      because the two values in ifp->if_u2.if_inline_ext[1] contained
      what should have been in d_ops and i_itemp; they were memmoved due
      to incorrect array indexing and then the original locations
      were zeroed with memset, again due to an array overrun.
      
      Fix this by properly using i_df.if_bytes to determine the number
      of extents, not di_nextents.
      
      Thanks to dchinner for looking at this with me and spotting the
      root cause.
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c11a13d6
    • Julien Grall's avatar
      arm/xen: Use alloc_percpu rather than __alloc_percpu · e67053ad
      Julien Grall authored
      commit 24d5373d upstream.
      
      The function xen_guest_init is using __alloc_percpu with an alignment
      which are not power of two.
      
      However, the percpu allocator never supported alignments which are not power
      of two and has always behaved incorectly in thise case.
      
      Commit 3ca45a46 "percpu: ensure requested alignment is power of two"
      introduced a check which trigger a warning [1] when booting linux-next
      on Xen. But in reality this bug was always present.
      
      This can be fixed by replacing the call to __alloc_percpu with
      alloc_percpu. The latter will use an alignment which are a power of two.
      
      [1]
      
      [    0.023921] illegal size (48) or align (48) for percpu allocation
      [    0.024167] ------------[ cut here ]------------
      [    0.024344] WARNING: CPU: 0 PID: 1 at linux/mm/percpu.c:892 pcpu_alloc+0x88/0x6c0
      [    0.024584] Modules linked in:
      [    0.024708]
      [    0.024804] CPU: 0 PID: 1 Comm: swapper/0 Not tainted
      4.9.0-rc7-next-20161128 #473
      [    0.025012] Hardware name: Foundation-v8A (DT)
      [    0.025162] task: ffff80003d870000 task.stack: ffff80003d844000
      [    0.025351] PC is at pcpu_alloc+0x88/0x6c0
      [    0.025490] LR is at pcpu_alloc+0x88/0x6c0
      [    0.025624] pc : [<ffff00000818e678>] lr : [<ffff00000818e678>]
      pstate: 60000045
      [    0.025830] sp : ffff80003d847cd0
      [    0.025946] x29: ffff80003d847cd0 x28: 0000000000000000
      [    0.026147] x27: 0000000000000000 x26: 0000000000000000
      [    0.026348] x25: 0000000000000000 x24: 0000000000000000
      [    0.026549] x23: 0000000000000000 x22: 00000000024000c0
      [    0.026752] x21: ffff000008e97000 x20: 0000000000000000
      [    0.026953] x19: 0000000000000030 x18: 0000000000000010
      [    0.027155] x17: 0000000000000a3f x16: 00000000deadbeef
      [    0.027357] x15: 0000000000000006 x14: ffff000088f79c3f
      [    0.027573] x13: ffff000008f79c4d x12: 0000000000000041
      [    0.027782] x11: 0000000000000006 x10: 0000000000000042
      [    0.027995] x9 : ffff80003d847a40 x8 : 6f697461636f6c6c
      [    0.028208] x7 : 6120757063726570 x6 : ffff000008f79c84
      [    0.028419] x5 : 0000000000000005 x4 : 0000000000000000
      [    0.028628] x3 : 0000000000000000 x2 : 000000000000017f
      [    0.028840] x1 : ffff80003d870000 x0 : 0000000000000035
      [    0.029056]
      [    0.029152] ---[ end trace 0000000000000000 ]---
      [    0.029297] Call trace:
      [    0.029403] Exception stack(0xffff80003d847b00 to
                                     0xffff80003d847c30)
      [    0.029621] 7b00: 0000000000000030 0001000000000000
      ffff80003d847cd0 ffff00000818e678
      [    0.029901] 7b20: 0000000000000002 0000000000000004
      ffff000008f7c060 0000000000000035
      [    0.030153] 7b40: ffff000008f79000 ffff000008c4cd88
      ffff80003d847bf0 ffff000008101778
      [    0.030402] 7b60: 0000000000000030 0000000000000000
      ffff000008e97000 00000000024000c0
      [    0.030647] 7b80: 0000000000000000 0000000000000000
      0000000000000000 0000000000000000
      [    0.030895] 7ba0: 0000000000000035 ffff80003d870000
      000000000000017f 0000000000000000
      [    0.031144] 7bc0: 0000000000000000 0000000000000005
      ffff000008f79c84 6120757063726570
      [    0.031394] 7be0: 6f697461636f6c6c ffff80003d847a40
      0000000000000042 0000000000000006
      [    0.031643] 7c00: 0000000000000041 ffff000008f79c4d
      ffff000088f79c3f 0000000000000006
      [    0.031877] 7c20: 00000000deadbeef 0000000000000a3f
      [    0.032051] [<ffff00000818e678>] pcpu_alloc+0x88/0x6c0
      [    0.032229] [<ffff00000818ece8>] __alloc_percpu+0x18/0x20
      [    0.032409] [<ffff000008d9606c>] xen_guest_init+0x174/0x2f4
      [    0.032591] [<ffff0000080830f8>] do_one_initcall+0x38/0x130
      [    0.032783] [<ffff000008d90c34>] kernel_init_freeable+0xe0/0x248
      [    0.032995] [<ffff00000899a890>] kernel_init+0x10/0x100
      [    0.033172] [<ffff000008082ec0>] ret_from_fork+0x10/0x50
      Reported-by: default avatarWei Chen <wei.chen@arm.com>
      Link: https://lkml.org/lkml/2016/11/28/669Signed-off-by: default avatarJulien Grall <julien.grall@arm.com>
      Signed-off-by: default avatarStefano Stabellini <sstabellini@kernel.org>
      Reviewed-by: default avatarStefano Stabellini <sstabellini@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e67053ad
    • Boris Ostrovsky's avatar
      xen/gntdev: Use VM_MIXEDMAP instead of VM_IO to avoid NUMA balancing · 45394bf3
      Boris Ostrovsky authored
      commit 30faaafd upstream.
      
      Commit 9c17d965 ("xen/gntdev: Grant maps should not be subject to
      NUMA balancing") set VM_IO flag to prevent grant maps from being
      subjected to NUMA balancing.
      
      It was discovered recently that this flag causes get_user_pages() to
      always fail with -EFAULT.
      
      check_vma_flags
      __get_user_pages
      __get_user_pages_locked
      __get_user_pages_unlocked
      get_user_pages_fast
      iov_iter_get_pages
      dio_refill_pages
      do_direct_IO
      do_blockdev_direct_IO
      do_blockdev_direct_IO
      ext4_direct_IO_read
      generic_file_read_iter
      aio_run_iocb
      
      (which can happen if guest's vdisk has direct-io-safe option).
      
      To avoid this let's use VM_MIXEDMAP flag instead --- it prevents
      NUMA balancing just as VM_IO does and has no effect on
      check_vma_flags().
      Reported-by: default avatarOlaf Hering <olaf@aepfle.de>
      Suggested-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Acked-by: default avatarHugh Dickins <hughd@google.com>
      Tested-by: default avatarOlaf Hering <olaf@aepfle.de>
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      45394bf3
    • Jason Gunthorpe's avatar
      tpm xen: Remove bogus tpm_chip_unregister · b7bbf06c
      Jason Gunthorpe authored
      commit 1f0f30e4 upstream.
      
      tpm_chip_unregister can only be called after tpm_chip_register.
      devm manages the allocation so no unwind is needed here.
      
      Fixes: afb5abc2 ("tpm: two-phase chip management functions")
      Reviewed-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Signed-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b7bbf06c
    • Douglas Anderson's avatar
      kernel/debug/debug_core.c: more properly delay for secondary CPUs · f726f4f4
      Douglas Anderson authored
      commit 2d13bb64 upstream.
      
      We've got a delay loop waiting for secondary CPUs.  That loop uses
      loops_per_jiffy.  However, loops_per_jiffy doesn't actually mean how
      many tight loops make up a jiffy on all architectures.  It is quite
      common to see things like this in the boot log:
      
        Calibrating delay loop (skipped), value calculated using timer
        frequency.. 48.00 BogoMIPS (lpj=24000)
      
      In my case I was seeing lots of cases where other CPUs timed out
      entering the debugger only to print their stack crawls shortly after the
      kdb> prompt was written.
      
      Elsewhere in kgdb we already use udelay(), so that should be safe enough
      to use to implement our timeout.  We'll delay 1 ms for 1000 times, which
      should give us a full second of delay (just like the old code wanted)
      but allow us to notice that we're done every 1 ms.
      
      [akpm@linux-foundation.org: simplifications, per Daniel]
      Link: http://lkml.kernel.org/r/1477091361-2039-1-git-send-email-dianders@chromium.orgSigned-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Reviewed-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: Brian Norris <briannorris@chromium.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f726f4f4
    • Christian Lamparter's avatar
      watchdog: qcom: fix kernel panic due to external abort on non-linefetch · 9b78d690
      Christian Lamparter authored
      commit f06f35c6 upstream.
      
      This patch fixes a off-by-one in the "watchdog: qcom: add option for
      standalone watchdog not in timer block" patch that causes the
      following panic on boot:
      
      > Unhandled fault: external abort on non-linefetch (0x1008) at 0xc8874002
      > pgd = c0204000
      > [c8874002] *pgd=87806811, *pte=0b017653, *ppte=0b017453
      > Internal error: : 1008 [#1] SMP ARM
      > CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.8.6 #0
      > Hardware name: Generic DT based system
      > PC is at 0xc02222f4
      > LR is at 0x1
      > pc : [<c02222f4>]    lr : [<00000001>]    psr: 00000113
      > sp : c782fc98  ip : 00000003  fp : 00000000
      > r10: 00000004  r9 : c782e000  r8 : c04ab98c
      > r7 : 00000001  r6 : c8874002  r5 : c782fe00  r4 : 00000002
      > r3 : 00000000  r2 : c782fe00  r1 : 00100000  r0 : c8874002
      > Flags: nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
      > Control: 10c5387d  Table: 8020406a  DAC: 00000051
      > Process swapper/0 (pid: 1, stack limit = 0xc782e210)
      > Stack: (0xc782fc98 to 0xc7830000)
      > [...]
      
      The WDT_STS (status) needs to be translated via wdt_addr as well.
      
      fixes: f0d9d0f4 ("watchdog: qcom: add option for standalone watchdog not in timer block")
      Signed-off-by: default avatarChristian Lamparter <chunkeey@gmail.com>
      Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9b78d690
    • Alexander Usyskin's avatar
      watchdog: mei_wdt: request stop on reboot to prevent false positive event · 2eccf0e0
      Alexander Usyskin authored
      commit 9eff1140 upstream.
      
      Systemd on reboot enables shutdown watchdog that leaves the watchdog
      device open to ensure that even if power down process get stuck the
      platform reboots nonetheless.
      The iamt_wdt is an alarm-only watchdog and can't reboot system, but the
      FW will generate an alarm event reboot was completed in time, as the
      watchdog is not automatically disabled during power cycle.
      So we should request stop watchdog on reboot to eliminate wrong alarm
      from the FW.
      Signed-off-by: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
      Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
      Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2eccf0e0
    • Konstantin Khlebnikov's avatar
      kernel/watchdog: use nmi registers snapshot in hardlockup handler · 36b08b81
      Konstantin Khlebnikov authored
      commit 4d1f0fb0 upstream.
      
      NMI handler doesn't call set_irq_regs(), it's set only by normal IRQ.
      Thus get_irq_regs() returns NULL or stale registers snapshot with IP/SP
      pointing to the code interrupted by IRQ which was interrupted by NMI.
      NULL isn't a problem: in this case watchdog calls dump_stack() and
      prints full stack trace including NMI.  But if we're stuck in IRQ
      handler then NMI watchlog will print stack trace without IRQ part at
      all.
      
      This patch uses registers snapshot passed into NMI handler as arguments:
      these registers point exactly to the instruction interrupted by NMI.
      
      Fixes: 55537871 ("kernel/watchdog.c: perform all-CPU backtrace in case of hard lockup")
      Link: http://lkml.kernel.org/r/146771764784.86724.6006627197118544150.stgit@buzzSigned-off-by: default avatarKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Ulrich Obergfell <uobergfe@redhat.com>
      Cc: Aaron Tomlin <atomlin@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      36b08b81