Commit graph

330005 commits

Author SHA1 Message Date
Linus Torvalds aab174f0df Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs update from Al Viro:

 - big one - consolidation of descriptor-related logics; almost all of
   that is moved to fs/file.c

   (BTW, I'm seriously tempted to rename the result to fd.c.  As it is,
   we have a situation when file_table.c is about handling of struct
   file and file.c is about handling of descriptor tables; the reasons
   are historical - file_table.c used to be about a static array of
   struct file we used to have way back).

   A lot of stray ends got cleaned up and converted to saner primitives,
   disgusting mess in android/binder.c is still disgusting, but at least
   doesn't poke so much in descriptor table guts anymore.  A bunch of
   relatively minor races got fixed in process, plus an ext4 struct file
   leak.

 - related thing - fget_light() partially unuglified; see fdget() in
   there (and yes, it generates the code as good as we used to have).

 - also related - bits of Cyrill's procfs stuff that got entangled into
   that work; _not_ all of it, just the initial move to fs/proc/fd.c and
   switch of fdinfo to seq_file.

 - Alex's fs/coredump.c spiltoff - the same story, had been easier to
   take that commit than mess with conflicts.  The rest is a separate
   pile, this was just a mechanical code movement.

 - a few misc patches all over the place.  Not all for this cycle,
   there'll be more (and quite a few currently sit in akpm's tree)."

Fix up trivial conflicts in the android binder driver, and some fairly
simple conflicts due to two different changes to the sock_alloc_file()
interface ("take descriptor handling from sock_alloc_file() to callers"
vs "net: Providing protocol type via system.sockprotoname xattr of
/proc/PID/fd entries" adding a dentry name to the socket)

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (72 commits)
  MAX_LFS_FILESIZE should be a loff_t
  compat: fs: Generic compat_sys_sendfile implementation
  fs: push rcu_barrier() from deactivate_locked_super() to filesystems
  btrfs: reada_extent doesn't need kref for refcount
  coredump: move core dump functionality into its own file
  coredump: prevent double-free on an error path in core dumper
  usb/gadget: fix misannotations
  fcntl: fix misannotations
  ceph: don't abuse d_delete() on failure exits
  hypfs: ->d_parent is never NULL or negative
  vfs: delete surplus inode NULL check
  switch simple cases of fget_light to fdget
  new helpers: fdget()/fdput()
  switch o2hb_region_dev_write() to fget_light()
  proc_map_files_readdir(): don't bother with grabbing files
  make get_file() return its argument
  vhost_set_vring(): turn pollstart/pollstop into bool
  switch prctl_set_mm_exe_file() to fget_light()
  switch xfs_find_handle() to fget_light()
  switch xfs_swapext() to fget_light()
  ...
2012-10-02 20:25:04 -07:00
Akinobu Mita 5da444aae5 sparc: fix format string argument for prom_printf()
prom_printf() takes printf style arguments.  Specifing GCC's format
attribute reveals that there are several wrong usages of prom_printf().

This fixes those wrong format strings and arguments, and also leaves
format attributes in order to detect similar mistakes at compile time.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-02 23:20:34 -04:00
Ben Skeggs b9f10852fc drm/nv98/crypt: fix fuc build with latest envyas
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:18 +10:00
Ben Skeggs 7234d0230e drm/nouveau/devinit: fixup various issues with subdev ctor/init ordering
Details of the problem, and solution, are in comments in the commit
proper.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:17 +10:00
Ben Skeggs 002d0c735c drm/nv41/vm: fix and enable use of "real" pciegart
Hopefully fixed the tlb flush timeout issue.  Was able to observe this
condition occur occasionally, and it appears the binary driver doesn't
wait on the old condition either..

Should give 39-bit DMA addressing on the relevant chipsets.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:17 +10:00
Ben Skeggs e5f186c4f9 drm/nv44/vm: fix and enable use of "real" pciegart
Something seems to be missing in regards to flushing specific ranges of
the TLB.  For the moment, flushing the entire thing seems to make it
work alright.

Should give 39-bit DMA addressing on the relevant chipsets.

v2: allocate contig 16KiB for dummy pages, reported by mwk on irc

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:17 +10:00
Ben Skeggs 8a57d279d6 drm/nv04/dmaobj: fixup vm target handling in preparation for nv4x pcie
We don't need to pull the page address out of the page tables on nv4x
chips that have a real GART.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:16 +10:00
Ben Skeggs dc73b45ad4 drm/nouveau: store supported dma mask in vmmgr
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:16 +10:00
Ben Skeggs c0abf5c9fa drm/nvc0/ibus: initial implementation of subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:15 +10:00
Martin Peres 2f951a5db5 drm/nouveau/therm: add support for fan-control modes
For now, only 2 control modes are available:
- NONE: The fan is never touched (default)
- MANUAL: The fan is set to the user-defined fan speed (pwm1)

This patch introduces a distinction between ptherm internal fan management
and external fan management. The latter is bound to respect the fan mode
while the first can still select the speed it wants unless the NONE mode
is selected. This is important for automatic fan management.

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:15 +10:00
Martin Peres c9cbf13506 drm/nouveau/hwmon: rename pwm0* to pmw1* to follow hwmon's rules
This was reported by tizbac on IRC.

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:15 +10:00
Martin Peres cfc732bbc5 drm/nouveau/therm: calculate the pwm divisor on nv50+
v2: Martin Peres <martin.peres@labri.fr>
- fixed unintentional use of floating point

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:14 +10:00
Martin Peres bf6546b421 drm/nouveau/fan: rewrite the fan tachometer driver to get more precision, faster
The previous driver waited for 250ms to accumulate data. This version times a
complete fan rotation and extrapolates to RPM.

The fan rotational speed should now be read in less than 250ms (worst case)
and usually in less 50ms.

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:14 +10:00
Martin Peres aa1b9b4836 drm/nouveau/therm: move thermal-related functions to the therm subdev
It looks scary because of the size, but I tried to keep the differences minimal.
Further patches will fix the actual "driver" code and add new features.

v2: change filenames, split to submodules

v3: add a missing include

v4: Ben Skeggs <bskeggs@redhat.com>
- fixed set_defaults() to allow min_duty < 30 (thermal table will
  override this if it's actually necessary)
- fixed set_defaults() to not provide pwm_freq so nv4x (which only has
  pwm_div) can actually work.  the boards using pwm_freq will have a
  thermal table entry to provide us the value.
- removed unused files

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:14 +10:00
Martin Peres d46497dce7 drm/nouveau/bios: parse the pwm divisor from the perf table
v2: perf_table now is more in line with the other functions

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:13 +10:00
Martin Peres 32334cc03a drm/nouveau/therm: use the EXTDEV table to detect i2c monitoring devices
This commit also adds a static list of all known devices and their possible
i2c addresses.

v2: use the common table parsing technique as suggested by darktama

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:13 +10:00
Martin Peres 7d70e9c1c6 drm/nouveau/therm: rework thermal table parsing
As an accident, it should also fix temperature reading on nv4x.

v2: introduce nvbios_therm_entry as advised by darktama

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:13 +10:00
Martin Peres e36199980b drm/nouveau/gpio: expose the PWM/TOGGLE parameter found in the gpio vbios table
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:12 +10:00
Dmitry Eremin-Solenikov d89c8ce071 drm/nouveau: fix pm initialization order
If nouveau_pm_perflvl_get() fails, pm->profiles list will be left
uninitialized, which causes oops during nouveau_pm_fini().

Move INIT_LIST_HEAD before call to nouveau_pm_perflvl_get().

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:12 +10:00
Ben Skeggs acac7bdba6 drm/nouveau/bios: check that fixed tvdac gpio data is valid before using it
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:11 +10:00
Ben Skeggs da07e52cf1 drm/nouveau: log channel debug/error messages from client object rather than drm client
This will make it more obvious which application caused particular messages.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:11 +10:00
Ben Skeggs aa74c3755e drm/nouveau: have drm debugging macros build on top of core macros
May kill the DRM version completely at some point, undecided..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:11 +10:00
Ben Skeggs fa6df8c163 drm/nouveau/core: have client-id be a string, rather than an integer
Can be somewhat more informative that way...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:10 +10:00
Ben Skeggs b3ccd34ded drm/nvc0/fifo: re-bash PBUS regs after vm-fault to BARs/PEEPHOLE
Seems to be required to "re-arm" the engines after a vm fault.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:10 +10:00
Ben Skeggs f73221e4aa drm/nvc0/gr: implement initial trap handler
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:10 +10:00
Ben Skeggs d66b9d9a68 drm/nvc0/gr: rebuild fuc with latest envyas
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:09 +10:00
Ben Skeggs cd8c14b407 drm/nvc0/ltcg: read LTS count at startup
Not really sure how to confirm this 100%, but, the numbers match on all the
traces I have for NVCx (2 LTS), NVD9 (1LTS) and NVEx (4LTS).

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:09 +10:00
Ben Skeggs e5bf578ce6 drm/nve0/gr: enable use of our fuc by default
Graphics acceleration is still disabled by default due to lingering issues
that need to be solved.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:09 +10:00
Ben Skeggs ec6566f323 drm/nve0/gr: remove 0x404160 bashing from hub fuc
Triggers PIBUS interrupts due to register not existing anymore, and as
a result HUB_SET_CHAN times out.

After this commit, our fuc loads and can accelerate at least fbcon, X,
glxgears and OA on NVE4.  NVE7 not tested as of yet.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:08 +10:00
Ben Skeggs 1978a2f280 drm/nve0/gr: initial fuc implementation, based on fermi's code
Currently identical except the available chipset register lists.  This will
*not* currently work and is disabled by default because of this.

May get merged again later, remains to be seen what further changes will be
required.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:08 +10:00
Ben Skeggs 2c1a425e7d drm/nve0/ibus: handle PIBUS interrupts to prevent storm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:07 +10:00
Ben Skeggs 757833cc9f drm/nouveau/sw: trap and clear PMC_INTR_0_SOFTWARE
Came in useful for debugging another issue earlier, so keep it around.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:07 +10:00
Marcin Slusarz 5b8a43aeb9 drm/nouveau: quiet some static-related sparse noise
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:07 +10:00
Marcin Slusarz e6626254f9 drm/nouveau: constify instances of nouveau_bitfield and nouveau_enum structs
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:06 +10:00
Ben Skeggs c97f8c922e drm/nouveau/fifo: use defines instead of hardcoded class ids
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:06 +10:00
Ben Skeggs 1971f04e16 drm/nouveau/dmaobj: reject unsupported parent types instead of half-succeeding
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:06 +10:00
Ben Skeggs 9456f7d1be drm/nouveau: add defines for internal class names
Will probably flesh the documentation of the classes out a bit too at some
later point.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:05 +10:00
Ben Skeggs 368be5f1b8 drm/nv50/fifo: add support for dma channel class
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:05 +10:00
Ben Skeggs ab2858928b drm/nv84/fifo: add support for dma channel class
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:05 +10:00
Ben Skeggs a7c6e75eb2 drm/nouveau/fifo: version the dma channel class struct
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:04 +10:00
Ben Skeggs 503b0f1cd6 drm/nouveau/fifo: separate object classes for dma channels
Future code will use the object class rather than chipset checks in order to
identify available channel features.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:04 +10:00
Ben Skeggs 72a1482777 drm/nouveau: restore fifo chid information in engine error messages
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:03 +10:00
Ben Skeggs 4c2d42225b drm/nouveau/core: have fifo store a unique context identifier at attach time
This value will match something that's easily available from the engine IRQ
handlers, and used to lookup the relevant context.

Since the changes in how this is done on each generation match when the
major PFIFO changes happened, fifo is responsible for calculating the
correct value to avoid duplicating the same code among many engine modules.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:03 +10:00
Ben Skeggs 0c5b8cecf3 drm/nouveau/fifo: add method to lookup fifo chid related to a given object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:03 +10:00
Ben Skeggs 3acec63aee drm/nouveau/core: protect engine context list with hardirq-safe spinlock
IRQ handlers will need access to engine contexts.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:02 +10:00
Ben Skeggs 6fa8e62937 drm/nv84/fifo: mask only the engine we're waiting on for channel unload
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:02 +10:00
Ben Skeggs 49981046e3 drm/nve0: use async copy engine for ttm buffer moves if available
Kepler PFIFO lost the ability to address multiple engines from a single
channel, so we need a separate one for the copy engine.

v2: Marcin Slusarz <marcin.slusarz@gmail.com>
- regression fix: restore hw accelerated buffer copies

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:02 +10:00
Ben Skeggs 4f32656dc7 drm/nve0/copy: add initial support for the async copy engines
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:01 +10:00
Ben Skeggs dbff2dee9f drm/nve0/fifo: support engine selection when creating fifo channels
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:01 +10:00
Ben Skeggs 43b1e9c989 drm/nouveau/device: return proper error codes if ioremap fails
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:01 +10:00