pandora-kernel.git
13 years agodrm/nouveau: Reduce severity of the unknown getparam error.
Francisco Jerez [Tue, 12 Oct 2010 01:17:43 +0000 (03:17 +0200)]
drm/nouveau: Reduce severity of the unknown getparam error.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Acked-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: Avoid lock dependency between ramht and ramin spinlocks.
Francisco Jerez [Mon, 11 Oct 2010 01:37:32 +0000 (03:37 +0200)]
drm/nouveau: Avoid lock dependency between ramht and ramin spinlocks.

The ramht code called some gpuobj functions with the HARDIRQ-safe
RAMHT spinlock held, this could potentially lead to a dead lock
because ramin_lock is HARDIRQ-unsafe.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: Some random cleanups.
Francisco Jerez [Mon, 11 Oct 2010 01:43:58 +0000 (03:43 +0200)]
drm/nouveau: Some random cleanups.

Remove some unused/duplicated definitions and make sparse happy again.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv11: Fix bad PLL detection false positive.
Francisco Jerez [Thu, 7 Oct 2010 01:33:15 +0000 (03:33 +0200)]
drm/nv11: Fix bad PLL detection false positive.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv04-nv40: Fall back to panel rescaling if we have no usable native mode.
Francisco Jerez [Sun, 10 Oct 2010 03:21:59 +0000 (05:21 +0200)]
drm/nv04-nv40: Fall back to panel rescaling if we have no usable native mode.

This allows the user to set a mode larger than the native one, useful
if we had trouble finding the actual native mode (e.g. because it goes
above the hardware bandwidth limits).

Reported-by: Grzesiek Sójka <pld@pfu.pl>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: Reject modes exceeding the integrated TMDS maximum bandwidth.
Francisco Jerez [Sat, 2 Oct 2010 14:00:35 +0000 (16:00 +0200)]
drm/nouveau: Reject modes exceeding the integrated TMDS maximum bandwidth.

Reported-by: Grzesiek Sójka <pld@pfu.pl>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: Fix sleep while atomic in the semaphore code.
Francisco Jerez [Sat, 9 Oct 2010 02:02:09 +0000 (04:02 +0200)]
drm/nouveau: Fix sleep while atomic in the semaphore code.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: ratelimit IRQ messages
Jiri Slaby [Tue, 5 Oct 2010 13:07:33 +0000 (15:07 +0200)]
drm/nouveau: ratelimit IRQ messages

There are two messages in the ISR of nouveau which might be printed out
hundred times in a second. Ratelimit them. (We need to move
nouveau_ratelimit to the top of the file.)

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reviewed-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agopowerpc: Update a BKL related comment
Alessio Igor Bogani [Tue, 16 Nov 2010 07:55:16 +0000 (07:55 +0000)]
powerpc: Update a BKL related comment

The commit 5e3d20a remove bkl from startup code so setup_arch() it isn't called
with bkl held anymore. Update the comment on top of that function.
Fix also a typo.

This work was supported by a hardware donation from the CE Linux Forum.

Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13 years agopowerpc/mm: Fix module instruction tlb fault handling on Book-E 64
Kumar Gala [Wed, 17 Nov 2010 07:20:32 +0000 (07:20 +0000)]
powerpc/mm: Fix module instruction tlb fault handling on Book-E 64

We were seeing oops like the following when we did an rmmod on a module:

Unable to handle kernel paging request for instruction fetch
Faulting instruction address: 0x8000000000008010
Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=2 P5020 DS
last sysfs file: /sys/devices/qman-portals.2/qman-pool.9/uevent
Modules linked in: qman_tester(-)
NIP: 8000000000008010 LR: c000000000074858 CTR: 8000000000008010
REGS: c00000002e29bab0 TRAP: 0400   Not tainted
(2.6.34.6-00744-g2d21f14)
MSR: 0000000080029000 <EE,ME,CE>  CR: 24000448  XER: 00000000
TASK = c00000007a8be600[4987] 'rmmod' THREAD: c00000002e298000 CPU: 1
GPR00: 8000000000008010 c00000002e29bd30 8000000000012798 c00000000035fb28
GPR04: 0000000000000002 0000000000000002 0000000024022428 c000000000009108
GPR08: fffffffffffffffe 800000000000a618 c0000000003c13c8 0000000000000000
GPR12: 0000000022000444 c00000000fffed00 0000000000000000 0000000000000000
GPR16: 00000000100c0000 0000000000000000 00000000100dabc8 0000000010099688
GPR20: 0000000000000000 00000000100cfc28 0000000000000000 0000000010011a44
GPR24: 00000000100017b2 0000000000000000 0000000000000000 0000000000000880
GPR28: c00000000035fb28 800000000000a7b8 c000000000376d80 c0000000003cce50
NIP [8000000000008010] .test_exit+0x0/0x10 [qman_tester]
LR [c000000000074858] .SyS_delete_module+0x1f8/0x2f0
Call Trace:
[c00000002e29bd30] [c0000000000748b4] .SyS_delete_module+0x254/0x2f0 (unreliable)
[c00000002e29be30] [c000000000000580] syscall_exit+0x0/0x2c
Instruction dump:
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
38600000 4e800020 60000000 60000000 <4e80002060000000 60000000 60000000
---[ end trace 4f57124939a84dc8 ]---

This appears to be due to checking the wrong permission bits in the
instruction_tlb_miss handling if the address that faulted was in vmalloc
space.  We need to look at the supervisor execute (_PAGE_BAP_SX) bit and
not the user bit (_PAGE_BAP_UX/_PAGE_EXEC).

Also removed a branch level since it did not appear to be used.

Reported-by: Jeffrey Ladouceur <Jeffrey.Ladouceur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13 years agopowerpc: Fix call to subpage_protection()
Michael Neuling [Wed, 17 Nov 2010 16:32:59 +0000 (16:32 +0000)]
powerpc: Fix call to subpage_protection()

In:
  powerpc/mm: Fix pgtable cache cleanup with CONFIG_PPC_SUBPAGE_PROT
  commit d28513bc7f675d28b479db666d572e078ecf182d
  Author: David Gibson <david@gibson.dropbear.id.au>

subpage_protection() was changed to to take an mm rather a pgdir but it
didn't change calling site in hashpage_preload().  The change wasn't
noticed at compile time since hashpage_preload() used a void* as the
parameter to subpage_protection().

This is obviously wrong and can trigger the following crash when
CONFIG_SLAB, CONFIG_DEBUG_SLAB, CONFIG_PPC_64K_PAGES
CONFIG_PPC_SUBPAGE_PROT are enabled.

Freeing unused kernel memory: 704k freed
Unable to handle kernel paging request for data at address 0x6b6b6b6b6b6c49b7
Faulting instruction address: 0xc0000000000410f4
cpu 0x2: Vector: 300 (Data Access) at [c00000004233f590]
    pc: c0000000000410f4: .hash_preload+0x258/0x338
    lr: c000000000041054: .hash_preload+0x1b8/0x338
    sp: c00000004233f810
   msr: 8000000000009032
   dar: 6b6b6b6b6b6c49b7
 dsisr: 40000000
  current = 0xc00000007e2c0070
  paca    = 0xc000000007fe0500
    pid   = 1, comm = init
enter ? for help
[c00000004233f810c000000000041020 .hash_preload+0x184/0x338 (unreliable)
[c00000004233f8f0c00000000003ed98 .update_mmu_cache+0xb0/0xd0
[c00000004233f990c000000000157754 .__do_fault+0x48c/0x5dc
[c00000004233faa0c000000000158fd0 .handle_mm_fault+0x508/0xa8c
[c00000004233fb90c0000000006acdd4 .do_page_fault+0x428/0x6ac
[c00000004233fe30c000000000005260 handle_page_fault+0x20/0x74

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13 years agopowerpc: Set CONFIG_32BIT on ppc32
kerstin jonsson [Fri, 22 Oct 2010 00:17:55 +0000 (00:17 +0000)]
powerpc: Set CONFIG_32BIT on ppc32

commit ffe8018c3424892c9590048fc36caa6c3e0c8a76 of the -mm tree
fixes the initramfs size calculation for e.g. s390 but breaks it
for 32bit architectures which do not define CONFIG_32BIT.

This patch fix the problem for PPC32 which will elsewise end up
with a __initramfs_size of 0.

Signed-off-by: Kerstin Jonsson <kerstin.jonsson@ericsson.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13 years agopowerpc/mm: Fix build error in setup_initial_memory_limit
Kumar Gala [Wed, 10 Nov 2010 12:29:49 +0000 (12:29 +0000)]
powerpc/mm: Fix build error in setup_initial_memory_limit

arch/powerpc/mm/tlb_nohash.c: In function 'setup_initial_memory_limit':
arch/powerpc/mm/tlb_nohash.c:588:29: error: 'ppc64_memblock_base' undeclared (first use in this function)
arch/powerpc/mm/tlb_nohash.c:588:29: note: each undeclared identifier is reported only once for each function it appears in

Due to a copy/paste typo with the following commit:

commit cd3db0c4ca3d237e7ad20f7107216e575705d2b0
Author: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date:   Tue Jul 6 15:39:02 2010 -0700

    memblock: Remove rmo_size, burry it in arch/powerpc where it belongs

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13 years agopowerpc/pseries: Don't override CONFIG_PPC_PSERIES_DEBUG
Nishanth Aravamudan [Thu, 14 Oct 2010 14:48:52 +0000 (14:48 +0000)]
powerpc/pseries: Don't override CONFIG_PPC_PSERIES_DEBUG

EEH and pci_dlpar #undef DEBUG, but I think they were added before the
ability to control this from Kconfig. It's really annoying to only get
some of the debug messages from these files. Leave the lpar.c #undef
alone as it produces so much output as to make the kernel unusable.
Update the Kconfig text to indicate this particular quirk :)

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Acked-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13 years agopowerpc: Fix div64 in bootloader
Benjamin Herrenschmidt [Thu, 18 Nov 2010 03:39:24 +0000 (14:39 +1100)]
powerpc: Fix div64 in bootloader

The code is missing a fix that went into the main kernel variant
(we should try to share that code again at some stage)

Reported-by: Albert Cahalan <acahalan@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13 years agojbd2: fix /proc/fs/jbd2/<dev> when using an external journal
yangsheng [Thu, 18 Nov 2010 02:46:26 +0000 (21:46 -0500)]
jbd2: fix /proc/fs/jbd2/<dev> when using an external journal

In jbd2_journal_init_dev(), we need make sure the journal structure is
fully initialzied before calling jbd2_stats_proc_init().

Reviewed-by: Andreas Dilger <andreas.dilger@oracle.com>
Signed-off-by: yangsheng <sheng.yang@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 years agoext4: missing unlock in ext4_clear_request_list()
Dan Carpenter [Thu, 18 Nov 2010 02:46:25 +0000 (21:46 -0500)]
ext4: missing unlock in ext4_clear_request_list()

If the the li_request_list was empty then it returned with the lock
held.  Instead of adding a "goto unlock" I just removed that special
case and let it go past the empty list_for_each_safe().

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 years agoext4: fix setting random pages PageUptodate
Markus Trippelsdorf [Thu, 18 Nov 2010 02:46:06 +0000 (21:46 -0500)]
ext4: fix setting random pages PageUptodate

ext4_end_bio calls put_page and kmem_cache_free before calling
SetPageUpdate(). This can result in setting the PageUptodate bit on
random pages and causes the following BUG:

 BUG: Bad page state in process rm  pfn:52e54
 page:ffffea0001222260 count:0 mapcount:0 mapping:          (null) index:0x0
 arch kernel: page flags: 0x4000000000000008(uptodate)

Fix the problem by moving put_io_page() after the SetPageUpdate() call.

Thanks to Hugh Dickins for analyzing this problem.

Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 years agohardirq.h: remove now-empty #ifdef/#endif pair
Linus Torvalds [Thu, 18 Nov 2010 02:36:25 +0000 (18:36 -0800)]
hardirq.h: remove now-empty #ifdef/#endif pair

Commit 451a3c24b013 ("BKL: remove extraneous #include <smp_lock.h>")
removed the #include line that was the only thing that was surrounded by
the #ifdef/#endif.

So now that #ifdef is guarding nothing at all. Just remove it.

Reported-by: Byeong-ryeol Kim <brofkims@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoFix build failure due to hwirq.h needing smp_lock.h
Linus Torvalds [Wed, 17 Nov 2010 22:58:36 +0000 (14:58 -0800)]
Fix build failure due to hwirq.h needing smp_lock.h

Arnd Bergmann did an automated scripting run to find left-over instances
of <linux/smp_lock.h>, and had made it trigger it on the normal BKL use
of lock_kernel and unlock_lernel (and apparently release_kernel_lock and
reacquire_kernel_lock too, used by the scheduler).

That resulted in commit 451a3c24b013 ("BKL: remove extraneous #include
<smp_lock.h>").

However, hardirq.h was the only remaining user of the old
'kernel_locked()' interface, and Arnd's script hadn't checked for that.
So depending on your configuration and what header files had been
included, you would get errors like "implicit declaration of function
'kernel_locked'" during the build.

The right fix is not to just re-instate the smp_lock.h include - it is
to just remove 'kernel_locked()' entirely, since the only use was this
one special low-level detail.  Just make hardirq.h do it directly.

In fact this simplifies and clarifies the code, because some trivial
analysis makes it clear that hardirq.h only ever used _one_ of the two
definitions of kernel_locked(), so we can remove the other one entirely.

Reported-by: Zimny Lech <napohybelskurwysynom2010@gmail.com>
Reported-and-acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoKVM: VMX: Fix host userspace gsbase corruption
Avi Kivity [Thu, 11 Nov 2010 10:37:26 +0000 (12:37 +0200)]
KVM: VMX: Fix host userspace gsbase corruption

We now use load_gs_index() to load gs safely; unfortunately this also
changes MSR_KERNEL_GS_BASE, which we managed separately.  This resulted
in confusion and breakage running 32-bit host userspace on a 64-bit kernel.

Fix by
- saving guest MSR_KERNEL_GS_BASE before we we reload the host's gs
- doing the host save/load unconditionally, instead of only when in guest
  long mode

Things can be cleaned up further, but this is the minmal fix for now.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agoKVM: Correct ordering of ldt reload wrt fs/gs reload
Avi Kivity [Tue, 19 Oct 2010 16:48:35 +0000 (18:48 +0200)]
KVM: Correct ordering of ldt reload wrt fs/gs reload

If fs or gs refer to the ldt, they must be reloaded after the ldt.  Reorder
the code to that effect.

Userspace code that uses the ldt with kvm is nonexistent, so this doesn't fix
a user-visible bug.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agogianfar: fix signedness issue
Nicolas Kaiser [Mon, 15 Nov 2010 10:59:42 +0000 (10:59 +0000)]
gianfar: fix signedness issue

irq_of_parse_and_map() has an unsigned return type.
Testing for a negative error value doesn't work here.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: bnx2x: fix error value sign
Vasiliy Kulikov [Sun, 14 Nov 2010 10:08:34 +0000 (10:08 +0000)]
net: bnx2x: fix error value sign

bnx2x_init_one() should return negative value on error.
By mistake it returns ENODEV instead of -ENODEV.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years ago8139cp: fix checksum broken
Shan Wei [Wed, 17 Nov 2010 19:55:08 +0000 (11:55 -0800)]
8139cp: fix checksum broken

I am not family with RealTek RTL-8139C+ series 10/100 PCI Ethernet driver.
I try to guess the meaning of RxProtoIP and IPFail.
RxProtoIP stands for received IPv4 packet that upper protocol is not tcp and udp.
!(status & IPFail) is true means that driver correctly to check checksum in IPv4 header.

If these are right, driver will set ip_summed with CHECKSUM_UNNECESSARY for other
upper protocol, e.g. sctp, igmp protocol. This will cause protocol stack ignores
checksum check for packets with invalid checksum.

This patch is only compile-test.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agor8169: fix checksum broken
Shan Wei [Fri, 12 Nov 2010 00:15:25 +0000 (00:15 +0000)]
r8169: fix checksum broken

If r8196 received packets with invalid sctp/igmp(not tcp, udp) checksum, r8196 set skb->ip_summed
wit CHECKSUM_UNNECESSARY. This cause that upper protocol don't check checksum field.

I am not family with r8196 driver. I try to guess the meaning of RxProtoIP and IPFail.
RxProtoIP stands for received IPv4 packet that upper protocol is not tcp and udp.
!(opts1 & IPFail) is true means that driver correctly to check checksum in IPv4 header.

If it's right, I think we should not set ip_summed wit CHECKSUM_UNNECESSARY for my sctp packets
with invalid checksum.

If it's not right, please tell me.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agords: Integer overflow in RDS cmsg handling
Dan Rosenberg [Wed, 17 Nov 2010 06:37:16 +0000 (06:37 +0000)]
rds: Integer overflow in RDS cmsg handling

In rds_cmsg_rdma_args(), the user-provided args->nr_local value is
restricted to less than UINT_MAX.  This seems to need a tighter upper
bound, since the calculation of total iov_size can overflow, resulting
in a small sock_kmalloc() allocation.  This would probably just result
in walking off the heap and crashing when calling rds_rdma_pages() with
a high count value.  If it somehow doesn't crash here, then memory
corruption could occur soon after.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agokgdb,ppc: Fix regression in evr register handling
Dongdong Deng [Tue, 16 Nov 2010 22:02:00 +0000 (16:02 -0600)]
kgdb,ppc: Fix regression in evr register handling

Commit ff10b88b5a05c8f1646dd15fb9f6093c1384ff6d (kgdb,ppc: Individual
register get/set for ppc) introduced a problem where memcpy was used
incorrectly to read and write the evr registers with a kernel that
has:

CONFIG_FSL_BOOKE=y
CONFIG_SPE=y
CONFIG_KGDB=y

This patch also fixes the following compilation problems:

arch/powerpc/kernel/kgdb.c: In function 'dbg_get_reg':
arch/powerpc/kernel/kgdb.c:341: error: passing argument 2 of 'memcpy' makes pointer from integer without a cast
arch/powerpc/kernel/kgdb.c: In function 'dbg_set_reg':
arch/powerpc/kernel/kgdb.c:366: error: passing argument 1 of 'memcpy' makes pointer from integer without a cast

[jason.wessel@windriver.com: Remove void * casts and fix patch header]
Reported-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
CC: linuxppc-dev@lists.ozlabs.org
13 years agokgdb,x86: fix regression in detach handling
Jason Wessel [Mon, 15 Nov 2010 14:07:35 +0000 (08:07 -0600)]
kgdb,x86: fix regression in detach handling

The fix from ba773f7c510c0b252145933926c636c439889207
(x86,kgdb: Fix hw breakpoint regression) was not entirely complete.

The kgdb_remove_all_hw_break() function also needs to call the
hw_break_release_slot() or else a breakpoint can get activated again
after the debugger has detached.

The kgdb test suite exposes the behavior in the form of either a hang
or repetitive failure.  The kernel config that exposes the problem
contains all of the following:

CONFIG_DEBUG_RODATA=y
CONFIG_KGDB_TESTS=y
CONFIG_KGDB_TESTS_ON_BOOT=y
CONFIG_KGDB_TESTS_BOOT_STRING="V1F100"

Reported-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Tested-by: Frederic Weisbecker <fweisbec@gmail.com>
13 years agokdb: fix crash when KDB_BASE_CMD_MAX is exceeded
Jovi Zhang [Wed, 10 Nov 2010 13:22:18 +0000 (07:22 -0600)]
kdb: fix crash when KDB_BASE_CMD_MAX is exceeded

When the number of dyanmic kdb commands exceeds KDB_BASE_CMD_MAX, the
kernel will fault.

Signed-off-by: Jovi Zhang <bookjovi@gmail.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
13 years agokdb: fix memory leak in kdb_main.c
Jovi Zhang [Wed, 10 Nov 2010 13:22:18 +0000 (07:22 -0600)]
kdb: fix memory leak in kdb_main.c

Call kfree in the error path as well as the success path in kdb_ll().

Signed-off-by: Jovi Zhang <bookjovi@gmail.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
13 years ago[libata] remove SCSI host lock and serial number usage from ata_scsi_queuecmd
Jeff Garzik [Wed, 17 Nov 2010 17:03:58 +0000 (12:03 -0500)]
[libata] remove SCSI host lock and serial number usage from ata_scsi_queuecmd

cmd->serial_number is never tested in any path we reach; therefore we may
remove the call to scsi_cmd_get_serial() inside DEF_SCSI_QCMD, the SCSI
host_lock acquisition surrounding it, and our own SCSI host_lock
unlock+relock cycle.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
13 years agoBKL: remove references to lock_kernel from comments
Arnd Bergmann [Wed, 17 Nov 2010 15:26:56 +0000 (16:26 +0100)]
BKL: remove references to lock_kernel from comments

Lock_kernel is gone from the code, so the comments should be updated,
too.  nfsd now uses lock_flocks instead of lock_kernel to protect
against posix file locks.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: J. Bruce Fields <bfields@redhat.com>
Cc: linux-nfs@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoBKL: remove extraneous #include <smp_lock.h>
Arnd Bergmann [Wed, 17 Nov 2010 15:26:55 +0000 (16:26 +0100)]
BKL: remove extraneous #include <smp_lock.h>

The big kernel lock has been removed from all these files at some point,
leaving only the #include.

Remove this too as a cleanup.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agostaging/stradis: mark as "depends on BKL"
Arnd Bergmann [Wed, 17 Nov 2010 15:26:53 +0000 (16:26 +0100)]
staging/stradis: mark as "depends on BKL"

The stradis driver is on its way out, but it should still be marked
correctly as depending on the big kernel lock.  It could easily be
changed to not require it if someone decides to revive the driver and
port it to v4l2 in the process.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: Sedat Dilek <sedat.dilek@googlemail.com>
Cc: Nathan Laredo <laredo@gnu.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoARM: mx25: dynamically allocatate imx-fb devices
Uwe Kleine-König [Thu, 11 Nov 2010 14:32:21 +0000 (15:32 +0100)]
ARM: mx25: dynamically allocatate imx-fb devices

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: mx25: dynamically allocate imxdi_rtc devices
Uwe Kleine-König [Thu, 11 Nov 2010 10:57:21 +0000 (11:57 +0100)]
ARM: mx25: dynamically allocate imxdi_rtc devices

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: mx25: dynamically allocate imx-keypad devices
Uwe Kleine-König [Thu, 11 Nov 2010 10:35:33 +0000 (11:35 +0100)]
ARM: mx25: dynamically allocate imx-keypad devices

The mxc-keypad device seems to be the result of an early and partial
merge of the keypad driver.  It's unused and there is no corresponding
driver available, so just remove it.

Cc: Alberto Panizzo <maramaopercheseimorto@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: mx25: move registration of gpios to plat-mxc/gpio.c
Uwe Kleine-König [Thu, 11 Nov 2010 09:52:33 +0000 (10:52 +0100)]
ARM: mx25: move registration of gpios to plat-mxc/gpio.c

To use common macros to define the gpio ports for imx{1,21,25,27} the
existing ones had to made more general and a few more base address defines
were necessary.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: mx25: dynamically allocate mxc_pwm devices
Uwe Kleine-König [Wed, 10 Nov 2010 21:15:45 +0000 (22:15 +0100)]
ARM: mx25: dynamically allocate mxc_pwm devices

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: mx25: dynamically allocate fsl-usb2-udc devices
Uwe Kleine-König [Wed, 10 Nov 2010 20:50:07 +0000 (21:50 +0100)]
ARM: mx25: dynamically allocate fsl-usb2-udc devices

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: mx25: dynamically allocate mxc-ehci devices
Uwe Kleine-König [Wed, 10 Nov 2010 20:27:55 +0000 (21:27 +0100)]
ARM: mx25: dynamically allocate mxc-ehci devices

According to the reference manual of the i.MX25 the host controller uses an
offset of 0x200 not 0x400 as was specified in the resources for mxc_usbh2.

Needs-Testing: yes
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: move registration of gpios to plat-mxc/gpio.c
Uwe Kleine-König [Wed, 10 Nov 2010 09:51:38 +0000 (10:51 +0100)]
ARM: imx: move registration of gpios to plat-mxc/gpio.c

This finally gets rid of mach-imx/devices.c.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: remove now empty devices.h
Uwe Kleine-König [Wed, 10 Nov 2010 09:22:02 +0000 (10:22 +0100)]
ARM: imx: remove now empty devices.h

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: dynamically allocate imx21-hcd devices
Uwe Kleine-König [Wed, 10 Nov 2010 09:11:23 +0000 (10:11 +0100)]
ARM: imx: dynamically allocate imx21-hcd devices

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: dynamically allocate imx-keypad devices
Uwe Kleine-König [Wed, 10 Nov 2010 08:58:56 +0000 (09:58 +0100)]
ARM: imx: dynamically allocate imx-keypad devices

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: dynamically allocate fsl-usb2-udc devices
Uwe Kleine-König [Tue, 9 Nov 2010 16:52:14 +0000 (17:52 +0100)]
ARM: imx: dynamically allocate fsl-usb2-udc devices

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: dynamically allocate mxc-ehci devices
Uwe Kleine-König [Fri, 5 Nov 2010 17:52:09 +0000 (18:52 +0100)]
ARM: imx: dynamically allocate mxc-ehci devices

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: dynamically register mxc-mmc devices
Uwe Kleine-König [Fri, 5 Nov 2010 16:26:09 +0000 (17:26 +0100)]
ARM: imx: dynamically register mxc-mmc devices

... plus a trivial simplification of mx21ads_sdhc_init()

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: mx3/mach-pcm037_eet: Fix section mismatch for eet_init_devices()
Alberto Panizzo [Mon, 1 Nov 2010 17:00:03 +0000 (18:00 +0100)]
ARM: mx3/mach-pcm037_eet: Fix section mismatch for eet_init_devices()

This function should be marked as __init because it is used only
in the init phase.

This fix the compiler warning:
 LD      arch/arm/mach-mx3/built-in.o
 WARNING: arch/arm/mach-mx3/built-in.o(.text+0x1328): Section mismatch in reference from the function eet_init_devices() to the (unknown reference) .init.rodata:(unknown)
 The function eet_init_devices() references
 the (unknown reference) __initconst (unknown).
 This is often because eet_init_devices lacks a __initconst
 annotation or the annotation of (unknown) is wrong.

Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: dynamically allocate mxc_pwm devices
Uwe Kleine-König [Fri, 5 Nov 2010 14:01:16 +0000 (15:01 +0100)]
ARM: imx: dynamically allocate mxc_pwm devices

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: mx3: enable SPI_IMX for better compile coverage
Uwe Kleine-König [Fri, 5 Nov 2010 10:22:37 +0000 (11:22 +0100)]
ARM: mx3: enable SPI_IMX for better compile coverage

SPI_IMX defaults to m for i.MX machines.  So enabling SPI is enough.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: dynamically register imx-fb devices
Uwe Kleine-König [Thu, 4 Nov 2010 16:07:48 +0000 (17:07 +0100)]
ARM: imx: dynamically register imx-fb devices

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: change the way flexcan devices are registered
Uwe Kleine-König [Thu, 4 Nov 2010 11:02:35 +0000 (12:02 +0100)]
ARM: imx: change the way flexcan devices are registered

Group soc specific data in a global struct instead of repeating it for each
call to imxXX_add_flexcanX.  The structs holding the actual data are placed
in .init.constdata and so don't do much harm.  Compared to the previous
approach this reduces code size to call imx_add_flexcan.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: dynamically allocate imx2-wdt devices
Uwe Kleine-König [Thu, 4 Nov 2010 09:09:10 +0000 (10:09 +0100)]
ARM: imx: dynamically allocate imx2-wdt devices

Currently there is no platform data used in the driver.  In case this
changes and for consistency NULL is passed unused to the soc specific
functions.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: dynamically allocate mx2-camera device
Uwe Kleine-König [Tue, 2 Nov 2010 16:50:55 +0000 (17:50 +0100)]
ARM: imx: dynamically allocate mx2-camera device

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx/gpio: remove some useless casts
Uwe Kleine-König [Tue, 2 Nov 2010 15:42:27 +0000 (16:42 +0100)]
ARM: imx/gpio: remove some useless casts

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: dynamically allocate mx1-camera device
Uwe Kleine-König [Tue, 2 Nov 2010 10:59:08 +0000 (11:59 +0100)]
ARM: imx: dynamically allocate mx1-camera device

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: allow specifying a dma mask when creating a platform device
Uwe Kleine-König [Tue, 2 Nov 2010 10:56:54 +0000 (11:56 +0100)]
ARM: imx: allow specifying a dma mask when creating a platform device

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: dynamically allocate imx_udc device
Uwe Kleine-König [Tue, 2 Nov 2010 09:03:51 +0000 (10:03 +0100)]
ARM: imx: dynamically allocate imx_udc device

This is only available for mx1 machines with no in-tree user.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: remove unused devices
Uwe Kleine-König [Fri, 29 Oct 2010 09:50:36 +0000 (11:50 +0200)]
ARM: imx: remove unused devices

all these don't have a driver and are not added in any machine file.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: dynamically allocate mxc_w1 devices
Uwe Kleine-König [Fri, 29 Oct 2010 08:56:07 +0000 (10:56 +0200)]
ARM: imx: dynamically allocate mxc_w1 devices

Currently there is no platform data used in the driver.  In case this
changes NULL is passed unused to the soc specific functions.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: remove deprecated symbols as all users are gone now
Uwe Kleine-König [Fri, 22 Oct 2010 07:20:52 +0000 (09:20 +0200)]
ARM: imx: remove deprecated symbols as all users are gone now

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx/debug-macro: rework using the new io mapping macro
Uwe Kleine-König [Tue, 26 Oct 2010 07:42:54 +0000 (09:42 +0200)]
ARM: imx/debug-macro: rework using the new io mapping macro

This gets rid of the last user of IMX_NEEDS_DEPRECATED_SYMBOLS.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: change static io mapping to use a function
Uwe Kleine-König [Mon, 25 Oct 2010 13:44:25 +0000 (15:44 +0200)]
ARM: imx: change static io mapping to use a function

Now only the virtual addresses [0xf4000000, 0xf5ffffff] are used for
static per-SoC mappings.  The few mappings of whole chip selects are
moved accordingly.

The now wrong defines for virtual base addresses are removed.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: remove last explicit users of virtual base address defines
Uwe Kleine-König [Mon, 25 Oct 2010 13:54:58 +0000 (15:54 +0200)]
ARM: imx: remove last explicit users of virtual base address defines

This allows changing the mapping without the need to adapt all users.

While at it remove some unneeded casts to void __iomem *, this is already
taken care for in the IO_ADDRESS macros

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: use MXxy_IO_P2V macros to setup static mappings
Uwe Kleine-König [Mon, 25 Oct 2010 13:38:09 +0000 (15:38 +0200)]
ARM: imx: use MXxy_IO_P2V macros to setup static mappings

This makes less code rely on the virtual constants.

To further simplify code and reduce the needed boilerplate when
defining the static mappings a new helper macro is defined in
mach/hardware.h.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: imx: refactor the io mapping macro
Uwe Kleine-König [Mon, 25 Oct 2010 09:40:30 +0000 (11:40 +0200)]
ARM: imx: refactor the io mapping macro

This makes it more assembler friendly and allows it to be used in situation
that need an unsigned long and not a pointer.  Also the naming is
clearer.  IOMEM is introduced without IMX_ prefix as it is used this way
in more than one ARM subarch and it might become globally available
soon.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agoARM: mx3: fix the last users of IMX_NEEDS_DEPRECATED_SYMBOLS
Uwe Kleine-König [Fri, 22 Oct 2010 12:49:45 +0000 (14:49 +0200)]
ARM: mx3: fix the last users of IMX_NEEDS_DEPRECATED_SYMBOLS

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
13 years agokernel: make /proc/kallsyms mode 400 to reduce ease of attacking
Marcus Meissner [Tue, 16 Nov 2010 10:46:03 +0000 (11:46 +0100)]
kernel: make /proc/kallsyms mode 400 to reduce ease of attacking

Making /proc/kallsyms readable only for root by default makes it
slightly harder for attackers to write generic kernel exploits by
removing one source of knowledge where things are in the kernel.

This is the second submit, discussion happened on this on first submit
and mostly concerned that this is just one hole of the sieve ...  but
one of the bigger ones.

Changing the permissions of at least System.map and vmlinux is also
required to fix the same set, but a packaging issue.

Target of this starter patch and follow ups is removing any kind of
kernel space address information leak from the kernel.

[ Side note: the default of root-only reading is the "safe" value, and
  it's easy enough to then override at any time after boot.  The /proc
  filesystem allows root to change the permissions with a regular
  chmod, so you can "revert" this at run-time by simply doing

    chmod og+r /proc/kallsyms

  as root if you really want regular users to see the kernel symbols.
  It does help some tools like "perf" figure them out without any
  setup, so it may well make sense in some situations.  - Linus ]

Signed-off-by: Marcus Meissner <meissner@suse.de>
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Eugene Teo <eugeneteo@kernel.org>
Reviewed-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMerge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
Linus Torvalds [Wed, 17 Nov 2010 02:46:28 +0000 (18:46 -0800)]
Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6

* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
  nfs: Ignore kmemleak false positive in nfs_readdir_make_qstr
  SUNRPC: Simplify rpc_alloc_iostats by removing pointless local variable
  nfs: trivial: remove unused nfs_wait_event macro
  NFS: readdir shouldn't read beyond the reply returned by the server
  NFS: Fix a couple of regressions in readdir.
  Revert "NFSv4: Fall back to ordinary lookup if nfs4_atomic_open() returns EISDIR"
  Regression: fix mounting NFS when NFSv3 support is not compiled
  NLM: Fix a regression in lockd

13 years agoMerge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 16 Nov 2010 23:20:05 +0000 (15:20 -0800)]
Merge branch 'sched-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  sched: Fix cross-sched-class wakeup preemption
  sched: Fix runnable condition for stoptask
  sched: Use group weight, idle cpu metrics to fix imbalances during idle

13 years agoMerge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspe...
Linus Torvalds [Tue, 16 Nov 2010 23:18:17 +0000 (15:18 -0800)]
Merge branch 'pm-fixes' of git://git./linux/kernel/git/rafael/suspend-2.6

* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
  PM / PM QoS: Fix reversed min and max
  PM / OPP: Hide OPP configuration when SoCs do not provide an implementation
  PM: Allow devices to be removed during late suspend and early resume

13 years agoMerge branch 'futexes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 16 Nov 2010 22:31:03 +0000 (14:31 -0800)]
Merge branch 'futexes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'futexes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  futex: Address compiler warnings in exit_robust_list

13 years agoSCSI host lock push-down
Jeff Garzik [Tue, 16 Nov 2010 07:10:29 +0000 (02:10 -0500)]
SCSI host lock push-down

Move the mid-layer's ->queuecommand() invocation from being locked
with the host lock to being unlocked to facilitate speeding up the
critical path for drivers who don't need this lock taken anyway.

The patch below presents a simple SCSI host lock push-down as an
equivalent transformation.  No locking or other behavior should change
with this patch.  All existing bugs and locking orders are preserved.

Additionally, add one parameter to queuecommand,
struct Scsi_Host *
and remove one parameter from queuecommand,
void (*done)(struct scsi_cmnd *)

Scsi_Host* is a convenient pointer that most host drivers need anyway,
and 'done' is redundant to struct scsi_cmnd->scsi_done.

Minimal code disturbance was attempted with this change.  Most drivers
needed only two one-line modifications for their host lock push-down.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocfg80211: fix extension channel checks to initiate communication
Luis R. Rodriguez [Sat, 13 Nov 2010 00:31:23 +0000 (16:31 -0800)]
cfg80211: fix extension channel checks to initiate communication

When operating in a mode that initiates communication and using
HT40 we should fail if we cannot use both primary and secondary
channels to initiate communication. Our current ht40 allowmap
only covers STA mode of operation, for beaconing modes we need
a check on the fly as the mode of operation is dynamic and
there other flags other than disable which we should read
to check if we can initiate communication.

Do not allow for initiating communication if our secondary HT40
channel has is either disabled, has a passive scan flag, a
no-ibss flag or is a radar channel. Userspace now has similar
checks but this is also needed in-kernel.

Reported-by: Jouni Malinen <jouni.malinen@atheros.com>
Cc: stable@kernel.org
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Set proper eeprom offset for AR9287 HTC devices
Rajkumar Manoharan [Wed, 10 Nov 2010 12:21:26 +0000 (17:51 +0530)]
ath9k_hw: Set proper eeprom offset for AR9287 HTC devices

AR9287 based PCI & USB devices are differed in eeprom start offset.
So set proper the offset for HTC devices to read nvram correctly.

Cc: stable@kernel.org
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Add new devices into AR7010
Rajkumar Manoharan [Wed, 10 Nov 2010 12:21:25 +0000 (17:51 +0530)]
ath9k_htc: Add new devices into AR7010

Treat new PIDs (0xA704, 0x1200) as AR7010 devices.

Cc: stable@kernel.org
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Update usb device ID list
Rajkumar Manoharan [Wed, 10 Nov 2010 12:21:24 +0000 (17:51 +0530)]
ath9k_htc: Update usb device ID list

Added new VID/PIDs into supported devices list

Cc: stable@kernel.org
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Remove pm_qos request after hw unregister.
Vivek Natarajan [Wed, 10 Nov 2010 09:41:07 +0000 (15:11 +0530)]
ath9k: Remove pm_qos request after hw unregister.

Update pm_qos before removing it in deinit_device to prevent this
warning:

pm_qos_update_request() called for unknown object.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoxfrm: update flowi saddr in icmp_send if unset
Ulrich Weber [Fri, 5 Nov 2010 01:39:12 +0000 (01:39 +0000)]
xfrm: update flowi saddr in icmp_send if unset

otherwise xfrm_lookup will fail to find correct policy

Signed-off-by: Ulrich Weber <uweber@astaro.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
Linus Torvalds [Tue, 16 Nov 2010 18:51:56 +0000 (10:51 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jbarnes/pci-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  PCI: fix offset check for sysfs mmapped files

13 years agoirda: irttp: allow zero byte packets
Wolfram Sang [Tue, 16 Nov 2010 17:50:47 +0000 (09:50 -0800)]
irda: irttp: allow zero byte packets

Sending zero byte packets is not neccessarily an error (AF_INET accepts it,
too), so just apply a shortcut. This was discovered because of a non-working
software with WINE. See

  http://bugs.winehq.org/show_bug.cgi?id=19397#c86
  http://thread.gmane.org/gmane.linux.irda.general/1643

for very detailed debugging information and a testcase. Kudos to Wolfgang for
those!

Reported-by: Wolfgang Schwotzer <wolfgang.schwotzer@gmx.net>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Tested-by: Mike Evans <mike.evans@cardolan.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
Linus Torvalds [Tue, 16 Nov 2010 17:27:13 +0000 (09:27 -0800)]
Merge branch 'for-linus' of git://git390.marist.edu/linux-2.6

* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6:
  [S390] kprobes: Fix the return address of multiple kretprobes
  [S390] kprobes: disable interrupts throughout
  [S390] ftrace: build without frame pointers on s390
  [S390] mm: add devmem_is_allowed() for STRICT_DEVMEM checking
  [S390] vmlogrdr: purge after recording is switched off
  [S390] cio: fix incorrect ccw_device_init_count
  [S390] tape: add medium state notifications
  [S390] fix get_user_pages_fast

13 years agoPCI: fix offset check for sysfs mmapped files
Darrick J. Wong [Tue, 16 Nov 2010 17:13:41 +0000 (09:13 -0800)]
PCI: fix offset check for sysfs mmapped files

I just loaded 2.6.37-rc2 on my machines, and I noticed that X no longer starts.
Running an strace of the X server shows that it's doing this:

open("/sys/bus/pci/devices/0000:07:00.0/resource0", O_RDWR) = 10
mmap(NULL, 16777216, PROT_READ|PROT_WRITE, MAP_SHARED, 10, 0) = -1 EINVAL (Invalid argument)

This code seems to be asking for a shared read/write mapping of 16MB worth of
BAR0 starting at file offset 0, and letting the kernel assign a starting
address.  Unfortunately, this -EINVAL causes X not to start.  Looking into
dmesg, there's a complaint like so:

process "Xorg" tried to map 0x01000000 bytes at page 0x00000000 on 0000:07:00.0 BAR 0 (start 0x        96000000, size 0x         1000000)

...with the following code in pci_mmap_fits:

pci_start = (mmap_api == PCI_MMAP_SYSFS) ?
pci_resource_start(pdev, resno) >> PAGE_SHIFT : 0;
        if (start >= pci_start && start < pci_start + size &&
                        start + nr <= pci_start + size)

It looks like the logic here is set up such that when the mmap call comes via
sysfs, the check in pci_mmap_fits wants vma->vm_pgoff to be between the
resource's start and end address, and the end of the vma to be no farther than
the end.  However, the sysfs PCI resource files always start at offset zero,
which means that this test always fails for programs that mmap the sysfs files.
Given the comment in the original commit
3b519e4ea618b6943a82931630872907f9ac2c2b, I _think_ the old procfs files
require that the file offset be equal to the resource's base address when
mmapping.

I think what we want here is for pci_start to be 0 when mmap_api ==
PCI_MMAP_PROCFS.  The following patch makes that change, after which the Matrox
and Mach64 X drivers work again.

Acked-by: Martin Wilck <martin.wilck@ts.fujitsu.com>
Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
13 years agonfs: Ignore kmemleak false positive in nfs_readdir_make_qstr
Catalin Marinas [Thu, 11 Nov 2010 12:53:47 +0000 (12:53 +0000)]
nfs: Ignore kmemleak false positive in nfs_readdir_make_qstr

Strings allocated via kmemdup() in nfs_readdir_make_qstr() are
referenced from the nfs_cache_array which is stored in a page cache
page. Kmemleak does not scan such pages and it reports several false
positives. This patch annotates the string->name pointer so that
kmemleak does not consider it a real leak.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Bryan Schumaker <bjschuma@netapp.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoSUNRPC: Simplify rpc_alloc_iostats by removing pointless local variable
Jesper Juhl [Sun, 7 Nov 2010 21:11:34 +0000 (22:11 +0100)]
SUNRPC: Simplify rpc_alloc_iostats by removing pointless local variable

Hi,

We can simplify net/sunrpc/stats.c::rpc_alloc_iostats() a bit by getting
rid of the unneeded local variable 'new'.

Please CC me on replies.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agonfs: trivial: remove unused nfs_wait_event macro
Jeff Layton [Fri, 12 Nov 2010 14:23:04 +0000 (09:23 -0500)]
nfs: trivial: remove unused nfs_wait_event macro

Nothing uses this macro anymore.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agokernel/sysctl.c: Fix build failure with !CONFIG_PRINTK
Joe Perches [Tue, 16 Nov 2010 05:17:27 +0000 (21:17 -0800)]
kernel/sysctl.c: Fix build failure with !CONFIG_PRINTK

Sigh...

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoInput: aiptek - tighten up permissions on sysfs attributes
Dmitry Torokhov [Mon, 15 Nov 2010 21:33:25 +0000 (13:33 -0800)]
Input: aiptek - tighten up permissions on sysfs attributes

Sysfs attributes affecting device behavior should not be, by default,
world-writeable. If distributions want to allow console users access
these attributes they need to employ udev and friends to adjust
permissions as needed.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
13 years agoLinux 2.6.37-rc2 v2.6.37-rc2
Linus Torvalds [Tue, 16 Nov 2010 02:31:02 +0000 (18:31 -0800)]
Linux 2.6.37-rc2

13 years agoNFS: readdir shouldn't read beyond the reply returned by the server
Trond Myklebust [Tue, 16 Nov 2010 01:26:22 +0000 (20:26 -0500)]
NFS: readdir shouldn't read beyond the reply returned by the server

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNFS: Fix a couple of regressions in readdir.
Trond Myklebust [Tue, 16 Nov 2010 01:26:22 +0000 (20:26 -0500)]
NFS: Fix a couple of regressions in readdir.

Fix up the issue that array->eof_index needs to be able to be set
even if array->size == 0.

Ensure that we catch all important memory allocation error conditions
and/or kmap() failures.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoRevert "NFSv4: Fall back to ordinary lookup if nfs4_atomic_open() returns EISDIR"
Trond Myklebust [Wed, 3 Nov 2010 14:24:16 +0000 (10:24 -0400)]
Revert "NFSv4: Fall back to ordinary lookup if nfs4_atomic_open() returns EISDIR"

This reverts commit 80e60639f1b7c121a7fea53920c5a4b94009361a.

This change requires further fixes to ensure that the open doesn't
succeed if the lookup later results in a regular file being created.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoRegression: fix mounting NFS when NFSv3 support is not compiled
Paulius Zaleckas [Sun, 31 Oct 2010 16:21:05 +0000 (18:21 +0200)]
Regression: fix mounting NFS when NFSv3 support is not compiled

Trying to mount NFS (root partition in my case) fails if CONFIG_NFS_V3
is not selected. nfs_validate_mount_data() returns EPROTONOSUPPORT,
because of this check:

#ifndef CONFIG_NFS_V3
if (args->version == 3)
goto out_v3_not_compiled;
#endif /* !CONFIG_NFS_V3 */

and args->version was always initialized to 3.

It was working in 2.6.36

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agoNLM: Fix a regression in lockd
Trond Myklebust [Tue, 2 Nov 2010 13:11:55 +0000 (09:11 -0400)]
NLM: Fix a regression in lockd

Nick Bowler reports:
There are no unusual messages on the client... but I just logged into
the server and I see lots of messages of the following form:

  nfsd: request from insecure port (192.168.8.199:35766)!
  nfsd: request from insecure port (192.168.8.199:35766)!
  nfsd: request from insecure port (192.168.8.199:35766)!
  nfsd: request from insecure port (192.168.8.199:35766)!
  nfsd: request from insecure port (192.168.8.199:35766)!

Bisected to commit 9247685088398cf21bcb513bd2832b4cd42516c4 (SUNRPC:
Properly initialize sock_xprt.srcaddr in all cases)

Apparently, removing the 'transport->srcaddr.ss_family = family' from
xs_create_sock() triggers this due to nlmclnt_lookup_host() incorrectly
initialising the srcaddr family to AF_UNSPEC.

Reported-by: Nick Bowler <nbowler@elliptictech.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13 years agocapabilities/syslog: open code cap_syslog logic to fix build failure
Eric Paris [Mon, 15 Nov 2010 23:36:29 +0000 (18:36 -0500)]
capabilities/syslog: open code cap_syslog logic to fix build failure

The addition of CONFIG_SECURITY_DMESG_RESTRICT resulted in a build
failure when CONFIG_PRINTK=n.  This is because the capabilities code
which used the new option was built even though the variable in question
didn't exist.

The patch here fixes this by moving the capabilities checks out of the
LSM and into the caller.  All (known) LSMs should have been calling the
capabilities hook already so it actually makes the code organization
better to eliminate the hook altogether.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: James Morris <jmorris@namei.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMerge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 15 Nov 2010 22:06:11 +0000 (14:06 -0800)]
Merge branch 'omap-fixes-for-linus' of git://git./linux/kernel/git/tmlind/linux-omap-2.6

* 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6:
  arm: omap1: devices: need to return with a value
  OMAP1: camera.h: add missing include
  omap: dma: Add read-back to DMA interrupt handler to avoid spuriousinterrupts
  OMAP2: Devkit8000: Fix mmc regulator failure

13 years agoMerge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelv...
Linus Torvalds [Mon, 15 Nov 2010 22:05:44 +0000 (14:05 -0800)]
Merge branch 'hwmon-for-linus' of git://git./linux/kernel/git/jdelvare/staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  hwmon: (w83795) Check for BEEP pin availability
  hwmon: (w83795) Clear intrusion alarm immediately
  hwmon: (w83795) Read the intrusion state properly
  hwmon: (w83795) Print the actual temperature channels as sources
  hwmon: (w83795) List all usable temperature sources
  hwmon: (w83795) Expose fan control method
  hwmon: (w83795) Fix fan control mode attributes
  hwmon: (lm95241) Check validity of input values
  hwmon: Change mail address of Hans J. Koch

13 years agoMerge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvar...
Linus Torvalds [Mon, 15 Nov 2010 22:03:17 +0000 (14:03 -0800)]
Merge branch 'i2c-for-linus' of git://git./linux/kernel/git/jdelvare/staging

* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  i2c: Sanity checks on adapter registration
  i2c: Mark i2c_adapter.id as deprecated
  i2c: Drivers shouldn't include <linux/i2c-id.h>
  i2c: Delete unused adapter IDs
  i2c: Remove obsolete cleanup for clientdata