Commit Graph

388836 Commits

Author SHA1 Message Date
Kees Cook 412f30105e HID: pantherlord: validate output report details
A HID device could send a malicious output report that would cause the
pantherlord HID driver to write beyond the output report allocation
during initialization, causing a heap overflow:

[  310.939483] usb 1-1: New USB device found, idVendor=0e8f, idProduct=0003
...
[  315.980774] BUG kmalloc-192 (Tainted: G        W   ): Redzone overwritten

CVE-2013-2892

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-09-04 11:58:32 +02:00
Henrik Rydberg 8c89cc17b9 HID: Correct the USB IDs for the new Macbook Air 6
A recent patch (9d9a04ee) added support for the new machine, but got
the sequence of USB ids wrong. Reports from both Ian and Linus T show
that the 0x0291 id is for ISO, not ANSI, which should have the missing
number 0x0290. This patchs moves the three numbers accordingly, fixing
the problem.

Reported-and-tested-by: Ian Munsie <darkstarsword@gmail.com>
Tested-by: Linus G Thiel <linus@hanssonlarsson.se>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-09-04 10:50:41 +02:00
Jiri Kosina efd15f5f4f Merge branch 'master' into for-3.12/upstream
Sync with Linus' tree to be able to apply fixup patch on top
of 9d9a04ee75 ("HID: apple: Add support for the 2013 Macbook Air")

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-09-04 10:49:57 +02:00
Jiri Kosina 6c2794a298 HID: battery: don't do DMA from stack
Instead of using data from stack for DMA in hidinput_get_battery_property(),
allocate the buffer dynamically.

Cc: stable@kernel.org
Reported-by: Richard Ryniker <ryniker@alum.mit.edu>
Reported-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-09-02 13:43:00 +02:00
Stefan Achatz a4be0ed39f HID: roccat: add support for KonePureOptical v2
KonePureOptical is a KonePure with different sensor.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-09-02 13:38:38 +02:00
Bruno Prémont 1cde501bb4 HID: picolcd: Prevent NULL pointer dereference on _remove()
When picolcd is switched into bootloader mode (for FW flashing) make
sure not to try to dereference NULL-pointers of feature-devices during
unplug/unbind.

This fixes following BUG:
  BUG: unable to handle kernel NULL pointer dereference at 00000298
  IP: [<f811f56b>] picolcd_exit_framebuffer+0x1b/0x80 [hid_picolcd]
  *pde = 00000000
  Oops: 0000 [#1]
  Modules linked in: hid_picolcd syscopyarea sysfillrect sysimgblt fb_sys_fops
  CPU: 0 PID: 15 Comm: khubd Not tainted 3.11.0-rc7-00002-g50d62d4 #2
  EIP: 0060:[<f811f56b>] EFLAGS: 00010292 CPU: 0
  EIP is at picolcd_exit_framebuffer+0x1b/0x80 [hid_picolcd]
  Call Trace:
   [<f811d1ab>] picolcd_remove+0xcb/0x120 [hid_picolcd]
   [<c1469b09>] hid_device_remove+0x59/0xc0
   [<c13464ca>] __device_release_driver+0x5a/0xb0
   [<c134653f>] device_release_driver+0x1f/0x30
   [<c134603d>] bus_remove_device+0x9d/0xd0
   [<c13439a5>] device_del+0xd5/0x150
   [<c14696a4>] hid_destroy_device+0x24/0x60
   [<c1474cbb>] usbhid_disconnect+0x1b/0x40
   ...

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Cc: stable@kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-09-02 13:36:50 +02:00
Vasily Titskiy 9e0bf92c22 HID: usbhid: quirk for N-Trig DuoSense Touch Screen
The DuoSense touchscreen device causes a 10 second timeout. This fix
removes the delay.

Signed-off-by: Vasily Titskiy <qehgt0@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-09-02 13:34:43 +02:00
Marcel Holtmann 60cbd53e4b HID: uhid: add devname module alias
For simple device node creation, add the devname module alias.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-09-02 13:28:07 +02:00
Yonghua Zheng 277fe44dd8 HID: hidraw: Add spinlock in struct hidraw to protect list
It is unsafe to call list_for_each_entry in hidraw_report_event to
traverse each hidraw_list node without a lock protection, the list
could be modified if someone calls hidraw_release and list_del to
remove itself from the list, this can cause hidraw_report_event
to touch a deleted list struct and panic.

To prevent this, introduce a spinlock in struct hidraw to protect
list from concurrent access.

Signed-off-by: Yonghua Zheng <younghua.zheng@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-08-26 21:40:24 +02:00
Stefan Kriwanek 06bb521911 HID: Fix Speedlink VAD Cezanne support for some devices
Some devices of the "Speedlink VAD Cezanne" model need more aggressive fixing
than already done.

I made sure through testing that this patch would not interfere with the proper
working of a device that is bug-free. (The driver drops EV_REL events with
abs(val) >= 256, which are not achievable even on the highest laser resolution
hardware setting.)

Signed-off-by: Stefan Kriwanek <mail@stefankriwanek.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-08-26 13:51:10 +02:00
Andy Shevchenko 15261f6d8d HID: hid-sensor-hub: fix style of comments
This patch fixes the style of the comments to be like following
	/* The commentary */

There is no functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-08-26 13:46:11 +02:00
Wei Yongjun c0b20fd9b6 HID: use module_hid_driver() to simplify the code
module_hid_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-08-26 13:23:04 +02:00
Paul Gortmaker 8cd3c556b5 HID: samples/hidraw: add .gitignore file
To fix:

 # Untracked files:
 #   (use "git add <file>..." to include in what will be committed)
 #
 #	samples/hidraw/hid-example

as seen in git status output after an allyesconfig build.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-08-20 12:48:58 +02:00
David Herrmann 6e0fe2e572 input: document gamepad API and add extra keycodes
Until today all gamepad input drivers report their data differently. It is
nearly impossible to write applications for more than one device in a
generic way. Therefore, this patch introduces a uniform gamepad API which
will be used for all new drivers.

Instead of mapping buttons by their labels, we now map them by position.
This allows applications to work with any gamepad regardless of the labels
on the buttons. Furthermore, we standardize the ABS_* codes for analog
triggers and sticks.

For D-Pads the long overdue BTN_DPAD_* codes are introduced. They should
be fairly obvious how to use. To avoid confusion, the action buttons now
have BTN_EAST/SOUTH/WEST/NORTH aliases.

Reported-by: Todd Showalter <todd@electronjump.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-08-20 12:31:35 +02:00
Linus Torvalds 58c59bc997 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID fix from Jiri Kosina:
 "Revert of a patch which breaks enumeration workaround in
  hid-logitech-dj"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  Revert "HID: hid-logitech-dj: querying_devices was never set"
2013-08-09 11:53:06 -07:00
Linus Torvalds 78ebf0e349 fbdev fixes:
- omapdss: compilation fix and DVI fix for PandaBoard
 - mxsfb: fix colors when using 18bit LCD bus
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJSBMT+AAoJEPo9qoy8lh71q+EP/jALUWxJQUpswFsuhKu6Mubf
 IUg9F06EH5D+P5IIUWTE5rU5rtEQVm6ANg3gfTiKmjepxgF0zb/odpFjNmhKiFXu
 HKqiJWixi07veAxWUidkF2YEPzmoRHQ7rLCVrE4Tg4n0MOzD43sp6HrNWHY3YN4m
 XT+V8ZFN0AyLBQveE70tGjuk8Th+tMb4Xoja6vGhpE4MvQJpdBHu9IencBIVlINW
 IXbVTCbApOVSbkLuZkXIivrhbWZQhmIYqDO5/kwgaTI7xpTcYlSzjHrhnbHZ/Lw9
 ZNCC6DP63v2PsPwakjSbAyQeFIj8k/iqvlpcGK7p7RHq2vIA/UL1Vr3gN/nNGC+k
 /ZeVyGOFfLKWJCvIcVEkQpZcQPg1bJafIEc4DexQc5kKU07GcnLi2bEwY7JezbYm
 skmiMTaDN4M4JFBltVy69bW/92Z1b1O2Ei+zulwP39OcgHLTooNqk8Y780EQROSM
 enuPtgxWiKjJJ1VJy1p4ZWqIn7mtaXuKsFsdMOC9ClQBpBdxrBw9PtV3rjkht7ov
 uU/5YPb/ccuyGW7dRK7zrmMMryaEq/YhJS/XKzT/5Xju2XvZk1XSSTJjvLeFyD3+
 Qwh+lYPCHLQM2ICajiAGSPmpwdvTRY9ViexnWESaZNwe8p1if0PIyE/tHpYsAYCy
 mzzoatK5N96HjIdrXBPK
 =bHE/
 -----END PGP SIGNATURE-----

Merge tag 'fbdev-fixes-3.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux

Pull fbdev fixes from Tomi Valkeinen:
 - omapdss: compilation fix and DVI fix for PandaBoard
 - mxsfb: fix colors when using 18bit LCD bus

* tag 'fbdev-fixes-3.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux:
  ARM: OMAP: dss-common: fix Panda's DVI DDC channel
  video: mxsfb: fix color settings for 18bit data bus and 32bpp
  OMAPDSS: analog-tv-connector: compile fix
2013-08-09 11:52:34 -07:00
Linus Torvalds 6a93316661 Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie:
 "Mostly radeon, more fixes for dynamic power management which is is off
  by default for this release anyways, but there are a large number of
  testers, so I'd like to keep merging the fixes.

  Otherwise, radeon UVD fixes affecting suspend/resume regressions, i915
  regression fixes, one for your mac mini, ast, mgag200, cirrus ttm fix
  and one regression fix in the core"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (25 commits)
  drm: Don't pass negative delta to ktime_sub_ns()
  drm/radeon: make missing smc ucode non-fatal
  drm/radeon/dpm: require rlc for dpm
  drm/radeon/cik: use a mutex to properly lock srbm instanced registers
  drm/radeon: remove unnecessary unpin
  drm/radeon: add more UVD CS checking
  drm/radeon: stop sending invalid UVD destroy msg
  drm/radeon: only save UVD bo when we have open handles
  drm/radeon: always program the MC on startup
  drm/radeon: fix audio dto calculation on DCE3+ (v3)
  drm/radeon/dpm: disable sclk ss on rv6xx
  drm/radeon: fix halting UVD
  drm/radeon/dpm: adjust power state properly for UVD on SI
  drm/radeon/dpm: fix spread spectrum setup (v2)
  drm/radeon/dpm: adjust thermal protection requirements
  drm/radeon: select audio dto based on encoder id for DCE3
  drm/radeon: properly handle pm on gpu reset
  drm/i915: do not disable backlight on vgaswitcheroo switch off
  drm/i915: Don't call encoder's get_config unless encoder is active
  drm/i915: avoid brightness overflow when doing scale
  ...
2013-08-09 11:51:29 -07:00
Oleg Nesterov 201d3dfa4d dlm: kill the unnecessary and wrong device_close()->recalc_sigpending()
device_close()->recalc_sigpending() is not needed, sigprocmask() takes
care of TIF_SIGPENDING correctly.

And without ->siglock it is racy and wrong, it can wrongly clear
TIF_SIGPENDING and miss a signal.

But even with this patch device_close() is still buggy:

  1. sigprocmask() should not be used, we have set_task_blocked(),
     but this is minor.

  2. We should never block SIGKILL or SIGSTOP, and this is what
     the code tries to do.

  3. This can't protect against SIGKILL or SIGSTOP anyway. Another
     thread can do signal_wake_up(), say, do_signal_stop() or
     complete_signal() or debugger.

  4. sigprocmask(SIG_BLOCK, allsigs) doesn't necessarily clears
     TIF_SIGPENDING, say, freezing() or ->jobctl.

  5. device_write() looks equally wrong by the same reason.

Looks like, this tries to protect some wait_event_interruptible() logic
from signals, it should be turned into uninterruptible wait.  Or we need
to implement something like signals_stop/start for such a use-case.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-08-09 10:48:20 -07:00
Jiri Kosina 8e5654ce69 Revert "HID: hid-logitech-dj: querying_devices was never set"
This reverts commit 407a2c2a4d.

Explanation provided by Benjamin Tissoires:

Commit "HID: hid-logitech-dj, querying_devices was never set" activate
a flag which guarantees that we do not ask the receiver for too many
enumeration. When the flag is set, each following enumeration call is
discarded (the usb request is not forwarded to the receiver). The flag
is then released when the driver receive a pairing information event,
which normally follows the enumeration request.
However, the USB3 bug makes the driver think the enumeration request
has been forwarded to the receiver. However, it is actually not the
case because the USB stack returns -EPIPE. So, when a new unknown
device appears, the workaround consisting in asking for a new
enumeration is not working anymore: this new enumeration is discarded
because of the flag, which is never reset.

A solution could be to trigger a timeout before releasing it, but for
now, let's just revert the patch.

Reported-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Tested-by: Sune Mølgaard <sune@molgaard.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-08-09 11:34:19 +02:00
Manoj Chourasia 212a871a39 HID: hidraw: correctly deallocate memory on device disconnect
This changes puts the commit 4fe9f8e203 back in place
with the fixes for slab corruption because of the commit.

When a device is unplugged, wait for all processes that
have opened the device to close before deallocating the device.

This commit was solving kernel crash because of the corruption in
rb tree of vmalloc. The rootcause was the device data pointer was
geting excessed after the memory associated with hidraw was freed.

The commit 4fe9f8e203 was buggy as it was also freeing the hidraw
first and then calling delete operation on the list associated with
that hidraw leading to slab corruption.

Signed-off-by: Manoj Chourasia <mchourasia@nvidia.com>
Tested-by: Peter Wu <lekensteyn@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-08-09 11:27:00 +02:00
Dave Airlie e42f581421 Merge tag 'drm-intel-fixes-2013-08-08' of git://people.freedesktop.org/~danvet/drm-intel into drm-fixes
Daniel writes:
A few bugfixes for serious stuff and regressions. Highlight is the
reinstated hack to keep the i915 backlight on when running on an optimus
machine, this prevents black screens especially with some radeon muxed
platforms. And the patch to quiet dmesg on Linus' old mac mini ;-)

* tag 'drm-intel-fixes-2013-08-08' of git://people.freedesktop.org/~danvet/drm-intel:
  drm/i915: do not disable backlight on vgaswitcheroo switch off
  drm/i915: Don't call encoder's get_config unless encoder is active
  drm/i915: avoid brightness overflow when doing scale
  drm/i915: update last_vblank when disabling the power well
  drm/i915: fix gen4 digital port hotplug definitions
2013-08-09 09:09:37 +10:00
Linus Torvalds 6c2580c501 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32
Pull AVR32 build fix from Hans-Christian Egtvedt.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32:
  avr32: boards/atngw100/mrmt.c: fix building error
2013-08-08 13:11:53 -07:00
Oleg Nesterov 8742f229b6 userns: limit the maximum depth of user_namespace->parent chain
Ensure that user_namespace->parent chain can't grow too much.
Currently we use the hardroded 32 as limit.

Reported-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-08-08 13:11:39 -07:00
Linus Torvalds 55f5bfd4c9 ext4 bugfixes for v3.11-rc4
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABCAAGBQJR+YUoAAoJENNvdpvBGATwxsgQAJzxe8x1SWW8jrvasMELW3bS
 I7gl3lu789GROmZo5MI6+XI1DSCjHcMTisoPnPGx8q9LNhiYQGjp9Loxgl+L+Cem
 wbDfkSHrhxtDoEw2rdpPb/hFHOpsv8t6TT53GVbdc5l/lxwyvdrblXxhWbLuTRCQ
 G0X2VoxvTph7SyVPpRqoU4U99vW3g6LRI0dsxyU8kLc/kp7/t89gwh6Gj0wlb6tb
 4pswvEuxK4HauMPjajCIaEeGpQoHbvCVpB4P9HvEtL/wklc5hNIAWy5+KYjMFWil
 8Vc6RsJv6DZc66z+X4PT1oYrx6bkhNKNRGBETV2/dzeLU/7o2ttUIQ0vlOlN9gKV
 xSne19OKwqhhRMuWrc3LDzunlFiLex2zHbZJVDOeKNXmEJVpO9ZPVkvpoi/g0vOE
 DPwcc89J+763CVmXu8uyPqgQRfJTp2dXNggP3lINCDi1mFayrBqR0S6rQ1B2m/6R
 8HYDjJ6gBpXBcs0FTGh1cfbpI8GpPx9Xu3Q/FtjvczEXUO3831KCm+k7O3cUjB72
 I7I3wmyYQvUanOc39fg+EZ0cXpiSIZG4Mjv+8vWgADFlCMUKMaC+vp2PuKmBxTuk
 7dAkxKr2kXfMirGWF1R/vo/CaKnCWmJbAJDFJ8Mt/Nk3zn3NOl/kCRtxndlj7k+m
 /s8DHlVLyD8dgvzRO9gp
 =xqB3
 -----END PGP SIGNATURE-----

Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

Pull ext4 bugfixes from Ted Ts'o.

Misc ext4 fixes, delayed by Ted moving mail servers and email getting
marked as spam due to bad spf records.

* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: add WARN_ON to check the length of allocated blocks
  ext4: fix retry handling in ext4_ext_truncate()
  ext4: destroy ext4_es_cachep on module unload
  ext4: make sure group number is bumped after a inode allocation race
2013-08-08 09:38:19 -07:00
Linus Torvalds 64b4aaf025 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull security layer fix from James Morris:
 "Smack casting fix"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  Smack: IPv6 casting error fix for 3.11
2013-08-08 09:36:38 -07:00
Linus Torvalds 84e4526f88 regulator: DT binding fixes for v3.11
A couple of fixes to bring the DT binding documentation for Palmas into
 sync with the code.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSA3XHAAoJELSic+t+oim99V8P/RlIUqTKx17nWChbpbTYgysx
 PNuwXp5TUjkvCmTtCy0OvdxyLoYWGR+LLzNfhYPNItLD9uXMA4Z6I+oNDb0wNxGl
 XbPBN3FfZg2SEfV6gjXonXGOhLM7nT/90xwfKBHj2dmkZTCpu2BRnnm5qwgdyfKv
 QZytKT3YajmcInCmaaanXznRRAqezc61audbGxbd2g0ewmMUs9NEt6UhkswluQsP
 oxYOQ8RnW6jUvZ4451Z2UsYsV/oijZwrqg+gkNz1McEePPS86Yidr4flmv83gB9Y
 tFMt4kzw0onHGpH2tmNsvkPkgk3DULdo1P/wiWi/Ap51/ZuhCkEPHIu1MariwEGf
 thMrlGqN6FYbT4+j+MzHbF2cM/QodQuN6hqRbUSQO2hYVu8/isoh3bySQPyyK6c6
 idbmdEe3oot+OWkBN7wICI0qlNZQBnAq+R/SLzrlOWtW+coGEnOwmMiM18MS9UcV
 1Y/cNxS1zhXoFNoNVXjgUWdrTmxMEbVLI9Hr/5XjfBJIYR+uJOtsIPno3NuFJ7o4
 4C1RSOxtLsdyP6aJ1IsozUGIRARgVsys6oVKAVW6atJDTTzOW/Qm+2uhSjbJuR5c
 W1npzNKvyuFZ+rgiHJPpI+5f5TS30ct56c6UDj0c7fHlYP4PE7u3y3hsTV4DyhIK
 LwUGRM9rjtnLF0jvxdac
 =faDW
 -----END PGP SIGNATURE-----

Merge tag 'regulator-v3.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator DT binding fixes from Mark Brown:
 "A couple of fixes to bring the DT binding documentation for Palmas
  into sync with the code"

* tag 'regulator-v3.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: palmas-pmic: doc: remove ti,tstep
  regulator: palmas-pmic: doc: fix typo for sleep-mode
2013-08-08 09:34:40 -07:00
Linus Torvalds d56290bbc1 regmap: Fixes for v3.11
Two things here, one is a fix for a nasty issue where we were failing to
 sync the last register in a block when using raw writes and the other
 fixes a missing header for the !REGMAP stubs so that we don't rely on
 implicit includes in that case.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSA3O4AAoJELSic+t+oim9stQP+QFLjbyTpjBe10scjPnZ94MV
 yfAl31+uBi80YPsNxTQC/JxzNtQCn+X0Y7I2/gdpf5DcUA6Vw+D8l5ABZDAiWWmU
 FtijXn86zEmHtjGD88om4WX7trm9wKnL0YYUdNUXYeXduoLl9uElZGqSZedDziXk
 5W0967WTKu22OeqsRe5PtXmjtFfWuI0TYEHboc7KVNTZRFdDQVzmr5oRynzW3rL2
 vZ3bb9GK0fN2RTwWhjQu5fQJfjV7ZS30JAy6/uHAWaeh1u90yCcMoHgRJ0YfuBMj
 3ggFVvMU2rgg9NOdlv4WuxUWEnElgKi6kWg2Figu8gKFeUPlbxkw6AMwYlg9eyUR
 mSRoBs34iN1kdPqe467pKxjKZLrhyu3ZDK2fnR+wCQ8uWqKrjE/YvTiYCfzuwi6S
 AMV/FiOVSzhTIyQxtvgyhGP5hR401UZtOo4Lom1GcXKeLX3/vPceErqBFYM3m7bB
 pf0BlovDR1BgmN6NB9oIk8Q60NJD7Rjl1dYxXyTAgWVSZLVy3mpYYvqvBsLBtfbA
 L9hhLuQ5dHWg3rNWLNaKX0z5sBNklnCfSHUhfURBO5X8H+5eoVQatqv9ZCleJp8X
 Xyyjjsu4UyoBLfOMmlEEoxsYnhNbTAgvHFZ7YD5DlnZruLPT/hMgvoyf4kWoFFCc
 zU96Lr3d9NIBgVtb+0C/
 =OFAa
 -----END PGP SIGNATURE-----

Merge tag 'regmap-v3.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap

Pull regmap fixes from Mark Brown:
 "Two things here, one is a fix for a nasty issue where we were failing
  to sync the last register in a block when using raw writes and the
  other fixes a missing header for the !REGMAP stubs so that we don't
  rely on implicit includes in that case"

* tag 'regmap-v3.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: Add missing header for !CONFIG_REGMAP stubs
  regmap: cache: Make sure to sync the last register in a block
2013-08-08 09:34:04 -07:00
Linus Torvalds 91b831a207 spi: Simple fix for davinci
Just one update for SPI, a simple fix to the davinci driver to correct
 the direction for which DMA is mapped following the dmaengine
 conversion.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSA3JLAAoJELSic+t+oim9V4EP/1y95gtcWpo6NOxvu88+FRar
 QC5FOnuDQRBgZnupurK95C27JZOJfwH0o/6PLiG/c/f+nEYyBhFFnJ+5ZC8O6Rg9
 gzGWymtDAuS6Rlh6MI7f++k3z2DrSj8KF/0v2KW71CgaKmdvpTOoXK8FVBXx6Y5W
 X74vW/+aZVQU483OUygYHl67QHDuOpKLQwkTKMcxVAheWHRCcb3zhUUgVKog8EEi
 Ukl6C2xV67b7/x1TFGhUouq1pS0ShLNQdLYL8NLuc+HdFxg/nob1hGtu9crZ0Asp
 FdqIQ6OBJfxkpklBY5g7GDabKD80Wb16fG9JYp0PpRphvrtKpn9rPejQXDpeIhHY
 kw+5o0rw0YqyCaL2Gs9uvmgKjYXhrs+lLogCHWxRg7JbMF6FfvDkBJd8wG5UiYEY
 /AvHNhsaY1YszdyNqRRc5AOrD8WEmDMS1kWDGk4tOw1lu+3X0gVzxx+7kZa61H9r
 t0nFpcuRnvqyiPiGC7kH8g9/BeLMG/kW9h+1W92kIfwof2A9CufTKSFS78/UEw/C
 CUTds7hFlpDh8fGSUpx5hr3xC4oGZxSF2hJTtFuHNjKnVfrxBeUQcF+y4oR8+kWH
 89Xt1GqO7wKjyVXVlqWL+bCD11s37Ur7PcaFTqIxDKxRA2TY21/THuFJ/JQnEbaa
 KCyCUBODgPFJ42X0jXfY
 =zVk5
 -----END PGP SIGNATURE-----

Merge tag 'spi-v3.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fix from Mark Brown:
 "Just one update for SPI, a simple fix to the davinci driver to correct
  the direction for which DMA is mapped following the dmaengine
  conversion"

* tag 'spi-v3.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: spi-davinci: Fix direction in dma_map_single()
2013-08-08 09:33:27 -07:00
Linus Torvalds bb014db07c More virtio console fixes than I'm happy with, but all real issues,
and all CC:stable..
 
 Thanks,
 Rusty.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJSAtjmAAoJENkgDmzRrbjxV/kP+wQaShGQ6Q8U7yYew7yZvo2H
 CE3VHpSkp3NnJfAqNMz/sCES7pAvYXvUM1hcVQ+GI1ZqVnN5yJViqeygIOU/xQEN
 WjslgtCvpdw0/R3dL4oxhcIMdgBioP9hknB56WPqHFZ9Ytb5GxPVf4wCNpd7FrsC
 iGHklImzN1r4AjxSTdbCCCk8iYKJOJRTAfZrtVtkc9uOU68GGBcAl8ArSPIScwEb
 41JuuB/Qgja0ssCYpD5jrC74QePvU1eTgSQWs8Tgc6v43UNFjZyKWSY8G13MAd+l
 c3SCLCRqzPxpwhIhvAMQFnkmIlIqVpp66nnh6AqJt8Mw2ymSvP3AY5PMegV92Al+
 afBofUz2KRPinGINe7SrrpRt/NU3SM+k1CWHeVu76U7V59f8ohxW9dLqI6otOrq+
 6GZx2Z9vyVkj4TP8vz4rNZINKXjRBaGhTNcQ0rM3obMFM4Dg+4dhF+PpGA8UyFwI
 3Tw2c0zbVIqQ6fEO63ZYGhAdVNdlZoPA2tuA34hfY/D07842tgkPhuAF6yDeb4jg
 JmiERc506JpLws0Tu6E6H+x6LQAGr9cYPgBpvucab/SVa3bcrEJj2oqDt0pZaTiO
 q6HkkDwfoDVdv9TY3sCgOmKSUp/smkrloa3vMHLUZsnjx66iIPdHn+PcN/7Im8ut
 kfnKgLgo/BloWT0XeFv+
 =ZV9B
 -----END PGP SIGNATURE-----

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

Pull virtio fixes from Rusty Russell:
 "More virtio console fixes than I'm happy with, but all real issues,
  and all CC:stable.."

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  virtio-scsi: Fix virtqueue affinity setup
  virtio: console: return -ENODEV on all read operations after unplug
  virtio: console: fix raising SIGIO after port unplug
  virtio: console: clean up port data immediately at time of unplug
  virtio: console: fix race in port_fops_open() and port unplug
  virtio: console: fix race with port unplug and open/close
  virtio/console: Add pipe_lock/unlock for splice_write
  virtio/console: Quit from splice_write if pipe->nrbufs is 0
2013-08-08 09:32:20 -07:00
Linus Torvalds 67ef626506 ARM: SoC fixes for v3.11-rc
- MSM: GPIO fixes (includes old code removal)
 - OMAP: earlyprintk regression, AM33xx cpgmac PM regression
 - OMAP5: urgent fix for potentially harmful voltage regulator values
 - Renesas: gpio-keys fix, fix SD card detection, fix shdma calculation error
 - STi: critical SMP boot fix
 - tegra: DTS fix for usb-phy
 - a couple MAINTAINERS updates
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJSAshIAAoJEFk3GJrT+8Zl3i8QAITSHEVGoksh0dgi2djlknMK
 HoZq35kL/tpUCzZZkt3YroQFAgCeNhnfaWoelR2I7Pvaevyu7Z0wpIigfNhnraH2
 cvzlaZPZKJxW32yPWrOOJjaEaxQ8ltBIt6XUfqMusXHKPI99XV3nkj/6vuux3OXI
 9ADE4lHtH2mlMjOgoP4xJb+cID1raRloXjNWz69u816/a+cujT+3ghqE9DDZY1Xo
 7exYSukwaMLVFg2HpG+LbNzpZxHYD1oIR4Mww79XefMq0/7JDlb+e7DuvIhNlPAW
 GPZMfE98h+YPLYTVFW3rKcQCIl081IsaZRIQSupX2J2jGW6Izv16lZad5yBvLYhk
 TX41o4ATfpS/FAW7ahz2olhewsHvLY/5TYDjlr/ULSBWcaE5/v6Zu7H3DaZ4BFho
 T8WMf6pYz8Mu2fSBbkLonbt+mJBdzh1/42M0bCO469VBlls3B79efuEvhU2V+XC4
 APuCd9m/Eo5Uf+1dJP0IcvHwVRPbJGH75dGnWCAVD0gkQ9cAHoinT9jqHW3gIB9o
 FE/yUx0w9Bq0p/7twF2xgKaBqAMzcACDWXozfY8+8gXGfoqh32WY72qUV4lUycYa
 3La2pg6NeD37pVtspG9lGZg8iQJSL+WKzba3NTuZry2st+/mHP5QXQZhgtz8jzkc
 GHwcz+o7yQm31P17N7I+
 =aecr
 -----END PGP SIGNATURE-----

Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Kevin Hilman:
 - MSM: GPIO fixes (includes old code removal)
 - OMAP: earlyprintk regression, AM33xx cpgmac PM regression
 - OMAP5: urgent fix for potentially harmful voltage regulator values
 - Renesas: gpio-keys fix, fix SD card detection, fix shdma calculation
   error
 - STi: critical SMP boot fix
 - tegra: DTS fix for usb-phy
 - a couple MAINTAINERS updates

(Arnd is on paternity leave, Kevin is stepping up to help arm-soc
maintenance)

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  MAINTAINERS: add TI Keystone ARM platform
  MAINTAINERS: delete Srinidhi from ux500
  ARM: tegra: enable ULPI phy on Colibri T20
  ARM: STi: remove sti_secondary_start from INIT section.
  ARM: STi: Fix cpu nodes with correct device_type.
  ARM: shmobile: lager: do not annotate gpio_buttons as __initdata
  ARM: shmobile: BOCK-W: fix SDHI0 PFC settings
  shdma: fixup sh_dmae_get_partial() calculation error
  ARM: OMAP2+: hwmod: AM335x: fix cpgmac address space
  ARM: OMAP2+: hwmod: rt address space index for DT
  ARM: OMAP2+: Sync hwmod state with the pm_runtime and omap_device state
  ARM: OMAP2+: Avoid idling memory controllers with no drivers
  ARM: OMAP2+: hwmod: Fix a crash in _setup_reset() with DEBUG_LL
  ARM: dts: omap5-uevm: update optional/unused regulator configurations
  ARM: dts: omap5-uevm: fix regulator configurations mandatory for SoC
  ARM: dts: omap5-uevm: document regulator signals used on the actual board
  ARM: msm: Consolidate gpiomux for older architectures
  ARM: shmobile: armadillo800eva: Don't request GPIO 166 in board code
  ARM: msm: dts: Fix the gpio register address for msm8960
2013-08-08 09:28:08 -07:00
Linus Torvalds 370905069c Revert "slub: do not put a slab to cpu partial list when cpu_partial is 0"
This reverts commit 318df36e57.

This commit caused Steven Rostedt's hackbench runs to run out of memory
due to a leak.  As noted by Joonsoo Kim, it is buggy in the following
scenario:

 "I guess, you may set 0 to all kmem caches's cpu_partial via sysfs,
  doesn't it?

  In this case, memory leak is possible in following case.  Code flow of
  possible leak is follwing case.

   * in __slab_free()
   1. (!new.inuse || !prior) && !was_frozen
   2. !kmem_cache_debug && !prior
   3. new.frozen = 1
   4. after cmpxchg_double_slab, run the (!n) case with new.frozen=1
   5. with this patch, put_cpu_partial() doesn't do anything,
      because this cache's cpu_partial is 0
   6. return

  In step 5, leak occur"

And Steven does indeed have cpu_partial set to 0 due to RT testing.

Joonsoo is cooking up a patch, but everybody agrees that reverting this
for now is the right thing to do.

Reported-and-bisected-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Acked-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-08-08 09:06:37 -07:00
Cong Ding c4afd7b95f avr32: boards/atngw100/mrmt.c: fix building error
there is an additional "{", which causes building error.

Signed-off-by: Cong Ding <dinggnu@gmail.com>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
2013-08-08 14:16:22 +02:00
Michel Dänzer e91abf80a0 drm: Don't pass negative delta to ktime_sub_ns()
It takes an unsigned value. This happens not to blow up on 64-bit
architectures, but it does on 32-bit, causing
drm_calc_vbltimestamp_from_scanoutpos() to calculate totally bogus
timestamps for vblank events. Which in turn causes e.g. gnome-shell to
hang after a DPMS off cycle with current xf86-video-ati Git.

[airlied: regression introduced in drm: use monotonic time in drm_calc_vbltimestamp_from_scanoutpos]

Cc: stable@vger.kernel.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59339
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59836
Tested-by: shui yangwei <yangweix.shui@intel.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-08-08 09:50:25 +10:00
Dave Airlie 16d5b27250 Merge branch 'drm-fixes-3.11' of git://people.freedesktop.org/~agd5f/linux
Some more radeon fixes.  Mostly dpm and uvd fixes.  Fixes hangs
with dpm on more rv6xx asics, and fixes suspend and resume with UVD.

* 'drm-fixes-3.11' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: make missing smc ucode non-fatal
  drm/radeon/dpm: require rlc for dpm
  drm/radeon/cik: use a mutex to properly lock srbm instanced registers
  drm/radeon: remove unnecessary unpin
  drm/radeon: add more UVD CS checking
  drm/radeon: stop sending invalid UVD destroy msg
  drm/radeon: only save UVD bo when we have open handles
  drm/radeon: always program the MC on startup
  drm/radeon: fix audio dto calculation on DCE3+ (v3)
  drm/radeon/dpm: disable sclk ss on rv6xx
  drm/radeon: fix halting UVD
  drm/radeon/dpm: adjust power state properly for UVD on SI
  drm/radeon/dpm: fix spread spectrum setup (v2)
  drm/radeon/dpm: adjust thermal protection requirements
  drm/radeon: select audio dto based on encoder id for DCE3
  drm/radeon: properly handle pm on gpu reset
2013-08-08 09:47:02 +10:00
Alex Deucher 8a53fa23fd drm/radeon: make missing smc ucode non-fatal
The smc ucode is required for dpm (dynamic power
management), but if it's missing just skip dpm setup
and don't disable acceleration.

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=67876

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:19 -04:00
Alex Deucher 761bfb9998 drm/radeon/dpm: require rlc for dpm
The rlc is required for dpm to work properly, so if
the rlc ucode is missing, don't enable dpm.  Enabling
dpm without the rlc enabled can result in hangs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:19 -04:00
Alex Deucher f61d5b4677 drm/radeon/cik: use a mutex to properly lock srbm instanced registers
We need proper locking in the driver when accessing instanced
registers on CIK.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:18 -04:00
Christian König 3744b248f9 drm/radeon: remove unnecessary unpin
We don't pin the BO on allocation, so don't unpin it on free.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:17 -04:00
Christian König 56cc2c1538 drm/radeon: add more UVD CS checking
Improve error handling in case userspace sends us
an invalid command buffer.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:16 -04:00
Christian König 641a00593f drm/radeon: stop sending invalid UVD destroy msg
We also need to check the handle.

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:15 -04:00
Christian König 4ad9c1c774 drm/radeon: only save UVD bo when we have open handles
Otherwise just reinitialize from scratch on resume,
and so make it more likely to succeed.

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:15 -04:00
Alex Deucher 6fab3febf6 drm/radeon: always program the MC on startup
For r6xx+ asics.  This mirrors the behavior of pre-r6xx
asics.  We need to program the MC even if something
else in startup() fails.  Failure to do so results in
an unusable GPU.

Based on a fix from: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2013-08-07 17:37:14 -04:00
Alex Deucher 1518dd8efd drm/radeon: fix audio dto calculation on DCE3+ (v3)
Need to set the wallclock ratio and adjust the phase
and module registers appropriately.  May fix problems
with audio timing at certain display timings.

v2: properly handle clocks below 24mhz
v3: rebase r600 changes

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:13 -04:00
Alex Deucher ce149a9406 drm/radeon/dpm: disable sclk ss on rv6xx
Enabling spread spectrum on the engine clock
leads to hangs on some asics.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=66963

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:12 -04:00
Christian König 2858c00d28 drm/radeon: fix halting UVD
Removing the clock/power or resetting the VCPU can cause
hangs if that happens in the middle of a register write.

Stall the memory and register bus before putting the VCPU
into reset. Keep it in reset when unloading the module or
suspending.

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:11 -04:00
Alex Deucher 797f203f62 drm/radeon/dpm: adjust power state properly for UVD on SI
There are some hardware issue with reclocking on SI when
UVD is active, so use a stable power state when UVD is
active.  Fixes possible hangs and performance issues when
using UVD on SI.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:11 -04:00
Alex Deucher b841ce7b41 drm/radeon/dpm: fix spread spectrum setup (v2)
Need to check for engine and memory clock ss separately
and only enable dynamic ss if either of them are found.

This should fix systems which have a ss table, but do
not have entries for engine or memory.  On those systems
we may enable dynamic spread spectrum without enabling
it on the engine or memory clocks which can lead to a
hang in some cases.

fixes some systems reported here:
https://bugs.freedesktop.org/show_bug.cgi?id=66963

v2: fix typo

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:10 -04:00
Alex Deucher fda837241f drm/radeon/dpm: adjust thermal protection requirements
On rv770 and newer, clock gating is not required
for thermal protection.  The only requirement is that
the design utilizes a thermal sensor.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:09 -04:00
Alex Deucher e1accbf054 drm/radeon: select audio dto based on encoder id for DCE3
There are two audio dtos on radeon asics that you can
select between.  Normally, dto0 is used for hdmi and
dto1 for DP, but it seems that the dto is somehow
tied to the encoders on DCE3 asics.

fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=67435

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2013-08-07 17:37:08 -04:00
Alex Deucher 95f595097b drm/radeon: properly handle pm on gpu reset
When we reset the GPU, we need to properly tear
down power management before reseting the GPU and then
set it back up again after reset.  Add the missing
radeon_pm_[suspend|resume] calls to the gpu reset
function.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:07 -04:00