Commit graph

469938 commits

Author SHA1 Message Date
Linus Torvalds 850ebc0c0c Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie:
 "AST, i915, radeon and msm fixes, all over the place.

  All fixing build issues, regressions, oopses or failure to detect
  cards"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/ast: AST2000 cannot be detected correctly
  drm/ast: open key before detect chips
  drm/msm: don't crash if no msm.vram param
  drm/msm/hdmi: fix build break on non-CCF platforms
  drm/msm: Change nested function to static function
  drm/radeon/dpm: set the thermal type properly for special configs
  drm/radeon: reduce memory footprint for debugging
  drm/radeon: add connector quirk for fujitsu board
  drm/radeon: fix semaphore value init
  drm/radeon: only use me/pfp sync on evergreen+
  drm/i915: Wait for vblank before enabling the TV encoder
  drm/i915: Evict CS TLBs between batches
  drm/i915: Fix irq enable tracking in driver load
  drm/i915: Fix EIO/wedged handling in gem fault handler
  drm/i915: Prevent recursive deadlock on releasing a busy userptr
2014-09-12 08:27:40 -07:00
Julia Lawall d456ea2edc drm: use c99 initializers in structures
Use c99 initializers for structures.

Drop 0 initializers in drivers/gpu/drm/sti/sti_vtac.c.  A 0x0 initializer
is left in vtac_mode_aux in drivers/gpu/drm/sti/sti_vtac.c to highlight the
relation to vtac_mode_main.

A simplified version of the semantic match that finds the first problem is
as follows: (http://coccinelle.lip6.fr/)

// <smpl>
@decl@
identifier i1,fld;
type T;
field list[n] fs;
@@

struct i1 {
 fs
 T fld;
 ...};

@bad@
identifier decl.i1,i2;
expression e;
initializer list[decl.n] is;
@@

struct i1 i2 = { is,
+ .fld = e
- e
 ,...};
// </smpl>

v2: Drop 0 initializers and add trailing commas at the suggestions of Josh
Triplett.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-12 16:49:34 +02:00
Randy Dunlap f3a808817f drm: fix drm_modeset_lock.h kernel-doc notation
Fix drm kernel-doc notation to squelch these warnings:

Warning(..//include/drm/drm_modeset_lock.h:41): cannot understand function prototype: 'struct drm_modeset_acquire_ctx '
Warning(..//include/drm/drm_modeset_lock.h:66): cannot understand function prototype: 'struct drm_modeset_lock '

Need to include the keyword 'struct' for structure descriptions.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-12 16:49:33 +02:00
Daniel Vetter 6865b20ad3 drm: Move DRM_MAGIC_HASH_ORDER into drm_drv.c
Only used in one place ever, so put it right next to that.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-12 15:28:14 +02:00
Daniel Vetter 00285be8ff drm: Move drm_class to drm_internal.h
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-12 15:28:14 +02:00
Daniel Vetter 8f1a2c8dc0 drm: Move LOCK_TEST_WITH_RETURN to <drm/drm_legacy.h>
Unfortunately we can't move struct drm_lock_data easily since
it's embedded into struct drm_master. And figuring out where exactly
this struct should be allocated isn't that simple ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-12 15:28:13 +02:00
Daniel Vetter ba8286fab5 drm: Move legacy buffer structures to <drm/drm_legacy.h>
A few odd cases:
- mgag200 someho had a totally unused drm_dma_handle_t. Remove it.
- i915 still uses the legacy pci dma alloc api, so grows an include.

Everything else fairly standard.

v2: Include "drm_legacy.h" in drm.ko source files for consistency.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-12 15:28:12 +02:00
Daniel Vetter 86c1fbd55c drm: Move drm_memory.c map support declarations to <drm/drm_legacy.h>
And replace the drm_core_ prefix with drm_legacy_ since really, this
isn't core stuff.

Also drop drm_core_dropmap since it's unused.

v2: Fix up i810.ko fully which somehow slipped through.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-12 15:28:12 +02:00
Daniel Vetter 78238757eb drm: Purge ioctl forward declarations from drmP.h
If we push down the ioctl table in drm_ioctl.c all the forward
declarations in drmP.h are not required any more.

v2: Fold in fixup from Fenugguang Wu to declare functions as static.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-12 15:27:47 +02:00
David Howells 95389b08d9 KEYS: Fix termination condition in assoc array garbage collection
This fixes CVE-2014-3631.

It is possible for an associative array to end up with a shortcut node at the
root of the tree if there are more than fan-out leaves in the tree, but they
all crowd into the same slot in the lowest level (ie. they all have the same
first nibble of their index keys).

When assoc_array_gc() returns back up the tree after scanning some leaves, it
can fall off of the root and crash because it assumes that the back pointer
from a shortcut (after label ascend_old_tree) must point to a normal node -
which isn't true of a shortcut node at the root.

Should we find we're ascending rootwards over a shortcut, we should check to
see if the backpointer is zero - and if it is, we have completed the scan.

This particular bug cannot occur if the root node is not a shortcut - ie. if
you have fewer than 17 keys in a keyring or if you have at least two keys that
sit into separate slots (eg. a keyring and a non keyring).

This can be reproduced by:

	ring=`keyctl newring bar @s`
	for ((i=1; i<=18; i++)); do last_key=`keyctl newring foo$i $ring`; done
	keyctl timeout $last_key 2

Doing this:

	echo 3 >/proc/sys/kernel/keys/gc_delay

first will speed things up.

If we do fall off of the top of the tree, we get the following oops:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
IP: [<ffffffff8136cea7>] assoc_array_gc+0x2f7/0x540
PGD dae15067 PUD cfc24067 PMD 0
Oops: 0000 [#1] SMP
Modules linked in: xt_nat xt_mark nf_conntrack_netbios_ns nf_conntrack_broadcast ip6t_rpfilter ip6t_REJECT xt_conntrack ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_ni
CPU: 0 PID: 26011 Comm: kworker/0:1 Not tainted 3.14.9-200.fc20.x86_64 #1
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
Workqueue: events key_garbage_collector
task: ffff8800918bd580 ti: ffff8800aac14000 task.ti: ffff8800aac14000
RIP: 0010:[<ffffffff8136cea7>] [<ffffffff8136cea7>] assoc_array_gc+0x2f7/0x540
RSP: 0018:ffff8800aac15d40  EFLAGS: 00010206
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff8800aaecacc0
RDX: ffff8800daecf440 RSI: 0000000000000001 RDI: ffff8800aadc2bc0
RBP: ffff8800aac15da8 R08: 0000000000000001 R09: 0000000000000003
R10: ffffffff8136ccc7 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000070 R15: 0000000000000001
FS:  0000000000000000(0000) GS:ffff88011fc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000018 CR3: 00000000db10d000 CR4: 00000000000006f0
Stack:
 ffff8800aac15d50 0000000000000011 ffff8800aac15db8 ffffffff812e2a70
 ffff880091a00600 0000000000000000 ffff8800aadc2bc3 00000000cd42c987
 ffff88003702df20 ffff88003702dfa0 0000000053b65c09 ffff8800aac15fd8
Call Trace:
 [<ffffffff812e2a70>] ? keyring_detect_cycle_iterator+0x30/0x30
 [<ffffffff812e3e75>] keyring_gc+0x75/0x80
 [<ffffffff812e1424>] key_garbage_collector+0x154/0x3c0
 [<ffffffff810a67b6>] process_one_work+0x176/0x430
 [<ffffffff810a744b>] worker_thread+0x11b/0x3a0
 [<ffffffff810a7330>] ? rescuer_thread+0x3b0/0x3b0
 [<ffffffff810ae1a8>] kthread+0xd8/0xf0
 [<ffffffff810ae0d0>] ? insert_kthread_work+0x40/0x40
 [<ffffffff816ffb7c>] ret_from_fork+0x7c/0xb0
 [<ffffffff810ae0d0>] ? insert_kthread_work+0x40/0x40
Code: 08 4c 8b 22 0f 84 bf 00 00 00 41 83 c7 01 49 83 e4 fc 41 83 ff 0f 4c 89 65 c0 0f 8f 5a fe ff ff 48 8b 45 c0 4d 63 cf 49 83 c1 02 <4e> 8b 34 c8 4d 85 f6 0f 84 be 00 00 00 41 f6 c6 01 0f 84 92
RIP  [<ffffffff8136cea7>] assoc_array_gc+0x2f7/0x540
 RSP <ffff8800aac15d40>
CR2: 0000000000000018
---[ end trace 1129028a088c0cbd ]---

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
2014-09-12 22:34:31 +10:00
Daniel Vetter 44af3f5c6a drm: unexport drm_global_mutex
Drivers really, really have no business even looking at this lock. And
thankfully they don't.

So unexport it and move the declaration to drm_internal.h.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-12 11:19:47 +02:00
Daniel Vetter 67d0ec4e88 drm: Move piles of functions from drmP.h to drm_internal.h
This way drivers can't grow crazy ideas any more, and it also
helps a bit in reviewing EXPORT_SYMBOLS.

v2: Even more stuff. Unfortunately we can't move drm_vm_open_locked
because exynos does some horrible stuff with it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-12 11:16:29 +02:00
Daniel Vetter 1888299571 drm: Move vblank related module options into drm_irq.c
This allows us to drop 2 header declarations from drmP.h. The 3rd one
is also used in drm_ioctl.c, so for that create a new drm_internal.h
header for non-legacy non-kms (since we have internal headers for
those parts already) declarations private to drm.ko.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-12 11:14:56 +02:00
Daniel Vetter 7610a04c00 drm: Drop drm_sysfs_class from drmP.h
No user at all.

My guess is that this is a leftover from ttm before it used
the more abstract helpers to register/unregister its sysfs
objects (see drm_sysfs.h). At least in the existing history
it was never used.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-12 11:08:56 +02:00
Daniel Vetter 1c96e84ee4 drm: Move __drm_pci_free to drm_legacy.h
Also sprinkle the customary legacy_ prefix.

Unfortunately we can't move the other functions since i915 is still
using them. Shame on me for that one :(

v2: Fix patch subject as spotted by David Herrmann.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-12 11:08:56 +02:00
Daniel Vetter 4f03b1fc1e drm: Create drm legacy driver header
And move a few legayc functions to start things over there.

It compiles ...

Inspired by a patch from Dave Airlie, but with a split between drm.ko
private legacy functions and stuff used by drivers.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-12 11:08:55 +02:00
Daniel Vetter a677f4cc88 drm: Move drm_legacy_vma_flush into drm_legacy.h
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-09-12 11:08:54 +02:00
Daniel Vetter 9ec4e2ff3e drm: Move sg functions into drm_legacy.h
Also sprinkle the drm_legacy_ prefix where missing.

v2: Drop extern from function declarations and include "drm_legacy.h"
in drm_scatter.c, spotted by David.

Cc: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-12 11:08:54 +02:00
Daniel Vetter a266162aef drm: Move dma functions into drm_legacy.h
Also drop the unneeded EXPORT_SYMBOL and sprinkle drm_legacy_ prefixes
where missing.

v2: Drop the confusing _core_ and drop extern, both suggested by
David.

Cc: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-12 11:08:53 +02:00
Dave Airlie edbaae5a5c Merge tag 'topic/vblank-rework-2014-09-12' of git://anongit.freedesktop.org/drm-intel into drm-next
So updated vblank-rework pull request, now with the polish that Mario
requested applied (and reviewed by him). Also with backmerge like you've
requested for easier merging.

The neat thing this finally allows is to immediately disable the vblank
interrupt on the last drm_vblank_put if the hardware has perfectly
accurate vblank counter and timestamp readout support. On i915 that
required piles of small adjustements from Ville since depending upon the
platform and port the vblank happens at different scanout lines.

Of course this is fully opt-in and per-device (we need that since gen2
doesn't have a hw vblank counter).

* tag 'topic/vblank-rework-2014-09-12' of git://anongit.freedesktop.org/drm-intel: (22 commits)
  drm: Clarify vblank ts/scanoutpos sampling #defines
  drm: Simplify return value of drm_get_last_vbltimestamp
  drm: Only update final vblank count when precise ts is available
  drm: Really never disable vblank irqs for offdelay==0
  drm: Use vblank_disable_and_save in drm_vblank_cleanup()
  drm: Remove drm_vblank_cleanup from drm_vblank_init error path.
  drm: Store the vblank timestamp when adjusting the counter during disable
  drm: Fix confusing debug message in drm_update_vblank_count()
  drm/i915: Update scanline_offset only for active crtcs
  drm: Kick start vblank interrupts at drm_vblank_on()
  drm/i915: Opt out of vblank disable timer on >gen2
  drm: Add dev->vblank_disable_immediate flag
  drm: Disable vblank interrupt immediately when drm_vblank_offdelay<0
  drm: Fix race between drm_vblank_off() and drm_queue_vblank_event()
  drm: Fix deadlock between event_lock and vbl_lock/vblank_time_lock
  drm: Reduce the amount of dev->vblank[crtc] in the code
  drm: Avoid random vblank counter jumps if the hardware counter has been reset
  drm: Have the vblank counter account for the time between vblank irq disable and drm_vblank_off()
  drm: Move drm_update_vblank_count()
  drm: Don't clear vblank timestamps when vblank interrupt is disabled
  ...
2014-09-12 19:04:53 +10:00
Pawel Moll e4cf39ea47 video: ARM CLCD: Fix color model capabilities for DT platforms
The DT-based panel capabilities selection was picking up
a subset of available modes based on hardware configuration.
This was wrong, as the capabilities describe available
memory models and adapt the display controller to them
that the RGB output is wired up correctly (as in: R and
B components are not swapped).

This patch fixes it by removing the unnecessary limitation.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2014-09-12 11:45:10 +03:00
Dave Airlie a9d6dd2554 drm/ast: switch to using CACHED by default for sysram
This fixes problems on ppc64 platforms, where we could end up using
a WC mapping for migrating BOs with memcpy, when really we want to
use cached memory.

Tested-by: Ben Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-12 17:32:12 +10:00
Dave Airlie fd7e0d7192 drm: split ati_pcigart.h out of drmP.h
Just move this into a separate header file, and make the
two users use it.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-12 14:11:14 +10:00
Dave Airlie 10d123b2f2 Merge branch 'drm-next-3.18' of git://people.freedesktop.org/~agd5f/linux into drm-next
concurrent buffer reads.

* 'drm-next-3.18' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: allow concurrent buffer reads
  drm/radeon: add the infrastructure for concurrent buffer access
  drm/ttm: allow fence to be added as shared
2014-09-12 13:58:27 +10:00
Josh Boyer e351943b08 drm/vmwgfx: Fix drm.h include
The userspace drm.h include doesn't prefix the drm directory.  This can lead
to compile failures as /usr/include/drm/ isn't in the standard gcc include
paths.  Fix it to be <drm/drm.h>, which matches the rest of the driver drm
header files that get installed into /usr/include/drm.

Red Hat Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1138759

Fixes: 1d7a5cbf8f
Reported-by: Jeffrey Bastian <jbastian@redhat.com>
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-12 13:57:49 +10:00
Y.C. Chen 83502a5d34 drm/ast: AST2000 cannot be detected correctly
Type error and cause AST2000 cannot be detected correctly

Signed-off-by: Y.C. Chen <yc_chen@aspeedtech.com>
Reviewed-by: Egbert Eich <eich@suse.de>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-12 13:41:39 +10:00
Y.C. Chen 8f372e250a drm/ast: open key before detect chips
Some config settings like 3rd TX chips will not get correctly
if the extended reg is protected

Signed-off-by: Y.C. Chen <yc_chen@aspeedtech.com>
Reviewed-by: Egbert Eich <eich@suse.de>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-12 13:41:27 +10:00
Linus Torvalds c73f6fdf2f Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
Pull Ceph fixes from Sage Weil:
 "The main thing here is a set of three patches that fix a buffer
  overrun for large authentication tickets (sigh).

  There is also a trivial warning fix and an error path fix that are
  both regressions"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  libceph: do not hard code max auth ticket len
  libceph: add process_one_ticket() helper
  libceph: gracefully handle large reply messages from the mon
  rbd: fix error return code in rbd_dev_device_setup()
  rbd: avoid format-security warning inside alloc_workqueue()
2014-09-11 18:03:21 -07:00
Linus Torvalds 7ee2d2d671 xen: bug fixes for 3.17-rc4
- Fix for PVHVM suspend/resume and migration
 - Don't pointlessly retry certain ballooning ops
 - Fix gntalloc when grefs have run out.
 - Fix PV boot if KSALR is enable or very large modules are used.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQEcBAABAgAGBQJUEZw4AAoJEFxbo/MsZsTRoHkIAJ5h287Wer2Yf4ALlFI47Esl
 AhcgVKi7WMJ6mBQUk/xpbSS3MZEuTuPJVbuiabJwRaZk9vX7w8q08yrAD8SOrCwY
 6iGooaWEZ96P5DPI5fmWBuOgt5f2wfqzAp//wl/dK/kzr6Kw63huTXa0H0fmd8BY
 Gy13pN4JEPDyvjjZWFvDcrcEUA9eTcTaXQZisBUGuGictXySr5ovz9G3EKOtJP0D
 vkmDzApijFEEjJwZMGazgipng4mwh94fW4+7bs57s6iREpMzOJDTRKrl9suaXdza
 5HA2ed7Au/qL8IwiQAFGxQpMBqNQxEGerlFfPBhRPuGQ+Ek3/pZF3BTU56w/nt4=
 =y/Ol
 -----END PGP SIGNATURE-----

Merge tag 'stable/for-linus-3.17-b-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull Xen bug fixes from David Vrabel:
 - fix for PVHVM suspend/resume and migration
 - don't pointlessly retry certain ballooning ops
 - fix gntalloc when grefs have run out.
 - fix PV boot if KSALR is enable or very large modules are used.

* tag 'stable/for-linus-3.17-b-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  x86/xen: don't copy bogus duplicate entries into kernel page tables
  xen/gntalloc: safely delete grefs in add_grefs() undo path
  xen/gntalloc: fix oops after runnning out of grant refs
  xen/balloon: cancel ballooning if adding new memory failed
  xen/manage: Always freeze/thaw processes when suspend/resuming
2014-09-11 16:52:29 -07:00
Linus Torvalds 018cace21b Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux
Pull powerpc fixes from Michael Ellerman:
 "Ben's travelling so this is my first attempt at a pull request.

  There's nothing too exciting.  The CONFIG_FHANDLE one is annoying, I
  know you love defconfig changes.  But we've had a couple of developers
  waste time debugging boxes that wouldn't boot, only to realise it's
  just that systemd needs CONFIG_FHANDLE and our defconfigs don't have
  it.

  The new syscalls seem to be working, I've run the selftests that
  exist, and also let trinity bash on them for a while"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux:
  powerpc: Wire up sys_seccomp(), sys_getrandom() and sys_memfd_create()
  powerpc: Make CONFIG_FHANDLE=y for all 64 bit powerpc defconfigs
  powerpc: use machine_subsys_initcall() for opal_hmi_handler_init()
  powerpc/perf: Fix ABIv2 kernel backtraces
  powerpc/pseries: Fix endian issues in memory hotplug
2014-09-11 16:49:56 -07:00
Greg Kroah-Hartman e2c60989dc usb: fixes for v3.17-rc4
Some late fixes for dwc3 so we have something more stable
 on v3.17-final.
 
 Most bugs have been there for quite a while and nobody
 noticed, except for TRB completion when multiple TRBs
 are started.
 
 Patches were tested on AM437x SK and J6 EVM and are passing
 my tests.
 
 Signed-of-by: Felipe Balbi <balbi@ti.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJUEhtjAAoJEIaOsuA1yqREmoIP/AxYZMK/EU06WaOIGkKr0JA4
 nAJLVIivJva4A6M4Pln8fXnwOj4Nfyo25CqU51czyAKEn2qBjStXOe5Tr6xiFU9e
 omlhHFltnDbIukDpqX0lJitFbHxZU7mKl4JZ3+XxEIVvYNS4eGhd4cmWC7Lin9Jy
 gEaIhErnRUofx9/+Mdn+E0ReV0ZY1ZM771CbI+Bzl/bL5cppqEYuegW8APguYVoF
 /NyHnQ6CL0wjcXcekqIsErlhNUqa9Y1YNUqfMBJdoWSpLCEb55yH3SLES+hpiYT7
 RjD39wmyCcn6FxUlcv2n0kAEcLJPFjXswHzexnMZetGAcSxb2A3oMN7WbU437b2m
 PXigtEcTKq6Nn73bpJu+z3WHElpYLICurtU2zjZt6LxD6MKhLWVJ7LdKpPu941uy
 D6AxGUSSYrTwTId5pzx0iqmyKttQbWHWBim0950/XgF6KC8uV0ativ2K0GO+C8ao
 PzUQOprcFHaW+hE5RHsGdr+PWHHriFpsAx6CYZDpgXmdBZcFu8jFZBEf6KJu/fDZ
 ZrLX3c4F3SBTtYQPogf2f2Ta36V91m3iUhcotK45YXsFvqc6sUbA+A1wfgXOAuzO
 cqR18TEN+qv3VNvcitc0b6jznIsbvcFPK3c7FmAPS4fi9zMGIGBdad9FyFObly5R
 aLvfAMPOcJcF+BUVk1bF
 =CdSO
 -----END PGP SIGNATURE-----

Merge tag 'fixes-for-v3.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus

Felipe writes:

usb: fixes for v3.17-rc4

Some late fixes for dwc3 so we have something more stable
on v3.17-final.

Most bugs have been there for quite a while and nobody
noticed, except for TRB completion when multiple TRBs
are started.

Patches were tested on AM437x SK and J6 EVM and are passing
my tests.

Signed-of-by: Felipe Balbi <balbi@ti.com>
2014-09-11 15:08:14 -07:00
Mathias Nyman 96044694b8 xhci: fix oops when xhci resumes from hibernate with hw lpm capable devices
Resuming from hibernate (S4) will restart and re-initialize xHC.
The device contexts are freed and will be re-allocated later during device reset.

Usb core will disable link pm in device resume before device reset, which will
try to change the max exit latency, accessing the device contexts before they are re-allocated.

There is no need to zero (disable) the max exit latency when disabling hw lpm
for a freshly re-initialized xHC. So check that device context exists before
doing anything. The max exit latency will be set again after device reset when usb core
enables the link pm.

Reported-by: Imre Deak <imre.deak@intel.com>
Tested-by: Imre Deak <imre.deak@intel.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11 14:23:52 -07:00
Al Cooper 0eda06c7c1 usb: xhci: Fix OOPS in xhci error handling code
The xhci driver will OOPS on resume from S2/S3 if dma_alloc_coherent()
is out of memory. This is a result of two things:
1. xhci_mem_cleanup() in xhci-mem.c free's xhci->lpm_command if
it's not NULL, but doesn't set it to NULL after the free.
2. xhci_mem_cleanup() is called twice on resume, once for normal
restart and once from xhci_mem_init() if dma_alloc_coherent() fails,
resulting in a free of xhci->lpm_command that has already been freed.
The fix is to set xhci->lpm_command to NULL after freeing it.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11 14:23:52 -07:00
Mathias Nyman c207e7c50f xhci: Fix null pointer dereference if xhci initialization fails
If xhci initialization fails before the roothub bandwidth
domains (xhci->rh_bw[i]) are allocated it will oops when
trying to access rh_bw members in xhci_mem_cleanup().

Reported-by: Manuel Reimer <manuel.reimer@gmx.de>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11 14:23:52 -07:00
Mark c66f1c62e8 storage: Add single-LUN quirk for Jaz USB Adapter
The Iomega Jaz USB Adapter is a SCSI-USB converter cable. The hardware
seems to be identical to e.g. the Microtech XpressSCSI, using a Shuttle/
SCM chip set. However its firmware restricts it to only work with Jaz
drives.

On connecting the cable a message like this appears four times in the log:
 reset full speed USB device number 4 using uhci_hcd

That's non-fatal but the US_FL_SINGLE_LUN quirk fixes it.

Signed-off-by: Mark Knibbs <markk@clara.co.uk>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11 14:22:25 -07:00
Hans de Goede a79e5bc53a uas: Add missing le16_to_cpu calls to asm1051 / asm1053 usb-id check
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: stable@vger.kernel.org # 3.16
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11 14:21:43 -07:00
Linus Torvalds 8381e57a6e ACPI and power management fixes for 3.17-rc5
- Fix for the cpufreq Operation Performance Points (OPP) code
    where a recent commit added a kcalloc() call with an incorrect
    ordering of arguments.  From Anand Moon.
 
  - Reverts of two ACPI battery commits that caused incorrect
    diagnostic information to be printed to dmesg in some cases
    from Bjørn Mork.
 
  - Fix for the ACPI RTC operation region handler that applied the
    & operator to an argument already representing an address and
    that caused it to overwrite its own argument instead of writing
    to the address contained in it as expected.  From Chun-Yi Lee.
 
  - Fix for the PM domain implementation in the ACPI LPSS (Low-Power
    Subsystem) driver where one callback pointer pointed to a wrong
    routine and one was NULL, but it shouldn't.  From Fu Zhonghui.
 
 /
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCAAGBQJUEakAAAoJEILEb/54YlRxDfsQAJ6YUQ0ONNwzsKOEWs+Cvk45
 At8U7+qLsr6NEpU7Hr+HGmUrHrRsuSa3SKIWOXtTBIrBTGs12cEry8Wp4e9eTgrJ
 CWWn2LMKILqlOhjJI2xT33VVvEJu8+R1sccgv9mCqVNeQj+hwVc6iTe07jiNKJt9
 V8uWVaRu3IMNqOyq2Sd6IDH/uskF8PIPK39NZ/aZSQoKZzgv//ktfv4UjXmp/UcQ
 DiyajliRiRRXJ4meP399WpdWQ+EykfE6exOZIRj9qohvkXSL4aFmSHc69n7WQN7b
 9Jnkr1rRMbUJrfgstJKSFcY34pETLSl5iocwJJy8aijW9oQxt6Gfde2+HOU4KsJr
 9y0Mf4LYPsQ6t9q+JbxAeXXDgfT48Z1oKV3OYjXV05uo6OpRgA4cW/qbjRoQk0cD
 Egf5lB01VzRz56dAM/2oDtoZ7F7ajPFrlrqW+yy+Eo7A8auFQ05Ydgs9ZZ4TLP1Q
 3RJ2weBZpGpQSwRlxVZtsq0boeYVogMT8AINCLuvnz4WnUD6aDifPWZzIkr7HKGl
 1z8Vig9NgB2yWRyCdjx+dpaTNsWf1bnBNnOKaR0Wi36+GkXM0icjNwR/ho7Gxc7e
 oUS7hgt8s7bFbOZr1ns8ad+8DxVPpQRSp8/lD4Ge94n5G2A9q2+3jLMHcxeb+3vS
 vxkCLIzR4vsgIaENiiT9
 =FgS1
 -----END PGP SIGNATURE-----

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

Pull ACPI and power management fixes from Rafael Wysocki:
 "These are regression fixes (cpufreq, ACPI battery) and fixes for stuff
  that never worked correctly (ACPI RTC operation region handler and PM
  domain implementation in the ACPI LPSS driver).

  Specifics:

   - Fix for the cpufreq Operation Performance Points (OPP) code where a
     recent commit added a kcalloc() call with an incorrect ordering of
     arguments.  From Anand Moon.

   - Reverts of two ACPI battery commits that caused incorrect
     diagnostic information to be printed to dmesg in some cases from
     Bjørn Mork.

   - Fix for the ACPI RTC operation region handler that applied the &
     operator to an argument already representing an address and that
     caused it to overwrite its own argument instead of writing to the
     address contained in it as expected.  From Chun-Yi Lee.

   - Fix for the PM domain implementation in the ACPI LPSS (Low-Power
     Subsystem) driver where one callback pointer pointed to a wrong
     routine and one was NULL, but it shouldn't.  From Fu Zhonghui"

* tag 'pm+acpi-3.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI / LPSS: complete PM entries for LPSS power domain
  Revert "ACPI / battery: fix wrong value of capacity_now reported when fully charged"
  Revert "ACPI / battery: Fix warning message in acpi_battery_get_state()"
  ACPI / RTC: Fix CMOS RTC opregion handler accesses to wrong addresses
  cpufreq / OPP: Fix the order of arguments for kcalloc()
2014-09-11 12:51:10 -07:00
Stefano Stabellini d50582e06f xen/arm: remove mach_to_phys rbtree
Remove the rbtree used to keep track of machine to physical mappings:
the frontend can grant the same page multiple times, leading to errors
inserting or removing entries from the mach_to_phys tree.

Linux only needed to know the physical address corresponding to a given
machine address in swiotlb-xen. Now that swiotlb-xen can call the
xen_dma_* functions passing the machine address directly, we can remove
it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-by: Denis Schneider <v1ne2go@gmail.com>
2014-09-11 18:11:53 +00:00
Stefano Stabellini 340720be32 xen/arm: reimplement xen_dma_unmap_page & friends
xen_dma_unmap_page, xen_dma_sync_single_for_cpu and
xen_dma_sync_single_for_device are currently implemented by calling into
the corresponding generic ARM implementation of these functions. In
order to do this, firstly the dma_addr_t handle, that on Xen is a
machine address, needs to be translated into a physical address.  The
operation is expensive and inaccurate, given that a single machine
address can correspond to multiple physical addresses in one domain,
because the same page can be granted multiple times by the frontend.

To avoid this problem, we introduce a Xen specific implementation of
xen_dma_unmap_page, xen_dma_sync_single_for_cpu and
xen_dma_sync_single_for_device, that can operate on machine addresses
directly.

The new implementation relies on the fact that the hypervisor creates a
second p2m mapping of any grant pages at physical address == machine
address of the page for dom0. Therefore we can access memory at physical
address == dma_addr_r handle and perform the cache flushing there. Some
cache maintenance operations require a virtual address. Instead of using
ioremap_cache, that is not safe in interrupt context, we allocate a
per-cpu PAGE_KERNEL scratch page and we manually update the pte for it.

arm64 doesn't need cache maintenance operations on unmap for now.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-by: Denis Schneider <v1ne2go@gmail.com>
2014-09-11 18:11:53 +00:00
Stefano Stabellini 5ebc77de83 xen/arm: introduce XENFEAT_grant_map_identity
The flag tells us that the hypervisor maps a grant page to guest
physical address == machine address of the page in addition to the
normal grant mapping address. It is needed to properly issue cache
maintenance operation at the completion of a DMA operation involving a
foreign grant.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-by: Denis Schneider <v1ne2go@gmail.com>
2014-09-11 18:11:52 +00:00
Will Deacon eb35bdd7bc arm64: flush TLS registers during exec
Nathan reports that we leak TLS information from the parent context
during an exec, as we don't clear the TLS registers when flushing the
thread state.

This patch updates the flushing code so that we:

  (1) Unconditionally zero the tpidr_el0 register (since this is fully
      context switched for native tasks and zeroed for compat tasks)

  (2) Zero the tp_value state in thread_info before clearing the
      tpidrr0_el0 register for compat tasks (since this is only writable
      by the set_tls compat syscall and therefore not fully switched).

A missing compiler barrier is also added to the compat set_tls syscall.

Cc: <stable@vger.kernel.org>
Acked-by: Nathan Lynch <Nathan_Lynch@mentor.com>
Reported-by: Nathan Lynch <Nathan_Lynch@mentor.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2014-09-11 18:34:58 +01:00
Linus Torvalds 1497e84a49 Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Pull dmaengine fixes from Vinod Koul:
 "Two minor fixes.

  First one from Kuninori clarifying dmas bindings and second from Lars
  for fixing dma descriptor completion in non cyclic case"

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine: jz4740: Fix non-cyclic descriptor completion
  dt/bindings: rcar-audmapp: tidyup dmas explanation
2014-09-11 10:11:29 -07:00
Linus Torvalds 8b02c5ef75 Two pin control fixes:
- Fix a warning about unbalanced IRQs on the Baytrail
 - Update Tomasz Figa's address in MAINTAINERS
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJUEU6dAAoJEEEQszewGV1zaOAQAMoMYHdby1C+YTmcctm0Vx/P
 wGgYy8t3siAJQynC6l1rVrXemo3E5k92ODnTqNwxfZm4RGvaIZ3PzHtzZO/d5s3j
 vm5enhialjHznjhXSdw1sTs7hHhSTw7DCbDKXCmWjhn/PR1tQ/sqFYkXJHQyPeyv
 UjMUJHBWXkOd6fwhIVFDgVN7xSBPIUvq3wqIPDfj1CA817nhP0Iq8mKsj6a5v9N1
 cI5L8g0GWK1Iwo71C+tKYqOMp8YBForC28N8hkzzezSvxKfwAIgeVKQI1MAbInFC
 +8I8VGo7KDgQqGrUfTHZRGsVJwu+9UpY/VcRLapft3ySnMlQm6zE1fzvOJXFXXay
 R4sNQ2xFSWPnPMToB/+cFMS+dvKuJMSRCBtT9XqU/kGTkXi843ZB18ZfgefuKEDy
 e9wq8SozQ9H0MdwYv62Jmsg0RN1uFUOpc9ngpzpP//UPrASOfJ26pOBcileMzcHE
 RaTCvtpSZScWzShGZsgngIZqZoaiUhQ5cFSJvYrrvtiknHHJ3RACxF9CQa1EBSuM
 k9oegA3UkJUW+lnxNclNCfKsuH7pR5eiPqGUftuk2XFXwCzi+VdVny3xNNTSBdcn
 RbhsqHh/ELl+E+FXwuWAFWi6FRtJ+shyCqvgXr84byxSpBkHqqizrtMB73T3Qasv
 kuN9OyZPWcv+F4QS3Sch
 =MrRB
 -----END PGP SIGNATURE-----

Merge tag 'pinctrl-v3.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull two pin control fixes from Linus Walleij:
 - fix a warning about unbalanced IRQs on the Baytrail
 - update Tomasz Figa's address in MAINTAINERS

* tag 'pinctrl-v3.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  MAINTAINERS: Tomasz has moved
  pinctrl: baytrail: resolve unbalanced IRQ wake disable warning
2014-09-11 10:10:04 -07:00
Linus Torvalds c8c16e3624 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov:
 "An update to Synaptics PS/2 driver to handle "ForcePads" (currently
  found in HP EliteBook 1040 laptops), a change for Elan PS/2 driver to
  detect newer touchpads, bunch of devices get annotated as Trackpoint
  and/or Pointer to help userspace classify and handle them, plus
  assorted driver fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: serport - add compat handling for SPIOCSTYPE ioctl
  Input: atmel_mxt_ts - fix double free of input device
  Input: synaptics - add support for ForcePads
  Input: matrix_keypad - use request_any_context_irq()
  Input: atmel_mxt_ts - downgrade warning about empty interrupts
  Input: wm971x - fix typo in module parameter description
  Input: cap1106 - fix register definition
  Input: add missing POINTER / DIRECT properties to a bunch of drivers
  Input: add INPUT_PROP_POINTING_STICK property
  Input: elantech - fix detection of touchpad on ASUS s301l
2014-09-11 10:08:36 -07:00
Christian König 298593b609 drm/radeon: allow concurrent buffer reads
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-09-11 10:46:02 -04:00
Christian König 57d20a43c9 drm/radeon: add the infrastructure for concurrent buffer access
This allows us to specify if we want to sync to
the shared fences of a reservation object or not.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-09-11 10:46:01 -04:00
Christian König ae9c0af2c0 drm/ttm: allow fence to be added as shared
This patch adds a new flag to the ttm_validate_buffer list to
add the fence as shared to the reservation object.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-09-11 10:46:00 -04:00
Rafael J. Wysocki d2be8992df Merge branches 'acpi-rtc', 'acpi-lpss' and 'acpi-battery'
* acpi-rtc:
  ACPI / RTC: Fix CMOS RTC opregion handler accesses to wrong addresses

* acpi-lpss:
  ACPI / LPSS: complete PM entries for LPSS power domain

* acpi-battery:
  Revert "ACPI / battery: fix wrong value of capacity_now reported when fully charged"
  Revert "ACPI / battery: Fix warning message in acpi_battery_get_state()"
2014-09-11 15:09:30 +02:00
Rafael J. Wysocki 1c00f73c83 Merge branch 'pm-cpufreq'
* pm-cpufreq:
  cpufreq / OPP: Fix the order of arguments for kcalloc()
2014-09-11 15:09:05 +02:00
Daniel Vetter 336879b1da Merge remote-tracking branch 'airlied/drm-next' into topic/vblank-rework
Dave asked me to do the backmerge before sending him the revised pull
request, so here we go. Nothing fancy in the conflicts, just a few
things changed right next to each another.

Conflicts:
	drivers/gpu/drm/drm_irq.c

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-09-11 14:46:53 +02:00