cascardo/linux.git
9 years agoMerge tag 'xfs-for-linus-3.17-rc1' of git://oss.sgi.com/xfs/xfs
Linus Torvalds [Wed, 13 Aug 2014 23:49:53 +0000 (17:49 -0600)]
Merge tag 'xfs-for-linus-3.17-rc1' of git://oss.sgi.com/xfs/xfs

Pull xfs update from Dave Chinner:
 "This update contains:
   - conversion of the XFS core to pass negative error numbers
   - restructing of core XFS code that is shared with userspace to
     fs/xfs/libxfs
   - introduction of sysfs interface for XFS
   - bulkstat refactoring
   - demand driven speculative preallocation removal
   - XFS now always requires 64 bit sectors to be configured
   - metadata verifier changes to ensure CRCs are calculated during log
     recovery
   - various minor code cleanups
   - miscellaneous bug fixes

  The diffstat is kind of noisy because of the restructuring of the code
  to make kernel/userspace code sharing simpler, along with the XFS wide
  change to use the standard negative error return convention (at last!)"

* tag 'xfs-for-linus-3.17-rc1' of git://oss.sgi.com/xfs/xfs: (45 commits)
  xfs: fix coccinelle warnings
  xfs: flush both inodes in xfs_swap_extents
  xfs: fix swapext ilock deadlock
  xfs: kill xfs_vnode.h
  xfs: kill VN_MAPPED
  xfs: kill VN_CACHED
  xfs: kill VN_DIRTY()
  xfs: dquot recovery needs verifiers
  xfs: quotacheck leaves dquot buffers without verifiers
  xfs: ensure verifiers are attached to recovered buffers
  xfs: catch buffers written without verifiers attached
  xfs: avoid false quotacheck after unclean shutdown
  xfs: fix rounding error of fiemap length parameter
  xfs: introduce xfs_bulkstat_ag_ichunk
  xfs: require 64-bit sector_t
  xfs: fix uflags detection at xfs_fs_rm_xquota
  xfs: remove XFS_IS_OQUOTA_ON macros
  xfs: tidy up xfs_set_inode32
  xfs: allow inode allocations in post-growfs disk space
  xfs: mark xfs_qm_quotacheck as static
  ...

9 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Linus Torvalds [Wed, 13 Aug 2014 23:45:40 +0000 (17:45 -0600)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jack/linux-fs

Pull quota, reiserfs, UDF updates from Jan Kara:
 "Scalability improvements for quota, a few reiserfs fixes, and couple
  of misc cleanups (udf, ext2)"

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  reiserfs: Fix use after free in journal teardown
  reiserfs: fix corruption introduced by balance_leaf refactor
  udf: avoid redundant memcpy when writing data in ICB
  fs/udf: re-use hex_asc_upper_{hi,lo} macros
  fs/quota: kernel-doc warning fixes
  udf: use linux/uaccess.h
  fs/ext2/super.c: Drop memory allocation cast
  quota: remove dqptr_sem
  quota: simplify remove_inode_dquot_ref()
  quota: avoid unnecessary dqget()/dqput() calls
  quota: protect Q_GETFMT by dqonoff_mutex

9 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
Linus Torvalds [Wed, 13 Aug 2014 23:43:29 +0000 (17:43 -0600)]
Merge branch 'for-linus' of git://git./linux/kernel/git/sage/ceph-client

Pull Ceph updates from Sage Weil:
 "There is a lot of refactoring and hardening of the libceph and rbd
  code here from Ilya that fix various smaller bugs, and a few more
  important fixes with clone overlap.  The main fix is a critical change
  to the request_fn handling to not sleep that was exposed by the recent
  mutex changes (which will also go to the 3.16 stable series).

  Yan Zheng has several fixes in here for CephFS fixing ACL handling,
  time stamps, and request resends when the MDS restarts.

  Finally, there are a few cleanups from Himangi Saraogi based on
  Coccinelle"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (39 commits)
  libceph: set last_piece in ceph_msg_data_pages_cursor_init() correctly
  rbd: remove extra newlines from rbd_warn() messages
  rbd: allocate img_request with GFP_NOIO instead GFP_ATOMIC
  rbd: rework rbd_request_fn()
  ceph: fix kick_requests()
  ceph: fix append mode write
  ceph: fix sizeof(struct tYpO *) typo
  ceph: remove redundant memset(0)
  rbd: take snap_id into account when reading in parent info
  rbd: do not read in parent info before snap context
  rbd: update mapping size only on refresh
  rbd: harden rbd_dev_refresh() and callers a bit
  rbd: split rbd_dev_spec_update() into two functions
  rbd: remove unnecessary asserts in rbd_dev_image_probe()
  rbd: introduce rbd_dev_header_info()
  rbd: show the entire chain of parent images
  ceph: replace comma with a semicolon
  rbd: use rbd_segment_name_free() instead of kfree()
  ceph: check zero length in ceph_sync_read()
  ceph: reset r_resend_mds after receiving -ESTALE
  ...

9 years agoMerge tag 'upstream-3.17-rc1' of git://git.infradead.org/linux-ubifs
Linus Torvalds [Wed, 13 Aug 2014 23:42:11 +0000 (17:42 -0600)]
Merge tag 'upstream-3.17-rc1' of git://git.infradead.org/linux-ubifs

Pull UBI/UBIFS changes from Artem Bityutskiy:
 "No significant changes, mostly small fixes here and there.  The more
  important fixes are:

   - UBI deleted list items while iterating the list with
     'list_for_each_entry'
   - The UBI block driver did not work properly with very large UBI
     volumes"

* tag 'upstream-3.17-rc1' of git://git.infradead.org/linux-ubifs: (21 commits)
  UBIFS: Add log overlap assertions
  Revert "UBIFS: add a log overlap assertion"
  UBI: bugfix in ubi_wl_flush()
  UBI: block: Avoid disk size integer overflow
  UBI: block: Set disk_capacity out of the mutex
  UBI: block: Make ubiblock_resize return something
  UBIFS: add a log overlap assertion
  UBIFS: remove unnecessary check
  UBIFS: remove mst_mutex
  UBIFS: kernel-doc warning fix
  UBI: init_volumes: Ignore volumes with no LEBs
  UBIFS: replace seq_printf by seq_puts
  UBIFS: replace count*size kzalloc by kcalloc
  UBIFS: kernel-doc warning fix
  UBIFS: fix error path in create_default_filesystem()
  UBIFS: fix spelling of "scanned"
  UBIFS: fix some comments
  UBIFS: remove useless @ecc in struct ubifs_scan_leb
  UBIFS: remove useless statements
  UBIFS: Add missing break statements in dbg_chk_pnode()
  ...

9 years agoreiserfs: Fix use after free in journal teardown
Jan Kara [Wed, 6 Aug 2014 17:43:56 +0000 (19:43 +0200)]
reiserfs: Fix use after free in journal teardown

If do_journal_release() races with do_journal_end() which requeues
delayed works for transaction flushing, we can leave work items for
flushing outstanding transactions queued while freeing them. That
results in use after free and possible crash in run_timers_softirq().

Fix the problem by not requeueing works if superblock is being shut down
(MS_ACTIVE not set) and using cancel_delayed_work_sync() in
do_journal_release().

CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
9 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Mon, 11 Aug 2014 18:44:11 +0000 (11:44 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs

Pull vfs updates from Al Viro:
 "Stuff in here:

   - acct.c fixes and general rework of mnt_pin mechanism.  That allows
     to go for delayed-mntput stuff, which will permit mntput() on deep
     stack without worrying about stack overflows - fs shutdown will
     happen on shallow stack.  IOW, we can do Eric's umount-on-rmdir
     series without introducing tons of stack overflows on new mntput()
     call chains it introduces.
   - Bruce's d_splice_alias() patches
   - more Miklos' rename() stuff.
   - a couple of regression fixes (stable fodder, in the end of branch)
     and a fix for API idiocy in iov_iter.c.

  There definitely will be another pile, maybe even two.  I'd like to
  get Eric's series in this time, but even if we miss it, it'll go right
  in the beginning of for-next in the next cycle - the tricky part of
  prereqs is in this pile"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (40 commits)
  fix copy_tree() regression
  __generic_file_write_iter(): fix handling of sync error after DIO
  switch iov_iter_get_pages() to passing maximal number of pages
  fs: mark __d_obtain_alias static
  dcache: d_splice_alias should detect loops
  exportfs: update Exporting documentation
  dcache: d_find_alias needn't recheck IS_ROOT && DCACHE_DISCONNECTED
  dcache: remove unused d_find_alias parameter
  dcache: d_obtain_alias callers don't all want DISCONNECTED
  dcache: d_splice_alias should ignore DCACHE_DISCONNECTED
  dcache: d_splice_alias mustn't create directory aliases
  dcache: close d_move race in d_splice_alias
  dcache: move d_splice_alias
  namei: trivial fix to vfs_rename_dir comment
  VFS: allow ->d_manage() to declare -EISDIR in rcu_walk mode.
  cifs: support RENAME_NOREPLACE
  hostfs: support rename flags
  shmem: support RENAME_EXCHANGE
  shmem: support RENAME_NOREPLACE
  btrfs: add RENAME_NOREPLACE
  ...

9 years agofix copy_tree() regression
Al Viro [Sun, 10 Aug 2014 07:44:55 +0000 (03:44 -0400)]
fix copy_tree() regression

Since 3.14 we had copy_tree() get the shadowing wrong - if we had one
vfsmount shadowing another (i.e. if A is a slave of B, C is mounted
on A/foo, then D got mounted on B/foo creating D' on A/foo shadowed
by C), copy_tree() of A would make a copy of D' shadow the the copy of
C, not the other way around.

It's easy to fix, fortunately - just make sure that mount follows
the one that shadows it in mnt_child as well as in mnt_hash, and when
copy_tree() decides to attach a new mount, check if the last child
it has added to the same parent should be shadowing the new one.
And if it should, just use the same logics commit_tree() has - put the
new mount into the hash and children lists right after the one that
should shadow it.

Cc: stable@vger.kernel.org [3.14 and later]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
9 years ago__generic_file_write_iter(): fix handling of sync error after DIO
Al Viro [Fri, 8 Aug 2014 16:39:16 +0000 (12:39 -0400)]
__generic_file_write_iter(): fix handling of sync error after DIO

If DIO results in short write and sync write fails, we want to bugger off
whether the DIO part has written anything or not; the logics on the return
will take care of the right return value.

Cc: stable@vger.kernel.org [3.16]
Reported-by: Anton Altaparmakov <aia21@cam.ac.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
9 years agoMerge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma
Linus Torvalds [Mon, 11 Aug 2014 14:14:01 +0000 (07:14 -0700)]
Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma

Pull slave-dma updates from Vinod Koul:
 "Some notable changes are:
   - new driver for AMBA AXI NBPF by Guennadi
   - new driver for sun6i controller by Maxime
   - pl330 drivers fixes from Lar's
   - sh-dma updates and fixes from Laurent, Geert and Kuninori
   - Documentation updates from Geert
   - drivers fixes and updates spread over dw, edma, freescale, mpc512x
     etc.."

* 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (72 commits)
  dmaengine: sun6i: depends on RESET_CONTROLLER
  dma: at_hdmac: fix invalid remaining bytes detection
  dmaengine: nbpfaxi: don't build this driver where it cannot be used
  dmaengine: nbpf_error_get_channel() can be static
  dma: pl08x: Use correct specifier for size_t values
  dmaengine: Remove the context argument to the prep_dma_cyclic operation
  dmaengine: nbpfaxi: convert to tasklet
  dmaengine: nbpfaxi: fix a theoretical race
  dmaengine: add a driver for AMBA AXI NBPF DMAC IP cores
  dmaengine: add device tree binding documentation for the nbpfaxi driver
  dmaengine: edma: Do not register second device when booted with DT
  dmaengine: edma: Do not change the error code returned from edma_alloc_slot
  dmaengine: rcar-dmac: Add device tree bindings documentation
  dmaengine: shdma: Allocate cyclic sg list dynamically
  dmaengine: shdma: Make channel filter ignore unrelated devices
  dmaengine: sh: Rework Kconfig and Makefile
  dmaengine: sun6i: Fix memory leaks
  dmaengine: sun6i: Free the interrupt before killing the tasklet
  dmaengine: sun6i: Remove switch statement from buswidth convertion routine
  dmaengine: of: kconfig: select DMA_ENGINE when DMA_OF is selected
  ...

9 years agoMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Linus Torvalds [Mon, 11 Aug 2014 14:04:17 +0000 (07:04 -0700)]
Merge branch 'next' of git://git./linux/kernel/git/rzhang/linux

Pull thermal updates from Zhang Rui:
 "Specifics:

   - adds full support for 2 types of Thermal Controllers produced by
     STMicroelectronics.  One is a more traditional memory mapped
     variant, the other is controlled solely by system configuration
     registers.  From Lee Jones.

   - add TMU (Thermal Management Unit) support for Exynos3250 Soc.
     From Chanwoo Choi.

   - add critical and passive trip point support for int3403 thermal
     driver.  From Srinivas Pandruvada.

   - a couple of small fixes/cleanups from Javi Merino, and Geert
     Uytterhoeven"

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
  thermal: document struct thermal_zone_device and thermal_governor
  thermal: cpu_cooling: fix typo highjack -> hijack
  thermal: rcar: Document SoC-specific bindings
  thermal: samsung: Add TMU support for Exynos3250 SoC
  thermal: exynos: fix ordering in exynos_tmu_remove()
  thermal: allow building dove_thermal with mvebu
  thermal: sti: Add support for ST's Memory Mapped based Thermal controller
  thermal: sti: Add support for ST's System Config Register based Thermal controller
  thermal: sti: Introduce ST Thermal core code
  thermal: sti: Supply Device Tree documentation
  Thermal: int3403: Add CRT and PSV trip

9 years agoMerge tag 'md/3.17' of git://neil.brown.name/md
Linus Torvalds [Mon, 11 Aug 2014 14:02:35 +0000 (07:02 -0700)]
Merge tag 'md/3.17' of git://neil.brown.name/md

Pull md updates from Neil Brown:
 "Most interesting is that md devices (major == 9) with minor numbers of
  512 or more will no longer be created simply by opening a block device
  file.  They can only be created by writing to

      /sys/module/md_mod/parameters/new_array

  The 'auto-create-on-open' semantic is cumbersome and we need to start
  moving away from it"

* tag 'md/3.17' of git://neil.brown.name/md:
  md: don't allow bitmap file to be added to raid0/linear.
  md/raid0: check for bitmap compatability when changing raid levels.
  md: Recovery speed is wrong
  md: disable probing for md devices 512 and over.
  md/raid1,raid10: always abort recover on write error.

9 years agoMerge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 11 Aug 2014 04:31:58 +0000 (21:31 -0700)]
Merge tag 'modules-next-for-linus' of git://git./linux/kernel/git/rusty/linux

Pull module updates from Rusty Russell:
 "This finally applies the stricter sysfs perms checking we pulled out
  before last merge window.  A few stragglers are fixed (thanks
  linux-next!)"

* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  arch/powerpc/platforms/powernv/opal-dump.c: fix world-writable sysfs files
  arch/powerpc/platforms/powernv/opal-elog.c: fix world-writable sysfs files
  drivers/video/fbdev/s3c2410fb.c: don't make debug world-writable.
  ARM: avoid ARM binutils leaking ELF local symbols
  scripts: modpost: Remove numeric suffix pattern matching
  scripts: modpost: fix compilation warning
  sysfs: disallow world-writable files.
  module: return bool from within_module*()
  module: add within_module() function
  modules: Fix build error in moduleloader.h

9 years agoMerge tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 11 Aug 2014 04:31:04 +0000 (21:31 -0700)]
Merge tag 'virtio-next-for-linus' of git://git./linux/kernel/git/rusty/linux

Pull virtio updates from Rusty Russell.

* tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  Revert "hwrng: virtio - ensure reads happen after successful probe"
  virtio: rng: delay hwrng_register() till driver is ready
  virtio: rng: re-arrange struct elements for better packing
  virtio: rng: remove unused struct element
  virtio: Replace DEFINE_PCI_DEVICE_TABLE macro use
  virtio: console: remove unnecessary null test before debugfs_remove_recursive

9 years agoRevert "proc: Point /proc/{mounts,net} at /proc/thread-self/{mounts,net} instead...
Linus Torvalds [Mon, 11 Aug 2014 04:24:59 +0000 (21:24 -0700)]
Revert "proc: Point /proc/{mounts,net} at /proc/thread-self/{mounts,net} instead of /proc/self/{mounts,net}"

This reverts commits 344470cac42e and e81324407269.

It turns out that the exact path in the symlink matters, if for somewhat
unfortunate reasons: some apparmor configurations don't allow dhclient
access to the per-thread /proc files.  As reported by Jörg Otte:

  audit: type=1400 audit(1407684227.003:28): apparmor="DENIED"
    operation="open" profile="/sbin/dhclient"
    name="/proc/1540/task/1540/net/dev" pid=1540 comm="dhclient"
    requested_mask="r" denied_mask="r" fsuid=0 ouid=0

so we had better revert this for now.  We might be able to work around
this in practice by only using the per-thread symlinks if the thread
isn't the thread group leader, and if the namespaces differ between
threads (which basically never happens).

We'll see. In the meantime, the revert was made to be intentionally easy.

Reported-by: Jörg Otte <jrg.otte@gmail.com>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome...
Linus Torvalds [Sun, 10 Aug 2014 18:13:58 +0000 (11:13 -0700)]
Merge tag 'for-linus' of git://git./linux/kernel/git/olof/chrome-platform

Pull chrome platform updates from Olof Johansson:
 "Updates to the Chromebook/box platform drivers:

   - a bugfix to pstore registration that makes it also work on
     non-Google systems
   - addition of new shipped Chromebooks (later models have more probing
     through ACPI so the need for these updates will be less over time).
   - A couple of minor coding style updates"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform:
  platform/chrome: chromeos_laptop - Add a limit for deferred retries
  platform/chrome: Add support for the acer c720p touchscreen.
  platform/chrome: pstore: fix dmi table to match all chrome systems
  platform/chrome: coding style fixes
  platform/chrome: chromeos_laptop - Add Toshiba CB35 Touch
  platform/chrome: chromeos_laptop - Add Dell Chromebook 11 touch
  platform/chrome: chromeos_laptop - Add HP Chromebook 14
  platform/chrome: chromeos_laptop - Add support for Acer C720

9 years agoMerge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
Linus Torvalds [Sun, 10 Aug 2014 18:13:06 +0000 (11:13 -0700)]
Merge tag 'fixes-for-linus' of git://git./linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Olof Johansson:
 - a short branch of OMAP fixes that we didn't merge before the window
   opened.
 - a small cleanup that sorts the rk3288 dts entries properly
 - a build fix due to a reference to a removed DT node on exynos

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  ARM: dts: exynos5420: remove disp_pd
  ARM: EXYNOS: Fix suspend/resume sequences
  ARM: dts: Fix the sort ordering of EHCI and HSIC in rk3288.dtsi
  ARM: OMAP3: Fix coding style problems in arch/arm/mach-omap2/control.c
  ARM: OMAP3: Fix choice of omap3_restore_es function in OMAP34XX rev3.1.2 case.
  ARM: OMAP2+: clock: allow omap2_dpll_round_rate() to round to next-lowest rate

9 years agoMerge branch 'linux-3.17' of git://anongit.freedesktop.org/git/nouveau/linux-2.6
Linus Torvalds [Sun, 10 Aug 2014 00:46:39 +0000 (17:46 -0700)]
Merge branch 'linux-3.17' of git://anongit.freedesktop.org/git/nouveau/linux-2.6

Pull nouveau drm updates from Ben Skeggs:
 "Apologies for not getting this done in time for Dave's drm-next merge
  window.  As he mentioned, a pre-existing bug reared its head a lot
  more obviously after this lot of changes.  It took quite a bit of time
  to track it down.  In any case, Dave suggested I try my luck by
  sending directly to you this time.

  Overview:

   - more code for Tegra GK20A from NVIDIA - probing, reclockig
   - better fix for Kepler GPUs that have the graphics engine powered
     off on startup, method courtesy of info provided by NVIDIA
   - unhardcoding of a bunch of graphics engine setup on
     Fermi/Kepler/Maxwell, will hopefully solve some issues people have
     noticed on higher-end models
   - support for "Zero Bandwidth Clear" on Fermi/Kepler/Maxwell, needs
     userspace support in general, but some lucky apps will benefit
     automagically
   - reviewed/exposed the full object APIs to userspace (finally), gives
     it access to perfctrs, ZBC controls, various events.  More to come
     in the future.
   - various other fixes"

Acked-by: Dave Airlie <airlied@redhat.com>
* 'linux-3.17' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: (87 commits)
  drm/nouveau: expose the full object/event interfaces to userspace
  drm/nouveau: fix headless mode
  drm/nouveau: hide sysfs pstate file behind an option again
  drm/nv50/disp: shhh compiler
  drm/gf100-/gr: implement the proper SetShaderExceptions method
  drm/gf100-/gr: remove some broken ltc bashing, for now
  drm/gf100-/gr: unhardcode attribute cb config
  drm/gf100-/gr: fetch tpcs-per-ppc info on startup
  drm/gf100-/gr: unhardcode pagepool config
  drm/gf100-/gr: unhardcode bundle cb config
  drm/gf100-/gr: improve initial context patch list helpers
  drm/gf100-/gr: add support for zero bandwidth clear
  drm/nouveau/ltc: add zbc drivers
  drm/nouveau/ltc: s/ltcg/ltc/ + cleanup
  drm/nouveau: use ram info from nvif_device
  drm/nouveau/disp: implement nvif event sources for vblank/connector notifiers
  drm/nouveau/disp: allow user direct access to channel control registers
  drm/nouveau/disp: audit and version display classes
  drm/nouveau/disp: audit and version SCANOUTPOS method
  drm/nv50-/disp: audit and version PIOR_PWR method
  ...

9 years agoMerge tag 'trace-ipi-tracepoints' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 10 Aug 2014 00:33:44 +0000 (17:33 -0700)]
Merge tag 'trace-ipi-tracepoints' of git://git./linux/kernel/git/rostedt/linux-trace

Pull IPI tracepoints for ARM from Steven Rostedt:
 "Nicolas Pitre added generic tracepoints for tracing IPIs and updated
  the arm and arm64 architectures.  It required some minor updates to
  the generic tracepoint system, so it had to wait for me to implement
  them"

* tag 'trace-ipi-tracepoints' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  ARM64: add IPI tracepoints
  ARM: add IPI tracepoints
  tracepoint: add generic tracepoint definitions for IPI tracing
  tracing: Do not do anything special with tracepoint_string when tracing is disabled

9 years agoMerge tag 'trace-fixes-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
Linus Torvalds [Sun, 10 Aug 2014 00:29:36 +0000 (17:29 -0700)]
Merge tag 'trace-fixes-3.16' of git://git./linux/kernel/git/rostedt/linux-trace

Pull trace file read iterator fixes from Steven Rostedt:
 "This contains a fix for two long standing bugs.  Both of which are
  rarely ever hit, and requires the user to do something that users
  rarely do.  It took a few special test cases to even trigger this bug,
  and one of them was just one test in the process of finishing up as
  another one started.

  Both bugs have to do with the ring buffer iterator rb_iter_peek(), but
  one is more indirect than the other.

  The fist bug fix is simply an increase in the safety net loop counter.
  The counter makes sure that the rb_iter_peek() only iterates the
  number of times we expect it can, and no more.  Well, there was one
  way it could iterate one more than we expected, and that caused the
  ring buffer to shutdown with a nasty warning.  The fix was simply to
  up that counter by one.

  The other bug has to be with rb_iter_reset() (called by
  rb_iter_peek()).  This happens when a user reads both the trace_pipe
  and trace files.  The trace_pipe is a consuming read and does not use
  the ring buffer iterator, but the trace file is not a consuming read
  and does use the ring buffer iterator.  When the trace file is being
  read, if it detects that a consuming read occurred, it resets the
  iterator and starts over.  But the reset code that does this
  (rb_iter_reset()), checks if the reader_page is linked to the ring
  buffer or not, and will look into the ring buffer itself if it is not.
  This is wrong, as it should always try to read the reader page first.
  Not to mention, the code that looked into the ring buffer did it
  wrong, and used the header_page "read" offset to start reading on that
  page.  That offset is bogus for pages in the writable ring buffer, and
  was corrupting the iterator, and it would start returning bogus
  events"

* tag 'trace-fixes-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  ring-buffer: Always reset iterator to reader page
  ring-buffer: Up rb_iter_peek() loop count to 3

9 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm...
Linus Torvalds [Sun, 10 Aug 2014 00:10:41 +0000 (17:10 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/ebiederm/user-namespace

Pull namespace updates from Eric Biederman:
 "This is a bunch of small changes built against 3.16-rc6.  The most
  significant change for users is the first patch which makes setns
  drmatically faster by removing unneded rcu handling.

  The next chunk of changes are so that "mount -o remount,.." will not
  allow the user namespace root to drop flags on a mount set by the
  system wide root.  Aks this forces read-only mounts to stay read-only,
  no-dev mounts to stay no-dev, no-suid mounts to stay no-suid, no-exec
  mounts to stay no exec and it prevents unprivileged users from messing
  with a mounts atime settings.  I have included my test case as the
  last patch in this series so people performing backports can verify
  this change works correctly.

  The next change fixes a bug in NFS that was discovered while auditing
  nsproxy users for the first optimization.  Today you can oops the
  kernel by reading /proc/fs/nfsfs/{servers,volumes} if you are clever
  with pid namespaces.  I rebased and fixed the build of the
  !CONFIG_NFS_FS case yesterday when a build bot caught my typo.  Given
  that no one to my knowledge bases anything on my tree fixing the typo
  in place seems more responsible that requiring a typo-fix to be
  backported as well.

  The last change is a small semantic cleanup introducing
  /proc/thread-self and pointing /proc/mounts and /proc/net at it.  This
  prevents several kinds of problemantic corner cases.  It is a
  user-visible change so it has a minute chance of causing regressions
  so the change to /proc/mounts and /proc/net are individual one line
  commits that can be trivially reverted.  Unfortunately I lost and
  could not find the email of the original reporter so he is not
  credited.  From at least one perspective this change to /proc/net is a
  refgression fix to allow pthread /proc/net uses that were broken by
  the introduction of the network namespace"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
  proc: Point /proc/mounts at /proc/thread-self/mounts instead of /proc/self/mounts
  proc: Point /proc/net at /proc/thread-self/net instead of /proc/self/net
  proc: Implement /proc/thread-self to point at the directory of the current thread
  proc: Have net show up under /proc/<tgid>/task/<tid>
  NFS: Fix /proc/fs/nfsfs/servers and /proc/fs/nfsfs/volumes
  mnt: Add tests for unprivileged remount cases that have found to be faulty
  mnt: Change the default remount atime from relatime to the existing value
  mnt: Correct permission checks in do_remount
  mnt: Move the test for MNT_LOCK_READONLY from change_mount_flags into do_remount
  mnt: Only change user settable mount flags in remount
  namespaces: Use task_lock and not rcu to protect nsproxy

9 years agoMerge branch 'stable-3.17' of git://git.infradead.org/users/pcmoore/selinux
Linus Torvalds [Sat, 9 Aug 2014 22:09:52 +0000 (15:09 -0700)]
Merge branch 'stable-3.17' of git://git.infradead.org/users/pcmoore/selinux

Pull SElinux fixes from Paul Moore:
 "Two small patches to fix a couple of build warnings in SELinux and
  NetLabel.  The patches are obvious enough that I don't think any
  additional explanation is necessary, but it basically boils down to
  the usual: I was stupid, and these patches fix some of the stupid.

  Both patches were posted earlier this week to the SELinux list, and
  that is where they sat as I didn't think there were noteworthy enough
  to go upstream at this point in time, but DaveM would rather see them
  upstream now so who am I to argue.  As the patches are both very
  small"

* 'stable-3.17' of git://git.infradead.org/users/pcmoore/selinux:
  selinux: remove unused variabled in the netport, netnode, and netif caches
  netlabel: fix the netlbl_catmap_setlong() dummy function

9 years agoMerge branch 'for-3.17' of git://linux-nfs.org/~bfields/linux
Linus Torvalds [Sat, 9 Aug 2014 21:31:18 +0000 (14:31 -0700)]
Merge branch 'for-3.17' of git://linux-nfs.org/~bfields/linux

Pull nfsd updates from Bruce Fields:
 "This includes a major rewrite of the NFSv4 state code, which has
  always depended on a single mutex.  As an example, open creates are no
  longer serialized, fixing a performance regression on NFSv3->NFSv4
  upgrades.  Thanks to Jeff, Trond, and Benny, and to Christoph for
  review.

  Also some RDMA fixes from Chuck Lever and Steve Wise, and
  miscellaneous fixes from Kinglong Mee and others"

* 'for-3.17' of git://linux-nfs.org/~bfields/linux: (167 commits)
  svcrdma: remove rdma_create_qp() failure recovery logic
  nfsd: add some comments to the nfsd4 object definitions
  nfsd: remove the client_mutex and the nfs4_lock/unlock_state wrappers
  nfsd: remove nfs4_lock_state: nfs4_state_shutdown_net
  nfsd: remove nfs4_lock_state: nfs4_laundromat
  nfsd: Remove nfs4_lock_state(): reclaim_complete()
  nfsd: Remove nfs4_lock_state(): setclientid, setclientid_confirm, renew
  nfsd: Remove nfs4_lock_state(): exchange_id, create/destroy_session()
  nfsd: Remove nfs4_lock_state(): nfsd4_open and nfsd4_open_confirm
  nfsd: Remove nfs4_lock_state(): nfsd4_delegreturn()
  nfsd: Remove nfs4_lock_state(): nfsd4_open_downgrade + nfsd4_close
  nfsd: Remove nfs4_lock_state(): nfsd4_lock/locku/lockt()
  nfsd: Remove nfs4_lock_state(): nfsd4_release_lockowner
  nfsd: Remove nfs4_lock_state(): nfsd4_test_stateid/nfsd4_free_stateid
  nfsd: Remove nfs4_lock_state(): nfs4_preprocess_stateid_op()
  nfsd: remove old fault injection infrastructure
  nfsd: add more granular locking to *_delegations fault injectors
  nfsd: add more granular locking to forget_openowners fault injector
  nfsd: add more granular locking to forget_locks fault injector
  nfsd: add a list_head arg to nfsd_foreach_client_lock
  ...

9 years agoMerge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
Linus Torvalds [Sat, 9 Aug 2014 20:03:34 +0000 (13:03 -0700)]
Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6

Pull CIFS updates from Steve French:
 "The most visible change in this set is the additional of multi-credit
  support for SMB2/SMB3 which dramatically improves the large file i/o
  performance for these dialects and significantly increases the maximum
  i/o size used on the wire for SMB2/SMB3.

  Also reconnection behavior after network failure is improved"

* 'for-next' of git://git.samba.org/sfrench/cifs-2.6: (35 commits)
  Add worker function to set allocation size
  [CIFS] Fix incorrect hex vs. decimal in some debug print statements
  update CIFS TODO list
  Add Pavel to contributor list in cifs AUTHORS file
  Update cifs version
  CIFS: Fix STATUS_CANNOT_DELETE error mapping for SMB2
  CIFS: Optimize readpages in a short read case on reconnects
  CIFS: Optimize cifs_user_read() in a short read case on reconnects
  CIFS: Improve indentation in cifs_user_read()
  CIFS: Fix possible buffer corruption in cifs_user_read()
  CIFS: Count got bytes in read_into_pages()
  CIFS: Use separate var for the number of bytes got in async read
  CIFS: Indicate reconnect with ECONNABORTED error code
  CIFS: Use multicredits for SMB 2.1/3 reads
  CIFS: Fix rsize usage for sync read
  CIFS: Fix rsize usage in user read
  CIFS: Separate page reading from user read
  CIFS: Fix rsize usage in readpages
  CIFS: Separate page search from readpages
  CIFS: Use multicredits for SMB 2.1/3 writes
  ...

9 years agodrm/nouveau: expose the full object/event interfaces to userspace
Ben Skeggs [Sat, 9 Aug 2014 18:10:31 +0000 (04:10 +1000)]
drm/nouveau: expose the full object/event interfaces to userspace

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: fix headless mode
Ben Skeggs [Sat, 9 Aug 2014 18:10:31 +0000 (04:10 +1000)]
drm/nouveau: fix headless mode

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: hide sysfs pstate file behind an option again
Ben Skeggs [Sat, 9 Aug 2014 18:10:30 +0000 (04:10 +1000)]
drm/nouveau: hide sysfs pstate file behind an option again

No-one has yet had time to move this to debugfs as discussed during
the last merge window.  Until this happens, hide the option to make
it clear it's not going to be here forever.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50/disp: shhh compiler
Ben Skeggs [Sat, 9 Aug 2014 18:10:30 +0000 (04:10 +1000)]
drm/nv50/disp: shhh compiler

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gf100-/gr: implement the proper SetShaderExceptions method
Ben Skeggs [Sat, 9 Aug 2014 18:10:30 +0000 (04:10 +1000)]
drm/gf100-/gr: implement the proper SetShaderExceptions method

We have another version of it implemented in SW, however, that version
isn't serialised with normal PGRAPH operation and can possibly clobber
the enables for another context.

This is the same method that's implemented by the NVIDIA binary driver.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gf100-/gr: remove some broken ltc bashing, for now
Ben Skeggs [Sat, 9 Aug 2014 18:10:30 +0000 (04:10 +1000)]
drm/gf100-/gr: remove some broken ltc bashing, for now

... and hope that the defaults are good enough.  This was always
supposed to be a read/modify/write thing anyway, so we're writing
very wrong stuff for some boards already.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gf100-/gr: unhardcode attribute cb config
Ben Skeggs [Sat, 9 Aug 2014 18:10:30 +0000 (04:10 +1000)]
drm/gf100-/gr: unhardcode attribute cb config

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gf100-/gr: fetch tpcs-per-ppc info on startup
Ben Skeggs [Sat, 9 Aug 2014 18:10:29 +0000 (04:10 +1000)]
drm/gf100-/gr: fetch tpcs-per-ppc info on startup

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gf100-/gr: unhardcode pagepool config
Ben Skeggs [Sat, 9 Aug 2014 18:10:29 +0000 (04:10 +1000)]
drm/gf100-/gr: unhardcode pagepool config

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gf100-/gr: unhardcode bundle cb config
Ben Skeggs [Sat, 9 Aug 2014 18:10:29 +0000 (04:10 +1000)]
drm/gf100-/gr: unhardcode bundle cb config

Should be the same values as before, except:

GF117 has smaller buffer allocated, as per register setup.
GK20A now uses values from Tegra driver, not GK104's.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gf100-/gr: improve initial context patch list helpers
Ben Skeggs [Sat, 9 Aug 2014 18:10:29 +0000 (04:10 +1000)]
drm/gf100-/gr: improve initial context patch list helpers

Removes need for fixed buffer indices, and allows the functions
utilising them to also be run outside of context generation.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gf100-/gr: add support for zero bandwidth clear
Ben Skeggs [Sat, 9 Aug 2014 18:10:29 +0000 (04:10 +1000)]
drm/gf100-/gr: add support for zero bandwidth clear

Default ZBC table is compatible with binary driver defaults.

Userspace will need to be updated to take full advantage of this
feature, however, some applications will see a performance boost
without updated drivers.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/ltc: add zbc drivers
Ben Skeggs [Sat, 9 Aug 2014 18:10:28 +0000 (04:10 +1000)]
drm/nouveau/ltc: add zbc drivers

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/ltc: s/ltcg/ltc/ + cleanup
Ben Skeggs [Sat, 9 Aug 2014 18:10:28 +0000 (04:10 +1000)]
drm/nouveau/ltc: s/ltcg/ltc/ + cleanup

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: use ram info from nvif_device
Ben Skeggs [Sat, 9 Aug 2014 18:10:28 +0000 (04:10 +1000)]
drm/nouveau: use ram info from nvif_device

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/disp: implement nvif event sources for vblank/connector notifiers
Ben Skeggs [Sat, 9 Aug 2014 18:10:28 +0000 (04:10 +1000)]
drm/nouveau/disp: implement nvif event sources for vblank/connector notifiers

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/disp: allow user direct access to channel control registers
Ben Skeggs [Sat, 9 Aug 2014 18:10:28 +0000 (04:10 +1000)]
drm/nouveau/disp: allow user direct access to channel control registers

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/disp: audit and version display classes
Ben Skeggs [Sat, 9 Aug 2014 18:10:27 +0000 (04:10 +1000)]
drm/nouveau/disp: audit and version display classes

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/disp: audit and version SCANOUTPOS method
Ben Skeggs [Sat, 9 Aug 2014 18:10:27 +0000 (04:10 +1000)]
drm/nouveau/disp: audit and version SCANOUTPOS method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50-/disp: audit and version PIOR_PWR method
Ben Skeggs [Sat, 9 Aug 2014 18:10:27 +0000 (04:10 +1000)]
drm/nv50-/disp: audit and version PIOR_PWR method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50-/disp: audit and version SOR_DP_PWR method
Ben Skeggs [Sat, 9 Aug 2014 18:10:27 +0000 (04:10 +1000)]
drm/nv50-/disp: audit and version SOR_DP_PWR method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50-/disp: audit and version LVDS_SCRIPT method
Ben Skeggs [Sat, 9 Aug 2014 18:10:27 +0000 (04:10 +1000)]
drm/nv50-/disp: audit and version LVDS_SCRIPT method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50-/disp: audit and version SOR_HDMI_PWR method
Ben Skeggs [Sat, 9 Aug 2014 18:10:26 +0000 (04:10 +1000)]
drm/nv50-/disp: audit and version SOR_HDMI_PWR method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50-/disp: audit and version SOR_HDA_ELD method
Ben Skeggs [Sat, 9 Aug 2014 18:10:26 +0000 (04:10 +1000)]
drm/nv50-/disp: audit and version SOR_HDA_ELD method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50-/disp: audit and version SOR_PWR method
Ben Skeggs [Sat, 9 Aug 2014 18:10:26 +0000 (04:10 +1000)]
drm/nv50-/disp: audit and version SOR_PWR method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50-/disp: audit and version DAC_LOAD method
Ben Skeggs [Sat, 9 Aug 2014 18:10:26 +0000 (04:10 +1000)]
drm/nv50-/disp: audit and version DAC_LOAD method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50-/disp: audit and version DAC_PWR method
Ben Skeggs [Sat, 9 Aug 2014 18:10:26 +0000 (04:10 +1000)]
drm/nv50-/disp: audit and version DAC_PWR method

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50-/disp: share channel creation between nv50/gf110 impls
Ben Skeggs [Sat, 9 Aug 2014 18:10:25 +0000 (04:10 +1000)]
drm/nv50-/disp: share channel creation between nv50/gf110 impls

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50/kms: don't assume same class versions for all channels
Ben Skeggs [Sat, 9 Aug 2014 18:10:25 +0000 (04:10 +1000)]
drm/nv50/kms: don't assume same class versions for all channels

One of the next commits will remove some of the class IDs, leaving only
the ones used by NVIDIA which, presumably, mark where functionality
changes actually happened.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/fifo: implement nvif event source
Ben Skeggs [Sat, 9 Aug 2014 18:10:25 +0000 (04:10 +1000)]
drm/nouveau/fifo: implement nvif event source

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/fifo: allow direct access to channel control registers where possible
Ben Skeggs [Sat, 9 Aug 2014 18:10:25 +0000 (04:10 +1000)]
drm/nouveau/fifo: allow direct access to channel control registers where possible

The indirect method has been left in-place here as a fallback path, as
it may not be possible to map the non-PAGE_SIZE aligned control areas
across some chipset+interface combinations.

This isn't a problem for the primary use-case where the core and drm
are linked together in kernel-land, but across a VM or (in the case
where it applies now) between the core in the kernel and a userspace
test tool.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/fifo: audit and version fifo channel classes
Ben Skeggs [Sat, 9 Aug 2014 18:10:25 +0000 (04:10 +1000)]
drm/nouveau/fifo: audit and version fifo channel classes

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/device: audit and version NVIF_CONTROL class and methods
Ben Skeggs [Sat, 9 Aug 2014 18:10:25 +0000 (04:10 +1000)]
drm/nouveau/device: audit and version NVIF_CONTROL class and methods

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/pm: audit and version NVIF_PERFMON class and methods
Ben Skeggs [Sat, 9 Aug 2014 18:10:24 +0000 (04:10 +1000)]
drm/nouveau/pm: audit and version NVIF_PERFMON class and methods

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/dma: audit and version NV_DMA classes
Ben Skeggs [Sat, 9 Aug 2014 18:10:24 +0000 (04:10 +1000)]
drm/nouveau/dma: audit and version NV_DMA classes

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/dmaobj: switch to a slightly saner design
Ben Skeggs [Sat, 9 Aug 2014 18:10:24 +0000 (04:10 +1000)]
drm/nouveau/dmaobj: switch to a slightly saner design

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/dmaobj: update to an improved style of class definition
Ben Skeggs [Sat, 9 Aug 2014 18:10:24 +0000 (04:10 +1000)]
drm/nouveau/dmaobj: update to an improved style of class definition

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/device: audit and version NV_DEVICE class
Ben Skeggs [Sat, 9 Aug 2014 18:10:24 +0000 (04:10 +1000)]
drm/nouveau/device: audit and version NV_DEVICE class

The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: use ioctl interface for abi16 gpuobj free
Ben Skeggs [Sat, 9 Aug 2014 18:10:23 +0000 (04:10 +1000)]
drm/nouveau: use ioctl interface for abi16 gpuobj free

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: use ioctl interface for abi16 ntfy alloc
Ben Skeggs [Sat, 9 Aug 2014 18:10:23 +0000 (04:10 +1000)]
drm/nouveau: use ioctl interface for abi16 ntfy alloc

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: use ioctl interface for abi16 grobj alloc
Ben Skeggs [Sat, 9 Aug 2014 18:10:23 +0000 (04:10 +1000)]
drm/nouveau: use ioctl interface for abi16 grobj alloc

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: remove as much direct use of core headers as possible
Ben Skeggs [Sat, 9 Aug 2014 18:10:23 +0000 (04:10 +1000)]
drm/nouveau: remove as much direct use of core headers as possible

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: remove (most) hardcoded object handle usage
Ben Skeggs [Sat, 9 Aug 2014 18:10:23 +0000 (04:10 +1000)]
drm/nouveau: remove (most) hardcoded object handle usage

The PFIFO<->EVO sync buffers will be fixed up later when inter-channel
sync in general is improved.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: port to nvif client/device/objects
Ben Skeggs [Sat, 9 Aug 2014 18:10:22 +0000 (04:10 +1000)]
drm/nouveau: port to nvif client/device/objects

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: initial pass at moving to struct nvif_device
Ben Skeggs [Sat, 9 Aug 2014 18:10:22 +0000 (04:10 +1000)]
drm/nouveau: initial pass at moving to struct nvif_device

This is an attempt at isolating some of the changes necessary to port
to NVIF in a separate commit.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: kill nouveau_dev() + wrap register macros
Ben Skeggs [Sat, 9 Aug 2014 18:10:22 +0000 (04:10 +1000)]
drm/nouveau: kill nouveau_dev() + wrap register macros

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: fix some usages of the wrong print function
Ben Skeggs [Sat, 9 Aug 2014 18:10:22 +0000 (04:10 +1000)]
drm/nouveau: fix some usages of the wrong print function

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/nvif: import library functions for the ioctl/event interfaces
Ben Skeggs [Sat, 9 Aug 2014 18:10:21 +0000 (04:10 +1000)]
drm/nouveau/nvif: import library functions for the ioctl/event interfaces

This is a wrapper around the interfaces defined in an earlier commit,
and is also used by various userspace (either by a libdrm backend, or
libpciaccess) tools/tests.

In the future this will be extended to handle channels, replacing some
long-unloved code we currently use, and allow fifo/display/mpeg (hi
Ilia ;)) engines to all be exposed in the same way.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/client: add method to retrieve device list
Ben Skeggs [Sat, 9 Aug 2014 18:10:21 +0000 (04:10 +1000)]
drm/nouveau/client: add method to retrieve device list

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/core: remove NV_D0 family
Ben Skeggs [Sat, 9 Aug 2014 18:10:21 +0000 (04:10 +1000)]
drm/nouveau/core: remove NV_D0 family

The one place where it mattered has been replaced with a class check,
which is more appropriate anyway.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/device: add method to retrieve some basic device info
Ben Skeggs [Sat, 9 Aug 2014 18:10:21 +0000 (04:10 +1000)]
drm/nouveau/device: add method to retrieve some basic device info

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/core: import ioctl/event interfaces
Ben Skeggs [Sat, 9 Aug 2014 18:10:20 +0000 (04:10 +1000)]
drm/nouveau/core: import ioctl/event interfaces

This forms the basis for the new APIs that will be exposed to userspace,
giving it access to:

- Object method calls, the immediately useful of which is performance
  counters and the abiity to manipulate the ZBC tables.
- Information on the child classes an object supports, in order to avoid
  having to try all supported classes until successful.
- Notifications, which will be used in the future to inform the client
  if its channel was killed due to a lockup, etc.

This commit imports the interfaces, but are not currently used.  The DRM
portion of the driver will be ported to speak to the core using these
interfaces as much as possible.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/core: add function to return list of supported children
Ben Skeggs [Sat, 9 Aug 2014 18:10:20 +0000 (04:10 +1000)]
drm/nouveau/core: add function to return list of supported children

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/core: rework event interface
Ben Skeggs [Sat, 9 Aug 2014 18:10:20 +0000 (04:10 +1000)]
drm/nouveau/core: rework event interface

This is a lot of prep-work for being able to send event notifications
back to userspace.  Events now contain data, rather than a "something
just happened" signal.

Handler data is now embedded into a containing structure, rather than
being kmalloc()'d, and can optionally have the notify routine handled
in a workqueue.

Various races between suspend/unload with display HPD/DP IRQ handlers
automagically solved as a result.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/core: move handle-based object apis to handle.c
Ben Skeggs [Sat, 9 Aug 2014 18:10:20 +0000 (04:10 +1000)]
drm/nouveau/core: move handle-based object apis to handle.c

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/core: fail creation of zero-argument objects, when arguments are passed
Ben Skeggs [Sat, 9 Aug 2014 18:10:20 +0000 (04:10 +1000)]
drm/nouveau/core: fail creation of zero-argument objects, when arguments are passed

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: store a pointer to vm in nouveau_cli
Ben Skeggs [Sat, 9 Aug 2014 18:10:20 +0000 (04:10 +1000)]
drm/nouveau: store a pointer to vm in nouveau_cli

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: store vblank event handler data in nv_crtc
Ben Skeggs [Sat, 9 Aug 2014 18:10:19 +0000 (04:10 +1000)]
drm/nouveau: store vblank event handler data in nv_crtc

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50/kms: create ctxdma objects for framebuffers as required
Ben Skeggs [Sat, 9 Aug 2014 18:10:19 +0000 (04:10 +1000)]
drm/nv50/kms: create ctxdma objects for framebuffers as required

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50/kms: move framebuffer wrangling out of common code
Ben Skeggs [Sat, 9 Aug 2014 18:10:19 +0000 (04:10 +1000)]
drm/nv50/kms: move framebuffer wrangling out of common code

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: Bump version from 1.1.1 to 1.1.2
Mario Kleiner [Wed, 6 Aug 2014 04:09:44 +0000 (06:09 +0200)]
drm/nouveau: Bump version from 1.1.1 to 1.1.2

Linux 3.16 fixed multiple bugs in kms pageflip completion events
and timestamping, which were originally introduced in Linux 3.13.

These fixes have been backported to all stable kernels since 3.13.

However, the userspace nouveau-ddx needs to be aware if it is
running on a kernel on which these bugs are fixed, or not.

Bump the patchlevel of the drm driver version to signal this,
so backporting this patch to stable 3.13+ kernels will give the
ddx the required info.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: <stable@vger.kernel.org> #v3.13+
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50-/sw: use nv50_software_context_dtor....
Ben Skeggs [Thu, 7 Aug 2014 21:21:53 +0000 (07:21 +1000)]
drm/nv50-/sw: use nv50_software_context_dtor....

You would not believe the troubles this caused me...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nv50-/fb: use dma_mapping_error() to check dma_map_page() result
Ben Skeggs [Tue, 5 Aug 2014 12:03:49 +0000 (22:03 +1000)]
drm/nv50-/fb: use dma_mapping_error() to check dma_map_page() result

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: Dis/Enable vblank irqs during suspend/resume.
Mario Kleiner [Tue, 29 Jul 2014 00:36:44 +0000 (02:36 +0200)]
drm/nouveau: Dis/Enable vblank irqs during suspend/resume.

Vblank irqs don't get disabled during suspend or driver
unload, which causes irq delivery after "suspend" or
driver unload, at least until the gpu is powered off.
This could race with drm_vblank_cleanup() in the case
of nouveau and cause a use-after-free bug if the driver
is unloaded.

More annoyingly during everyday use, at least on nv50
display engine (likely also others), vblank irqs are
off after a resume from suspend, but the drm doesn't
know this, so all vblank related functionality is dead
after a resume. E.g., all windowed OpenGL clients will
hang at swapbuffers time, as well as many fullscreen
clients in many cases. This makes suspend/resume useless
if one wants to use any OpenGL apps after the resume.

In Linux 3.16, drm_vblank_on() was added, complementing
the older drm_vblank_off()  to solve these problems
elegantly, so use those calls in nouveaus suspend/resume
code.

For kernels 3.8 - 3.15, we need to cherry-pick the
drm_vblank_on() patch to support this patch.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: <stable@vger.kernel.org> #v3.16
Cc: <stable@vger.kernel.org> #v3.8+: f275228: drm: Add drm_vblank_on()
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: platform: update moved Tegra header
Alexandre Courbot [Sat, 26 Jul 2014 09:36:02 +0000 (18:36 +0900)]
drm/nouveau: platform: update moved Tegra header

Header for tegra_powergate functions has moved to soc/tegra/pmc.h.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/gk20a: reclocking support
Alexandre Courbot [Sat, 26 Jul 2014 09:41:41 +0000 (18:41 +0900)]
drm/nouveau/gk20a: reclocking support

Add support for reclocking on GK20A, using a statically-defined pstates
table. The algorithms for calculating the coefficients and setting the
clocks are directly taken from the ChromeOS kernel.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/clk: support for non-BIOS pstates
Alexandre Courbot [Sat, 26 Jul 2014 09:41:40 +0000 (18:41 +0900)]
drm/nouveau/clk: support for non-BIOS pstates

Make nouveau_clock_create() take new two optional arguments: an array
of pstates and its size. When these are specified,
nouveau_clock_create() will use the provided pstates instead of
probing them using the BIOS.

This is useful for platforms which do not provide a BIOS, like Tegra.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/clk: make therm and volt devices optional
Alexandre Courbot [Sat, 26 Jul 2014 09:41:39 +0000 (18:41 +0900)]
drm/nouveau/clk: make therm and volt devices optional

Allow the clock subsystem to operate even if voltage and thermal devices
are not set for the device (for people with watercooling! ;))

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/perfmon: do not forget to destroy the engine context
Samuel Pitoiset [Mon, 21 Jul 2014 09:59:44 +0000 (11:59 +0200)]
drm/nouveau/perfmon: do not forget to destroy the engine context

This fixes a crash when we reload Nouveau DRM.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau: map pages using DMA API
Alexandre Courbot [Thu, 31 Jul 2014 09:09:42 +0000 (18:09 +0900)]
drm/nouveau: map pages using DMA API

The DMA API is the recommended way to map pages no matter what the
underlying bus is. Use the DMA functions for page mapping and remove
currently existing wrappers.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/pwr/macros: Stop playing Russian roulette on data memory
Roy Spliet [Sat, 2 Aug 2014 15:15:01 +0000 (17:15 +0200)]
drm/nouveau/pwr/macros: Stop playing Russian roulette on data memory

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nve4/graph: do not crash if no power device present
Alexandre Courbot [Tue, 15 Jul 2014 01:36:11 +0000 (10:36 +0900)]
drm/nve4/graph: do not crash if no power device present

Detect and workaround the absence of a power device so chips that do not
feature one (e.g. GK20A) can still use this driver.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/gk20a: add BAR instance
Alexandre Courbot [Fri, 27 Jun 2014 11:36:54 +0000 (20:36 +0900)]
drm/gk20a: add BAR instance

GK20A's BAR is functionally identical to NVC0's, but do not support
being ioremapped write-combined. Create a BAR instance for GK20A that
reflect that state.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
9 years agodrm/nouveau/bar: add noncached ioremap property
Alexandre Courbot [Fri, 27 Jun 2014 10:28:50 +0000 (19:28 +0900)]
drm/nouveau/bar: add noncached ioremap property

Some BARs (like GK20A's) do not support being ioremapped write-combined.
Add a boolean property to the BAR structure and handle that case in the
Nouveau BO implementation.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
9 years agodrm/nouveau: support for probing platform devices
Alexandre Courbot [Thu, 26 Jun 2014 05:33:32 +0000 (14:33 +0900)]
drm/nouveau: support for probing platform devices

Add a platform driver for Nouveau devices declared using the device tree
or platform data. This driver currently supports GK20A on Tegra
platforms and is only compiled for these platforms if Nouveau is
enabled.

Nouveau will probe the chip type itself using the BOOT0 register, so all
this driver really needs to do is to make sure the module is powered and
its clocks active before calling nouveau_drm_platform_probe().

Heavily based on work done by Thierry Reding.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/kms: restore acceleration before fb_set_suspend() resumes
Ben Skeggs [Mon, 30 Jun 2014 03:18:48 +0000 (13:18 +1000)]
drm/nouveau/kms: restore acceleration before fb_set_suspend() resumes

This *should* be safe these days.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 years agodrm/nouveau/kms: take more care when pulling down accelerated fbcon
Ben Skeggs [Sat, 28 Jun 2014 10:44:07 +0000 (20:44 +1000)]
drm/nouveau/kms: take more care when pulling down accelerated fbcon

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>