deliverable/linux.git
13 years agodrm/nv50-nvc0: completely disable relocs
Ben Skeggs [Tue, 7 Jun 2011 01:12:39 +0000 (11:12 +1000)] 
drm/nv50-nvc0: completely disable relocs

GPU virtual addresses are constant now so this should never be getting hit
anyway and userspace shouldn't break from them being ignored.

This is being done in preference to teaching the code how to deal with BOs
that exist at different virtual addresses within separate VMs.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: convert bo.mem.start usage to bo.offset
Ben Skeggs [Tue, 7 Jun 2011 01:24:14 +0000 (11:24 +1000)] 
drm/nouveau: convert bo.mem.start usage to bo.offset

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: convert some bo.offset use to vma.offset
Ben Skeggs [Tue, 7 Jun 2011 01:02:38 +0000 (11:02 +1000)] 
drm/nouveau: convert some bo.offset use to vma.offset

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: create temp vmas for both src and dst of bo moves
Ben Skeggs [Mon, 6 Jun 2011 10:54:42 +0000 (20:54 +1000)] 
drm/nouveau: create temp vmas for both src and dst of bo moves

Greatly simplifies a number of things, particularly once per-client GPU
address spaces are involved.

May add this back later once I know what things'll look like.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: store bo's page size in nouveau_bo
Ben Skeggs [Mon, 6 Jun 2011 04:15:46 +0000 (14:15 +1000)] 
drm/nouveau: store bo's page size in nouveau_bo

Was previously assuming a page size of 4KiB unless a VMA was present to
override it.  Eventually, a buffer won't necessarily have a VMA at all at
some stages of its life, so we need to store this info elsewhere.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: skip move_notify() if bo does not have a vma attached
Ben Skeggs [Fri, 3 Jun 2011 04:55:39 +0000 (14:55 +1000)] 
drm/nouveau: skip move_notify() if bo does not have a vma attached

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: will need to specify channel for vm-ful gpuobj allocations
Ben Skeggs [Fri, 3 Jun 2011 04:23:30 +0000 (14:23 +1000)] 
drm/nouveau: will need to specify channel for vm-ful gpuobj allocations

Abuses existing gpuobj_new() chan argument for this, which in turn forces
all NVOBJ_FLAG_VM allocations to be done from the global heap, not
suballocated from the channel's private heap.  Not a problem though in
practise.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: initialise any vm for a channel before pushbuf/ntfy
Ben Skeggs [Fri, 3 Jun 2011 03:59:44 +0000 (13:59 +1000)] 
drm/nouveau: initialise any vm for a channel before pushbuf/ntfy

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: modify gpuobj/ntfy takedown ordering
Ben Skeggs [Mon, 6 Jun 2011 01:34:27 +0000 (11:34 +1000)] 
drm/nouveau: modify gpuobj/ntfy takedown ordering

gpuobj really needs splitting into channel/gpuobj code instead...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/gem: implement stub hooks for GEM object open/close
Ben Skeggs [Fri, 3 Jun 2011 06:18:26 +0000 (16:18 +1000)] 
drm/nouveau/gem: implement stub hooks for GEM object open/close

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: remove 'chan' argument from nouveau_gem_new
Ben Skeggs [Tue, 7 Jun 2011 02:25:36 +0000 (12:25 +1000)] 
drm/nouveau: remove 'chan' argument from nouveau_gem_new

Userspace hasn't passed us a channel_hint for a long long time now, and
there isn't actually a need to do so anymore anyway.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50-nvc0/chan: inherit vm from fpriv, rather than chan_vm directly
Ben Skeggs [Fri, 3 Jun 2011 00:20:52 +0000 (10:20 +1000)] 
drm/nv50-nvc0/chan: inherit vm from fpriv, rather than chan_vm directly

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50-nvc0/vm: take client reference on shared channel vm
Ben Skeggs [Fri, 3 Jun 2011 00:07:08 +0000 (10:07 +1000)] 
drm/nv50-nvc0/vm: take client reference on shared channel vm

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50-nvc0/vm: don't touch chan_vm
Ben Skeggs [Thu, 2 Jun 2011 23:57:27 +0000 (09:57 +1000)] 
drm/nv50-nvc0/vm: don't touch chan_vm

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: no need to update bo.offset from vma after validate
Ben Skeggs [Fri, 3 Jun 2011 05:47:39 +0000 (15:47 +1000)] 
drm/nouveau: no need to update bo.offset from vma after validate

On chipsets using nouveau_vm, the virtual address stays constant, so
the value set at bo creation time is fine.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: store a per-client channel list
Ben Skeggs [Wed, 1 Jun 2011 09:18:48 +0000 (19:18 +1000)] 
drm/nouveau: store a per-client channel list

Removes the need to disable IRQs to lookup channel struct on every pushbuf
ioctl, among others.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: use NULL file_priv for DRM-created channels
Ben Skeggs [Tue, 31 May 2011 01:12:55 +0000 (11:12 +1000)] 
drm/nouveau: use NULL file_priv for DRM-created channels

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: allocate structure to store per-client data
Ben Skeggs [Tue, 31 May 2011 01:11:28 +0000 (11:11 +1000)] 
drm/nouveau: allocate structure to store per-client data

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: silence error for missing dac loadval table
Ben Skeggs [Wed, 1 Jun 2011 04:11:10 +0000 (14:11 +1000)] 
drm/nouveau: silence error for missing dac loadval table

There's lots of boards (all recent ones) that don't have this anymore, so
punt the message to debug loglevel.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: DCB table quirks for another busted XFX board
Ben Skeggs [Mon, 30 May 2011 02:53:37 +0000 (12:53 +1000)] 
drm/nv50: DCB table quirks for another busted XFX board

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: log if accel is disabled by default on a chipset
Ben Skeggs [Fri, 27 May 2011 06:18:10 +0000 (16:18 +1000)] 
drm/nouveau: log if accel is disabled by default on a chipset

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/gr: fill in some more data for 0xc1/0xc8/0xce
Ben Skeggs [Fri, 27 May 2011 05:50:59 +0000 (15:50 +1000)] 
drm/nvc0/gr: fill in some more data for 0xc1/0xc8/0xce

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/gr: fix typo in class9197 init
Ben Skeggs [Thu, 26 May 2011 22:36:45 +0000 (08:36 +1000)] 
drm/nvc0/gr: fix typo in class9197 init

Reported-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/gr: calculate magicgpc918 ourselves
Ben Skeggs [Thu, 26 May 2011 02:12:43 +0000 (12:12 +1000)] 
drm/nvc0/gr: calculate magicgpc918 ourselves

Not a clue what it is yet, but we get the same numbers as NVIDIA now.

My 465 didn't seem to care to greatly *what* I bashed into these registers..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/gr: add some missing magics for 0xc1/0xc8/0xce
Ben Skeggs [Thu, 26 May 2011 00:54:05 +0000 (10:54 +1000)] 
drm/nvc0/gr: add some missing magics for 0xc1/0xc8/0xce

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/gr: import and use our own fuc by default
Ben Skeggs [Wed, 25 May 2011 08:32:44 +0000 (18:32 +1000)] 
drm/nvc0/gr: import and use our own fuc by default

The ability to use NVIDIA's fuc has been retained *temporarily* in order
to better debug any issues that may be lingering in our initial attempt
at writing this ucode.  Once I'm fairly confident we're okay, it'll be
removed.

There's a number of things not implemented by this fuc currently, but
most of it is sets of state that our context setup would not have used
anyway.  No doubt we'll find out what they're for at some point, and
implement it if required.

This has been tested on 0xc0/0xc4 thus far, and from what I could tell
it worked as well as NVIDIA's.  It's also been tested on 0xc1, but even
with NVIDIA's fuc that chipset doesn't work correctly with nouveau yet.

0xc3/0xc8/0xce should in theory be supported too, but I don't have the
hardware to check that.

There's no doubt numerous bugs to squash yet, please report any!

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: fix suspend/resume of PGRAPH/PCOPYn
Ben Skeggs [Wed, 25 May 2011 07:22:43 +0000 (17:22 +1000)] 
drm/nvc0: fix suspend/resume of PGRAPH/PCOPYn

We need the physical VRAM address in vinst, even for objects mapped into
a vm, as the gpuobj suspend/resume code uses PMEM to access the object.

Previously, vinst was overloaded to mean "VRAM address" for !VM objects,
and "VM address" for VM objects, causing the wrong data to be accessed
during suspend/resume.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: default to noaccel on 0xc1/0xc8/0xce for now
Ben Skeggs [Wed, 25 May 2011 04:48:50 +0000 (14:48 +1000)] 
drm/nouveau: default to noaccel on 0xc1/0xc8/0xce for now

Until we know these should work properly, would much rather default to
noaccel than risk giving people corruption/hangs out of the box..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc1/gr: switch on acceleration support
Ben Skeggs [Tue, 24 May 2011 06:06:42 +0000 (16:06 +1000)] 
drm/nvc1/gr: switch on acceleration support

There's issues with certain 3D apps still, unknown whether this is a kernel
issue or not.. It does appear that it may be in the 3D driver however.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/gr: enable 0xc8/0xce support, no idea if it works or not..
Ben Skeggs [Tue, 24 May 2011 05:44:37 +0000 (15:44 +1000)] 
drm/nvc0/gr: enable 0xc8/0xce support, no idea if it works or not..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/gr: some initial state modifications
Ben Skeggs [Tue, 24 May 2011 04:57:53 +0000 (14:57 +1000)] 
drm/nvc0/gr: some initial state modifications

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/gr: 0x9197/0x9297 state init
Ben Skeggs [Tue, 24 May 2011 04:46:06 +0000 (14:46 +1000)] 
drm/nvc0/gr: 0x9197/0x9297 state init

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/gr: macro to determine fermi class, will use it in a few places
Ben Skeggs [Tue, 24 May 2011 04:37:41 +0000 (14:37 +1000)] 
drm/nvc0/gr: macro to determine fermi class, will use it in a few places

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/fifo: fix typos in unload_context
Ben Skeggs [Tue, 24 May 2011 01:54:42 +0000 (11:54 +1000)] 
drm/nvc0/fifo: fix typos in unload_context

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/fb: allocate page for some unknown PFFB object
Ben Skeggs [Tue, 24 May 2011 01:47:09 +0000 (11:47 +1000)] 
drm/nvc0/fb: allocate page for some unknown PFFB object

Fixes DMAR faults during accel, more than likely a similar problem to what
was solved on nv50 previously.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: Read temperature on Fermi like we do on nv84+
Martin Peres [Thu, 12 May 2011 20:40:47 +0000 (22:40 +0200)] 
drm/nvc0: Read temperature on Fermi like we do on nv84+

Signed-off-by: Martin Peres <martin.peres@ensi-bourges.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/radeon/kms: add initial CS checker support for compute
Alex Deucher [Wed, 8 Jun 2011 19:26:45 +0000 (15:26 -0400)] 
drm/radeon/kms: add initial CS checker support for compute

- Add some new compute regs
- Add new dispatch packets for evergreen/cayman

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agottm: Fix spelling mistakes and remove unused #ifdef
Konrad Rzeszutek Wilk [Wed, 8 Jun 2011 17:06:15 +0000 (17:06 +0000)] 
ttm: Fix spelling mistakes and remove unused #ifdef

. and some comments to make it easier to understand.

Ackedby: Randy Dunlap <randy.dunlap@oracle.com>
[v2: Added some more updates from Randy Dunlap]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: set dma_copy to NULL for r6xx+
Alex Deucher [Mon, 13 Jun 2011 21:33:39 +0000 (21:33 +0000)] 
drm/radeon/kms: set dma_copy to NULL for r6xx+

No need to assign the same copy callback for both
copy blit and dma.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/gem: add hooks to notify driver when object handle is created/destroyed
Ben Skeggs [Thu, 9 Jun 2011 00:24:59 +0000 (00:24 +0000)] 
drm/gem: add hooks to notify driver when object handle is created/destroyed

Nouveau is going to use these hooks to map/unmap objects from a client's
private GPU address space.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms/r6xx+: voltage fixes
Alex Deucher [Mon, 20 Jun 2011 17:00:31 +0000 (13:00 -0400)] 
drm/radeon/kms/r6xx+: voltage fixes

0xff01 is not an actual voltage value, but a flag
for the driver.  If the power state as that value,
skip setting the voltage.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/nouveau: drop leftover debugging
Dave Airlie [Mon, 20 Jun 2011 05:25:35 +0000 (15:25 +1000)] 
drm/nouveau: drop leftover debugging

this printk isn't really useful, just drop it for now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoMerge branch 'drm-nouveau-fixes' of git://anongit.freedesktop.org/git/nouveau/linux...
Dave Airlie [Mon, 20 Jun 2011 02:02:38 +0000 (12:02 +1000)] 
Merge branch 'drm-nouveau-fixes' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes

* 'drm-nouveau-fixes' of git://anongit.freedesktop.org/git/nouveau/linux-2.6:
  drm/nouveau: fix assumption that semaphore dmaobj is valid in x-chan sync
  drm/nv50/disp: fix gamma with page flipping overlay turned on
  drm/nouveau/pm: Prevent overflow in nouveau_perf_init()
  drm/nouveau: fix big-endian switch

13 years agodrm/radeon: avoid warnings from r600/eg irq handlers on powered off card.
Dave Airlie [Sat, 18 Jun 2011 03:59:51 +0000 (03:59 +0000)] 
drm/radeon: avoid warnings from r600/eg irq handlers on powered off card.

Since we were calling the wptr function before checking if the IH was
even enabled, or the GPU wasn't shutdown, we'd get spam in the logs when
the GPU readback 0xffffffff. This reorders things so we return early
in the no IH and GPU shutdown cases.

Reported-and-tested-by: ManDay on #radeon
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: add missing param for dce3.2 DP transmitter setup
Alex Deucher [Fri, 17 Jun 2011 06:11:30 +0000 (06:11 +0000)] 
drm/radeon/kms: add missing param for dce3.2 DP transmitter setup

This is used during phy init to set up the phy for DP.  This may
fix DP problems on DCE3.2 cards.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms/atom: fix duallink on some early DCE3.2 cards
Alex Deucher [Fri, 17 Jun 2011 17:13:52 +0000 (13:13 -0400)] 
drm/radeon/kms/atom: fix duallink on some early DCE3.2 cards

Certain revisions of the vbios on DCE3.2 cards have a bug
in the transmitter control table which prevents duallink from
being enabled properly on some cards.  The action switch statement
jumps to the wrong offset for the OUTPUT_ENABLE action.  The fix
is to use the ENABLE action rather than the OUTPUT_ENABLE action
on the affected cards.  In fixed version of the vbios, both
actions jump to the same offset, so the change should be safe.

Reported-and-tested-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoMerge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
Linus Torvalds [Sun, 19 Jun 2011 03:33:31 +0000 (20:33 -0700)] 
Merge branch 'hwmon-for-linus' of git://git./linux/kernel/git/groeck/staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging:
  hwmon: (s3c) Initialize sysfs attributes
  hwmon: (ibmpex) Initialize sysfs attributes
  hwmon: (ibmaem) Initialize sysfs attributes
  hwmon: (asus_atk0110) Consolidate sysfs attribute initialization
  hwmon: (coretemp) Drop unused struct members

13 years agoisofs: fix bh leak in isofs_fill_super() error case
Linus Torvalds [Wed, 8 Jun 2011 17:30:03 +0000 (10:30 -0700)] 
isofs: fix bh leak in isofs_fill_super() error case

In isofs_fill_super(), when an iso_primary_descriptor is found, it is
kept in pri_bh.  The error cases don't properly release it.  Fix it.

Reported-and-tested-by: 김원석 <stanley.will.kim@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agohwmon: (s3c) Initialize sysfs attributes
Guenter Roeck [Tue, 24 May 2011 19:34:55 +0000 (12:34 -0700)] 
hwmon: (s3c) Initialize sysfs attributes

Initialize dynamically allocated sysfs attributes before device_create_file()
call to suppress lockdep_init_map() warning if lockdep debugging is enabled.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 2.6.34+
13 years agohwmon: (ibmpex) Initialize sysfs attributes
Guenter Roeck [Tue, 24 May 2011 19:34:12 +0000 (12:34 -0700)] 
hwmon: (ibmpex) Initialize sysfs attributes

Initialize dynamically allocated sysfs attributes before device_create_file()
call to suppress lockdep_init_map() warning if lockdep debugging is enabled.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 2.6.34+
13 years agohwmon: (ibmaem) Initialize sysfs attributes
Guenter Roeck [Tue, 24 May 2011 19:33:26 +0000 (12:33 -0700)] 
hwmon: (ibmaem) Initialize sysfs attributes

Initialize dynamically allocated sysfs attributes before device_create_file()
call to suppress lockdep_init_map() warning if lockdep debugging is enabled.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 2.6.34+
13 years agohwmon: (asus_atk0110) Consolidate sysfs attribute initialization
Guenter Roeck [Tue, 24 May 2011 19:19:05 +0000 (12:19 -0700)] 
hwmon: (asus_atk0110) Consolidate sysfs attribute initialization

Call sysfs_attr_init() from atk_init_attribute() to handle sysfs attribute
initialization in a single function.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Luca Tettamanti <kronos.it@gmail.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
13 years agohwmon: (coretemp) Drop unused struct members
Jean Delvare [Tue, 7 Jun 2011 19:14:26 +0000 (15:14 -0400)] 
hwmon: (coretemp) Drop unused struct members

pdev_entry.cpu and pdev_entry.cpu_core_id aren't used anywhere in the
driver code so we can drop these struct members.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
13 years agodrm/nouveau: fix assumption that semaphore dmaobj is valid in x-chan sync
Ben Skeggs [Fri, 17 Jun 2011 13:41:54 +0000 (23:41 +1000)] 
drm/nouveau: fix assumption that semaphore dmaobj is valid in x-chan sync

The DDX modifies DMA_SEMAPHORE on nv50 in order to implement sync-to-vblank,
things will go very wrong for cross-channel sync after this.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50/disp: fix gamma with page flipping overlay turned on
Ben Skeggs [Thu, 16 Jun 2011 04:40:27 +0000 (14:40 +1000)] 
drm/nv50/disp: fix gamma with page flipping overlay turned on

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau/pm: Prevent overflow in nouveau_perf_init()
Emil Velikov [Sat, 11 Jun 2011 12:30:32 +0000 (13:30 +0100)] 
drm/nouveau/pm: Prevent overflow in nouveau_perf_init()

While parsing the perf table, there is no check if
the num of entries read from the vbios is less than
the currently allocated number.

In case of a buggy vbios this will cause overwriting
of kernel memory, causing aditional problems.

Add a simple check in order to prevent the case

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: fix big-endian switch
Ben Skeggs [Tue, 14 Jun 2011 00:16:17 +0000 (10:16 +1000)] 
drm/nouveau: fix big-endian switch

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agoMerge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Sat, 18 Jun 2011 04:15:11 +0000 (21:15 -0700)] 
Merge branch 'drm-fixes' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/i915: Fix gen6 (SNB) missed BLT ring interrupts.

13 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
Linus Torvalds [Sat, 18 Jun 2011 04:13:43 +0000 (21:13 -0700)] 
Merge branch 'fixes' of git://git./linux/kernel/git/davej/cpufreq

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] powernow-k8: Don't try to transition if the pstate is incorrect
  [CPUFREQ] powernow-k8: Don't notify of successful transition if we failed (vid case).
  [CPUFREQ] Don't set stat->last_index to -1 if the pol->cur has incorrect value.

13 years agoMerge branch 'anon_vma-locking'
Linus Torvalds [Sat, 18 Jun 2011 04:01:21 +0000 (21:01 -0700)] 
Merge branch 'anon_vma-locking'

* anon_vma-locking:
  mm: avoid anon_vma_chain allocation under anon_vma lock
  mm: avoid repeated anon_vma lock/unlock sequences in unlink_anon_vmas()
  mm: avoid repeated anon_vma lock/unlock sequences in anon_vma_clone()

13 years agomm: avoid anon_vma_chain allocation under anon_vma lock
Linus Torvalds [Sat, 18 Jun 2011 02:05:36 +0000 (19:05 -0700)] 
mm: avoid anon_vma_chain allocation under anon_vma lock

Hugh Dickins points out that lockdep (correctly) spots a potential
deadlock on the anon_vma lock, because we now do a GFP_KERNEL allocation
of anon_vma_chain while doing anon_vma_clone().  The problem is that
page reclaim will want to take the anon_vma lock of any anonymous pages
that it will try to reclaim.

So re-organize the code in anon_vma_clone() slightly: first do just a
GFP_NOWAIT allocation, which will usually work fine.  But if that fails,
let's just drop the lock and re-do the allocation, now with GFP_KERNEL.

End result: not only do we avoid the locking problem, this also ends up
getting better concurrency in case the allocation does need to block.
Tim Chen reports that with all these anon_vma locking tweaks, we're now
almost back up to the spinlock performance.

Reported-and-tested-by: Hugh Dickins <hughd@google.com>
Tested-by: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agomm: avoid repeated anon_vma lock/unlock sequences in unlink_anon_vmas()
Peter Zijlstra [Fri, 17 Jun 2011 11:54:23 +0000 (13:54 +0200)] 
mm: avoid repeated anon_vma lock/unlock sequences in unlink_anon_vmas()

This matches the anon_vma_clone() case, and uses the same lock helper
functions.  Because of the need to potentially release the anon_vma's,
it's a bit more complex, though.

We traverse the 'vma->anon_vma_chain' in two phases: the first loop gets
the anon_vma lock (with the helper function that only takes the lock
once for the whole loop), and removes any entries that don't need any
more processing.

The second phase just traverses the remaining list entries (without
holding the anon_vma lock), and does any actual freeing of the
anon_vma's that is required.

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Tested-by: Hugh Dickins <hughd@google.com>
Tested-by: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agomm: avoid repeated anon_vma lock/unlock sequences in anon_vma_clone()
Linus Torvalds [Fri, 17 Jun 2011 03:44:51 +0000 (20:44 -0700)] 
mm: avoid repeated anon_vma lock/unlock sequences in anon_vma_clone()

In anon_vma_clone() we traverse the vma->anon_vma_chain of the source
vma, locking the anon_vma for each entry.

But they are all going to have the same root entry, which means that
we're locking and unlocking the same lock over and over again.  Which is
expensive in locked operations, but can get _really_ expensive when that
root entry sees any kind of lock contention.

In fact, Tim Chen reports a big performance regression due to this: when
we switched to use a mutex instead of a spinlock, the contention case
gets much worse.

So to alleviate this all, this commit creates a small helper function
(lock_anon_vma_root()) that can be used to take the lock just once
rather than taking and releasing it over and over again.

We still have the same "take the lock and release" it behavior in the
exit path (in unlink_anon_vmas()), but that one is a bit harder to fix
since we're actually freeing the anon_vma entries as we go, and that
will touch the lock too.

Reported-and-tested-by: Tim Chen <tim.c.chen@linux.intel.com>
Tested-by: Hugh Dickins <hughd@google.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agodrm/i915: Fix gen6 (SNB) missed BLT ring interrupts.
Daniel J Blueman [Fri, 17 Jun 2011 18:32:19 +0000 (11:32 -0700)] 
drm/i915: Fix gen6 (SNB) missed BLT ring interrupts.

The failure appeared in dmesg as:

[drm:i915_hangcheck_ring_idle] *ERROR* Hangcheck timer elapsed... blt
ring idle [waiting on 35064155, at 35064155], missed IRQ?

This works around that problem on by making the blitter command
streamer write interrupt state to the Hardware Status Page when a
MI_USER_INTERRUPT command is decoded, which appears to force the seqno
out to memory before the interrupt happens.

v1->v2: Moved to prior interrupt handler installation and RMW flags as
per feedback.
v2->v3: Removed RMW of flags (by anholt)

Cc: stable@kernel.org
Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk> [v1]
Tested-by: Eric Anholt <eric@anholt.net> [v1,v3]
   (incidence of the bug with a testcase went from avg 2/1000 to
   0/12651 in the latest test run (plus more for v1))
Tested-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
Tested-by: Robert Hooker <robert.hooker@canonical.com> [v1]
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33394
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Fri, 17 Jun 2011 17:37:57 +0000 (10:37 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda - Fix no NID error with VIA codecs
  ALSA: isight: adjust for new queueing API
  ALSA: 6fire - Fix signedness bug
  ALSA: lola - Fix section mismatch
  ALSA: hda - Fix missing static inline to beep dummy function
  ALSA: 6fire: Fix double-free bug in usb6fire_fw_ezusb_upload()
  ALSA: hda - Fix beep_device compilation warnings
  ALSA: hda - Fix wrong auto-mute type for Acer Aspire-one
  ALSA: emu10k1: Add details for E-mu 0404 PCIe version
  ALSA: hdspm - Add firmware revision ID for RME MADI PCI version
  ALSA: hdspm - Fix jumping external wordclock frequency in AutoSync mode
  ALSA: hdspm - Fix locking in snd_hdspm_midi_input_read

13 years agoMerge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
Linus Torvalds [Fri, 17 Jun 2011 17:37:41 +0000 (10:37 -0700)] 
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs

* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: make log devices with write back caches work
  xfs: fix ->mknod() return value on xfs_get_acl() failure

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Linus Torvalds [Fri, 17 Jun 2011 17:37:01 +0000 (10:37 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/jikos/hid

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  Revert "HID: magicmouse: ignore 'ivalid report id' while switching modes"
  HID: hid-multitouch: fix broken eGalax
  HID: MAINTAINERS: Update USB HID/HIDBP DRIVERS pattern
  HID: hid-multitouch: add support for Chunghwa multi-touch panel
  HID: hiddev: fix use after free in hiddev_release
  HID: add quirk for HyperPen 10000U
  HID: hiddev: fix potential use-after-free

13 years agoMerge branches 'gpio/merge' and 'spi/merge' of git://git.secretlab.ca/git/linux-2.6
Linus Torvalds [Fri, 17 Jun 2011 17:36:32 +0000 (10:36 -0700)] 
Merge branches 'gpio/merge' and 'spi/merge' of git://git.secretlab.ca/git/linux-2.6

* 'gpio/merge' of git://git.secretlab.ca/git/linux-2.6:
  gpio: add GPIOF_ values regardless on kconfig settings
  gpio: include linux/gpio.h where needed
  gpio/omap4: Fix missing interrupts during device wakeup due to IOPAD.

* 'spi/merge' of git://git.secretlab.ca/git/linux-2.6:
  spi/bfin_spi: fix handling of default bits per word setting

13 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux...
Linus Torvalds [Fri, 17 Jun 2011 17:35:31 +0000 (10:35 -0700)] 
Merge branch 'fixes' of git://git./linux/kernel/git/tmlind/linux-omap-2.6

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6:
  OMAP1: PM: register notifiers with generic clock ops even when !PM_RUNTIME
  omap: pandora: fix NAND support
  OMAP: PM: omap_device: fix device power domain callbacks
  OMAP: PM debug: fix section mismatch warnings

13 years agoKEYS/DNS: Fix ____call_usermodehelper() to not lose the session keyring
David Howells [Fri, 17 Jun 2011 10:25:59 +0000 (11:25 +0100)] 
KEYS/DNS: Fix ____call_usermodehelper() to not lose the session keyring

____call_usermodehelper() now erases any credentials set by the
subprocess_inf::init() function.  The problem is that commit
17f60a7da150 ("capabilites: allow the application of capability limits
to usermode helpers") creates and commits new credentials with
prepare_kernel_cred() after the call to the init() function.  This wipes
all keyrings after umh_keys_init() is called.

The best way to deal with this is to put the init() call just prior to
the commit_creds() call, and pass the cred pointer to init().  That
means that umh_keys_init() and suchlike can modify the credentials
_before_ they are published and potentially in use by the rest of the
system.

This prevents request_key() from working as it is prevented from passing
the session keyring it set up with the authorisation token to
/sbin/request-key, and so the latter can't assume the authority to
instantiate the key.  This causes the in-kernel DNS resolver to fail
with ENOKEY unconditionally.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Eric Paris <eparis@redhat.com>
Tested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agospi/bfin_spi: fix handling of default bits per word setting
Mike Frysinger [Fri, 17 Jun 2011 08:35:37 +0000 (04:35 -0400)] 
spi/bfin_spi: fix handling of default bits per word setting

The default bits per word setting should be 8 bits, but since most of our
devices have been explicitly setting this up, we didn't notice when the
default stopped working.

At the moment, any default transfers without an explicit bit size setting
error out with:
bfin-spi bfin-spi.0: transfer: unsupported bits_per_word

So in the transfer logic, have a bits_per_word setting of 0 fall into the
8 bit transfer logic.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
13 years agoALSA: hda - Fix no NID error with VIA codecs
Takashi Iwai [Fri, 17 Jun 2011 12:23:46 +0000 (14:23 +0200)] 
ALSA: hda - Fix no NID error with VIA codecs

The via driver spews warnigs like
hda-codec: no NID for mapping control Independent HP:0:0
with some codecs because snd_hda_add_nid() is called with nid=0.
This patch fixes it by skipping the call when no corresponding widget
is found.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: isight: adjust for new queueing API
Clemens Ladisch [Fri, 17 Jun 2011 06:18:35 +0000 (08:18 +0200)] 
ALSA: isight: adjust for new queueing API

Since commit 13882a82ee16 (optimize iso queueing by setting
wake only after the last packet), drivers are required to call
fw_iso_context_queue_flush() after queueing a batch of packets.
The missing call would have an effect only if the controller
queue underruns, but then the DMA would stop completely.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoMerge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Fri, 17 Jun 2011 00:54:41 +0000 (17:54 -0700)] 
Merge branch 'drm-fixes' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/radeon/kms: use helper functions for fence read/write
  drm/radeon/kms: set DP link config properly for DP bridges
  drm/radeon/kms/atom: AdjustPixelClock fixes for DP bridges
  drm/radeon/kms: fix handling of DP to LVDS bridges
  drm/radeon/kms: issue blank/unblank commands for ext encoders
  drm/radeon/kms: fix support for DDC on dp bridges
  drm/radeon/kms: add support for load detection on dp bridges
  drm/radeon/kms: add missing external encoder action
  drm/radeon/kms: rework atombios_get_encoder_mode()
  drm/radeon/kms: fix num crtcs for Cedar and Caicos
  Revert "drm/i915: Enable GMBUS for post-gen2 chipsets"
  drivers/gpu/drm: use printk_ratelimited instead of printk_ratelimit
  drm/radeon: workaround a hw bug on some radeon chipsets with all-0 EDIDs.
  drm: make debug levels match in edid failure code.
  drm/radeon/kms: clear wb memory by default
  drm/radeon/kms: be more pedantic about the g5 quirk (v2)
  drm/radeon/kms: signed fix for evergreen thermal
  drm: populate irq_by_busid-member for pci

13 years agodrm/radeon/kms: use helper functions for fence read/write
Alex Deucher [Mon, 13 Jun 2011 21:39:06 +0000 (17:39 -0400)] 
drm/radeon/kms: use helper functions for fence read/write

The existing code assumed scratch registers in a number
of places while in most cases we are be using writeback
and events rather than scratch registers.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: set DP link config properly for DP bridges
Alex Deucher [Thu, 16 Jun 2011 14:06:17 +0000 (10:06 -0400)] 
drm/radeon/kms: set DP link config properly for DP bridges

DP clock and lanes were not set properly for DP bridges.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms/atom: AdjustPixelClock fixes for DP bridges
Alex Deucher [Thu, 16 Jun 2011 14:06:16 +0000 (10:06 -0400)] 
drm/radeon/kms/atom: AdjustPixelClock fixes for DP bridges

Need to set the external transmitter type properly in
AdjustPixelClock to get the properly output.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: fix handling of DP to LVDS bridges
Alex Deucher [Mon, 13 Jun 2011 21:13:35 +0000 (17:13 -0400)] 
drm/radeon/kms: fix handling of DP to LVDS bridges

They need to be treated like eDP rather than DP.

May fix:
https://bugzilla.kernel.org/show_bug.cgi?id=34822

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: issue blank/unblank commands for ext encoders
Alex Deucher [Mon, 13 Jun 2011 21:13:36 +0000 (17:13 -0400)] 
drm/radeon/kms: issue blank/unblank commands for ext encoders

Required for DPMS on some systems.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: fix support for DDC on dp bridges
Alex Deucher [Mon, 13 Jun 2011 21:13:34 +0000 (17:13 -0400)] 
drm/radeon/kms: fix support for DDC on dp bridges

Need to set up the bridge for DDC prior to the
i2c over aux transaction.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: add support for load detection on dp bridges
Alex Deucher [Mon, 13 Jun 2011 21:13:33 +0000 (17:13 -0400)] 
drm/radeon/kms: add support for load detection on dp bridges

dp to vga bridges for example.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: add missing external encoder action
Alex Deucher [Mon, 13 Jun 2011 21:13:32 +0000 (17:13 -0400)] 
drm/radeon/kms: add missing external encoder action

required for ddc.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: rework atombios_get_encoder_mode()
Alex Deucher [Mon, 13 Jun 2011 21:13:31 +0000 (17:13 -0400)] 
drm/radeon/kms: rework atombios_get_encoder_mode()

This should give us more reliable results if the table
is called before an active device is set.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: fix num crtcs for Cedar and Caicos
Alex Deucher [Thu, 16 Jun 2011 18:14:22 +0000 (18:14 +0000)] 
drm/radeon/kms: fix num crtcs for Cedar and Caicos

Only support 4 rather than 6.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoRevert "drm/i915: Enable GMBUS for post-gen2 chipsets"
Jean Delvare [Sat, 4 Jun 2011 19:34:56 +0000 (19:34 +0000)] 
Revert "drm/i915: Enable GMBUS for post-gen2 chipsets"

Revert commit 8f9a3f9b63b8cd3f03be9dc53533f90bd4120e5f. This fixes a
hang when loading the eeprom driver (see bug #35572.) GMBUS will be
re-enabled later, differently.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Reported-by: Marek Otahal <markotahal@gmail.com>
Tested-by: Yermandu Patapitafious <yermandu.dev@gmail.com>
Tested-by: Andrew Lutomirski <luto@mit.edu>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/linux-2.6-nsfd
Linus Torvalds [Thu, 16 Jun 2011 22:02:20 +0000 (15:02 -0700)] 
Merge git://git./linux/kernel/git/ebiederm/linux-2.6-nsfd

* git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/linux-2.6-nsfd:
  proc: Fix Oops on stat of /proc/<zombie pid>/ns/net

13 years agomigrate: don't account swapcache as shmem
Andrea Arcangeli [Thu, 16 Jun 2011 19:56:19 +0000 (12:56 -0700)] 
migrate: don't account swapcache as shmem

swapcache will reach the below code path in migrate_page_move_mapping,
and swapcache is accounted as NR_FILE_PAGES but it's not accounted as
NR_SHMEM.

Hugh pointed out we must use PageSwapCache instead of comparing
mapping to &swapper_space, to avoid build failure with CONFIG_SWAP=n.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years ago[CPUFREQ] powernow-k8: Don't try to transition if the pstate is incorrect
Konrad Rzeszutek Wilk [Thu, 16 Jun 2011 19:36:40 +0000 (15:36 -0400)] 
[CPUFREQ] powernow-k8: Don't try to transition if the pstate is incorrect

This patch augments the pstate transition code to error out
(instead of returning 0) when an incorrect pstate is provided.

Suggested-by: Borislav Petkov <bp@alien8.de>
CC: andre.przywara@amd.com
CC: Mark.Langsdorf@amd.com
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Dave Jones <davej@redhat.com>
13 years ago[CPUFREQ] powernow-k8: Don't notify of successful transition if we failed (vid case).
Konrad Rzeszutek Wilk [Thu, 16 Jun 2011 19:36:39 +0000 (15:36 -0400)] 
[CPUFREQ] powernow-k8: Don't notify of successful transition if we failed (vid case).

Before this patch if we failed the vid transition would still try to
submit the "new" frequencies to cpufreq.
That is incorrect - also we could submit a non-existing frequency value
which would cause cpufreq to crash. The ultimate fix is in cpufreq
to deal with incorrect values, but this patch improves the error
recovery in the AMD powernowk8 driver.

The failure that was reported was as follows:

powernow-k8: Found 1 AMD Athlon(tm) 64 Processor 3700+ (1 cpu cores) (version 2.20.00)
powernow-k8: fid 0x2 (1000 MHz), vid 0x12
powernow-k8: fid 0xa (1800 MHz), vid 0xa
powernow-k8: fid 0xc (2000 MHz), vid 0x8
powernow-k8: fid 0xe (2200 MHz), vid 0x8
Marking TSC unstable due to cpufreq changes
powernow-k8: fid trans failed, fid 0x2, curr 0x0
BUG: unable to handle kernel paging request at ffff880807e07b78
IP: [<ffffffff81479163>] cpufreq_stats_update+0x46/0x5b
...

And transition fails and data->currfid ends up with 0. Since
the machine does not support 800Mhz value when the calculation is
done ('find_khz_freq_from_fid(data->currfid);') it reports the
new frequency as 800000 which is bogus. This patch fixes
the issue during target setting.

The patch however does not fix the issue in 'powernowk8_cpu_init'
where the pol->cur can also be set with the 800000 value:

          pol->cur = find_khz_freq_from_fid(data->currfid);
  dprintk("policy current frequency %d kHz\n", pol->cur);

  /* min/max the cpu is capable of */
  if (cpufreq_frequency_table_cpuinfo(pol, data->powernow_table)) {

The fix for that looks to update cpufreq_frequency_table_cpuinfo to
check pol->cur.... but that would cause an regression in how the
acpi-cpufreq driver works (it sets cpu->cur after calling
cpufreq_frequency_table_cpuinfo). Instead the fix will be to let
cpufreq gracefully handle bogus data (another patch).

Acked-by: Borislav Petkov <bp@alien8.de>
CC: andre.przywara@amd.com
CC: Mark.Langsdorf@amd.com
Reported-by: Tobias Diedrich <ranma+xen@tdiedrich.de>
Tested-by: Tobias Diedrich <ranma+xen@tdiedrich.de>
[v1: Rebased on v3.0-rc2, reduced patch to deal with vid case]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Dave Jones <davej@redhat.com>
13 years ago[CPUFREQ] Don't set stat->last_index to -1 if the pol->cur has incorrect value.
Konrad Rzeszutek Wilk [Thu, 16 Jun 2011 19:36:38 +0000 (15:36 -0400)] 
[CPUFREQ] Don't set stat->last_index to -1 if the pol->cur has incorrect value.

If the driver submitted an non-existing pol>cur value (say it
used the default initialized value of zero), when the cpufreq
stats tries to setup its initial values it incorrectly sets
stat->last_index to -1 (or 0xfffff...). And cpufreq_stats_update
tries to update at that index location and fails.

This can be caused by:

stat->last_index = freq_table_get_index(stat, policy->cur);

not finding the appropiate frequency in the table (b/c the policy->cur
is wrong) and we end up crashing. The fix however is
concentrated in the 'cpufreq_stats_update' as the last_index
(and old_index) are updated there. Which means it can reset
the last_index to -1 again and on the next iteration cause a crash.

Without this patch, the following crash is observed:

powernow-k8: Found 1 AMD Athlon(tm) 64 Processor 3700+ (1 cpu cores) (version 2.20.00)
powernow-k8: fid 0x2 (1000 MHz), vid 0x12
powernow-k8: fid 0xa (1800 MHz), vid 0xa
powernow-k8: fid 0xc (2000 MHz), vid 0x8
powernow-k8: fid 0xe (2200 MHz), vid 0x8
Marking TSC unstable due to cpufreq changes
powernow-k8: fid trans failed, fid 0x2, curr 0x0
BUG: unable to handle kernel paging request at ffff880807e07b78
IP: [<ffffffff81479163>] cpufreq_stats_update+0x46/0x5b
.. snip..
Pid: 1, comm: swapper Not tainted 3.0.0-rc2 #45 MICRO-STAR INTERNATIONAL CO., LTD MS-7094/MS-7094
..snip..
Call Trace:
 [<ffffffff81479248>] cpufreq_stat_notifier_trans+0x48/0x7c
 [<ffffffff81095d68>] notifier_call_chain+0x32/0x5e
 [<ffffffff81095e6b>] __srcu_notifier_call_chain+0x47/0x63
 [<ffffffff81095e96>] srcu_notifier_call_chain+0xf/0x11
 [<ffffffff81477e7a>] cpufreq_notify_transition+0x111/0x134
 [<ffffffff8147b0d4>] powernowk8_target+0x53b/0x617
 [<ffffffff8147723a>] __cpufreq_driver_target+0x2e/0x30
 [<ffffffff8147a127>] cpufreq_governor_dbs+0x339/0x356
 [<ffffffff81477394>] __cpufreq_governor+0xa8/0xe9
 [<ffffffff81477525>] __cpufreq_set_policy+0x132/0x13e
 [<ffffffff8147848d>] cpufreq_add_dev_interface+0x272/0x28c

Reported-by: Tobias Diedrich <ranma+xen@tdiedrich.de>
Tested-by: Tobias Diedrich <ranma+xen@tdiedrich.de>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Dave Jones <davej@redhat.com>
13 years agoALSA: 6fire - Fix signedness bug
Torsten Schenk [Thu, 16 Jun 2011 19:06:27 +0000 (21:06 +0200)] 
ALSA: 6fire - Fix signedness bug

Fixed remaining issues of the signedness bug discovered by Dan Carpenter.
A check was remaining that tests if unsigned rt->rate is >= 0.
Changed that so that rt->rate now consistently uses ARRAY_SIZE(rates)
as invalid rate value and not -1.

Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoMerge branch 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuil...
Linus Torvalds [Thu, 16 Jun 2011 17:26:58 +0000 (10:26 -0700)] 
Merge branch 'rc-fixes' of git://git./linux/kernel/git/mmarek/kbuild-2.6

* 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  kbuild: Call depmod.sh via shell
  perf: clear out make flags when calling kernel make kernelver

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
Linus Torvalds [Thu, 16 Jun 2011 17:21:59 +0000 (10:21 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
  AFS: Use i_generation not i_version for the vnode uniquifier
  AFS: Set s_id in the superblock to the volume name
  vfs: Fix data corruption after failed write in __block_write_begin()
  afs: afs_fill_page reads too much, or wrong data
  VFS: Fix vfsmount overput on simultaneous automount
  fix wrong iput on d_inode introduced by e6bc45d65d
  Delay struct net freeing while there's a sysfs instance refering to it
  afs: fix sget() races, close leak on umount
  ubifs: fix sget races
  ubifs: split allocation of ubifs_info into a separate function
  fix leak in proc_set_super()

13 years agoMerge branch 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 16 Jun 2011 16:46:24 +0000 (09:46 -0700)] 
Merge branch 'sh-fixes-for-linus' of git://git./linux/kernel/git/lethal/sh-3.x

* 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x:
  sh: sh7724: Add USBHS DMAEngine support
  sh: ecovec: Add renesas_usbhs support
  sh, exec: remove redundant set_fs(USER_DS)
  drivers: sh: resume enabled clocks fix
  dmaengine: shdma: SH_DMAC_MAX_CHANNELS message fix
  sh: Fix up xchg/cmpxchg corruption with gUSA RB.
  sh: Remove compressed kernel libgcc dependency.
  sh: fix wrong icache/dcache address-array start addr in cache-debugfs.

13 years agoMerge branch 'rmobile-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 16 Jun 2011 16:46:08 +0000 (09:46 -0700)] 
Merge branch 'rmobile-fixes-for-linus' of git://git./linux/kernel/git/lethal/sh-3.x

* 'rmobile-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x:
  ARM: mach-shmobile: mackerel: tidyup usbhs driver settings
  ARM: mach-shmobile: Correct SCIF port types for SH7367.
  ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() fix
  ARM: mach-shmobile: Mackerel USB platform data update
  ARM: mach-shmobile: AG5EVM SDHI1 platform data update

13 years agoMerge branch 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 16 Jun 2011 16:45:47 +0000 (09:45 -0700)] 
Merge branch 'fbdev-fixes-for-linus' of git://git./linux/kernel/git/lethal/fbdev-3.x

* 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-3.x:
  fbdev: sh_mobile_hdmi: fix regression: statically enable RTPM
  fbdev/atyfb: Fix 2 defined-but-not-used warnings
  efifb: Fix call to wrong unregister function
  video: s3c-fb: move enabling channel for window
  video: s3c-fb: fix virtual resolution checking
  video: s3c-fb: fix misleading kfree in remove function

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Thu, 16 Jun 2011 16:44:20 +0000 (09:44 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/jmorris/security-testing-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
  SELinux: skip file_name_trans_write() when policy downgraded.
  selinux: fix case of names with whitespace/multibytes on /selinux/create

13 years agoxfs: make log devices with write back caches work
Christoph Hellwig [Thu, 16 Jun 2011 12:02:23 +0000 (12:02 +0000)] 
xfs: make log devices with write back caches work

There's no reason not to support cache flushing on external log devices.
The only thing this really requires is flushing the data device first
both in fsync and log commits.  A side effect is that we also have to
remove the barrier write test during mount, which has been superflous
since the new FLUSH+FUA code anyway.  Also use the chance to flush the
RT subvolume write cache before the fsync commit, which is required
for correct semantics.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
13 years agoAFS: Use i_generation not i_version for the vnode uniquifier
David Howells [Mon, 13 Jun 2011 23:45:44 +0000 (00:45 +0100)] 
AFS: Use i_generation not i_version for the vnode uniquifier

Store the AFS vnode uniquifier in the i_generation field, not the i_version
field of the inode struct.  i_version can then be given the AFS data version
number.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agoAFS: Set s_id in the superblock to the volume name
David Howells [Mon, 13 Jun 2011 23:38:44 +0000 (00:38 +0100)] 
AFS: Set s_id in the superblock to the volume name

Set s_id in the superblock to the name of the AFS volume that this superblock
corresponds to.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This page took 0.045716 seconds and 5 git commands to generate.