GitHub/mt8127/android_kernel_alcatel_ttab.git
14 years agobonding: fix potential deadlock in bond_uninit()
Amerigo Wang [Wed, 31 Mar 2010 21:30:52 +0000 (21:30 +0000)]
bonding: fix potential deadlock in bond_uninit()

bond_uninit() is invoked with rtnl_lock held, when it does destroy_workqueue()
which will potentially flush all works in this workqueue, if we hold rtnl_lock
again in the work function, it will deadlock.

So move destroy_workqueue() to destructor where rtnl_lock is not held any more,
suggested by Eric.

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Jay Vosburgh <fubar@us.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Jiri Pirko <jpirko@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: check the length of the socket address passed to connect(2)
Changli Gao [Wed, 31 Mar 2010 22:58:26 +0000 (22:58 +0000)]
net: check the length of the socket address passed to connect(2)

check the length of the socket address passed to connect(2).

Check the length of the socket address passed to connect(2). If the
length is invalid, -EINVAL will be returned.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
net/bluetooth/l2cap.c | 3 ++-
net/bluetooth/rfcomm/sock.c | 3 ++-
net/bluetooth/sco.c | 3 ++-
net/can/bcm.c | 3 +++
net/ieee802154/af_ieee802154.c | 3 +++
net/ipv4/af_inet.c | 5 +++++
net/netlink/af_netlink.c | 3 +++
7 files changed, 20 insertions(+), 3 deletions(-)
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agostmmac: add documentation for the driver.
Giuseppe CAVALLARO [Wed, 31 Mar 2010 21:44:04 +0000 (21:44 +0000)]
stmmac: add documentation for the driver.

Add Documentation/networking/stmmac.txt for the
stmmac network driver.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agostmmac: fix kconfig for crc32 build error
Carmelo AMOROSO [Wed, 31 Mar 2010 21:44:03 +0000 (21:44 +0000)]
stmmac: fix kconfig for crc32 build error

stmmac uses crc32 functions so it needs to select CRC32.

Fixes build error:
drivers/built-in.o: In function `dwmac1000_set_filter':
dwmac1000_core.c:(.text+0x3c380): undefined reference to `crc32_le'
dwmac1000_core.c:(.text+0x3c384): undefined reference to `bitrev32'

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: fix bug in vlan rx path for big endian architecture
Ajit Khaparde [Wed, 31 Mar 2010 02:00:32 +0000 (02:00 +0000)]
be2net: fix bug in vlan rx path for big endian architecture

vlan traffic on big endian architecture is broken.
Need to swap the vid before giving packet to stack.
This patch fixes it.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: fix flashing on big endian architectures
Ajit Khaparde [Wed, 31 Mar 2010 01:57:10 +0000 (01:57 +0000)]
be2net: fix flashing on big endian architectures

Flashing is broken on big endian architectures like ppc.
This patch fixes it.

From: Naresh G <nareshg@serverengines.com>
Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: fix a bug in flashing the redboot section
Ajit Khaparde [Wed, 31 Mar 2010 01:47:45 +0000 (01:47 +0000)]
be2net: fix a bug in flashing the redboot section

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Thu, 1 Apr 2010 16:19:42 +0000 (09:19 -0700)]
Merge branch 'drm-linus' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (76 commits)
  drm/radeon/kms: enable ACPI powermanagement mode on radeon gpus.
  drm/radeon/kms: rs400/480 should set common registers.
  drm/radeon/kms: add sanity check to wptr.
  drm/radeon/kms/evergreen: get DP working
  drm/radeon/kms: add hw_i2c module option
  drm/radeon/kms: use new pre/post_xfer i2c bit algo hooks
  drm/radeon/kms: disable MSI on IGP chips
  drm/radeon/kms: display watermark updates (v2)
  drm/radeon/kms/dp: disable training pattern on the sink at the end of link training
  drm/radeon/kms: minor fixes for eDP with LCD* device tags (v2)
  drm/radeon/kms/dp: remove extraneous training complete call
  drm/radeon/kms/atom: minor fixes to transmitter setup
  drm/radeon/kms: Only restrict BO to visible VRAM size when pinning to VRAM.
  drm: fix build error when SYSRQ is disabled
  drm/radeon/kms: fix macbookpro connector quirk
  drm/radeon/r6xx/r7xx: further safe reg clean up
  drm/radeon: bump the UMS driver version for r6xx/r7xx const buffer support
  drm/radeon/kms: bump the version for r6xx/r7xx const buffer support
  drm/radeon/r6xx/r7xx: CS parser fixes
  drm/radeon/kms: fix some typos in r6xx/r7xx hpd setup
  ...

Fix up MSI-related conflicts in drivers/gpu/drm/radeon/radeon_irq_kms.c

14 years agoMerge branch 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze
Linus Torvalds [Thu, 1 Apr 2010 16:14:20 +0000 (09:14 -0700)]
Merge branch 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze

* 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze: (35 commits)
  microblaze: Support word copying in copy_tofrom_user
  microblaze: Print early printk information to log buffer
  microblaze: head.S typo fix
  microblaze: Use MICROBLAZE_TLB_SIZE in asm code
  microblaze: Kconfig Fix - pci
  microblaze: Adding likely macros
  microblaze: Add .type and .size to ASM functions
  microblaze: Fix TLB macros
  microblaze: Use instruction with delay slot
  microblaze: Remove additional resr and rear loading
  microblaze: Change register usage for ESR and EAR
  microblaze: Prepare work for optimization in exception code
  microblaze: Add DEBUG option
  microblaze: Support systems without lmb bram
  microblaze: uaccess: Sync strlen, strnlen, copy_to/from_user
  microblaze: uaccess: Unify __copy_tofrom_user
  microblaze: uaccess: Move functions to generic location
  microblaze: uaccess: Fix put_user for noMMU
  microblaze: uaccess: Fix get_user macro for noMMU
  microblaze: uaccess: fix clear_user for noMMU kernel
  ...

14 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platf...
Linus Torvalds [Thu, 1 Apr 2010 16:13:57 +0000 (09:13 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/mjg59/platform-drivers-x86

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86:
  eeepc-wmi: new driver for WMI based hotkeys on Eee PC laptops
  asus-laptop: fix warning in asus_handle_init

14 years agooom: fix the unsafe usage of badness() in proc_oom_score()
Oleg Nesterov [Thu, 1 Apr 2010 13:13:57 +0000 (15:13 +0200)]
oom: fix the unsafe usage of badness() in proc_oom_score()

proc_oom_score(task) has a reference to task_struct, but that is all.
If this task was already released before we take tasklist_lock

- we can't use task->group_leader, it points to nowhere

- it is not safe to call badness() even if this task is
  ->group_leader, has_intersects_mems_allowed() assumes
  it is safe to iterate over ->thread_group list.

- even worse, badness() can hit ->signal == NULL

Add the pid_alive() check to ensure __unhash_process() was not called.

Also, use "task" instead of task->group_leader. badness() should return
the same result for any sub-thread. Currently this is not true, but
this should be changed anyway.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agomicroblaze: Support word copying in copy_tofrom_user
Michal Simek [Mon, 22 Mar 2010 19:31:26 +0000 (20:31 +0100)]
microblaze: Support word copying in copy_tofrom_user

Word copying is used only for aligned addresses.
Here is space for improving to use any better copying technique.
Look at memcpy implementation.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Print early printk information to log buffer
Michal Simek [Wed, 24 Mar 2010 10:07:10 +0000 (11:07 +0100)]
microblaze: Print early printk information to log buffer

If early printk console is not enabled then all messages
are written to log buffer.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: head.S typo fix
Michal Simek [Wed, 24 Mar 2010 10:06:23 +0000 (11:06 +0100)]
microblaze: head.S typo fix

I forget to change register name in comments.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Use MICROBLAZE_TLB_SIZE in asm code
Michal Simek [Wed, 24 Mar 2010 09:09:17 +0000 (10:09 +0100)]
microblaze: Use MICROBLAZE_TLB_SIZE in asm code

TLB size was hardcoded in asm code. This patch brings ability
to change TLB size only in one place. (mmu.h).

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Kconfig Fix - pci
Michal Simek [Tue, 23 Mar 2010 14:46:10 +0000 (15:46 +0100)]
microblaze: Kconfig Fix - pci

I forget to remove pci Kconfig option.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Adding likely macros
Michal Simek [Tue, 23 Mar 2010 14:37:02 +0000 (15:37 +0100)]
microblaze: Adding likely macros

On the base on GCOV analytics is helpful to add likely/unlikely
macros.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Add .type and .size to ASM functions
Michal Simek [Tue, 23 Mar 2010 07:09:32 +0000 (08:09 +0100)]
microblaze: Add .type and .size to ASM functions

Cachegrind analysis need this fix to be able to log asm functions.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Fix TLB macros
Michal Simek [Mon, 22 Mar 2010 13:54:35 +0000 (14:54 +0100)]
microblaze: Fix TLB macros

To be able to do trace TLB operations.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Use instruction with delay slot
Michal Simek [Mon, 22 Mar 2010 19:43:27 +0000 (20:43 +0100)]
microblaze: Use instruction with delay slot

Sync labels.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Remove additional resr and rear loading
Michal Simek [Fri, 19 Mar 2010 11:50:35 +0000 (12:50 +0100)]
microblaze: Remove additional resr and rear loading

RESR and REAR uses the same regs in whole file.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Change register usage for ESR and EAR
Michal Simek [Fri, 19 Mar 2010 11:44:40 +0000 (12:44 +0100)]
microblaze: Change register usage for ESR and EAR

This change synchronize register usage in code.
ESR = R4
EAR = R3

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Prepare work for optimization in exception code
Michal Simek [Mon, 22 Mar 2010 19:37:23 +0000 (20:37 +0100)]
microblaze: Prepare work for optimization in exception code

Any sync branch must follow mts instructions not mfs.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Add DEBUG option
Michal Simek [Thu, 18 Mar 2010 06:23:04 +0000 (07:23 +0100)]
microblaze: Add DEBUG option

Disable debug option in asm code.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Support systems without lmb bram
Michal Simek [Mon, 15 Mar 2010 07:48:27 +0000 (08:48 +0100)]
microblaze: Support systems without lmb bram

When the system has no lmb bram, main memory should be start from
zero because of microblaze vectors.

DTS fragment could look like:
DDR2_SDRAM: memory@0 {
device_type = "memory";
reg = < 0x0 0x10000000 >;
} ;

Then you have to setup CONFIG_KERNEL_BASE_ADDR=0 which caused
that kernel physical start address will be zero. On reset vector place
will be jump to 0x100 and on 0x100 starts kernel text.

You have to solve how to load the kernel before cpu starts.
Tested with XMD.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: uaccess: Sync strlen, strnlen, copy_to/from_user
Michal Simek [Mon, 22 Mar 2010 17:49:45 +0000 (18:49 +0100)]
microblaze: uaccess: Sync strlen, strnlen, copy_to/from_user

Last sync.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: uaccess: Unify __copy_tofrom_user
Michal Simek [Mon, 22 Mar 2010 17:39:20 +0000 (18:39 +0100)]
microblaze: uaccess: Unify __copy_tofrom_user

Move to generic location.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: uaccess: Move functions to generic location
Michal Simek [Mon, 22 Mar 2010 17:23:45 +0000 (18:23 +0100)]
microblaze: uaccess: Move functions to generic location

noMMU and MMU use them.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: uaccess: Fix put_user for noMMU
Michal Simek [Mon, 22 Mar 2010 15:22:41 +0000 (16:22 +0100)]
microblaze: uaccess: Fix put_user for noMMU

Here is small regression on dhrystone tests and I think
that on all benchmarking tests. It is due to better checking
mechanism in put_user macro

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: uaccess: Fix get_user macro for noMMU
Michal Simek [Mon, 8 Mar 2010 09:52:24 +0000 (10:52 +0100)]
microblaze: uaccess: Fix get_user macro for noMMU

Use unified version.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: uaccess: fix clear_user for noMMU kernel
Michal Simek [Mon, 22 Mar 2010 15:02:59 +0000 (16:02 +0100)]
microblaze: uaccess: fix clear_user for noMMU kernel

Previous patches fixed only MMU version and this is the first
patch for noMMU kernel

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: uaccess: Fix strncpy_from_user function
Michal Simek [Mon, 8 Mar 2010 08:38:02 +0000 (09:38 +0100)]
microblaze: uaccess: Fix strncpy_from_user function

Generic implementation for noMMU and MMU version

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: uaccess: fix copy_from_user macro
Michal Simek [Mon, 22 Mar 2010 14:56:32 +0000 (15:56 +0100)]
microblaze: uaccess: fix copy_from_user macro

copy_from_user macro also use copy_tofrom_user function

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: uaccess: copy_to_user unification
Michal Simek [Mon, 22 Mar 2010 14:52:53 +0000 (15:52 +0100)]
microblaze: uaccess: copy_to_user unification

noMMU and MMU kernel will use copy copy_tofrom_user
asm implementation.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: uaccess: sync put/get/clear_user macros
Michal Simek [Mon, 22 Mar 2010 14:46:56 +0000 (15:46 +0100)]
microblaze: uaccess: sync put/get/clear_user macros

Add macro description and resort.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: uaccess: fix put_user and get_user macros
Michal Simek [Mon, 22 Mar 2010 14:25:12 +0000 (15:25 +0100)]
microblaze: uaccess: fix put_user and get_user macros

Use FIXUP macros and resort them.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: uaccess: fix __get_user_asm macro
Michal Simek [Fri, 5 Mar 2010 17:03:53 +0000 (18:03 +0100)]
microblaze: uaccess: fix __get_user_asm macro

It is used __FIXUP_SECTION and __EX_TABLE_SECTION macros.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: uaccess: fix clean user macro
Michal Simek [Fri, 5 Mar 2010 15:50:01 +0000 (16:50 +0100)]
microblaze: uaccess: fix clean user macro

This is the first patch which does uaccess unification.
I choosed to do several patches to be able to use bisect
in future if any fault happens.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: move noMMU __range_ok function to uaccess.h
Michal Simek [Fri, 5 Mar 2010 14:49:53 +0000 (15:49 +0100)]
microblaze: move noMMU __range_ok function to uaccess.h

The same noMMU and MMU functions should be placed in
one file.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Move exception_table_entry upward
Michal Simek [Fri, 5 Mar 2010 14:37:57 +0000 (15:37 +0100)]
microblaze: Move exception_table_entry upward

Just sort to be able remove whole block.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Remove segment.h
Michal Simek [Fri, 5 Mar 2010 14:34:12 +0000 (15:34 +0100)]
microblaze: Remove segment.h

I would like to use asm-generic uaccess.h where are segment
macros defined. This is just first step.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Remove memset in free_init_pages
Michal Simek [Wed, 3 Mar 2010 16:03:21 +0000 (17:03 +0100)]
microblaze: Remove memset in free_init_pages

We don't need to do it.

Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Makefile cleanups
Arun Bhanu [Wed, 17 Mar 2010 08:06:04 +0000 (16:06 +0800)]
microblaze: Makefile cleanups

If CONFIG_INITRAMFS_SOURCE is set, "scripts/gen_initramfs_list.sh"
checks if the cpio image exists. Remove the duplicate check from the
Makefile.

Remove the "clean-kernel" variable which is unused in the Makefile and
is not used by the Kbuild.

Signed-off-by: Arun Bhanu <arun@bhanu.net>
Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Fix Makefile to delete build generated files
Arun Bhanu [Wed, 17 Mar 2010 08:06:03 +0000 (16:06 +0800)]
microblaze: Fix Makefile to delete build generated files

'make clean' does not to delete the following build generated file:
arch/microblaze/boot/linux.bin.ub

'make mrproper' does not to delete the following build generated files:
arch/microblaze/boot/simpleImage.*

Fix the Makefile to delete these build generated files.

See [1] for a discussion on why simpleImage.* files are deleted with 'make
mrproper' and not with 'make clean'.
[1] http://lkml.org/lkml/2010/3/12/96

Signed-off-by: Arun Bhanu <arun@bhanu.net>
Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Add a missing single quote to make 'make help' happy
Arun Bhanu [Fri, 12 Mar 2010 08:31:40 +0000 (16:31 +0800)]
microblaze: Add a missing single quote to make 'make help' happy

'make ARCH=microblaze help' fails with the following error due to a
missing single quote.

/bin/sh: -c: line 0: unexpected EOF while looking for matching `''
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [help] Error 2

Signed-off-by: Arun Bhanu <arun@bhanu.net>
Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agomicroblaze: Fix "kstack=" parsing
Steven J. Magnani [Wed, 24 Feb 2010 20:54:15 +0000 (14:54 -0600)]
microblaze: Fix "kstack=" parsing

The "kstack=" command line parameter is not parsed correctly.
All proper values are interpreted as zero.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
14 years agox86,kgdb: Always initialize the hw breakpoint attribute
Jason Wessel [Tue, 30 Mar 2010 19:05:07 +0000 (14:05 -0500)]
x86,kgdb: Always initialize the hw breakpoint attribute

It is required to call hw_breakpoint_init() on an attr before using it
in any other calls.  This fixes the problem where kgdb will sometimes
fail to initialize on x86_64.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: 2.6.33 <stable@kernel.org>
LKML-Reference: <1269975907-27602-1-git-send-email-jason.wessel@windriver.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
14 years agoperf: Use hot regs with software sched switch/migrate events
Frederic Weisbecker [Mon, 22 Mar 2010 18:40:03 +0000 (19:40 +0100)]
perf: Use hot regs with software sched switch/migrate events

Scheduler's task migration events don't work because they always
pass NULL regs perf_sw_event(). The event hence gets filtered
in perf_swevent_add().

Scheduler's context switches events use task_pt_regs() to get
the context when the event occured which is a wrong thing to
do as this won't give us the place in the kernel where we went
to sleep but the place where we left userspace. The result is
even more wrong if we switch from a kernel thread.

Use the hot regs snapshot for both events as they belong to the
non-interrupt/exception based events family. Unlike page faults
or so that provide the regs matching the exact origin of the event,
we need to save the current context.

This makes the task migration event working and fix the context
switch callchains and origin ip.

Example: perf record -a -e cs

Before:

    10.91%      ksoftirqd/0                  0  [k] 0000000000000000
                |
                --- (nil)
                    perf_callchain
                    perf_prepare_sample
                    __perf_event_overflow
                    perf_swevent_overflow
                    perf_swevent_add
                    perf_swevent_ctx_event
                    do_perf_sw_event
                    __perf_sw_event
                    perf_event_task_sched_out
                    schedule
                    run_ksoftirqd
                    kthread
                    kernel_thread_helper

After:

    23.77%  hald-addon-stor  [kernel.kallsyms]  [k] schedule
            |
            --- schedule
               |
               |--60.00%-- schedule_timeout
               |          wait_for_common
               |          wait_for_completion
               |          blk_execute_rq
               |          scsi_execute
               |          scsi_execute_req
               |          sr_test_unit_ready
               |          |
               |          |--66.67%-- sr_media_change
               |          |          media_changed
               |          |          cdrom_media_changed
               |          |          sr_block_media_changed
               |          |          check_disk_change
               |          |          cdrom_open

v2: Always build perf_arch_fetch_caller_regs() now that software
events need that too. They don't need it from modules, unlike trace
events, so we keep the EXPORT_SYMBOL in trace_event_perf.c

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Miller <davem@davemloft.net>
14 years agoperf: Correctly align perf event tracing buffer
Frederic Weisbecker [Mon, 22 Mar 2010 23:08:59 +0000 (00:08 +0100)]
perf: Correctly align perf event tracing buffer

The trace event buffer used by perf to record raw sample events
is typed as an array of char and may then not be aligned to 8
by alloc_percpu().

But we need it to be aligned to 8 in sparc64 because we cast
this buffer into a random structure type built by the TRACE_EVENT()
macro to store the traces. So if a random 64 bits field is accessed
inside, it may be not under an expected good alignment.

Use an array of long instead to force the appropriate alignment, and
perform a compile time check to ensure the size in byte of the buffer
is a multiple of sizeof(long) so that its actual size doesn't get
shrinked under us.

This fixes unaligned accesses reported while using perf lock
in sparc 64.

Suggested-by: David Miller <davem@davemloft.net>
Suggested-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Miller <davem@davemloft.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
14 years agodrm/radeon/kms: enable ACPI powermanagement mode on radeon gpus.
Dave Airlie [Wed, 31 Mar 2010 03:41:35 +0000 (13:41 +1000)]
drm/radeon/kms: enable ACPI powermanagement mode on radeon gpus.

Some GPUs have an APM/ACPI PM mode selection switch and some BIOSes
set this to APM. We really want this in ACPI mode for Linux.

Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: rs400/480 should set common registers.
Dave Airlie [Wed, 31 Mar 2010 03:42:50 +0000 (13:42 +1000)]
drm/radeon/kms: rs400/480 should set common registers.

These GPUs should be setting these registers up also.

Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: add sanity check to wptr.
Dave Airlie [Wed, 31 Mar 2010 03:38:56 +0000 (13:38 +1000)]
drm/radeon/kms: add sanity check to wptr.

If we resume in a bad way, we'll get 0xffffffff in wptr, and then
oops with no console. This just adds a sanity check so that we can
avoid the oops and hopefully get more details out of people's systems.

Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/evergreen: get DP working
Alex Deucher [Wed, 31 Mar 2010 18:42:11 +0000 (14:42 -0400)]
drm/radeon/kms/evergreen: get DP working

Need to enable the VID stream after link training

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Thu, 1 Apr 2010 02:32:50 +0000 (19:32 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

14 years agosparc: Fix regset register window handling.
David S. Miller [Thu, 1 Apr 2010 01:05:05 +0000 (18:05 -0700)]
sparc: Fix regset register window handling.

We have to adjust 'reg_window' down by 16 becuase the 'pos' iterator
we'll use to index into the stack slots will be between 16 and 32.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoeeepc-wmi: new driver for WMI based hotkeys on Eee PC laptops
Yong Wang [Sun, 21 Mar 2010 02:26:34 +0000 (10:26 +0800)]
eeepc-wmi: new driver for WMI based hotkeys on Eee PC laptops

Add a WMI driver for Eee PC laptops. Currently it only supports hotkeys.

Signed-off-by: Yong Wang <yong.y.wang@intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoasus-laptop: fix warning in asus_handle_init
Corentin Chary [Tue, 2 Mar 2010 21:24:12 +0000 (22:24 +0100)]
asus-laptop: fix warning in asus_handle_init

In function 'asus_laptop_get_info':
warning: passing argument 3 of 'asus_handle_init' from incompatible pointer type
note: expected 'char **' but argument is of type 'const char **'

Introduced by commit c21085108a02e1b838c34f3650c8cc9fbd178615
("asus-laptop: fix style problems reported by checkpath.pl").

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
14 years agofat: fix buffer overflow in vfat_create_shortname()
Nikolaus Schulz [Wed, 31 Mar 2010 17:21:10 +0000 (02:21 +0900)]
fat: fix buffer overflow in vfat_create_shortname()

When using the string representation of a random counter as part of the base
name, ensure that it is no longer than 4 bytes.

Since we are repeatedly decrementing the counter in a loop until we have found a
unique base name, the counter may wrap around zero; therefore, it is not enough
to mask its higher bits before entering the loop, this must be done inside the
loop.

[hirofumi@mail.parknet.co.jp: use snprintf()]
Signed-off-by: Nikolaus Schulz <microschulz@web.de>
Cc: stable@kernel.org
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogenirq: Force MSI irq handlers to run with interrupts disabled
Thomas Gleixner [Wed, 31 Mar 2010 11:30:19 +0000 (13:30 +0200)]
genirq: Force MSI irq handlers to run with interrupts disabled

Network folks reported that directing all MSI-X vectors of their multi
queue NICs to a single core can cause interrupt stack overflows when
enough interrupts fire at the same time.

This is caused by the fact that we run interrupt handlers by default
with interrupts enabled unless the driver reuqests the interrupt with
the IRQF_DISABLED set. The NIC handlers do not set this flag, so
simultaneous interrupts can nest unlimited and cause the stack
overflow.

The only safe counter measure is to run the interrupt handlers with
interrupts disabled. We can't switch to this mode in general right
now, but it is safe to do so for MSI interrupts.

Force IRQF_DISABLED for MSI interrupt handlers.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Linus Torvalds <torvalds@osdl.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: David Miller <davem@davemloft.net>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: stable@kernel.org
14 years agobonding: bond_xmit_roundrobin() fix
Eric Dumazet [Tue, 30 Mar 2010 23:08:37 +0000 (23:08 +0000)]
bonding: bond_xmit_roundrobin() fix

Commit a2fd940f (bonding: fix broken multicast with round-robin mode)
added a problem on litle endian machines.

drivers/net/bonding/bond_main.c:4159: warning: comparison is always
false due to limited range of data type

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net: Add missing unlock
Julia Lawall [Mon, 29 Mar 2010 05:35:05 +0000 (05:35 +0000)]
drivers/net: Add missing unlock

Unlock the lock before leaving the function.

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

// <smpl>
@r exists@
expression E1;
identifier f;
@@

f (...) { <+...
* spin_lock_irqsave (E1,...);
... when != E1
* return ...;
...+> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: gianfar - align BD ring size console messages
Kim Phillips [Tue, 30 Mar 2010 11:54:22 +0000 (11:54 +0000)]
net: gianfar - align BD ring size console messages

fix this:

eth2: :RX BD ring size for Q[0]: 256
eth2:TX BD ring size for Q[0]: 256

to look like:

eth2: RX BD ring size for Q[0]: 256
eth2: TX BD ring size for Q[0]: 256

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: gianfar - initialize per-queue statistics
Kim Phillips [Tue, 30 Mar 2010 11:54:21 +0000 (11:54 +0000)]
net: gianfar - initialize per-queue statistics

Interfaces come up claiming having already received 3.0 GiB.
Use kzalloc to properly initialize per-queue data.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogianfar: Fix a memory leak in gianfar close code
Andy Fleming [Mon, 29 Mar 2010 15:42:23 +0000 (15:42 +0000)]
gianfar: Fix a memory leak in gianfar close code

gianfar needed to ensure existence of the *skbuff arrays before
freeing the skbs in them, rather than ensuring their nonexistence.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrm/radeon/kms: add hw_i2c module option
Alex Deucher [Wed, 17 Mar 2010 06:07:37 +0000 (02:07 -0400)]
drm/radeon/kms: add hw_i2c module option

Turn off hw i2c by default except for mm i2c which
is hw only until we sort out the remaining prescale
issues on older chips.  hw i2c can be enabled with
hw_i2c=1.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: use new pre/post_xfer i2c bit algo hooks
Alex Deucher [Sun, 14 Mar 2010 16:22:44 +0000 (12:22 -0400)]
drm/radeon/kms: use new pre/post_xfer i2c bit algo hooks

This allows us to remove the internal bit algo bus used by
the radeon i2c algo.  We now register a radeon algo adapter
if the gpio line is hw capable and the hw inplementation is
available, otherwise we register a bit algo adapter.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoMerge branch 'v2.6.34-rc2' into drm-linus
Dave Airlie [Wed, 31 Mar 2010 04:55:14 +0000 (14:55 +1000)]
Merge branch 'v2.6.34-rc2' into drm-linus

14 years agodrm/radeon/kms: disable MSI on IGP chips
Alex Deucher [Tue, 30 Mar 2010 21:22:32 +0000 (17:22 -0400)]
drm/radeon/kms: disable MSI on IGP chips

Doesn't seem to work reliably and the pci quirks don't
always work.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: display watermark updates (v2)
Alex Deucher [Wed, 31 Mar 2010 04:33:27 +0000 (00:33 -0400)]
drm/radeon/kms: display watermark updates (v2)

- Add module option to force the display priority
  0 = auto, 1 = normal, 2 = high
- Default to high on r3xx/r4xx/rv515 chips
  Fixes flickering problems during heavy acceleration
  due to underflow to the display controllers
- Fill in minimal support for RS600

v2 - update display priority when bandwidth is updated
so the user can change the parameter at runtime and it
will take affect on the next modeset.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/dp: disable training pattern on the sink at the end of link training
Alex Deucher [Tue, 30 Mar 2010 06:03:48 +0000 (02:03 -0400)]
drm/radeon/kms/dp: disable training pattern on the sink at the end of link training

Seems to have gotten lost in the evergreen merge.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: minor fixes for eDP with LCD* device tags (v2)
Alex Deucher [Tue, 30 Mar 2010 01:37:08 +0000 (21:37 -0400)]
drm/radeon/kms: minor fixes for eDP with LCD* device tags (v2)

Some systems have LCD* rather than DFP* device tags in the bios
for eDP connectors; notably the new apple iMac. This fixes
things up so eDP connectors with either tag will work.

v2: fix typo

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/dp: remove extraneous training complete call
Alex Deucher [Mon, 29 Mar 2010 18:06:10 +0000 (14:06 -0400)]
drm/radeon/kms/dp: remove extraneous training complete call

Looks like a copy/paste typo from when evergreen support
was added.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/atom: minor fixes to transmitter setup
Alex Deucher [Mon, 29 Mar 2010 21:39:44 +0000 (17:39 -0400)]
drm/radeon/kms/atom: minor fixes to transmitter setup

- 8 lane links are not valid for DP
- remove unused num var

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: Only restrict BO to visible VRAM size when pinning to VRAM.
Michel Dänzer [Fri, 26 Mar 2010 19:18:55 +0000 (19:18 +0000)]
drm/radeon/kms: Only restrict BO to visible VRAM size when pinning to VRAM.

This prevented radeon.test=1 from testing transfers from/to GTT beyond the
visible VRAM size.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: fix build error when SYSRQ is disabled
Randy Dunlap [Thu, 25 Mar 2010 18:29:05 +0000 (18:29 +0000)]
drm: fix build error when SYSRQ is disabled

Fix build error when CONFIG_MAGIC_SYSRQ is not enabled:

drivers/gpu/drm/drm_fb_helper.c:915: error: 'sysrq_drm_fb_helper_restore_op' undeclared (first use in this function)
drivers/gpu/drm/drm_fb_helper.c:929: error: 'sysrq_drm_fb_helper_restore_op' undeclared (first use in this function)

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: fix macbookpro connector quirk
Alex Deucher [Fri, 26 Mar 2010 21:14:37 +0000 (17:14 -0400)]
drm/radeon/kms: fix macbookpro connector quirk

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/r6xx/r7xx: further safe reg clean up
Alex Deucher [Fri, 26 Mar 2010 23:36:33 +0000 (19:36 -0400)]
drm/radeon/r6xx/r7xx: further safe reg clean up

- remove a few more drm only regs
- remove sampler, alu, bool, loop constant regs.
  They are set via separate packet3's already

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon: bump the UMS driver version for r6xx/r7xx const buffer support
Alex Deucher [Fri, 26 Mar 2010 19:26:51 +0000 (15:26 -0400)]
drm/radeon: bump the UMS driver version for r6xx/r7xx const buffer support

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: bump the version for r6xx/r7xx const buffer support
Alex Deucher [Fri, 26 Mar 2010 19:24:14 +0000 (15:24 -0400)]
drm/radeon/kms: bump the version for r6xx/r7xx const buffer support

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/r6xx/r7xx: CS parser fixes
Alex Deucher [Fri, 26 Mar 2010 18:52:32 +0000 (14:52 -0400)]
drm/radeon/r6xx/r7xx: CS parser fixes

- Drop some more safe regs taht userspace shouldn't hit
- Constant base regs need relocs.  This allows us to use
constant buffers rather than the constant register file.
Also we don't want userspace to be able to set arbitrary
mc base values for the const caches.
- Track SQ_CONFIG so we know whether userspace is using
the cfile or constant buffers.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: fix some typos in r6xx/r7xx hpd setup
Alex Deucher [Wed, 24 Mar 2010 17:57:29 +0000 (13:57 -0400)]
drm/radeon/kms: fix some typos in r6xx/r7xx hpd setup

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/r600: remove some regs are not safe regs for command buffers
Alex Deucher [Wed, 24 Mar 2010 22:45:32 +0000 (18:45 -0400)]
drm/radeon/r600: remove some regs are not safe regs for command buffers

Only the drm should be touching them.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: Return ENODEV if the inode mapping changes
Chris Wilson [Thu, 18 Mar 2010 11:56:54 +0000 (11:56 +0000)]
drm: Return ENODEV if the inode mapping changes

Replace a BUG_ON with an error code in the event that the inode mapping
changes between calls to drm_open. This may happen for instance if udev
is loaded subsequent to the original opening of the device:

[  644.291870] kernel BUG at drivers/gpu/drm/drm_fops.c:146!
[  644.291876] invalid opcode: 0000 [#1] SMP
[  644.291882] last sysfs file: /sys/kernel/uevent_seqnum
[  644.291888]
[  644.291895] Pid: 7276, comm: lt-cairo-test-s Not tainted 2.6.34-rc1 #2 N150/N210/N220             /N150/N210/N220
[  644.291903] EIP: 0060:[<c11c70e3>] EFLAGS: 00210283 CPU: 0
[  644.291912] EIP is at drm_open+0x4b1/0x4e2
[  644.291918] EAX: f72d8d18 EBX: f790a400 ECX: f73176b8 EDX: 00000000
[  644.291923] ESI: f790a414 EDI: f790a414 EBP: f647ae20 ESP: f647adfc
[  644.291929]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
[  644.291937] Process lt-cairo-test-s (pid: 7276, ti=f647a000 task=f73f5c80 task.ti=f647a000)
[  644.291941] Stack:
[  644.291945]  00000000 f7bb7400 00000080 f6451100 f73176b8 f6479214 f6451100 f73176b8
[  644.291957] <0> c1297ce0 f647ae34 c11c6c04 f73176b8 f7949800 00000000 f647ae54 c1080ac5
[  644.291969] <0> f7949800 f6451100 00000000 f6451100 f73176b8 f6452780 f647ae70 c107d1e6
[  644.291982] Call Trace:
[  644.291991]  [<c11c6c04>] ? drm_stub_open+0x8a/0xb8
[  644.292000]  [<c1080ac5>] ? chrdev_open+0xef/0x106
[  644.292008]  [<c107d1e6>] ? __dentry_open+0xd4/0x1a6
[  644.292015]  [<c107d35b>] ? nameidata_to_filp+0x31/0x45
[  644.292022]  [<c10809d6>] ? chrdev_open+0x0/0x106
[  644.292030]  [<c10864e2>] ? do_last+0x346/0x423
[  644.292037]  [<c108789f>] ? do_filp_open+0x190/0x415
[  644.292046]  [<c1071eb5>] ? handle_mm_fault+0x214/0x710
[  644.292053]  [<c107d008>] ? do_sys_open+0x4d/0xe9
[  644.292061]  [<c1016462>] ? do_page_fault+0x211/0x23f
[  644.292068]  [<c107d0f0>] ? sys_open+0x23/0x2b
[  644.292075]  [<c1002650>] ? sysenter_do_call+0x12/0x26
[  644.292079] Code: 89 f0 89 55 dc e8 8d 96 0a 00 8b 45 e0 8b 55 dc 83 78 04 01 75 28 8b 83 18 02 00 00 85 c0 74 0f 8b 4d ec 3b 81 ac 00 00 00 74 13 <0f> 0b eb fe 8b 4d ec 8b 81 ac 00 00 00 89 83 18 02 00 00 89 f0
[  644.292143] EIP: [<c11c70e3>] drm_open+0x4b1/0x4e2 SS:ESP 0068:f647adfc
[  644.292175] ---[ end trace 2ddd476af89a60fa ]---

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: Fix NULL pointer dereference if memory allocation failed.
Pauli Nieminen [Fri, 19 Mar 2010 07:44:33 +0000 (07:44 +0000)]
drm/radeon/kms: Fix NULL pointer dereference if memory allocation failed.

When there is allocation failure in radeon_cs_parser_relocs parser->nrelocs
is not cleaned. This causes NULL pointer defeference in radeon_cs_parser_fini
when clean up code is trying to loop over the relocation array and free the
objects.

Fix adds a check for a possible NULL pointer in clean up code.

Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: avoid possible oops (call gart_fini before gart_disable)
Jerome Glisse [Wed, 17 Mar 2010 14:44:29 +0000 (14:44 +0000)]
drm/radeon/kms: avoid possible oops (call gart_fini before gart_disable)

radeon_gart_fini might call GART unbind callback function which
might try to access GART table but if gart_disable is call first
the GART table will be unmapped so any access to it will oops.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: don't print error on -ERESTARTSYS.
Dave Airlie [Fri, 19 Mar 2010 00:33:44 +0000 (10:33 +1000)]
drm/radeon/kms: don't print error on -ERESTARTSYS.

We can get this if the user moves the mouse when we are waiting to move
some stuff around in the validate. Don't fail.

Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/atom: make sure tables are valid (v2)
Alex Deucher [Thu, 18 Mar 2010 05:04:01 +0000 (01:04 -0400)]
drm/radeon/kms/atom: make sure tables are valid (v2)

Check that atom cmd and data tables are valid
before using them.

(v2)
- fix some whitespace errors noticed by Rafał Miłecki
- check a few more cases

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: remove lvds quirks
Alex Deucher [Wed, 17 Mar 2010 23:50:59 +0000 (19:50 -0400)]
drm/radeon/kms: remove lvds quirks

- no longer needed with the latest new pll algo fixes.
- also don't use lcd pll limits.  They don't seem
to work well for all systems.  If we have a case where
they are useful, we can set the flag for that case.

fixes fdo bug 27083

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: fix display bandwidth setup on rs4xx
Alex Deucher [Sun, 21 Mar 2010 15:09:24 +0000 (11:09 -0400)]
drm/radeon/kms: fix display bandwidth setup on rs4xx

I missed rs4xx in 7f1e613daf0fdd0884316ab25a749db3c671329e

Fixes fdo bug 27219.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: never treat rs4xx as AGP
Alex Deucher [Sun, 21 Mar 2010 18:02:25 +0000 (14:02 -0400)]
drm/radeon/kms: never treat rs4xx as AGP

RS4xx+ IGP chips use an internal gart, however,
some of them have the agp cap bits set in their pci
configs.  Make sure to clear the AGP flag as AGP will
not work with them.

Should fix fdo bug 27225

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: display watermark fixes
Alex Deucher [Wed, 17 Mar 2010 00:54:38 +0000 (20:54 -0400)]
drm/radeon/kms: display watermark fixes

- rs780/880 were using the wrong bandwidth functions
- convert r1xx-r4xx to use the same pm sclk/mclk structs as
r5xx+
- move bandwidth setup to a common function

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agomodule: add stub for is_module_percpu_address
Randy Dunlap [Wed, 31 Mar 2010 02:33:42 +0000 (11:33 +0900)]
module: add stub for is_module_percpu_address

Fix build for CONFIG_MODULES not enabled by providing a stub
for is_module_percpu_address().

kernel/lockdep.c:605: error: implicit declaration of function 'is_module_percpu_address'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
14 years agoBtrfs: fix chunk allocate size calculation
Josef Bacik [Wed, 17 Mar 2010 20:45:56 +0000 (20:45 +0000)]
Btrfs: fix chunk allocate size calculation

If the amount of free space left in a device is less than what we think should
be the minimum size, just ignore the minimum size and use the amount we have.  I
ran into this running tests on a 600mb volume, the chunk allocator wouldn't let
me allocate the last 52mb of the disk for data because we want to have at least
64mb chunks for data.  This patch fixes that problem.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: kill max_extent mount option
Josef Bacik [Fri, 19 Mar 2010 18:07:23 +0000 (18:07 +0000)]
Btrfs: kill max_extent mount option

As Yan pointed out, theres not much reason for all this complicated math to
account for file extents being split up into max_extent chunks, since they are
likely to all end up in the same leaf anyway.  Since there isn't much reason to
use max_extent, just remove the option altogether so we have one less thing we
need to test.

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: fail to mount if we have problems reading the block groups
Josef Bacik [Fri, 19 Mar 2010 20:49:55 +0000 (20:49 +0000)]
Btrfs: fail to mount if we have problems reading the block groups

We don't actually check the return value of btrfs_read_block_groups, so we can
possibly succeed to mount, but then fail to say read the superblock xattr for
selinux which will cause the vfs code to deactivate the super.

This is a problem because in find_free_extent we just assume that we
will find the right space_info for the allocation we want.  But if we
failed to read the block groups, we won't have setup any space_info's,
and we'll hit a NULL pointer deref in find_free_extent.

This patch fixes that problem by checking the return value of
btrfs_read_block_groups, and failing out properly.  I've also added a
check in find_free_extent so if for some reason we don't find an
appropriate space_info, we just return -ENOSPC.

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: check btrfs_get_extent return for IS_ERR()
Dan Carpenter [Sat, 20 Mar 2010 11:22:10 +0000 (11:22 +0000)]
Btrfs: check btrfs_get_extent return for IS_ERR()

btrfs_get_extent() never returns NULL, only a valid pointer or ERR_PTR()

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: handle kmalloc() failure in inode lookup ioctl
Dan Carpenter [Sat, 20 Mar 2010 11:24:15 +0000 (11:24 +0000)]
Btrfs: handle kmalloc() failure in inode lookup ioctl

Return -ENOMEM if kmalloc() fails.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: dereferencing freed memory
Dan Carpenter [Sat, 20 Mar 2010 11:24:48 +0000 (11:24 +0000)]
Btrfs: dereferencing freed memory

The original code dereferenced range on the next line.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Simplify num_stripes's calculation logical for __btrfs_alloc_chunk()
Zhao Lei [Thu, 25 Mar 2010 12:32:59 +0000 (12:32 +0000)]
Btrfs: Simplify num_stripes's calculation logical for __btrfs_alloc_chunk()

We can use this simple method to make source more readable.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Add error handle for btrfs_search_slot() in btrfs_read_chunk_tree()
Zhao Lei [Thu, 25 Mar 2010 12:34:49 +0000 (12:34 +0000)]
Btrfs: Add error handle for btrfs_search_slot() in btrfs_read_chunk_tree()

We need to check return value of btrfs_search_slot() in
btrfs_read_chunk_tree() and do corresponding error handing.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>