1
0
Fork 0
Commit Graph

270119 Commits (ae026b2aa19350f3c863df2dce7e0511dd78ff49)

Author SHA1 Message Date
Nicolas Iooss 3958b79266 configfs: fix kernel infoleak through user-controlled format string
Some modules call config_item_init_type_name() and config_group_init_type_name()
with parameter "name" directly controlled by userspace.  These two
functions call config_item_set_name() with this name used as a format
string, which can be used to leak information such as content of the
stack to userspace.

For example, make_netconsole_target() in netconsole module calls
config_item_init_type_name() with the name of a newly-created directory.
This means that the following commands give some unexpected output, with
configfs mounted in /sys/kernel/config/ and on a system with a
configured eth0 ethernet interface:

    # modprobe netconsole
    # mkdir /sys/kernel/config/netconsole/target_%lx
    # echo eth0 > /sys/kernel/config/netconsole/target_%lx/dev_name
    # echo 1 > /sys/kernel/config/netconsole/target_%lx/enabled
    # echo eth0 > /sys/kernel/config/netconsole/target_%lx/dev_name
    # dmesg |tail -n1
    [  142.697668] netconsole: target (target_ffffffffc0ae8080) is
    enabled, disable to update parameters

The directory name is correct but %lx has been interpreted in the
internal item name, displayed here in the error message used by
store_dev_name() in drivers/net/netconsole.c.

To fix this, update every caller of config_item_set_name to use "%s"
when operating on untrusted input.

This issue was found using -Wformat-security gcc flag, once a __printf
attribute has been added to config_item_set_name().

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-07-17 16:39:53 -07:00
Linus Torvalds eb254374a3 Staging/IIO driver fixes for 4.2-rc3
Here's some staging and IIO driver fixes for 4.2-rc3.
 
 Nothing major, the majority are IIO issues that were reported, with a
 few other minor staging driver fixes.  All have been in linux-next for a
 while with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlWpRFUACgkQMUfUDdst+yke/wCeJPDuYuOp/SFhyviMx9ojKIGF
 kVIAoI1xDY4SwVExztXcqyKo6m0H2yZ4
 =pxAa
 -----END PGP SIGNATURE-----

Merge tag 'staging-4.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging and IIO driver fixes from Greg KH:
 "Here's some staging and IIO driver fixes for 4.2-rc3.

  Nothing major, the majority are IIO issues that were reported, with a
  few other minor staging driver fixes.  All have been in linux-next for
  a while with no reported issues"

* tag 'staging-4.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (25 commits)
  staging: vt6656: check ieee80211_bss_conf bssid not NULL
  staging: vt6655: check ieee80211_bss_conf bssid not NULL
  staging:lustre: remove irq.h from socklnd.h
  staging: make board support depend on OF_IRQ and CLKDEV_LOOKUP
  iio: tmp006: Check channel info on write
  iio: sx9500: Add missing init in sx9500_buffer_pre{en,dis}able()
  iio:light:ltr501: fix regmap dependency
  iio:light:ltr501: fix variable in ltr501_init
  iio: sx9500: fix bug in compensation code
  iio: sx9500: rework error handling of raw readings
  iio: magnetometer: mmc35240: fix available sampling frequencies
  iio:light:stk3310: Fix REGMAP_I2C dependency
  iio: light: STK3310: un-invert proximity values
  iio:adc:cc10001_adc: fix Kconfig dependency
  iio: light: tcs3414: Fix bug preventing to set integration time
  iio:accel:bmc150-accel: fix counting direction
  iio:light:cm3323: clear bitmask before set
  iio: adc: at91_adc: allow to use full range of startup time
  iio: DAC: ad5624r_spi: fix bit shift of output data value
  iio: proximity: sx9500: Fix proximity value
  ...
2015-07-17 11:30:59 -07:00
Linus Torvalds 2b3eb6e337 USB driver fixes for 4.2-rc3
Here's some USB driver fixes for 4.2-rc3.
 
 The ususal number of gadget driver fixes are in here, along with some
 new device ids and a build fix for the mn10300 arch which required some
 symbols to be renamed in the mos7720 driver.
 
 All have been in linux-next for a while with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlWpRQEACgkQMUfUDdst+ykQTACfbXmLNn/1ycArRysqHGg5llIZ
 pdIAn2Yi8TCbXr9HvtugUcxQrDIANNcF
 =WUtC
 -----END PGP SIGNATURE-----

Merge tag 'usb-4.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB driver fixes from Greg KH:
 "Here's some USB driver fixes for 4.2-rc3.

  The ususal number of gadget driver fixes are in here, along with some
  new device ids and a build fix for the mn10300 arch which required
  some symbols to be renamed in the mos7720 driver.

  All have been in linux-next for a while with no reported issues"

* tag 'usb-4.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  USB: serial: Destroy serial_minors IDR on module exit
  usb: gadget: f_midi: fix error recovery path
  usb: phy: mxs: suspend to RAM causes NULL pointer dereference
  usb: gadget: udc: fix free_irq() after request_irq() failed
  usb: gadget: composite: Fix NULL pointer dereference
  usb: gadget: f_fs: do not set cancel function on synchronous {read,write}
  usb: f_mass_storage: limit number of reported LUNs
  usb: dwc3: core: avoid NULL pointer dereference
  usb: dwc2: embed storage for reg backup in struct dwc2_hsotg
  usb: dwc2: host: allocate qtd before atomic enqueue
  usb: dwc2: host: allocate qh before atomic enqueue
  usb: musb: host: rely on port_mode to call musb_start()
  USB: cp210x: add ID for Aruba Networks controllers
  USB: mos7720: rename registers
  USB: option: add 2020:4000 ID
2015-07-17 11:24:31 -07:00
Linus Torvalds 9bca4df258 This is a first set of GPIO fixes for the v4.2 series, all
hitting individual drivers and nothing else.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJVqPoCAAoJEEEQszewGV1zccEP/2bGViiPxrlBV2plLlteE4sT
 7zujWF3v1rkRZ1jr6tDafAthxtaL8WBY6O3rDWAVCZiVYATsYBGoh/Rg9EFwaKZ/
 6i5aqVFqAo9aNOFVmKabjUs8YESRTB4Wo1Ccuju/n4PkL7sGM+fBuZw5R6J7R+GU
 TpXMulHI4mDVjHuZWeUJ+GRnp6xmaTv5/PR1p1NC7D7zFulk6h4ZPYXJUhX8fhwC
 6Pp0bgH8JEvlzphDLHziX41jSEz8Pr3vWk0WJTYCisdsNl6oklfCMBcCOgluZmgO
 7v32RmxqXqBevhDgzd7sUUGjntmATb9kS4ZIcW6awX9Ia7TK55iG/pEd5pHfXAVV
 j79ViWfWxWLH2kVPiBTKSe+nCtMSg8hEj5RtPxTkBdUOL4BBgAigyY1DW4OgKPv5
 YOHiG0FN9UT/tNH8EmUNtnUW8k4a6LpLN+r+3Tgjbz1xgVcd/5wGlEzDm+TVnyMf
 RBojHUDYI0taE/KpGl7RkhcKZoDNsrYK/M+pKw5DTD8Ca/hfjMoLvqAs0uKzWjc7
 HDTtTTjAqFICNnf+yAaAKcjjpEp7r8xaj0c/cBIItIqG79vjLd+VnUvonjVzuTGP
 icysBdY5J2+NWBgWeVotopGhGs4NOYNIDQjzUwBLUBFcAVzvhsvTRc9LoncZq5Bn
 SWHIW/sZZ8hnWETNoz6q
 =mTd/
 -----END PGP SIGNATURE-----

Merge tag 'gpio-v4.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
 "This is a first set of GPIO fixes for the v4.2 series, all hitting
  individual drivers and nothing else (except for a documentation
  oneliner.  I intended to send a request earlier but life intervened)"

* tag 'gpio-v4.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio: pca953x: fix nested irqs rescheduling
  gpio: omap: prevent module from being unloaded while in use
  gpio: max732x: Add missing dev reference to gpiochip
  gpio/xilinx: Use correct address when setting initial values.
  gpio: zynq: Fix problem with unbalanced pm_runtime_enable
  gpio: omap: add missed spin_unlock_irqrestore in omap_gpio_irq_type
  gpio: brcmstb: fix null ptr dereference in driver remove
  gpio: Remove double "base" in comment
2015-07-17 10:40:45 -07:00
Linus Torvalds e05bf4f366 Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie:
 "Fixes all over the place.

  The rockchip and imx fixes I missed while on holidays, so I've queued
  them now which makes this a bit bigger.

  The rest is misc amdgpu, radeon, i915 and armada.

  I think the most important thing is the ioctl fix, we dropped the
  avoid compat ball, so we get to add a compat wrapper.

  There is also an i915 revert to avoid a regression with existing
  userspace"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (43 commits)
  drm/ttm: improve uncached page deallocation.
  drm/ttm: fix uncached page deallocation to properly fill page pool v3.
  drm/amdgpu/dce8: Re-set VBLANK interrupt state when enabling a CRTC
  drm/radeon/ci: silence a harmless PCC warning
  drm/amdgpu/cz: silence some dpm debug output
  drm/amdgpu/cz: store the forced dpm level
  drm/amdgpu/cz: unforce dpm levels before forcing to low/high
  drm/amdgpu: remove bogus check in gfx8 rb setup
  drm/amdgpu: set proper index/data pair for smc regs on CZ (v2)
  drm/amdgpu: disable the IP module if early_init returns -ENOENT (v2)
  drm/amdgpu: stop context leak in the error path
  drm/amdgpu: validate the context id in the dependencies
  drm/radeon: fix user ptr race condition
  drm/radeon: Don't flush the GART TLB if rdev->gart.ptr == NULL
  drm/radeon: add a dpm quirk for Sapphire Radeon R9 270X 2GB GDDR5
  drm/armada: avoid saving the adjusted mode to crtc->mode
  drm/armada: fix overlay when partially off-screen
  drm/armada: convert overlay to use drm_plane_helper_check_update()
  drm/armada: fix gem object free after failed prime import
  drm/armada: fix incorrect overlay plane cleanup
  ...
2015-07-17 10:05:00 -07:00
Jérôme Glisse e930888487 drm/ttm: improve uncached page deallocation.
Calls to set_memory_wb() incure heavy TLB flush and IPI cost. To
minimize those wait until pool grow beyond batch size before
draining the pool.

Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-and-Tested-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-07-17 18:18:04 +10:00
Jérôme Glisse ef2b731759 drm/ttm: fix uncached page deallocation to properly fill page pool v3.
Current code never allowed the page pool to actualy fill in anyway.
This fix it, so that we only start freeing page from the pool when
we go over the pool size.

Changed since v1:
  - Move the page batching optimization to its separate patch.

Changed since v2:
  - Do not remove code part of the batching optimization with
    this patch.
  - Better commit message.

Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-07-17 18:17:33 +10:00
Linus Torvalds 21bdb584af Power management and ACPI fixes for v4.2-rc3
- Fix a recently introduced issue in the cpufreq policy object
    reinitialization that leads to CPU offline/online breakage
    (Viresh Kumar).
 
  - Make it possible to access frequency tables of offline CPUs
    which is needed by thermal management code among other things
    (Viresh Kumar).
 
  - Fix an ACPI resource management regression introduced during
    the 4.0 cycle that may cause incorrect resource validation
    results to appear in 32-bit x86 kernels due to silent truncation
    of 64-bit values to 32-bit (Jiang Liu).
 
  - Fix up an RCU-related lockdep complaint about suspicious RCU
    usage in idle caused by using a suspend tracepoint in the
    core suspend-to-idle code (Rafael J Wysocki).
 
 /
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCAAGBQJVqC6GAAoJEILEb/54YlRxgREP/RXsHHL58VVMmSFEMkNX7lX2
 q2YibvVdNrZ9bk9+uNEk/NRc25mHrTHv8HyyIwn88EiUfbdvvKgyZez7KGzaFPYT
 0vAJLfKwqBHKpPMc0CaYHSIqAaL3RofqTCrw6pQHUj7S0q07fTV+rZ/A7eUnMbzG
 fQYf0zDIYAVrmd/GqB2fUxvMXbjWNmntDrHDahXG+C+96ih/wb1Hwz9Afb6l13Le
 Q6t/FXrVAi4g61dpnKIKFl3efE4u0s1CnfUCoz8VYT+g+ZSb/IYdaKlQ8kNGFGuA
 xxNpJgwdCWb7rD0WBuonX9lCaeM/Irg9SpfEw/DViSrKUm4GMOVm4EJ2S50oneVh
 lY6vy4Z95YqPxRccrsPchqg6KKUTnlv3PyNMdVM4UQCyoeKmIXLYIS0MT2juHh4R
 w1+GWE94AFcNC6kny0M6jWhG1pUfWEbajxNz3diIB4wJPG+qyBYcdzTrg1vyLD32
 4EeT5hUeQFPRILA9IiLk/L8uabJnqnvBarlJ/fl3qN0Pust3q/WbqgarqwN7tDcw
 ML3TlDLc9kU2e6q7VnvKqav0jCil7HHns5RIk3noOo1LZI7gM0o11sUXT4N84rla
 Aao+1v0Al6zMqSinCzp4uzwgaPThQpLWEGxuRvkNCceNXlJ1p5abx2DBZsSLI1Uk
 gAEcsa1eAg1TT3MQ2+RZ
 =BDs+
 -----END PGP SIGNATURE-----

Merge tag 'pm+acpi-4.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management and ACPI fixes from Rafael Wysocki:
 "These fix two bugs in the cpufreq core (including one recent
  regression), fix a 4.0 PCI regression related to the ACPI resources
  management and quieten an RCU-related lockdep complaint about a
  tracepoint in the suspend-to-idle code.

  Specifics:

   - Fix a recently introduced issue in the cpufreq policy object
     reinitialization that leads to CPU offline/online breakage (Viresh
     Kumar)

   - Make it possible to access frequency tables of offline CPUs which
     is needed by thermal management code among other things (Viresh
     Kumar)

   - Fix an ACPI resource management regression introduced during the
     4.0 cycle that may cause incorrect resource validation results to
     appear in 32-bit x86 kernels due to silent truncation of 64-bit
     values to 32-bit (Jiang Liu)

   - Fix up an RCU-related lockdep complaint about suspicious RCU usage
     in idle caused by using a suspend tracepoint in the core suspend-
     to-idle code (Rafael J Wysocki)"

* tag 'pm+acpi-4.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI / PCI: Fix regressions caused by resource_size_t overflow with 32-bit kernel
  cpufreq: Allow freq_table to be obtained for offline CPUs
  cpufreq: Initialize the governor again while restoring policy
  suspend-to-idle: Prevent RCU from complaining about tick_freeze()
2015-07-16 21:10:53 -07:00
Linus Torvalds 3e87ee06d0 platform-drivers-x86 for 4.2-3
Fix SMBIOS call handling and hwswitch state coherency in the dell-laptop driver.
 Cleanups for intel_*_ipc drivers.
 
 dell-laptop:
  - Do not cache hwswitch state
  - Check return value of each SMBIOS call
  - Clear buffer before each SMBIOS call
 
 intel_scu_ipc:
  - Move local memory initialization out of a mutex
 
 intel_pmc_ipc:
  - Update kerneldoc formatting
  - Fix compiler casting warnings
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJVqCrgAAoJEKbMaAwKp364aBcIALo/ZB6JFFd3oFDBbZR9bzvp
 senrgC2QSWboFlyJ2aHB09n98m6tR5x8HTE6BijT64bUyPSLTPgDZoeC9ezIu1H0
 rXKJZM7GduxYVOvVgOPVKqt/yUopI55jDhpgvFmxpXgp9zaz4our2y+93VCCBkIm
 9nJMHXIvK+Rg4Rg0MuEkaghLRFivJAYFuyFu6vgWQOGap1QXruPIylK6agZs2E9x
 KhJAlLNjoAAfqFFkWdk7PxMO8QIgV9pLU8RlOQmUdRSe8F+CI3AAJjdn+FdPoXFN
 EBirxMm8NAd9+/JlfU95fUBwPnofY+D3Q8jUyKBBxnZbDQMIA6gWtzGaA/BY/zI=
 =hpkC
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v4.2-3' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86

Pull x86 platform driver fixes from Darren Hart:
 "Fix SMBIOS call handling and hwswitch state coherency in the
  dell-laptop driver.  Cleanups for intel_*_ipc drivers.  Details:

  dell-laptop:
   - Do not cache hwswitch state
   - Check return value of each SMBIOS call
   - Clear buffer before each SMBIOS call

  intel_scu_ipc:
   - Move local memory initialization out of a mutex

  intel_pmc_ipc:
   - Update kerneldoc formatting
   - Fix compiler casting warnings"

* tag 'platform-drivers-x86-v4.2-3' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
  intel_scu_ipc: move local memory initialization out of a mutex
  intel_pmc_ipc: Update kerneldoc formatting
  dell-laptop: Do not cache hwswitch state
  dell-laptop: Check return value of each SMBIOS call
  dell-laptop: Clear buffer before each SMBIOS call
  intel_pmc_ipc: Fix compiler casting warnings
2015-07-16 20:57:25 -07:00
Dave Airlie aaab3bbab8 Merge branch 'drm-rockchip-2015-07-13' of https://github.com/markyzq/kernel-drm-rockchip into drm-fixes
misc rockchip fixes.

* 'drm-rockchip-2015-07-13' of https://github.com/markyzq/kernel-drm-rockchip:
  drm/rockchip: vop: remove hardware cursor window
  drm/rockchip: vop: switch cursor plane to window 3
  drm/rockchip: Drop owner assignment from platform_driver
  drm/rockchip: use drm_gem_mmap helpers
  drm/rockchip: only call drm_fb_helper_hotplug_event if fb_helper present
  drm/rockchip: Add BGR formats to VOP
2015-07-17 10:25:02 +10:00
Dave Airlie e1e50e1e1e imx-drm: fixes for parallel-display, imx-tve, and ipu-common
These patches fix the parallel-display driver to use the standard OF
 graph bindings for connecting a drm_panel via device tree instead of
 an undocumented, driver specific device tree property, take care to
 disable all IPU interrupts before setting up the irq chip to fix a
 kexec lockup, and fix VGA output on i.MX53-QSB boards by correcting
 the media bus format set by the imx-tve driver.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJVpLBMAAoJEFDCiBxwnmDrlw4P+wXO1F70lPLc9/XadcNVQnZn
 smKhchEFLQNcYOZIwV2r0Y5v8TDtY/qhb/212kYUrrWgYqK8ASmgadGxp43ROAqa
 VWF3UaNtPCg6BOjInRzwVoVDAzFUi3AIsEdZN6YXOyNc//fJGHEut3PqayTCfqop
 TD0R55If6volfRHyGmvDR5Tsdzx1SKPn8hKDvqVtLocu5FzptKS+/0imDlcYeeii
 PIJ1bcBLWAJIPcIfRcq1oJ/NDR8ELM1YMYtmJJ+CoIWp0cN3rYK+35Ja4XUFvbYt
 aPSUV85RcLyXRZmZlssmUeIbDN0zFGoEFMghY8er7KUS2gQKf/o5agMn3ffXhNF5
 iW4a7dpdtDmf0O4vC3g8WwO2IvzjVWQkjLppYW+NUd3Hl8y1iNZo8OWhb8pq8RlM
 bjNuaF+oLftFKKZ0HVoACpuLhga6sQN7XA1oUwIhzNhIDBNrdx2eJhvkMZfYsaUF
 kxn/Kbtgu7gsbg8TfiABB2g7C8F92frHh1ucSLpm6GBUE2hK+fmkWusdFoiztSPq
 fRi+zFqT9+Kf8anRzKu7mGxYoGxymduySNzX4Um5cmZ0BHguwPcitjTCALZwFVa4
 bXl5ykPcQnTb0WI0Zc9ZAT1geUKifJpTvwJchA5U9htFiJfNSd6E0QMPyPYB0rz6
 PFU1foBZa1dnus1FJFCJ
 =pGBQ
 -----END PGP SIGNATURE-----

Merge tag 'imx-drm-fixes-2015-07-14' of git://git.pengutronix.de/git/pza/linux into drm-fixes

imx-drm: fixes for parallel-display, imx-tve, and ipu-common

These patches fix the parallel-display driver to use the standard OF
graph bindings for connecting a drm_panel via device tree instead of
an undocumented, driver specific device tree property, take care to
disable all IPU interrupts before setting up the irq chip to fix a
kexec lockup, and fix VGA output on i.MX53-QSB boards by correcting
the media bus format set by the imx-tve driver.

* tag 'imx-drm-fixes-2015-07-14' of git://git.pengutronix.de/git/pza/linux:
  drm/imx: tve: fix media bus format for VGA output
  GPU: ipu: fix lockup caused by pending chained interrupts
  drm/imx: parallel-display: fix drm_panel support
2015-07-17 10:24:34 +10:00
Dave Airlie 8f6644ca97 Merge branch 'drm-armada-fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-fixes
A range of fixes for the Armada DRM driver:
- A missing wakeup could result in overlay frames being delayed, causing
  video playback to hiccup.
- Avoid unmapping a dma-buf attachment which was never mapped
- Fix the overlay when partially off the screen by switching to the
  drm_plane_helper_check_update() helper and using the calculated
  coordinates to set the start address.
- Remove an incorrect assignment to crtc->mode - which should be the
  unadjusted mode.
- Fix a missing call to drm_plane_cleanup() in the overlay code.

* 'drm-armada-fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
  drm/armada: avoid saving the adjusted mode to crtc->mode
  drm/armada: fix overlay when partially off-screen
  drm/armada: convert overlay to use drm_plane_helper_check_update()
  drm/armada: fix gem object free after failed prime import
  drm/armada: fix incorrect overlay plane cleanup
  drm/armada: fix missing overlay wake-up
2015-07-17 10:06:04 +10:00
Dave Airlie 61f2669fce Merge tag 'drm-intel-fixes-2015-07-15' of git://anongit.freedesktop.org/drm-intel into drm-fixes
Next batch of i915 fixes. Note that the compat32 patch here needs the drm
core one to be actually useful, I'll send you that one with a separate
drm-fixes pull request. One revert because a fix in -rc2 did break
existing userspace.

* tag 'drm-intel-fixes-2015-07-15' of git://anongit.freedesktop.org/drm-intel:
  drm/i915: Do not call intel_crtc_disable if the crtc is already disabled.
  Revert "drm/i915: Declare the swizzling unknown for L-shaped configurations"
  drm/i915: Forward all core DRM ioctls to core compat handling
  drm/i915: fix oops in primary_check_plane
  drm/i915: remove unused has_dma_mapping flag
  drm/i915: Fix missing return warning for !CONFIG_DEBUGFS
  drm/i915: avoid leaking DMA mappings
  drm/i915: Snapshot seqno of most recently submitted request.
  drm/i915: Store device pointer in contexts for late tracepoint usafe
2015-07-17 09:57:16 +10:00
Dave Airlie 375539832c Merge tag 'topic/drm-fixes-2015-07-16' of git://anongit.freedesktop.org/drm-intel into drm-fixes
Ok next attempt at drm-fixes pull. Big thing really is just the compat32
one for addfb2.1.

* tag 'topic/drm-fixes-2015-07-16' of git://anongit.freedesktop.org/drm-intel:
  drm: Provide compat ioctl for addfb2.1
  Documentation: drm: Fix tablulation in KMS properties table
  drm: add a check for x/y in drm_mode_setcrtc
  drm/rockchip: use drm_gem_mmap helpers
2015-07-17 09:56:00 +10:00
Linus Torvalds 761ab7664b Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe:
 "A collection of fixes from the last few weeks that should go into the
  current series.  This contains:

   - Various fixes for the per-blkcg policy data, fixing regressions
     since 4.1.  From Arianna and Tejun

   - Code cleanup for bcache closure macros from me.  Really just
     flushing this out, it's been sitting in another branch for months

   - FIELD_SIZEOF cleanup from Maninder Singh

   - bio integrity oops fix from Mike

   - Timeout regression fix for blk-mq from Ming Lei"

* 'for-linus' of git://git.kernel.dk/linux-block:
  blk-mq: set default timeout as 30 seconds
  NVMe: Reread partitions on metadata formats
  bcache: don't embed 'return' statements in closure macros
  blkcg: fix blkcg_policy_data allocation bug
  blkcg: implement all_blkcgs list
  blkcg: blkcg_css_alloc() should grab blkcg_pol_mutex while iterating blkcg_policy[]
  blkcg: allow blkcg_pol_mutex to be grabbed from cgroup [file] methods
  block/blk-cgroup.c: free per-blkcg data when freeing the blkcg
  block: use FIELD_SIZEOF to calculate size of a field
  bio integrity: do not assume bio_integrity_pool exists if bioset exists
2015-07-16 16:38:08 -07:00
Rafael J. Wysocki 17ffc8b083 Merge branches 'pm-cpuidle', 'pm-cpufreq' and 'acpi-resources'
* pm-cpuidle:
  suspend-to-idle: Prevent RCU from complaining about tick_freeze()

* pm-cpufreq:
  cpufreq: Allow freq_table to be obtained for offline CPUs
  cpufreq: Initialize the governor again while restoring policy

* acpi-resources:
  ACPI / PCI: Fix regressions caused by resource_size_t overflow with 32-bit kernel
2015-07-16 23:47:19 +02:00
Michel Dänzer 1002d71841 drm/amdgpu/dce8: Re-set VBLANK interrupt state when enabling a CRTC
Something (ATOM BIOS?) seems to be clobbering the LB_INTERRUPT_MASK
register while the CRTC is off, which caused e.g. glxgears or
gnome-shell to hang after a modeset.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-07-16 12:39:44 -04:00
Alex Deucher bda5e3e97f drm/radeon/ci: silence a harmless PCC warning
This has been a source of confusion.  Make it debug only.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-07-16 12:39:43 -04:00
Alex Deucher 1a45e8a11b drm/amdgpu/cz: silence some dpm debug output
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-16 12:39:43 -04:00
Alex Deucher 58829aa67d drm/amdgpu/cz: store the forced dpm level
So the selected forced level shows up properly in sysfs.

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-16 12:39:42 -04:00
Alex Deucher 85cfe09655 drm/amdgpu/cz: unforce dpm levels before forcing to low/high
This is necessary to properly reset the min/max limits before
clamping them otherwise we may get improper clamping depending
on what what was the last forced level.

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-16 12:39:41 -04:00
Alex Deucher 4f2d3ad686 drm/amdgpu: remove bogus check in gfx8 rb setup
Always respect the harvest configuration as is.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-16 12:39:41 -04:00
Alex Deucher 7b92cdbfe2 drm/amdgpu: set proper index/data pair for smc regs on CZ (v2)
v2: squash in later fix

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-16 12:39:40 -04:00
Alex Deucher 974e6b641f drm/amdgpu: disable the IP module if early_init returns -ENOENT (v2)
If we run into a part with a harvest configuration where the entire
IP block is unusable, just disable the IP block.

v2: fix logic as noted by Christian

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-16 12:39:39 -04:00
Christian König 5c2327beed drm/amdgpu: stop context leak in the error path
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-07-16 12:39:39 -04:00
Christian König 76a1ea618f drm/amdgpu: validate the context id in the dependencies
Just to make sure userspace don't send nonsense to the kernel.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-07-16 12:39:38 -04:00
Christian König 12f1384da6 drm/radeon: fix user ptr race condition
Port of amdgpu patch 9298e52f8b.

Signed-off-by: Christian König <christian.koenig@amd.com>
CC: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-16 12:39:37 -04:00
Michel Dänzer 233709d2cd drm/radeon: Don't flush the GART TLB if rdev->gart.ptr == NULL
This can be the case when the GPU is powered off, e.g. via vgaswitcheroo
or runpm. When the GPU is powered up again, radeon_gart_table_vram_pin
flushes the TLB after setting rdev->gart.ptr to non-NULL.

Fixes panic on powering off R7xx GPUs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61529
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-07-16 12:39:37 -04:00
Alex Deucher 5dfc71bc44 drm/radeon: add a dpm quirk for Sapphire Radeon R9 270X 2GB GDDR5
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=76490

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-07-16 12:39:36 -04:00
Grygorii Strashko fdd50409c8 gpio: pca953x: fix nested irqs rescheduling
pca953x interrupt controller functionality is implemented using
nested threaded IRQs which require parent_irq to be configured
properly otherwise below warning can be seen if IRQ core
will try re-schedule nested IRQ:

------------[ cut here ]------------
WARNING: CPU: 1 PID: 12 at kernel/irq/manage.c:696 irq_nested_primary_handler+0x30/0x38()
Primary handler called for nested irq 301
Modules linked in: uinput ipv6 smsc95xx usbnet mii imx2_wdt etnaviv(C) matrix_keypad matrix_keymap ar1021_i2c
CPU: 1 PID: 12 Comm: ksoftirqd/1 Tainted: G        WC    4.1.1 #9
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
Backtrace:
[<c0013298>] (dump_backtrace) from [<c0013488>] (show_stack+0x20/0x24)
[<c0013468>] (show_stack) from [<c05743c4>] (dump_stack+0x70/0xc0)
[<c0574354>] (dump_stack) from [<c002b7b8>] (warn_slowpath_common+0x88/0xc0)
[<c002b730>] (warn_slowpath_common) from [<c002b8ac>] (warn_slowpath_fmt+0x40/0x48)
[<c002b870>] (warn_slowpath_fmt) from [<c0075798>] (irq_nested_primary_handler+0x30/0x38)
[<c0075768>] (irq_nested_primary_handler) from [<c0075200>] (handle_irq_event_percpu+0x70/0x2d0)
[<c0075190>] (handle_irq_event_percpu) from [<c00754ac>] (handle_irq_event+0x4c/0x6c)
[<c0075460>] (handle_irq_event) from [<c0078204>] (handle_simple_irq+0xa4/0xc8)
[<c0078160>] (handle_simple_irq) from [<c0077cd4>] (resend_irqs+0x50/0x7c)
[<c0077c84>] (resend_irqs) from [<c002f99c>] (tasklet_action+0x94/0x140)
[<c002f908>] (tasklet_action) from [<c002eea8>] (__do_softirq+0xa0/0x3c8)
[<c002ee08>] (__do_softirq) from [<c002f208>] (run_ksoftirqd+0x38/0x54)
[<c002f1d0>] (run_ksoftirqd) from [<c004b1e4>] (smpboot_thread_fn+0x1f8/0x2f0)
[<c004afec>] (smpboot_thread_fn) from [<c0047744>] (kthread+0xe8/0x104)
[<c004765c>] (kthread) from [<c000fac8>] (ret_from_fork+0x14/0x2c)
---[ end trace 96052cda48865769 ]---

The issue was reported and described in details by Lothar Waßmann and
Christian Gmeiner in https://lkml.org/lkml/2014/9/9/123.

Fix it by adding missed call of gpiochip_set_chained_irqchip()
so GPIO IRQ chip helpers will set parent_irq for nested IRQs
properly.

Reported-by: Lothar Waßmann <LW@KARO-electronics.de>
Tested-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2015-07-16 14:40:08 +02:00
Grygorii Strashko c23837ce73 gpio: omap: prevent module from being unloaded while in use
OMAP GPIO driver allowed to be built as loadable module, but it
doesn't set owner field in GPIO chip structure. As result,
module_get/put() API is not working and it's possible to unload
OMAP driver while in use:

  omap_gpio 48051000.gpio: REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED

Hence, add missing configuration.

Cc: Tony Lindgren <tony@atomide.com>
Fixes: cac089f902 ('gpio: omap: Allow building as a loadable module')
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2015-07-16 14:26:03 +02:00
Marek Vasut 34ab54edbe gpio: max732x: Add missing dev reference to gpiochip
In case the gpiochip doesn't have the .dev field set, as is the case
in here, it is not possible to reference this device in DT as a GPIO
controller. A good example of this problem is that gpio-leds can not
be used when connected to this chip, the gpio-leds driver bails out
with -EPROBE_DEFER.

Fix this problem by setting the .dev field of the gpio_chip to the
parent i2c device.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Mans Rullgard <mans@mansr.com>
Cc: Olaf Mandel <o.mandel@menlosystems.com>
Cc: Semen Protsenko <semen.protsenko@globallogic.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2015-07-16 13:42:46 +02:00
Raphaël Teysseyre 5b2c9121ef gpio/xilinx: Use correct address when setting initial values.
xgpio_save_regs() is used in this driver to setup the initial
values of the registers in the hardware.

The relevant registers at that time are:
0x0 -> channel 0 data (32 bits, one for each GPIO on this channel).
0x4 -> channel 0 tri, controls in/out status for each GPIO of this channel.
0x8 -> channel 1 data
0xC -> channel 1 tri

gpio-xilinx.c defines these:
XGPIO_DATA_OFFSET   (0x0)
XGPIO_TRI_OFFSET    (0x4)
XGPIO_CHANNEL_OFFSET	0x8

Before this patch, the "data" register value of channel 1 was written
at 0x4 intead of 0x8 (overwriting the channel 0 "tri" register),
and the "tri" register value for channel 1 was written at 0x8 instead of 0xC.

Signed-off-by: Raphaël Teysseyre <rteysseyre@gmail.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2015-07-16 13:28:33 +02:00
Michal Simek 6b956af080 gpio: zynq: Fix problem with unbalanced pm_runtime_enable
Add missing pm_runtime_disabled to remove().

Error log:
root@zynqmp:~# modprobe gpio_zynq
root@zynqmp:~# lsmod
    Not tainted
gpio_zynq 7086 0 - Live 0xffffffbffc00a000
root@zynqmp:~# rmmod gpio_zynq
root@zynqmp:~# lsmod
    Not tainted
root@zynqmp:~# modprobe gpio_zynq
[  246.924438] zynq-gpio ff0a0000.gpio: Unbalanced pm_runtime_enable!
root@zynqmp:~# rmmod gpio_zynq
root@zynqmp:~# lsmod
    Not tainted

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2015-07-16 13:00:43 +02:00
Grygorii Strashko 977bd8a94c gpio: omap: add missed spin_unlock_irqrestore in omap_gpio_irq_type
Add missed spin_unlock_irqrestore in omap_gpio_irq_type when
omap_set_gpio_triggering() is failed.

It fixes static checker warning:

	drivers/gpio/gpio-omap.c:523 omap_gpio_irq_type()
	warn: inconsistent returns 'spin_lock:&bank->lock'.

This fixes commit:
1562e4618d ('gpio: omap: fix error handling in omap_gpio_irq_type')

Reported-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2015-07-16 10:35:56 +02:00
Linus Torvalds 3aa20508a6 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull TPM bugfixes from James Morris.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  tpm, tpm_crb: fail when TPM2 ACPI table contents look corrupted
  tpm: Fix initialization of the cdev
2015-07-15 18:38:24 -07:00
Linus Torvalds 9090fdb9c9 Changes for 4.2-rc
- Mainly fix-ups for the various 4.2 items
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJVpWPTAAoJELgmozMOVy/dRjkQALGpY+m0Q+dfS4geU+JvvH0/
 tTNJevWA1lu5xIgzk8aW+RgNOt+IQV2K6XnKOdKWcdE2wg9Yg9/8Y7atxeNSLoB6
 mdUfstmTHoDFRXea1wog45QVVv9ABqSXIOmFd/PQSf2pEHvwgmVaxO2KW5n0n71H
 0G9nw28jx+Igd1IjX3UezbB4Rm5jeG6exQEM5KKQ/l/cD2Pt/DIr9OmTmkMhj4Ft
 4ppC+JsDHZMT2mQljEB1UL6Va1BGgULn4JwZviXRGgTEFiS+rtUkWXy9CVeNIV+A
 bo6aHEBlO8zbj9xg0POkHGBP2XCkDpsc5EP6/zon30MLpOTpnnTp2zq/bhGpyr5w
 ytH1x6V8Od1Or9BrHygy1yLGaqaVthIuZMReLq0Bu26px8mTECdu8bUjwxEvbvep
 u51vQ75h99td5XtXBHULcd/I8mUb3JqbEHqig0ChLOcnOMh72KLql8qfhLvzrYSv
 gFMvnqUZWq4WYET8cKcWypj5+cIME4objOim6T/TG+zTCmgbPnhwBsgvujLhfhDy
 JhUjUfS+31S99I4smL7ceKQpfA/7awLuZf/C20zdLZO2wXnx7VmbNlhQA3mvssyt
 ZOXeLkLGcXDIT3egNj5VWQR/KlVtvUS9FNVslxqo4ItyZZwJtbHTwRAgATp3XRwD
 Po7E7bWoUQqpanhgiX4Q
 =N/5G
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma

Pull rdma fixes from Doug Ledford:
 "Mainly fix-ups for the various 4.2 items"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (24 commits)
  IB/core: Destroy ocrdma_dev_id IDR on module exit
  IB/core: Destroy multcast_idr on module exit
  IB/mlx4: Optimize do_slave_init
  IB/mlx4: Fix memory leak in do_slave_init
  IB/mlx4: Optimize freeing of items on error unwind
  IB/mlx4: Fix use of flow-counters for process_mad
  IB/ipath: Convert use of __constant_<foo> to <foo>
  IB/ipoib: Set MTU to max allowed by mode when mode changes
  IB/ipoib: Scatter-Gather support in connected mode
  IB/ucm: Fix bitmap wrap when devnum > IB_UCM_MAX_DEVICES
  IB/ipoib: Prevent lockdep warning in __ipoib_ib_dev_flush
  IB/ucma: Fix lockdep warning in ucma_lock_files
  rds: rds_ib_device.refcount overflow
  RDMA/nes: Fix for incorrect recording of the MAC address
  RDMA/nes: Fix for resolving the neigh
  RDMA/core: Fixes for port mapper client registration
  IB/IPoIB: Fix bad error flow in ipoib_add_port()
  IB/mlx4: Do not attemp to report HCA clock offset on VFs
  IB/cm: Do not queue work to a device that's going away
  IB/srp: Avoid using uninitialized variable
  ...
2015-07-15 17:03:03 -07:00
Gregory Fong 2252607d32 gpio: brcmstb: fix null ptr dereference in driver remove
If a failure occurs during probe, brcmstb_gpio_remove() is called. In
remove, we call platform_get_drvdata(), but at the time of failure in
the probe the driver data hadn't yet been set which leads to a NULL
ptr dereference in the remove's list_for_each.  Call
platform_set_drvdata() and set up list head right after allocating the
priv struct to both avoid the null pointer dereference that could
occur today.  To guard against potential future changes, check for
null pointer in remove.

Reported-by: Tim Ross <tross@broadcom.com>
Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2015-07-16 00:12:24 +02:00
Keith Busch 7bee607472 NVMe: Reread partitions on metadata formats
This patch has the driver automatically reread partitions if a namespace
has a separate metadata format. Previously revalidating a disk was
sufficient to get the correct capacity set on such formatted drives,
but partitions that may exist would not have been surfaced.

Reported-by: Paul Grabinar <paul.grabinar@ranbarg.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Cc: Matthew Wilcox <willy@linux.intel.com>
Tested-by: Paul Grabinar <paul.grabinar@ranbarg.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
2015-07-15 15:36:47 -06:00
Linus Torvalds 9c69481ed0 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 fixes from Martin Schwidefsky:
 "One improvement for the zcrypt driver, the quality attribute for the
  hwrng device has been missing.  Without it the kernel entropy seeding
  will not happen automatically.

  And six bug fixes, the most important one is the fix for the vector
  register corruption due to machine checks"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/nmi: fix vector register corruption
  s390/process: fix sfpc inline assembly
  s390/dasd: fix kernel panic when alias is set offline
  s390/sclp: clear upper register halves in _sclp_print_early
  s390/oprofile: fix compile error
  s390/sclp: fix compile error
  s390/zcrypt: enable s390 hwrng to seed kernel entropy
2015-07-15 13:12:44 -07:00
Russell King c62ff6b3c7 drm/armada: avoid saving the adjusted mode to crtc->mode
We're not supposed to store the adjusted mode into crtc->mode.  We don't
use it anyway, so we can safely remove this.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-07-15 16:45:30 +01:00
Russell King 73068ce3b5 drm/armada: fix overlay when partially off-screen
Fix the start address calculation when overlay is partially off screen.
fb->bits_per_pixel is not set for YUV formats, and is always zero, which
led to the first component always starting at zero.

Use drm_format_plane_cpp() instead.

This also revealed a problem in that YUYV formats toggle the U/V data
for odd pixel start address offsets.  We try to rectify that by
toggling the U/V swap, which for the most part works, but seemingly
introduces a flicker for one scan frame of swapped U/V.

However, these changes result in an overall improvement.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-07-15 16:45:29 +01:00
Russell King 98fb74f4ec drm/armada: convert overlay to use drm_plane_helper_check_update()
Use drm_plane_helper_check_update() rather than our own code to validate
and limit the size of the displayed image.  As we are able to support
scaling, permit the full scaling ability.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-07-15 16:45:29 +01:00
Russell King 0481c8c47f drm/armada: fix gem object free after failed prime import
Fix the gem object freeing after a partial import of a dma buffer,
eg, one which has been imported, but not mapped.  This was provoking
a warning from the dma_buf code.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-07-15 16:45:29 +01:00
Russell King 41dbb2dba2 drm/armada: fix incorrect overlay plane cleanup
The Armada overlay plane wasn't being properly cleaned up as it was
missing a call to drm_plane_cleanup().  It also wasn't freeing the
right type of pointer (although we were still freeing the right
pointer value.)

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-07-15 16:45:29 +01:00
Russell King 070f3f6bae drm/armada: fix missing overlay wake-up
Nothing was waking up the overlay plane wait queue, so we were fully
reliant on the HZ/25 wait timing out to make progress.  Fix the lack
of wake-up.

We were also mis-handling the wait_event_timeout() return value - this
returns an unsigned integer of the remaining time, or zero on timeout
and the condition evaluated false.  Checking this for less than zero
is not sane.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-07-15 16:45:29 +01:00
James Morris 91ef5ccd54 Merge tag 'tpm-fixes-for-4.2-rc2' of https://github.com/PeterHuewe/linux-tpmdd into for-linus 2015-07-15 21:46:59 +10:00
Tvrtko Ursulin c631d5f90e drm: Provide compat ioctl for addfb2.1
Frame buffer modifiers extensions provided in;

  commit e3eb3250d8
  Author: Rob Clark <robdclark@gmail.com>
  Date:   Thu Feb 5 14:41:52 2015 +0000

      drm: add support for tiled/compressed/etc modifier in addfb2

Missed the structure packing/alignment problem where 64-bit
members were added after the odd number of 32-bit ones. This
makes the compiler produce structures of different sizes under
32- and 64-bit x86 targets and makes the ioctl need explicit
compat handling.

v2: Removed the typedef. (Daniel Vetter)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Cc: Rob Clark <robdclark@gmail.com>
Cc: Daniel Stone <daniels@collabora.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: stable@vger.kernel.org
[danvet: Squash in compile fix from Mika.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-07-15 11:38:38 +02:00
Malcolm Priestley d309509f84 staging: vt6656: check ieee80211_bss_conf bssid not NULL
Sometimes bssid can go null on failed association.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Cc: <stable@vger.kernel.org> # v3.17+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 19:34:57 -07:00
Malcolm Priestley 8e8e919892 staging: vt6655: check ieee80211_bss_conf bssid not NULL
Sometimes bssid can go null on failed association.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Cc: <stable@vger.kernel.org> # v3.19+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 19:34:57 -07:00