safe/jmp/linux-2.6
14 years ago[S390] rename NT_PRXSTATUS to NT_S390_HIGHREGS
Martin Schwidefsky [Fri, 18 Dec 2009 16:43:20 +0000 (17:43 +0100)]
[S390] rename NT_PRXSTATUS to NT_S390_HIGHREGS

The elf notes number for the upper register halves is s390 specific.
Change the name of the elf notes to include S390.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years ago[S390] tty: PTR_ERR return of wrong pointer in fs3270_open()
Roel Kluin [Fri, 18 Dec 2009 16:43:19 +0000 (17:43 +0100)]
[S390] tty: PTR_ERR return of wrong pointer in fs3270_open()

Return the PTR_ERR of the correct pointer.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years ago[S390] s390: PTR_ERR return of wrong pointer in fallback_init_cip()
Roel Kluin [Fri, 18 Dec 2009 16:43:18 +0000 (17:43 +0100)]
[S390] s390: PTR_ERR return of wrong pointer in fallback_init_cip()

Return the PTR_ERR of the correct pointer.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years ago[S390] dasd: PTR_ERR return of wrong pointer in
Roel Kluin [Fri, 18 Dec 2009 16:43:17 +0000 (17:43 +0100)]
[S390] dasd: PTR_ERR return of wrong pointer in

Return the PTR_ERR of the correct pointer.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years ago[S390] dasd: move dasd-diag kmsg to dasd
Stefan Haberland [Fri, 18 Dec 2009 16:43:16 +0000 (17:43 +0100)]
[S390] dasd: move dasd-diag kmsg to dasd

The DIAG discipline does not have a own driver name. It shows up as
dasd-eckd or dasd-fba. So messages for dasd-diag are moved to the
generic dasd part.

Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years ago[S390] cio: fix drvdata usage for the console subchannel
Sebastian Ott [Fri, 18 Dec 2009 16:43:15 +0000 (17:43 +0100)]
[S390] cio: fix drvdata usage for the console subchannel

Using dev_set_drvdata prior to device_register will force the driver core
to kmalloc its private data. Since we use this for the console subchannel
lets set the drvdata before taking the subchannels spinlock.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years ago[S390] wire up sys_recvmmsg
Heiko Carstens [Fri, 18 Dec 2009 16:43:14 +0000 (17:43 +0100)]
[S390] wire up sys_recvmmsg

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years agoperf session: Make events_stats u64 to avoid overflow on 32-bit arches
Arnaldo Carvalho de Melo [Fri, 18 Dec 2009 15:03:03 +0000 (13:03 -0200)]
perf session: Make events_stats u64 to avoid overflow on 32-bit arches

Pekka Enberg reported weird percentages in perf report. It
turns out we are overflowing a 32-bit variables in struct
events_stats on 32-bit architectures.

Before:

 [acme@ana linux-2.6-tip]$ perf report -i pekka.perf.data 2> /dev/null | head -10
   281.96%       Xorg                        b710a561  [.] 0x000000b710a561
   140.15%       Xorg  [kernel]                        [k] __initramfs_end
    51.56%   metacity  libgobject-2.0.so.0.2000.1      [.] 0x00000000026e46
    35.12%  evolution  libcairo.so.2.10800.6           [.] 0x000000000203bd
    33.84%   metacity  libpthread-2.9.so               [.] 0x00000000007a3d

After:

 [acme@ana linux-2.6-tip]$ perf report -i pekka.perf.data 2> /dev/null | head -10
    30.04%       Xorg                       b710a561   [.] 0x000000b710a561
    14.93%       Xorg  [kernel]                        [k] __initramfs_end
     5.49%   metacity  libgobject-2.0.so.0.2000.1      [.] 0x00000000026e46
     3.74%  evolution  libcairo.so.2.10800.6           [.] 0x000000000203bd
     3.61%   metacity  libpthread-2.9.so               [.] 0x00000000007a3d

Reported-by: Pekka Enberg <penberg@cs.helsinki.fi>
Tested-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1261148583-20395-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoASoC: wm8974: fix a wrong bit definition
Guennadi Liakhovetski [Thu, 17 Dec 2009 13:51:35 +0000 (14:51 +0100)]
ASoC: wm8974: fix a wrong bit definition

The wm8974 datasheet defines BUFIOEN as bit 2.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
14 years agohw-breakpoints: Fix hardware breakpoints -> perf events dependency
Frederic Weisbecker [Thu, 17 Dec 2009 00:33:54 +0000 (01:33 +0100)]
hw-breakpoints: Fix hardware breakpoints -> perf events dependency

The kbuild's select command doesn't propagate through the config
dependencies.

Hence the current rules of hardware breakpoint's config can't
ensure perf can never be disabled under us.

We have:

config X86
selects HAVE_HW_BREAKPOINTS

config HAVE_HW_BREAKPOINTS
select PERF_EVENTS

config PERF_EVENTS
[...]

x86 will select the breakpoints but that won't propagate to perf
events. The user can still disable the latter, but it is
necessary for the breakpoints.

What we need is:

 - x86 selects HAVE_HW_BREAKPOINTS and PERF_EVENTS
 - HAVE_HW_BREAKPOINTS depends on PERF_EVENTS

so that we ensure PERF_EVENTS is enabled and frozen for x86.

This fixes the following kind of build errors:

 In file included from arch/x86/kernel/hw_breakpoint.c:31:
 include/linux/hw_breakpoint.h: In function 'hw_breakpoint_addr':
 include/linux/hw_breakpoint.h:39: error: 'struct perf_event' has no member named 'attr'

v2: Select also ANON_INODES from x86, required for perf

Reported-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reported-by: Michal Marek <mmarek@suse.cz>
Reported-by: Andrew Randrianasulu <randrik_a@yahoo.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
LKML-Reference: <1261010034-7786-1-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agosound: sgio2audio/pdaudiocf/usb-audio: initialize PCM buffer
Clemens Ladisch [Fri, 18 Dec 2009 08:27:24 +0000 (09:27 +0100)]
sound: sgio2audio/pdaudiocf/usb-audio: initialize PCM buffer

When allocating the PCM buffer, use vmalloc_user() instead of vmalloc().
Otherwise, it would be possible for applications to play the previous
contents of the kernel memory to the speakers, or to read it directly if
the buffer is exported to userspace.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: hda - Fix quirk for Maxdata obook4-1
Takashi Iwai [Fri, 18 Dec 2009 07:48:42 +0000 (08:48 +0100)]
ALSA: hda - Fix quirk for Maxdata obook4-1

Works fine with the auto-parser.

Reference: Novell bnc#564940
https://bugzilla.novell.com/show_bug.cgi?id=564940

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoalpha: Convert BUG() to use unreachable()
David Daney [Thu, 10 Dec 2009 23:07:24 +0000 (18:07 -0500)]
alpha: Convert BUG() to use unreachable()

Use the new unreachable() macro instead of for(;;);

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
CC: Richard Henderson <rth@twiddle.net>
CC: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
CC: linux-alpha@vger.kernel.org
Signed-off-by: Matt Turner <mattst88@gmail.com>
14 years agoalpha: Add minimal support for software performance events
Michael Cree [Tue, 8 Dec 2009 19:27:01 +0000 (14:27 -0500)]
alpha: Add minimal support for software performance events

In the kernel the patch enables configuration of the perf event
option, adds the perf_event_open syscall, and includes a minimal
architecture specific asm/perf_event.h header file.

Signed-off-by: Michael Cree <mcree@orcon.net.nz>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Matt Turner <mattst88@gmail.com>
14 years agoalpha: Wire up missing/new syscalls
Daniele Calore [Tue, 8 Dec 2009 18:59:47 +0000 (13:59 -0500)]
alpha: Wire up missing/new syscalls

This wire up the: fallocate, timerfd_create, timerfd_settime,
timerfd_gettime, signalfd4, eventfd2, epoll_create1, dup3, pipe2,
inotify_init1, preadv, pwritev and rt_tgsigqueueinfo syscalls for
the alpha port.

For umount2, alpha have an "old" and "new" version called: oldumount and
umount; so ignore umount2.

Rebased on top of 6e17e8b9fb74b9fb9f6ea331f7f4a049c5b4c4b8 by Matt
Turner.

Signed-off-by: Daniele Calore <orkaan@orkaan.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Matt Turner <mattst88@gmail.com>
14 years agox86, irq: Allow 0xff for /proc/irq/[n]/smp_affinity on an 8-cpu system
Suresh Siddha [Fri, 18 Dec 2009 02:29:46 +0000 (18:29 -0800)]
x86, irq: Allow 0xff for /proc/irq/[n]/smp_affinity on an 8-cpu system

John Blackwood reported:
> on an older Dell PowerEdge 6650 system with 8 cpus (4 are hyper-threaded),
> and  32 bit (x86) kernel, once you change the irq smp_affinity of an irq
> to be less than all cpus in the system, you can never change really the
> irq smp_affinity back to be all cpus in the system (0xff) again,
> even though no error status is returned on the "/bin/echo ff >
> /proc/irq/[n]/smp_affinity" operation.
>
> This is due to that fact that BAD_APICID has the same value as
> all cpus (0xff) on 32bit kernels, and thus the value returned from
> set_desc_affinity() via the cpu_mask_to_apicid_and() function is treated
> as a failure in set_ioapic_affinity_irq_desc(), and no affinity changes
> are made.

set_desc_affinity() is already checking if the incoming cpu mask
intersects with the cpu online mask or not. So there is no need
for the apic op cpu_mask_to_apicid_and() to check again
and return BAD_APICID.

Remove the BAD_APICID return value from cpu_mask_to_apicid_and()
and also fix set_desc_affinity() to return -1 instead of using BAD_APICID
to represent error conditions (as cpu_mask_to_apicid_and() can return
logical or physical apicid values and BAD_APICID is really to represent
bad physical apic id).

Reported-by: John Blackwood <john.blackwood@ccur.com>
Root-caused-by: John Blackwood <john.blackwood@ccur.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <1261103386.2535.409.camel@sbs-t61>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agopowerpc/gamecube/wii: Fix off-by-one error in ugecon/usbgecko_udbg
Albert Herranz [Thu, 17 Dec 2009 08:33:41 +0000 (08:33 +0000)]
powerpc/gamecube/wii: Fix off-by-one error in ugecon/usbgecko_udbg

The retry logic in ug_putc() is broken.

If the TX fifo is not ready and the counter runs out it will have a
value of -1 and no transfer should be attempted. Also, a counter
with a value of 0 means that the TX fifo got ready in the last try
and the transfer should be attempted.

Reported-by: "Juha Leppanen" <juha_motorsportcom@luukku.com>
Signed-off-by: "Juha Leppanen" <juha_motorsportcom@luukku.com>
Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/mpic: Fix problem that affinity is not updated
Yang Li [Wed, 16 Dec 2009 20:18:11 +0000 (20:18 +0000)]
powerpc/mpic: Fix problem that affinity is not updated

Since commit 57b150cce8e004ddd36330490a68bfb59b7271e9, desc->affinity
of an irq is changed after calling desc->chip->set_affinity.
Therefore we need to fix the irq_choose_cpu() not to depend on the
desc->affinity for new mask.

Signed-off-by: Jiajun Wu <b06378@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/mm: Fix stupid bug in subpge protection handling
David Gibson [Wed, 16 Dec 2009 14:29:56 +0000 (14:29 +0000)]
powerpc/mm: Fix stupid bug in subpge protection handling

Commit d28513bc7f675d28b479db666d572e078ecf182d ("Fix bug in pagetable
cache cleanup with CONFIG_PPC_SUBPAGE_PROT"), itself a fix for
breakage caused by an earlier clean up patch of mine, contains a
stupid bug.  I changed the parameters of the subpage_protection()
function, but failed to update one of the callers.

This patch fixes it, and replaces a void * with a typed pointer so
that the compiler will warn on such an error in future.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/iseries: use DECLARE_COMPLETION_ONSTACK for non-constant completion
Yong Zhang [Wed, 16 Dec 2009 04:35:57 +0000 (04:35 +0000)]
powerpc/iseries: use DECLARE_COMPLETION_ONSTACK for non-constant completion

The _ONSTACK variant should be used for on-stack completion,
otherwise it will break lockdep.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Fix MSI support on U4 bridge PCIe slot
Benjamin Herrenschmidt [Mon, 14 Dec 2009 15:31:13 +0000 (15:31 +0000)]
powerpc: Fix MSI support on U4 bridge PCIe slot

On machines using the Apple U4 bridge (AKA IBM CPC945) PCIe interface such
as the latest generation G5 machines x16 slot or the x16 slot of the
PowerStation, MSIs are currently broken (and will oops when enabling).

This fixes the oops and implements proper support for those. Instead of
using the PCIe <-> HT bridge conversion, on such slots we need to use
a bunch of magic registers in the bridge as the MSI target, encoding
the interrupt number in the low bits of the address itself

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Handle VSX alignment faults correctly in little-endian mode
Neil Campbell [Mon, 14 Dec 2009 04:08:57 +0000 (04:08 +0000)]
powerpc: Handle VSX alignment faults correctly in little-endian mode

This patch fixes the handling of VSX alignment faults in little-endian
mode (the current code assumes the processor is in big-endian mode).

The patch also makes the handlers clear the top 8 bytes of the register
when handling an 8 byte VSX load.

This is based on 2.6.32.

Signed-off-by: Neil Campbell <neilc@linux.vnet.ibm.com>
Cc: <stable@kernel.org>
Acked-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/mm: Fix typo of cpumask_clear_cpu()
Yang Li [Mon, 14 Dec 2009 03:01:49 +0000 (03:01 +0000)]
powerpc/mm: Fix typo of cpumask_clear_cpu()

The function name of cpumask_clear_cpu was not correct. Fortunately
nobody uses that code with hotplug yet :-)

Reported-by: Jin Qing <b24347@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/mm: Fix hash_utils_64.c compile errors with DEBUG enabled.
Sachin P. Sant [Sun, 13 Dec 2009 21:15:12 +0000 (21:15 +0000)]
powerpc/mm: Fix hash_utils_64.c compile errors with DEBUG enabled.

This time without the funny characters.

Fix following build errors generated with DEBUG=1

cc1: warnings being treated as errors
arch/powerpc/mm/hash_utils_64.c: In function 'htab_dt_scan_page_sizes':
arch/powerpc/mm/hash_utils_64.c:343: error: format '%04x' expects type 'unsigned int', but argument 4 has type 'long unsigned int'
arch/powerpc/mm/hash_utils_64.c:343: error: format '%08x' expects type 'unsigned int', but argument 5 has type 'long unsigned int'
arch/powerpc/mm/hash_utils_64.c: In function 'htab_initialize':
arch/powerpc/mm/hash_utils_64.c:666: error: format '%x' expects type 'unsigned int', but argument 4 has type 'long unsigned int'
... SNIP ...

Signed-off-by: Sachin Sant <sachinp@in.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Convert BUG() to use unreachable()
David Daney [Thu, 10 Dec 2009 07:28:19 +0000 (07:28 +0000)]
powerpc: Convert BUG() to use unreachable()

Use the new unreachable() macro instead of for(;;);

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: linuxppc-dev@ozlabs.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/pseries: Make declarations of cpu_hotplug_driver_lock() ANSI compatible.
Gautham R Shenoy [Thu, 10 Dec 2009 01:19:42 +0000 (01:19 +0000)]
powerpc/pseries: Make declarations of cpu_hotplug_driver_lock() ANSI compatible.

And add the __acquires() and __releases() annotations, while at it.

Signed-off-by: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/pseries: Don't panic when H_PROD fails during cpu-online.
Gautham R Shenoy [Thu, 10 Dec 2009 01:19:37 +0000 (01:19 +0000)]
powerpc/pseries: Don't panic when H_PROD fails during cpu-online.

If an online-attempt on a CPU which has been offlined using H_CEDE
with an appropriate cede latency hint fails, don't panic.

Instead print the error message and let the __cpu_up() code notify the
CPU Hotplug framework of the failure, which in turn can notify the
other subsystem through CPU_UP_CANCELED.

Signed-off-by: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/mm: Fix a WARN_ON() with CONFIG_DEBUG_PAGEALLOC and CONFIG_DEBUG_VM
Benjamin Herrenschmidt [Tue, 8 Dec 2009 21:08:44 +0000 (21:08 +0000)]
powerpc/mm: Fix a WARN_ON() with CONFIG_DEBUG_PAGEALLOC and CONFIG_DEBUG_VM

Set need to call __set_pte_at() and not set_pte_at() from __change_page_attr()
since the later will perform checks with CONFIG_DEBUG_VM that aren't suitable
to the way we override an existing PTE. (More specifically, it doesn't let
you write over a present PTE).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/defconfigs: Set HZ=100 on pseries and ppc64 defconfigs
Anton Blanchard [Sun, 6 Dec 2009 17:48:33 +0000 (17:48 +0000)]
powerpc/defconfigs: Set HZ=100 on pseries and ppc64 defconfigs

Now we have high res timers there is less of a reason for a high HZ value.
Furthermore I think there a few reasons we should reduce HZ to 100:

- Timer interrupt overhead. While this overhead is small, there are
  applications that are very sensitive to jitter (eg some HPC apps).

- Issues with the timer wheel code. When coming out of NO_HZ idle we work our
  way through the timer code one tick at a time.  If we have been idle a long
  time, this adds up - I sometimes see milliseconds of time spent in that
  loop.

  Long term we should fix the timer wheel algorithm, but for now if we reduce
  HZ then we reduce the amount of work the timer code has to do when coming
  out of idle.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/defconfigs: Disable token ring in powerpc defconfigs
Anton Blanchard [Sun, 6 Dec 2009 17:45:55 +0000 (17:45 +0000)]
powerpc/defconfigs: Disable token ring in powerpc defconfigs

Token what? Lets save some space in our powerpc kernels and remove token
ring support.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/defconfigs: Reduce 64bit vmlinux by making acenic and cramfs modules
Anton Blanchard [Sun, 6 Dec 2009 17:45:09 +0000 (17:45 +0000)]
powerpc/defconfigs: Reduce 64bit vmlinux by making acenic and cramfs modules

Machines with acenic adapters are rare these days, so we may as well make it
a module. Cramfs is also very rarely used so we can make it a module.

Together this saves 143kB on a 64bit compile:

   text    data     bss     dec     hex filename
8247176 1729404 1221988 11198568  aae068 vmlinux~
8134997 1727588 1188836 11051421  a8a19d vmlinux

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/pseries: Select XICS and PCI_MSI PSERIES
Mel Gorman [Fri, 27 Nov 2009 06:33:58 +0000 (06:33 +0000)]
powerpc/pseries: Select XICS and PCI_MSI PSERIES

It's possible to set CONFIG_XICS without CONFIG_PCI_MSI. When that happens,
the kernel fails to build with

arch/powerpc/platforms/built-in.o: In function `.xics_startup':
xics.c:(.text+0x12f60): undefined reference to `.unmask_msi_irq' make: ***
[.tmp_vmlinux1] Error 1

Furthermore, as noted by Benjamin Herrenschmidt, "CONFIG_XICS should be
made invisible and selected by PSERIES."

This patch fixes PSERIES to select both options

Signed-off-by: Mel Gorman <mel[at]csn.ul.ie>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/85xx: Wrong variable returned on error
Roel Kluin [Thu, 17 Dec 2009 14:45:15 +0000 (14:45 +0000)]
powerpc/85xx: Wrong variable returned on error

The wrong variable was returned in the case of an error.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/iseries: Convert to proc_fops
Alexey Dobriyan [Thu, 17 Dec 2009 14:45:05 +0000 (14:45 +0000)]
powerpc/iseries: Convert to proc_fops

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Make the CMM memory hotplug aware
Robert Jennings [Thu, 17 Dec 2009 14:44:52 +0000 (14:44 +0000)]
powerpc: Make the CMM memory hotplug aware

The Collaborative Memory Manager (CMM) module allocates individual pages
over time that are not migratable.  On a long running system this can
severely impact the ability to find enough pages to support a hotplug
memory remove operation.

This patch adds a memory isolation notifier and a memory hotplug notifier.
The memory isolation notifier will return the number of pages found in
the range specified.  This is used to determine if all of the used pages
in a pageblock are owned by the balloon (or other entities in the notifier
chain).  The hotplug notifier will free pages in the range which is to be
removed.  The priority of this hotplug notifier is low so that it will be
called near last, this helps avoids removing loaned pages in operations
that fail due to other handlers.

CMM activity will be halted when hotplug remove operations are active and
resume activity after a delay period to allow the hypervisor time to
adjust.

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Brian King <brking@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Gerald Schaefer <geralds@linux.vnet.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agomm: Add notifier in pageblock isolation for balloon drivers
Robert Jennings [Thu, 17 Dec 2009 14:44:38 +0000 (14:44 +0000)]
mm: Add notifier in pageblock isolation for balloon drivers

Memory balloon drivers can allocate a large amount of memory which is not
movable but could be freed to accomodate memory hotplug remove.

Prior to calling the memory hotplug notifier chain the memory in the
pageblock is isolated.  Currently, if the migrate type is not
MIGRATE_MOVABLE the isolation will not proceed, causing the memory removal
for that page range to fail.

Rather than failing pageblock isolation if the migrateteype is not
MIGRATE_MOVABLE, this patch checks if all of the pages in the pageblock,
and not on the LRU, are owned by a registered balloon driver (or other
entity) using a notifier chain.  If all of the non-movable pages are owned
by a balloon, they can be freed later through the memory notifier chain
and the range can still be isolated in set_migratetype_isolate().

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Brian King <brking@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Gerald Schaefer <geralds@linux.vnet.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoLinux 2.6.33-rc1 v2.6.33-rc1
Linus Torvalds [Fri, 18 Dec 2009 01:14:40 +0000 (17:14 -0800)]
Linux 2.6.33-rc1

14 years agoMerge branch 'cpumask-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 18 Dec 2009 01:00:20 +0000 (17:00 -0800)]
Merge branch 'cpumask-cleanups' of git://git./linux/kernel/git/rusty/linux-2.6-for-linus

* 'cpumask-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  cpumask: rename tsk_cpumask to tsk_cpus_allowed
  cpumask: don't recommend set_cpus_allowed hack in Documentation/cpu-hotplug.txt
  cpumask: avoid dereferencing struct cpumask
  cpumask: convert drivers/idle/i7300_idle.c to cpumask_var_t
  cpumask: use modern cpumask style in drivers/scsi/fcoe/fcoe.c
  cpumask: avoid deprecated function in mm/slab.c
  cpumask: use cpu_online in kernel/perf_event.c

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Fri, 18 Dec 2009 00:58:26 +0000 (16:58 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jmorris/security-testing-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
  Keys: KEYCTL_SESSION_TO_PARENT needs TIF_NOTIFY_RESUME architecture support
  NOMMU: Optimise away the {dac_,}mmap_min_addr tests
  security/min_addr.c: make init_mmap_min_addr() static
  keys: PTR_ERR return of wrong pointer in keyctl_get_security()

14 years agoMerge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 18 Dec 2009 00:57:49 +0000 (16:57 -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:
  OMAP3: serial - fix bug introduced in
  mfd: twl: fix twl4030 rename for remaining driver, board files
  USB ehci: replace mach header with plat
  omap3: Allow EHCI to be built on OMAP3

14 years agoPM: Measure device suspend and resume times
Rafael J. Wysocki [Fri, 18 Dec 2009 00:57:47 +0000 (01:57 +0100)]
PM: Measure device suspend and resume times

Measure and print the time of suspending and resuming all devices.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
14 years agoPM: Make the initcall_debug style timing for suspend/resume complete
Rafael J. Wysocki [Fri, 18 Dec 2009 00:57:31 +0000 (01:57 +0100)]
PM: Make the initcall_debug style timing for suspend/resume complete

Commit f2511774863487e61b56a97da07ebf8dd61d7836
(PM: Add initcall_debug style timing for suspend/resume) introduced
basic timing instrumentation, needed for a scritps/bootgraph.pl
equivalent or humans, but it missed the fact that bus types and
device classes which haven't been switched to using struct dev_pm_ops
objects yet need special handling.  As a result, the suspend/resume
timing information is only available for devices whose bus types or
device classes use struct dev_pm_ops objects, so the majority of
devices is not covered.

Fix this by adding basic suspend/resume timing instrumentation for
devices whose bus types and device classes still don't use struct
dev_pm_ops objects for power management.  To reduce code duplication
move the timing code to helper functions.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
14 years agoMerge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelv...
Linus Torvalds [Fri, 18 Dec 2009 00:48:08 +0000 (16:48 -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: (w83627hf) Fix for "No such device"
  hwmon: (sht15) Off-by-one error in array index + incorrect constants
  hwmon: Add driver for VIA CPU core temperature
  hwmon: (smsc47m1) Enable device if needed
  hwmon: (smsc47m1) Fail module loading on error
  hwmon: (smsc47m1) Only request I/O ports we really use
  hwmon: New driver for AMD Family 10h/11h CPUs

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
Linus Torvalds [Fri, 18 Dec 2009 00:38:48 +0000 (16:38 -0800)]
Merge git://git./linux/kernel/git/jejb/scsi-misc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (40 commits)
  [SCSI] 3w-9xxx fix bug in sgl loading
  [SCSI] fcoe, libfc: adds enable/disable for fcoe interface
  [SCSI] libfc: reduce hold time on SCSI host lock
  [SCSI] libfc: remote port gets stuck in restart state without really restarting
  [SCSI] pm8001: misc code cleanup
  [SCSI] pm8001: enable read HBA SAS address from VPD
  [SCSI] pm8001: do not reset local sata as it will not be found if reset
  [SCSI] pm8001: bit set pm8001_ha->flags
  [SCSI] pm8001:fix potential NULL pointer dereference
  [SCSI] pm8001: set SSC down-spreading only to get less errors on some 6G device.
  [SCSI] pm8001: fix endian issues with SAS address
  [SCSI] pm8001: enhance error handle for IO patch
  [SCSI] pm8001: Fix for sata io circular lock dependency.
  [SCSI] hpsa: add driver for HP Smart Array controllers.
  [SCSI] cxgb3i: always use negative errno in case of error
  [SCSI] bnx2i: minor code cleanup and update driver version
  [SCSI] bnx2i: Task management ABORT TASK fixes
  [SCSI] bnx2i: update CQ arming algorith for 5771x chipsets
  [SCSI] bnx2i: Adjust sq_size module parametr to power of 2 only if a non-zero value is specified
  [SCSI] bnx2i: Add 5771E device support to bnx2i driver
  ...

14 years agoMerge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
Linus Torvalds [Fri, 18 Dec 2009 00:38:06 +0000 (16:38 -0800)]
Merge branch 'upstream' of git://ftp.linux-mips.org/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: (71 commits)
  MIPS: Lasat: Fix botched changes to sysctl code.
  RTC: rtc-cmos.c: Fix warning on MIPS
  MIPS: Cleanup random differences beween lmo and Linus' kernel.
  MIPS: No longer hardwire CONFIG_EMBEDDED to y
  MIPS: Fix and enhance built-in kernel command line
  MIPS: eXcite: Remove platform.
  MIPS: Loongson: Cleanups of serial port support
  MIPS: Lemote 2F: Suspend CS5536 MFGPT Timer
  MIPS: Excite: move iodev_remove to .devexit.text
  MIPS: Lasat: Convert to proc_fops / seq_file
  MIPS: Cleanup signal code initialization
  MIPS: Modularize COP2 handling
  MIPS: Move EARLY_PRINTK to Kconfig.debug
  MIPS: Yeeloong 2F: Cleanup reset logic using the new ec_write function
  MIPS: Yeeloong 2F: Add LID open event as the wakeup event
  MIPS: Yeeloong 2F: Add basic EC operations
  MIPS: Move several variables from .bss to .init.data
  MIPS: Tracing: Make function graph tracer work with -mmcount-ra-address
  MIPS: Tracing: Reserve $12(t0) for mcount-ra-address of gcc 4.5
  MIPS: Tracing: Make ftrace for MIPS work without -fno-omit-frame-pointer
  ...

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs...
Linus Torvalds [Fri, 18 Dec 2009 00:01:03 +0000 (16:01 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/mason/btrfs-unstable

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  Btrfs: make sure fallocate properly starts a transaction
  Btrfs: make metadata chunks smaller
  Btrfs: Show discard option in /proc/mounts
  Btrfs: deny sys_link across subvolumes.
  Btrfs: fail mount on bad mount options
  Btrfs: don't add extent 0 to the free space cache v2
  Btrfs: Fix per root used space accounting
  Btrfs: Fix btrfs_drop_extent_cache for skip pinned case
  Btrfs: Add delayed iput
  Btrfs: Pass transaction handle to security and ACL initialization functions
  Btrfs: Make truncate(2) more ENOSPC friendly
  Btrfs: Make fallocate(2) more ENOSPC friendly
  Btrfs: Avoid orphan inodes cleanup during committing transaction
  Btrfs: Avoid orphan inodes cleanup while replaying log
  Btrfs: Fix disk_i_size update corner case
  Btrfs: Rewrite btrfs_drop_extents
  Btrfs: Add btrfs_duplicate_item
  Btrfs: Avoid superfluous tree-log writeout

14 years agoMerge branch 'kmemleak' of git://linux-arm.org/linux-2.6
Linus Torvalds [Fri, 18 Dec 2009 00:00:19 +0000 (16:00 -0800)]
Merge branch 'kmemleak' of git://linux-arm.org/linux-2.6

* 'kmemleak' of git://linux-arm.org/linux-2.6:
  kmemleak: fix kconfig for crc32 build error
  kmemleak: Reduce the false positives by checking for modified objects
  kmemleak: Show the age of an unreferenced object
  kmemleak: Release the object lock before calling put_object()
  kmemleak: Scan the _ftrace_events section in modules
  kmemleak: Simplify the kmemleak_scan_area() function prototype
  kmemleak: Do not use off-slab management with SLAB_NOLEAKTRACE

14 years agoMerge branch 'next-spi' of git://git.secretlab.ca/git/linux-2.6
Linus Torvalds [Thu, 17 Dec 2009 23:59:05 +0000 (15:59 -0800)]
Merge branch 'next-spi' of git://git.secretlab.ca/git/linux-2.6

* 'next-spi' of git://git.secretlab.ca/git/linux-2.6:
  spi: spi_txx9.c: use resource_size()
  spi: spi_sh_sci.c: use resource_size()
  spi: spi_mpc8xxx.c: use resource_size()
  spi: spi_bfin5xx.c: use resource_size()
  spi: atmel_spi.c: use resource_size()
  spi: Add s3c64xx SPI Controller driver
  atmel_spi: fix dma addr calculation for len > BUFFER_SIZE
  spi_s3c24xx: add FIQ pseudo-DMA support
  spi: controller driver for Designware SPI core
  spidev: add proper section markers
  spidev: use DECLARE_BITMAP instead of declaring the array

14 years agoMerge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight
Linus Torvalds [Thu, 17 Dec 2009 23:58:07 +0000 (15:58 -0800)]
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight

* 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight:
  backlight: mbp_nvidia_bl - add two more MacBookPro variants
  backlight: Pass device through notify callback in the pwm driver
  backlight: PTR_ERR return of wrong pointer in cr_backlight_probe()
  backlight: Constify struct backlight_ops
  backlight/thinkpad-acpi: issue backlight class events

Fix up trivial conflicts in thinkpad-acpi support (backlight support
already merged earlier).

14 years agoMerge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds
Linus Torvalds [Thu, 17 Dec 2009 23:55:08 +0000 (15:55 -0800)]
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds

* 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds:
  leds: leds-pwm: Set led_classdev max_brightness
  leds: leds-lp3944.h - remove unneeded includes
  leds: use default-on trigger for Cobalt Qube
  leds: drivers/leds/leds-ss4200.c: fix return statement
  leds: leds-pca9532.h- indent with tabs, not spaces
  leds: Add LED class driver for regulator driven LEDs.
  leds: leds-cobalt-qube.c: use resource_size()
  leds: leds-cobalt-raq.c - use resource_size()
  leds: Add driver for ADP5520/ADP5501 MFD PMICs
  leds: Add driver for LT3593 controlled LEDs
  leds-ss4200: Check pci_enable_device return
  leds: leds-alix2c - take port address from MSR
  leds: LED driver for Intel NAS SS4200 series (v5)

14 years agoMerge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
Linus Torvalds [Thu, 17 Dec 2009 23:53:41 +0000 (15:53 -0800)]
Merge branch 'for-linus' of /home/rmk/linux-2.6-arm

* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm:
  PCMCIA: fix pxa2xx_lubbock modular build error
  [ARM] Update mach-types
  [ARM] pxa: fix no reference of cpu_is_pxa25x() in devices.c
  [ARM] pxa/cm-x300: add PWM backlight support
  revert "[ARM] pxa/cm-x300: add PWM backlight support"
  ARM: use flush_kernel_dcache_area() for dmabounce
  ARM: add size argument to __cpuc_flush_dcache_page
  ARM: 5848/1: kill flush_ioremap_region()
  ARM: cache-l2x0: make better use of background cache handling
  ARM: cache-l2x0: avoid taking spinlock for every iteration
  [ARM] Kirkwood: Add LaCie Network Space v2 support
  ARM: dove: fix the mm mmu flags of the pj4 procinfo

14 years agoMakefile: Unexport LC_ALL instead of clearing it
H. Peter Anvin [Thu, 17 Dec 2009 23:51:37 +0000 (15:51 -0800)]
Makefile: Unexport LC_ALL instead of clearing it

Apparently not all versions of glibc and utilities treat an empty
LC_ALL as nonexistent, causing error messages to be garbled.  Instead,
explicitly unexport it from the environment.

Reported-and-tested-by: Masami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
LKML-Reference: <4B2AC394.4030108@redhat.com>
Cc: Michal Marek <mmarek@sues.cz>
Cc: Roland Dreier <rdreier@cisco.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
14 years agoprintk: fix new kernel-doc warnings
Randy Dunlap [Thu, 17 Dec 2009 23:27:27 +0000 (15:27 -0800)]
printk: fix new kernel-doc warnings

Fix kernel-doc warnings in printk.c:

Warning(kernel/printk.c:1422): No description found for parameter 'dumper'
Warning(kernel/printk.c:1422): Excess function parameter 'dump' description in 'kmsg_dump_register'
Warning(kernel/printk.c:1451): No description found for parameter 'dumper'
Warning(kernel/printk.c:1451): Excess function parameter 'dump' description in 'kmsg_dump_unregister'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoreadahead: add blk_run_backing_dev
Hisashi Hifumi [Thu, 17 Dec 2009 23:27:26 +0000 (15:27 -0800)]
readahead: add blk_run_backing_dev

I added blk_run_backing_dev on page_cache_async_readahead so readahead I/O
is unpluged to improve throughput on especially RAID environment.

The normal case is, if page N become uptodate at time T(N), then T(N) <=
T(N+1) holds.  With RAID (and NFS to some degree), there is no strict
ordering, the data arrival time depends on runtime status of individual
disks, which breaks that formula.  So in do_generic_file_read(), just
after submitting the async readahead IO request, the current page may well
be uptodate, so the page won't be locked, and the block device won't be
implicitly unplugged:

               if (PageReadahead(page))
                        page_cache_async_readahead()
                if (!PageUptodate(page))
                                goto page_not_up_to_date;
                //...
page_not_up_to_date:
                lock_page_killable(page);

Therefore explicit unplugging can help.

Following is the test result with dd.

#dd if=testdir/testfile of=/dev/null bs=16384

-2.6.30-rc6
1048576+0 records in
1048576+0 records out
17179869184 bytes (17 GB) copied, 224.182 seconds, 76.6 MB/s

-2.6.30-rc6-patched
1048576+0 records in
1048576+0 records out
17179869184 bytes (17 GB) copied, 206.465 seconds, 83.2 MB/s

(7Disks RAID-0 Array)

-2.6.30-rc6
1054976+0 records in
1054976+0 records out
17284726784 bytes (17 GB) copied, 212.233 seconds, 81.4 MB/s

-2.6.30-rc6-patched
1054976+0 records out
17284726784 bytes (17 GB) copied, 198.878 seconds, 86.9 MB/s

(7Disks RAID-5 Array)

The patch was found to improve performance with the SCST scsi target
driver.  See
http://sourceforge.net/mailarchive/forum.php?thread_name=a0272b440906030714g67eabc5k8f847fb1e538cc62%40mail.gmail.com&forum_name=scst-devel

[akpm@linux-foundation.org: unbust comment layout]
[akpm@linux-foundation.org: "fix" CONFIG_BLOCK=n]
Signed-off-by: Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>
Acked-by: Wu Fengguang <fengguang.wu@intel.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Tested-by: Ronald <intercommit@gmail.com>
Cc: Bart Van Assche <bart.vanassche@gmail.com>
Cc: Vladislav Bolkhovitin <vst@vlnb.net>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agortc: set wakeup capability for I2C and SPI RTC drivers
Anton Vorontsov [Thu, 17 Dec 2009 23:27:23 +0000 (15:27 -0800)]
rtc: set wakeup capability for I2C and SPI RTC drivers

RTC core won't allow wakeup alarms to be set if RTC devices' parent (i.e.
i2c_client or spi_device) isn't wakeup capable.

For I2C devices there is I2C_CLIENT_WAKE flag exists that we can pass via
board info, and if set, I2C core will initialize wakeup capability.  For
SPI devices there is no such flag at all.

I believe that it's not platform code responsibility to allow or disallow
wakeups, instead, drivers themselves should set the capability if a device
can trigger wakeups.

That's what drivers/base/power/sysfs.c says:

 * It is the responsibility of device drivers to enable (or disable)
 * wakeup signaling as part of changing device power states, respecting
 * the policy choices provided through the driver model.

I2C and SPI RTC devices send wakeup events via interrupt lines, so we
should set the wakeup capability if IRQ is routed.

Ideally we should also check irq for wakeup capability before setting
device's capability, i.e.

if (can_irq_wake(irq))
device_set_wakeup_capable(&client->dev, 1);

But there is no can_irq_wake() call exist, and it is not that trivial to
implement it for all interrupts controllers and complex/cascaded setups.

drivers/base/power/sysfs.c also covers these cases:

 * Devices may not be able to generate wakeup events from all power
 * states.  Also, the events may be ignored in some configurations;
 * for example, they might need help from other devices that aren't
 * active

So there is no guarantee that wakeup will actually work, and so I think
there is no point in being pedantic wrt checking IRQ wakeup capability.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agosdhci-of: add support for the wii sdhci controller
Albert Herranz [Thu, 17 Dec 2009 23:27:20 +0000 (15:27 -0800)]
sdhci-of: add support for the wii sdhci controller

Add support for the Secure Digital Host Controller Interface found on the
"Hollywood" chipset of the Nintendo Wii video game console.

Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agosdhci-of: reorganize driver to support additional hardware
Albert Herranz [Thu, 17 Dec 2009 23:27:20 +0000 (15:27 -0800)]
sdhci-of: reorganize driver to support additional hardware

This patch breaks down sdhci-of into a core portion and a eSDHC portion,
clearing the path to easily support additional hardware using the same OF
driver.

Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agosdhci-of: rename main driver file prior to reorganization
Albert Herranz [Thu, 17 Dec 2009 23:27:19 +0000 (15:27 -0800)]
sdhci-of: rename main driver file prior to reorganization

This patch renames sdhci-of.c to sdhci-of-core.c before reorganizing the
driver to support additional hardware.

The driver is still built as sdhci-of despite the rename of the file.  No
functional change.

Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agosdhci: protect header file against multi inclusion
Albert Herranz [Thu, 17 Dec 2009 23:27:19 +0000 (15:27 -0800)]
sdhci: protect header file against multi inclusion

Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agosdio: initialise SDIO functions and update card->sdio_funcs in lockstep
Matt Fleming [Thu, 17 Dec 2009 23:27:18 +0000 (15:27 -0800)]
sdio: initialise SDIO functions and update card->sdio_funcs in lockstep

Daniel Drake noticed a crash in the error path of mmc_attach_sdio().  This
bug is discussed at http://dev.laptop.org/ticket/9707.

BUG: unable to handle kernel paging request at 6b6b6c57
IP: [<b066d6e2>] sdio_remove_func+0x9/0x27
Call Trace:
[<b066cfb4>] ? mmc_sdio_remove+0x34/0x65
[<b066d1fc>] ? mmc_attach_sdio+0x217/0x240
[<b066a22f>] ? mmc_rescan+0x1a2/0x20f
[<b042e9a0>] ? worker_thread+0x156/0x1e

We need to accurately track how many SDIO functions have been initialised
(and keep card->sdio_funcs in sync) so that we don't try to remove more
functions than we initialised if we hit the error path in
mmc_attach_sdio().

Without this patch if we hit the error path in mmc_attach_sdio() we run
the risk of deferencing invalid memory in sdio_remove_func(), leading to a
crash.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Cc: Daniel Drake <dsd@laptop.org>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agosdio: fix reference counting in sdio_remove_func()
Daniel Drake [Thu, 17 Dec 2009 23:27:17 +0000 (15:27 -0800)]
sdio: fix reference counting in sdio_remove_func()

sdio_remove_func() needs to be more careful about reference counting.  It
can be called in error paths where sdio_add_func() has never been called
e.g.  mmc_attach_sdio error path --> mmc_sdio_remove --> sdio_remove_func

Signed-off-by: Daniel Drake <dsd@laptop.org>
Reviewed-by: Matt Fleming <matt@console-pimps.org>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agomm: introduce coredump parameter structure
Masami Hiramatsu [Thu, 17 Dec 2009 23:27:16 +0000 (15:27 -0800)]
mm: introduce coredump parameter structure

Introduce coredump parameter data structure (struct coredump_params) to
simplify binfmt->core_dump() arguments.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Suggested-by: Ingo Molnar <mingo@elte.hu>
Cc: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Roland McGrath <roland@redhat.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agodo_wait() optimization: do not place sub-threads on task_struct->children list
Oleg Nesterov [Thu, 17 Dec 2009 23:27:15 +0000 (15:27 -0800)]
do_wait() optimization: do not place sub-threads on task_struct->children list

Thanks to Roland who pointed out de_thread() issues.

Currently we add sub-threads to ->real_parent->children list.  This buys
nothing but slows down do_wait().

With this patch ->children contains only main threads (group leaders).
The only complication is that forget_original_parent() should iterate over
sub-threads by hand, and de_thread() needs another list_replace() when it
changes ->group_leader.

Henceforth do_wait_thread() can never see task_detached() && !EXIT_DEAD
tasks, we can remove this check (and we can unify do_wait_thread() and
ptrace_do_wait()).

This change can confuse the optimistic search in mm_update_next_owner(),
but this is fixable and minor.

Perhaps badness() and oom_kill_process() should be updated, but they
should be fixed in any case.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Roland McGrath <roland@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ratan Nalumasu <rnalumasu@gmail.com>
Cc: Vitaly Mayatskikh <vmayatsk@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agonommu: ramfs: remove unused local var
Mike Frysinger [Thu, 17 Dec 2009 23:27:14 +0000 (15:27 -0800)]
nommu: ramfs: remove unused local var

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Cc: David Howells <dhowells@redhat.com>
Acked-by: Greg Ungerer <gerg@snapgear.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agolib/vsprintf.c: document more vsnprintf extensions
Uwe Kleine-König [Thu, 17 Dec 2009 23:27:12 +0000 (15:27 -0800)]
lib/vsprintf.c: document more vsnprintf extensions

These were added in

9ac6e44 (lib/vsprintf.c: add %pU to print UUID/GUIDs)
c7dabef (vsprintf: use %pR, %pr instead of %pRt, %pRf)
8a27f7c (lib/vsprintf.c: Add "%pI6c" - print pointer as compressed ipv6 address)
4aa9960 (printk: add %I4, %I6, %i4, %i6 format specifiers)
dd45c9c (printk: add %pM format specifier for MAC addresses)

but only added comments to pointer() not vsnprintf() that is refered to by
printk's comments.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Harvey Harrison <harvey.harrison@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Joe Perches <joe@perches.com>
Cc: Jens Rosenboom <jens@mcbone.net>
Cc: David S. Miller <davem@davemloft.net>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agovt: don't export vt_kmsg_redirect() to userspace
Bernhard Walle [Thu, 17 Dec 2009 23:27:11 +0000 (15:27 -0800)]
vt: don't export vt_kmsg_redirect() to userspace

Fix following warning in linux-next by guarding the function definition
(both the "extern" and the inline) with #ifdef __KERNEL__.

usr/include/linux/vt.h:89: userspace cannot call function or variable defined in
the kernel

Introduced by commit 5ada918b82399eef3afd6a71e3637697d6bd719f ("vt:
introduce and use vt_kmsg_redirect() function").

Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agodrivers/video/via/viafbdev.c: correct code taking the size of a pointer
Julia Lawall [Thu, 17 Dec 2009 23:27:09 +0000 (15:27 -0800)]
drivers/video/via/viafbdev.c: correct code taking the size of a pointer

sizeof(viafb_gamma_table) is just the size of the pointer.  This is changed
to the size used when calling kmalloc to initialize the pointer.

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

// <smpl>
@@
expression *x;
expression f;
type T;
@@

*f(...,(T)x,...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Joseph Chan <JosephChan@via.com.tw>
Cc: Scott Fang <ScottFang@viatech.com.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agohwmon: I2C bus support for lis3lv02d and variant accelerometer chips
Samu Onkalo [Thu, 17 Dec 2009 23:27:07 +0000 (15:27 -0800)]
hwmon: I2C bus support for lis3lv02d and variant accelerometer chips

Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com>
Cc: Éric Piel <eric.piel@tremplin-utc.net>
Cc: Kalhan Trisal <kalhan.trisal@intel.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoreiserfs: truncate blocks not used by a write
Jan Kara [Thu, 17 Dec 2009 23:27:06 +0000 (15:27 -0800)]
reiserfs: truncate blocks not used by a write

It can happen that write does not use all the blocks allocated in
write_begin either because of some filesystem error (like ENOSPC) or
because page with data to write has been removed from memory.  We truncate
these blocks so that we don't have dangling blocks beyond i_size.

Cc: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agocs5535: CS5535_MFGPT_DEFAULT_IRQ should depend on CS5535_MFGPT
Geert Uytterhoeven [Thu, 17 Dec 2009 23:27:05 +0000 (15:27 -0800)]
cs5535: CS5535_MFGPT_DEFAULT_IRQ should depend on CS5535_MFGPT

It doesn't make much sense to have CS5535_MFGPT_DEFAULT_IRQ show up in
configs that cannot have CS5535_MFGPT.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Andres Salomon <dilinger@collabora.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agokernel/sysctl.c: fix the incomplete part of sysctl_max_map_count-should-be-non-negati...
WANG Cong [Thu, 17 Dec 2009 23:27:05 +0000 (15:27 -0800)]
kernel/sysctl.c: fix the incomplete part of sysctl_max_map_count-should-be-non-negative.patch

It is a mistake that we used 'proc_dointvec', it should be
'proc_dointvec_minmax', as in the original patch.

Signed-off-by: WANG Cong <amwang@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agox86: Fix objdump version check in arch/x86/tools/chkobjdump.awk
akpm@linux-foundation.org [Thu, 17 Dec 2009 23:26:36 +0000 (15:26 -0800)]
x86: Fix objdump version check in arch/x86/tools/chkobjdump.awk

It says

Warning: objdump version  is older than 2.19
Warning: Skipping posttest.

because it used the wrong field from `objdump -v':

akpm:/usr/src/25> /opt/crosstool/gcc-4.0.2-glibc-2.3.6/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-objdump -v
GNU objdump 2.16.1
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <200912172326.nBHNQaQl024796@imap1.linux-foundation.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Masami Hiramatsu <mhiramat@redhat.com>
14 years agoMerge branch 'cache' (early part)
Russell King [Thu, 17 Dec 2009 23:22:23 +0000 (23:22 +0000)]
Merge branch 'cache' (early part)

14 years agox86: Reenable TSC sync check at boot, even with NONSTOP_TSC
Pallipadi, Venkatesh [Thu, 17 Dec 2009 20:27:02 +0000 (12:27 -0800)]
x86: Reenable TSC sync check at boot, even with NONSTOP_TSC

Commit 83ce4009 did the following change
If the TSC is constant and non-stop, also set it reliable.

But, there seems to be few systems that will end up with TSC warp across
sockets, depending on how the cpus come out of reset. Skipping TSC sync
test on such systems may result in time inconsistency later.

So, reenable TSC sync test even on constant and non-stop TSC systems.
Set, sched_clock_stable to 1 by default and reset it in
mark_tsc_unstable, if TSC sync fails.

This change still gives perf benefit mentioned in 83ce4009 for systems
where TSC is reliable.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <20091217202702.GA18015@linux-os.sc.intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoRevert "task_struct: make journal_info conditional"
Linus Torvalds [Thu, 17 Dec 2009 21:23:24 +0000 (13:23 -0800)]
Revert "task_struct: make journal_info conditional"

This reverts commit e4c570c4cb7a95dbfafa3d016d2739bf3fdfe319, as
requested by Alexey:

 "I think I gave a good enough arguments to not merge it.
  To iterate:
   * patch makes impossible to start using ext3 on EXT3_FS=n kernels
     without reboot.
   * this is done only for one pointer on task_struct"

  None of config options which define task_struct are tristate directly
  or effectively."

Requested-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoMerge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mason/btrfs...
Chris Mason [Thu, 17 Dec 2009 21:01:41 +0000 (16:01 -0500)]
Merge branch 'master' of ssh:///linux/kernel/git/mason/btrfs-unstable into for-linus

14 years agoRevert "fix mismerge with Trond's stuff (create_mnt_ns() export is gone now)"
Linus Torvalds [Thu, 17 Dec 2009 20:51:05 +0000 (12:51 -0800)]
Revert "fix mismerge with Trond's stuff (create_mnt_ns() export is gone now)"

This reverts commit e9496ff46a20a8592fdc7bdaaf41b45eb808d310. Quoth Al:

 "it's dependent on a lot of other stuff not currently in mainline
  and badly broken with current fs/namespace.c.  Sorry, badly
  out-of-order cherry-pick from old queue.

  PS: there's a large pending series reworking the refcounting and
  lifetime rules for vfsmounts that will, among other things, allow to
  rip a subtree away _without_ dissolving connections in it, to be
  garbage-collected when all active references are gone.  It's
  considerably saner wrt "is the subtree busy" logics, but it's nowhere
  near being ready for merge at the moment; this changeset is one of the
  things becoming possible with that sucker, but it certainly shouldn't
  have been picked during this cycle.  My apologies..."

Noticed-by: Eric Paris <eparis@redhat.com>
Requested-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoBtrfs: make sure fallocate properly starts a transaction
Chris Mason [Thu, 17 Dec 2009 20:47:17 +0000 (15:47 -0500)]
Btrfs: make sure fallocate properly starts a transaction

The recent patch to make fallocate enospc friendly would send
down a NULL trans handle to the allocator.  This moves the
transaction start to properly fix things.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBluetooth: Prevent ill-timed autosuspend in USB driver
Oliver Neukum [Wed, 16 Dec 2009 18:23:43 +0000 (19:23 +0100)]
Bluetooth: Prevent ill-timed autosuspend in USB driver

The device must be marked busy as it receives data.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Tested-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Fix L2CAP locking scheme regression
Andrei Emeltchenko [Tue, 15 Dec 2009 09:38:04 +0000 (11:38 +0200)]
Bluetooth: Fix L2CAP locking scheme regression

When locking was introduced the error path branch was not taken
into account. Error was found in sparse code checking. Kudos to
Jani Nikula.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Acked-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Ack L2CAP I-frames before retransmit missing packet
Gustavo F. Padovan [Tue, 15 Dec 2009 22:13:27 +0000 (20:13 -0200)]
Bluetooth: Ack L2CAP I-frames before retransmit missing packet

Moving the Ack to before l2cap_retransmit_frame() we can avoid the
case where txWindow is full and the packet can't be retransmited.

Signed-off-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Fix unset of RemoteBusy flag for L2CAP
Gustavo F. Padovan [Tue, 15 Dec 2009 17:56:34 +0000 (15:56 -0200)]
Bluetooth: Fix unset of RemoteBusy flag for L2CAP

RemoteBusy flag need to be unset before l2cap_ertm_send(), otherwise
l2cap_ertm_send() will return without sending packets because it checks
that flag before start sending.

Signed-off-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoMerge branch btrfs-master into for-linus
Chris Mason [Thu, 17 Dec 2009 20:02:22 +0000 (15:02 -0500)]
Merge branch btrfs-master into for-linus

Conflicts:
fs/btrfs/acl.c

14 years agoBluetooth: Fix PTR_ERR return of wrong pointer in hidp_setup_hid()
Roel Kluin [Mon, 7 Dec 2009 13:23:21 +0000 (14:23 +0100)]
Bluetooth: Fix PTR_ERR return of wrong pointer in hidp_setup_hid()

Return the PTR_ERR of the correct pointer.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBtrfs: make metadata chunks smaller
Josef Bacik [Mon, 7 Dec 2009 21:45:59 +0000 (21:45 +0000)]
Btrfs: make metadata chunks smaller

This patch makes us a bit less zealous about making sure we have enough free
metadata space by pearing down the size of new metadata chunks to 256mb instead
of 1gb.  Also, we used to try an allocate metadata chunks when allocating data,
but that sort of thing is done elsewhere now so we can just remove it.  With my
-ENOSPC test I used to have 3gb reserved for metadata out of 75gb, now I have
1.7gb.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Show discard option in /proc/mounts
Matthew Wilcox [Mon, 14 Dec 2009 22:01:12 +0000 (22:01 +0000)]
Btrfs: Show discard option in /proc/mounts

Christoph's patch e244a0aeb6a599c19a7c802cda6e2d67c847b154 doesn't display
the discard option in /proc/mounts, leading to some confusion for me.
Here's the missing bit.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: deny sys_link across subvolumes.
TARUISI Hiroaki [Thu, 12 Nov 2009 07:14:26 +0000 (07:14 +0000)]
Btrfs: deny sys_link across subvolumes.

I rebased Christian Parpart's patch to deny hard link across
subvolumes. Original patch modifies also btrfs_rename, but
I excluded it because we can move across subvolumes now and
it make no problem.
-----------------

Hard link across subvolumes should not allowed in Btrfs.
btrfs_link checks root of 'to' directory is same as root
of 'from' file. If not same, btrfs_link returns -EPERM.

Signed-off-by: TARUISI Hiroaki <taruishi.hiroak@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: fail mount on bad mount options
Sage Weil [Sat, 7 Nov 2009 06:19:16 +0000 (06:19 +0000)]
Btrfs: fail mount on bad mount options

We shouldn't silently ignore unrecognized options.

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: don't add extent 0 to the free space cache v2
Yan, Zheng [Thu, 26 Nov 2009 09:31:11 +0000 (09:31 +0000)]
Btrfs: don't add extent 0 to the free space cache v2

If block group 0 is completely free, btrfs_read_block_groups will
add extent [0, BTRFS_SUPER_INFO_OFFSET) to the free space cache.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Fix per root used space accounting
Yan, Zheng [Thu, 12 Nov 2009 09:36:50 +0000 (09:36 +0000)]
Btrfs: Fix per root used space accounting

The bytes_used field in root item was originally planned to
trace the amount of used data and tree blocks. But it never
worked right since we can't trace freeing of data accurately.
This patch changes it to only trace the amount of tree blocks.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Fix btrfs_drop_extent_cache for skip pinned case
Yan, Zheng [Thu, 12 Nov 2009 09:36:44 +0000 (09:36 +0000)]
Btrfs: Fix btrfs_drop_extent_cache for skip pinned case

The check for skip pinned case is wrong, it may breaks the
while loop too soon.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Add delayed iput
Yan, Zheng [Thu, 12 Nov 2009 09:36:34 +0000 (09:36 +0000)]
Btrfs: Add delayed iput

iput() can trigger new transactions if we are dropping the
final reference, so calling it in btrfs_commit_transaction
may end up deadlock. This patch adds delayed iput to avoid
the issue.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Pass transaction handle to security and ACL initialization functions
Yan, Zheng [Thu, 12 Nov 2009 09:35:27 +0000 (09:35 +0000)]
Btrfs: Pass transaction handle to security and ACL initialization functions

Pass transaction handle down to security and ACL initialization
functions, so we can avoid starting nested transactions

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Make truncate(2) more ENOSPC friendly
Yan, Zheng [Thu, 12 Nov 2009 09:35:36 +0000 (09:35 +0000)]
Btrfs: Make truncate(2) more ENOSPC friendly

truncating and deleting regular files are unbound operations,
so it's not good to do them in a single transaction. This
patch makes btrfs_truncate and btrfs_delete_inode start a
new transaction after all items in a tree leaf are deleted.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Make fallocate(2) more ENOSPC friendly
Yan, Zheng [Thu, 12 Nov 2009 09:34:52 +0000 (09:34 +0000)]
Btrfs: Make fallocate(2) more ENOSPC friendly

fallocate(2) may allocate large number of file extents, so it's not
good to do it in a single transaction. This patch make fallocate(2)
start a new transaction for each file extents it allocates.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Avoid orphan inodes cleanup during committing transaction
Yan, Zheng [Thu, 12 Nov 2009 09:37:02 +0000 (09:37 +0000)]
Btrfs: Avoid orphan inodes cleanup during committing transaction

btrfs_lookup_dentry may trigger orphan cleanup, so it's not good
to call it while committing a transaction.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Avoid orphan inodes cleanup while replaying log
Yan, Zheng [Thu, 12 Nov 2009 09:34:40 +0000 (09:34 +0000)]
Btrfs: Avoid orphan inodes cleanup while replaying log

We do log replay in a single transaction, so it's not good to do unbound
operations. This patch cleans up orphan inodes cleanup after replaying
the log. It also avoids doing other unbound operations such as truncating
a file during replaying log. These unbound operations are postponed to
the orphan inode cleanup stage.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Fix disk_i_size update corner case
Yan, Zheng [Thu, 12 Nov 2009 09:34:21 +0000 (09:34 +0000)]
Btrfs: Fix disk_i_size update corner case

There are some cases file extents are inserted without involving
ordered struct. In these cases, we update disk_i_size directly,
without checking pending ordered extent and DELALLOC bit. This
patch extends btrfs_ordered_update_i_size() to handle these cases.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
Linus Torvalds [Thu, 17 Dec 2009 16:31:01 +0000 (08:31 -0800)]
Merge branch 'master' of git://git./linux/kernel/git/viro/vfs-2.6

* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
  kill I_LOCK
  fold do_sync_file_range into sys_sync_file_range
  fix up O_SYNC comments
  VFS/fsstack: handle 32-bit smp + preempt + large files in fsstack_copy_inode_size
  fsstack/ecryptfs: remove unused get_nlinks param to fsstack_copy_attr_all
  vfs: remove extraneous NULL d_inode check from do_filp_open
  fs: no games with DCACHE_UNHASHED
  fs: anon_inodes implement dname
  dio: fix use-after-free

14 years agoMerge branch 'for-linus' of git://gitserver.sunplusct.com/linux-2.6-score
Linus Torvalds [Thu, 17 Dec 2009 16:08:57 +0000 (08:08 -0800)]
Merge branch 'for-linus' of git://gitserver.sunplusct.com/linux-2.6-score

* 'for-linus' of git://gitserver.sunplusct.com/linux-2.6-score:
  score: include asm-generic/param.h in asm/delay.h.
  score: fixed pfn_valid define.
  score: add flush_dcahce_page and PG_dcache_dirty define