1. 07 Aug, 2015 3 commits
  2. 06 Aug, 2015 2 commits
    • David Weinehall's avatar
      drm/i915: Allow parsing of variable size child device entries from VBT · 047fe6e6
      David Weinehall authored
      VBT version 196 increased the size of common_child_dev_config. The parser
      code assumed that the size of this structure would not change.
      
      The modified code now copies the amount needed based on the VBT version,
      and emits a debug message if the VBT version is unknown (too new);
      since the struct config block won't shrink in newer versions it should
      be harmless to copy the maximum known size in such cases, so that's
      what we do, but emitting the warning is probably sensible anyway.
      
      In the longer run it might make sense to modify the parser code to
      use a version/feature mapping, rather than hardcoding things like this,
      but for now the variants are fairly managable.
      
      This fixes a regression introduced in
      
      commit 90e4f159
      
      
      Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Date:   Wed Mar 25 18:45:58 2015 +0200
      
          drm/i915: Fix the VBT child device parsing for BSW
      
      since we're hitting a DRM_ERROR on older platforms with this.
      
      v2: Stricter size checks
      Signed-off-by: default avatarDavid Weinehall <david.weinehall@linux.intel.com>
      [danvet: Fixup format string.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      047fe6e6
    • Jason Wang's avatar
      virtio-input: reset device and detach unused during remove · df4198b1
      Jason Wang authored
      
      
      Spec requires a device reset during cleanup, so do it and avoid warn
      in virtio core. And detach unused buffers to avoid memory leak.
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      df4198b1
  3. 05 Aug, 2015 10 commits
  4. 04 Aug, 2015 6 commits
    • Guenter Roeck's avatar
      staging: lustre: Include unaligned.h instead of access_ok.h · fb1de5a4
      Guenter Roeck authored
      Including access_ok.h causes the ia64:allmodconfig build (and maybe others)
      to fail with
      
      include/linux/unaligned/le_struct.h:6:19: error:
      	redefinition of 'get_unaligned_le16'
      include/linux/unaligned/access_ok.h:7:19: note:
      	previous definition of 'get_unaligned_le16' was here
      include/linux/unaligned/le_struct.h:26:20: error:
      	redefinition of 'put_unaligned_le32'
      include/linux/unaligned/access_ok.h:42:20: note:
      	previous definition of 'put_unaligned_le32' was here
      include/linux/unaligned/le_struct.h:31:20: error:
      	redefinition of 'put_unaligned_le64'
      include/linux/unaligned/access_ok.h:47:20: note:
      	previous definition of 'put_unaligned_le64' was here
      
      Include unaligned.h instead and leave it up to the architecture to decide
      how to implement unaligned accesses.
      
      Fixes: 8c4f1364
      
       ("Staging: lustre: Use put_unaligned_le64")
      Cc: Vaishali Thakkar <vthakkar1994@gmail.com>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fb1de5a4
    • Ross Lagerwall's avatar
      xen/events/fifo: Handle linked events when closing a port · fcdf31a7
      Ross Lagerwall authored
      
      
      An event channel bound to a CPU that was offlined may still be linked
      on that CPU's queue.  If this event channel is closed and reused,
      subsequent events will be lost because the event channel is never
      unlinked and thus cannot be linked onto the correct queue.
      
      When a channel is closed and the event is still linked into a queue,
      ensure that it is unlinked before completing.
      
      If the CPU to which the event channel bound is online, spin until the
      event is handled by that CPU. If that CPU is offline, it can't handle
      the event, so clear the event queue during the close, dropping the
      events.
      
      This fixes the missing interrupts (and subsequent disk stalls etc.)
      when offlining a CPU.
      Signed-off-by: default avatarRoss Lagerwall <ross.lagerwall@citrix.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      fcdf31a7
    • Daniel Vetter's avatar
      drm/atomic-helpers: Make encoder picking more robust · 6ea76f3c
      Daniel Vetter authored
      We've had a few issues with atomic where subtle bugs in the encoder
      picking logic lead to accidental self-stealing of the encoder,
      resulting in a NULL connector_state->crtc in update_connector_routing
      and subsequent.
      
      Linus applied some duct-tape for an mst regression in
      
      commit 27667f47
      
      
      Author: Linus Torvalds <torvalds@linux-foundation.org>
      Date:   Wed Jul 29 22:18:16 2015 -0700
      
          i915: temporary fix for DP MST docking station NULL pointer dereference
      
      But that was incomplete (the code will still oops when debuggin is
      enabled) and mangled the state even further. So instead WARN and bail
      out as the more future-proof option.
      
      Cc: Theodore Ts'o <tytso@mit.edu>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Reviewed-by: default avatarThierry Reding <treding@nvidia.com>
      Reviewed-by: default avatarAnder Conselvan de Oliveira <conselvan2@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      6ea76f3c
    • Daniel Vetter's avatar
      drm/dp-mst: Remove debug WARN_ON · 42639ba5
      Daniel Vetter authored
      
      
      Apparently been in there since forever and fairly easy to hit when
      hotplugging really fast. I can do that since my mst hub has a manual
      button to flick the hpd line for reprobing. The resulting WARNING spam
      isn't pretty.
      
      Cc: Dave Airlie <airlied@gmail.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarThierry Reding <treding@nvidia.com>
      Reviewed-by: default avatarAnder Conselvan de Oliveira <conselvan2@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      42639ba5
    • Daniel Vetter's avatar
      drm/i915: Fixup dp mst encoder selection · 459485ad
      Daniel Vetter authored
      In
      
      commit 8c7b5ccb
      
      
      Author: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Date:   Tue Apr 21 17:13:19 2015 +0300
      
          drm/i915: Use atomic helpers for computing changed flags
      
      we've switched over to the atomic version to compute the
      crtc->encoder->connector routing from the i915 variant. That one
      relies upon the ->best_encoder callback, but the i915-private version
      relied upon intel_find_encoder. Which didn't matter except for dp mst,
      where the encoder depends upon the selected crtc.
      
      Fix this functional bug by implemented a correct atomic-state based
      encoder selector for dp mst.
      
      Note that we can't get rid of the legacy best_encoder callback since
      the fbdev emulation uses that still. That means it's incorrect there
      still, but that's been the case ever since i915 dp mst support was
      merged so not a regression. Best to fix that by converting fbdev over
      to atomic too.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarAnder Conselvan de Oliveira <conselvan2@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      459485ad
    • Daniel Vetter's avatar
      drm/atomic-helper: Add an atomice best_encoder callback · 3b8a684b
      Daniel Vetter authored
      
      
      With legacy helpers all the routing was already set up when calling
      best_encoder and so could be inspected. But with atomic it's staged,
      hence we need a new atomic compliant callback for drivers which need
      to inspect the requested state and can't just decided the best encoder
      statically.
      
      This is needed to fix up i915 dp mst where we need to pick the right
      encoder depending upon the requested CRTC for the connector.
      
      v2: Don't forget to amend the kerneldoc
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Acked-by: default avatarThierry Reding <treding@nvidia.com>
      Reviewed-by: default avatarAnder Conselvan de Oliveira <conselvan2@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      3b8a684b
  5. 03 Aug, 2015 12 commits
  6. 02 Aug, 2015 7 commits
    • Benjamin Randazzo's avatar
      md: use kzalloc() when bitmap is disabled · b6878d9e
      Benjamin Randazzo authored
      
      
      In drivers/md/md.c get_bitmap_file() uses kmalloc() for creating a
      mdu_bitmap_file_t called "file".
      
      5769         file = kmalloc(sizeof(*file), GFP_NOIO);
      5770         if (!file)
      5771                 return -ENOMEM;
      
      This structure is copied to user space at the end of the function.
      
      5786         if (err == 0 &&
      5787             copy_to_user(arg, file, sizeof(*file)))
      5788                 err = -EFAULT
      
      But if bitmap is disabled only the first byte of "file" is initialized
      with zero, so it's possible to read some bytes (up to 4095) of kernel
      space memory from user space. This is an information leak.
      
      5775         /* bitmap disabled, zero the first byte and copy out */
      5776         if (!mddev->bitmap_info.file)
      5777                 file->pathname[0] = '\0';
      Signed-off-by: default avatarBenjamin Randazzo <benjamin@randazzo.fr>
      Signed-off-by: default avatarNeilBrown <neilb@suse.com>
      b6878d9e
    • Chanwoo Choi's avatar
      thermal: exynos: Remove unused code related to platform_data on probe() · 3c19d237
      Chanwoo Choi authored
      
      
      This patch removes the unused code related to struct exynos_tmu_platform_data
      because exynos_tmu_probe() don't handle the struct exynos_tmu_platform_data *pdata.
      
      Test HW: Exynos4412 - Trats2 board
      
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: Eduardo Valentin <edubezval@gmail.com>
      Cc: Lukasz Majewski <l.majewski@samsung.com>
      Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      Signed-off-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      Tested-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      3c19d237
    • Chanwoo Choi's avatar
      thermal: exynos: Add the dependency of CONFIG_THERMAL_OF instead of CONFIG_OF · f87e6bd3
      Chanwoo Choi authored
      
      
      The exynos thermal driver use the of_thermal_*() API to parse the basic data
      for thermal management from devicetree file. So, if CONFIG_EXYNOS_THERMAL is
      selected without CONFIG_THERMAL_OF, kernel can build it without any problem.
      But, exynos thermal driver is not working with following error log. This patch
      add the dependency of CONFIG_THERMAL_OF instead of CONFIG_OF.
      
      [    1.458644] get_th_reg: Cannot get trip points from of-thermal.c!
      [    1.459096] get_th_reg: Cannot get trip points from of-thermal.c!
      [    1.465211] exynos4412_tmu_initialize: No CRITICAL trip point defined at of-thermal.c!
      
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: Eduardo Valentin <edubezval@gmail.com>
      Cc: Lukasz Majewski <l.majewski@samsung.com>
      Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      Signed-off-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      f87e6bd3
    • Krzysztof Kozlowski's avatar
      thermal: exynos: Disable the regulator on probe failure · 5f09a5cb
      Krzysztof Kozlowski authored
      
      
      During probe the regulator (if present) was enabled but not disabled in
      case of failure. So an unsuccessful probe lead to enabling the
      regulator which was actually not needed because the device was not
      enabled.
      
      Additionally each deferred probe lead to increase of regulator enable
      count so it would not be effectively disabled during removal of the
      device.
      
      Test HW: Exynos4412 - Trats2 board
      Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Fixes: 498d22f6
      
       ("thermal: exynos: Support for TMU regulator defined at device tree")
      Cc: <stable@vger.kernel.org>
      Reviewed-by: default avatarJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      Signed-off-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      Tested-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      5f09a5cb
    • Javi Merino's avatar
      thermal: power_allocator: trace the real requested power · d5f83109
      Javi Merino authored
      
      
      The power allocator governor uses ftrace to output a bunch of internal
      data for debugging and tuning.  Currently, the requested power it
      outputs is the "weighted" requested power, that is, what each cooling
      device has requested multiplied by the cooling device weight.  It is
      more useful to trace the real request, without any weight being
      applied.
      
      This commit only affects the data traced, there is no functional change.
      
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: Eduardo Valentin <edubezval@gmail.com>
      Signed-off-by: default avatarJavi Merino <javi.merino@arm.com>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      d5f83109
    • Viresh Kumar's avatar
      thermal: remove dangling 'weight_attr' device file · 528464ea
      Viresh Kumar authored
      This file isn't getting removed while we unbind a device from thermal
      zone. And this causes following messages when the device is registered
      again:
      
      WARNING: CPU: 0 PID: 2228 at /home/viresh/linux/fs/sysfs/dir.c:31 sysfs_warn_dup+0x60/0x70()
      sysfs: cannot create duplicate filename '/devices/virtual/thermal/thermal_zone0/cdev0_weight'
      Modules linked in: cpufreq_dt(+) [last unloaded: cpufreq_dt]
      CPU: 0 PID: 2228 Comm: insmod Not tainted 4.2.0-rc3-00059-g44fffd9473eb #272
      Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
      [<c00153e8>] (unwind_backtrace) from [<c0012368>] (show_stack+0x10/0x14)
      [<c0012368>] (show_stack) from [<c053a684>] (dump_stack+0x84/0xc4)
      [<c053a684>] (dump_stack) from [<c002284c>] (warn_slowpath_common+0x80/0xb0)
      [<c002284c>] (warn_slowpath_common) from [<c00228ac>] (warn_slowpath_fmt+0x30/0x40)
      [<c00228ac>] (warn_slowpath_fmt) from [<c012d524>] (sysfs_warn_dup+0x60/0x70)
      [<c012d524>] (sysfs_warn_dup) from [<c012d244>] (sysfs_add_file_mode_ns+0x13c/0x190)
      [<c012d244>] (sysfs_add_file_mode_ns) from [<c012d2d4>] (sysfs_create_file_ns+0x3c/0x48)
      [<c012d2d4>] (sysfs_create_file_ns) from [<c03c04a8>] (thermal_zone_bind_cooling_device+0x260/0x358)
      [<c03c04a8>] (thermal_zone_bind_cooling_device) from [<c03c2e70>] (of_thermal_bind+0x88/0xb4)
      [<c03c2e70>] (of_thermal_bind) from [<c03c10d0>] (__thermal_cooling_device_register+0x17c/0x2e0)
      [<c03c10d0>] (__thermal_cooling_device_register) from [<c03c3f50>] (__cpufreq_cooling_register+0x3a0/0x51c)
      [<c03c3f50>] (__cpufreq_cooling_register) from [<bf00505c>] (cpufreq_ready+0x44/0x88 [cpufreq_dt])
      [<bf00505c>] (cpufreq_ready [cpufreq_dt]) from [<c03d6c30>] (cpufreq_add_dev+0x4a0/0x7dc)
      [<c03d6c30>] (cpufreq_add_dev) from [<c02cd3ec>] (subsys_interface_register+0x94/0xd8)
      [<c02cd3ec>] (subsys_interface_register) from [<c03d785c>] (cpufreq_register_driver+0x10c/0x1f0)
      [<c03d785c>] (cpufreq_register_driver) from [<bf0057d4>] (dt_cpufreq_probe+0x60/0x8c [cpufreq_dt])
      [<bf0057d4>] (dt_cpufreq_probe [cpufreq_dt]) from [<c02d03e4>] (platform_drv_probe+0x44/0xa4)
      [<c02d03e4>] (platform_drv_probe) from [<c02cead8>] (driver_probe_device+0x174/0x2b4)
      [<c02cead8>] (driver_probe_device) from [<c02ceca4>] (__driver_attach+0x8c/0x90)
      [<c02ceca4>] (__driver_attach) from [<c02cd078>] (bus_for_each_dev+0x68/0x9c)
      [<c02cd078>] (bus_for_each_dev) from [<c02ce2f0>] (bus_add_driver+0x19c/0x214)
      [<c02ce2f0>] (bus_add_driver) from [<c02cf490>] (driver_register+0x78/0xf8)
      [<c02cf490>] (driver_register) from [<c0009710>] (do_one_initcall+0x8c/0x1d4)
      [<c0009710>] (do_one_initcall) from [<c05396b0>] (do_init_module+0x5c/0x1b8)
      [<c05396b0>] (do_init_module) from [<c0086490>] (load_module+0xd34/0xed8)
      [<c0086490>] (load_module) from [<c0086704>] (SyS_init_module+0xd0/0x120)
      [<c0086704>] (SyS_init_module) from [<c000f480>] (ret_fast_syscall+0x0/0x3c)
      ---[ end trace 3be0e7b7dc6e3c4f ]---
      
      Fixes: db916513
      
       ("thermal: export weight to sysfs")
      Acked-by: default avatarJavi Merino <javi.merino@arm.com>
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      528464ea
    • NeilBrown's avatar
      md/raid1: extend spinlock to protect raid1_end_read_request against inconsistencies · 423f04d6
      NeilBrown authored
      raid1_end_read_request() assumes that the In_sync bits are consistent
      with the ->degaded count.
      raid1_spare_active updates the In_sync bit before the ->degraded count
      and so exposes an inconsistency, as does error()
      So extend the spinlock in raid1_spare_active() and error() to hide those
      inconsistencies.
      
      This should probably be part of
        Commit: 34cab6f4 ("md/raid1: fix test for 'was read error from
        last working device'.")
      as it addresses the same issue.  It fixes the same bug and should go
      to -stable for same reasons.
      
      Fixes: 76073054
      
       ("md/raid1: clean up read_balance.")
      Cc: stable@vger.kernel.org (v3.0+)
      Signed-off-by: default avatarNeilBrown <neilb@suse.com>
      423f04d6