13 years agoGFS2: Support for I/O barriers
Steven Whitehouse [Fri, 26 Sep 2008 09:23:22 +0000 (10:23 +0100)]
GFS2: Support for I/O barriers

This patch adds barrier support to GFS2. There is not a lot of change
really... we just add the barrier flag when we write journal header
blocks. If the underlying device refuses to support them, we fall back
to the previous way of doing things (wait for the I/O and hope) since
there is nothing else we can do. There is no user configuration,
barriers will always be on unless the device refuses to support them.
This seems a reasonable solution to me since this is a correctness

Signed-off-by: Steven Whitehouse <>
13 years agoGFS2: Add UUID to GFS2 sb
Steven Whitehouse [Mon, 22 Sep 2008 06:29:31 +0000 (07:29 +0100)]
GFS2: Add UUID to GFS2 sb

This patch adds a UUID to the GFS2 sb structure. This field is not
actually referenced from kernel space at all, but is added for
completeness and due to the userland tools which get their on-disk
structure information from the gfs2_ondisk.h header file.

Since we have to be backwards compatible, we will assume that any GFS2
sb for which the UUID is all 0 does not have a UUID as such.

We should then be (after some userland changes) able to support the -U
mount option. This addresses Fedora bugzilla #242689

Signed-off-by: Steven Whitehouse <>
13 years agoGFS2: high time to take some time over atime
Steven Whitehouse [Thu, 18 Sep 2008 12:53:59 +0000 (13:53 +0100)]
GFS2: high time to take some time over atime

Until now, we've used the same scheme as GFS1 for atime. This has failed
since atime is a per vfsmnt flag, not a per fs flag and as such the
"noatime" flag was not getting passed down to the filesystems. This
patch removes all the "special casing" around atime updates and we
simply use the VFS's atime code.

The net result is that GFS2 will now support all the same atime related
mount options of any other filesystem on a per-vfsmnt basis. We do lose
the "lazy atime" updates, but we gain "relatime". We could add lazy
atime to the VFS at a later date, if there is a requirement for that
variant still - I suspect relatime will be enough.

Also we lose about 100 lines of code after this patch has been applied,
and I have a suspicion that it will speed things up a bit, even when
atime is "on". So it seems like a nice clean up as well.

From a user perspective, everything stays the same except the loss of
the per-fs atime quantum tweekable (ought to be per-vfsmnt at the very
least, and to be honest I don't think anybody ever used it) and that a
number of options which were ignored before now work correctly.

Please let me know if you've got any comments. I'm pushing this out
early so that you can all see what my plans are.

Signed-off-by: Steven Whitehouse <>
13 years agoGFS2: The war on bloat
Steven Whitehouse [Thu, 18 Sep 2008 12:49:32 +0000 (13:49 +0100)]
GFS2: The war on bloat

The following patch shrinks the gfs2_args structure which is embedded in
every GFS2 superblock. It cuts down the size of the options to a single
unsigned int (the 13 bits of bitfields will be rounded up to that size
by the compiler) from the current 11 unsigned ints. So on x86 thats 44
bytes shrinking to 4 bytes, in each and every GFS2 superblock.

Signed-off-by: Steven Whitehouse <>
13 years agoGFS2: GFS2 will panic if you misspell any mount options
Abhijith Das [Mon, 15 Sep 2008 13:54:06 +0000 (08:54 -0500)]
GFS2: GFS2 will panic if you misspell any mount options

The gfs2 superblock pointer is NULL after a failed mount. When control
eventually goes to gfs2_kill_sb, we dereference this NULL pointer. This
patch ensures that the gfs2 superblock pointer is not NULL before being
dereferenced in gfs2_kill_sb.

Signed-off-by: Abhijith Das <>
Signed-off-by: Steven Whitehouse <>
13 years agoGFS2: Direct IO write at end of file error
Bob Peterson [Thu, 11 Sep 2008 19:35:37 +0000 (15:35 -0400)]
GFS2: Direct IO write at end of file error

This patch fixes a problem whereby a direct_io write doesn't fall
back to buffered write properly at end of file.

Signed-off-by: Bob Peterson <>
Signed-off-by: Steven Whitehouse <>
13 years agoGFS2: Use an IS_ERR test rather than a NULL test
Julien Brunel [Mon, 1 Sep 2008 08:51:22 +0000 (10:51 +0200)]
GFS2: Use an IS_ERR test rather than a NULL test

In case of error, the function gfs2_inode_lookup returns an
ERR pointer, but never returns a NULL pointer. So a NULL test that
necessarily comes after an IS_ERR test should be deleted, and a NULL
test that may come after a call to this function should be
strengthened by an IS_ERR test.

The semantic match that finds this problem is as follows:

// <smpl>
expression x, E;
statement S1,S2;
x = gfs2_inode_lookup(...)
... when != x = E
* if (x != NULL)
S1 else S2
// </smpl>

Signed-off-by: Julien Brunel <>
Signed-off-by: Julia Lawall <>
Signed-off-by: Steven Whitehouse <>
13 years agoGFS2: Fix race relating to glock min-hold time
Steven Whitehouse [Tue, 2 Sep 2008 12:33:17 +0000 (13:33 +0100)]
GFS2: Fix race relating to glock min-hold time

In the case that a request for a glock arrives right after the
grant reply has arrived, it sometimes means that the gl_tstamp
field hasn't been updated recently enough. The net result is that
the min-hold time for the glock is ignored. If this happens
often enough, it leads to poor performance.

This patch adds an additional test, so that if the reply pending
bit is set on a glock, then it will select the maximum length of
time for the min-hold time, rather than looking at gl_tstamp.

Signed-off-by: Steven Whitehouse <>
13 years agoGFS2: Fix & clean up GFS2 rename
Steven Whitehouse [Tue, 26 Aug 2008 08:38:26 +0000 (09:38 +0100)]
GFS2: Fix & clean up GFS2 rename

This patch fixes a locking issue in the rename code by ensuring that we hold
the per sb rename lock over both directory and "other" renames which involve
different parent directories.

At the same time, this moved the (only called from one place) function
gfs2_ok_to_move into the file that its called from, so we can mark it
static. This should make a code a bit easier to follow.

Signed-off-by: Steven Whitehouse <>
Cc: Peter Staubach <>
13 years agoGFS2: rm on multiple nodes causes panic
Bob Peterson [Tue, 12 Aug 2008 18:39:29 +0000 (13:39 -0500)]
GFS2: rm on multiple nodes causes panic

This patch fixes a problem whereby simultaneous unlink, rmdir,
rename and link operations (e.g. rm -fR *) from multiple nodes
on the same GFS2 file system can cause kernel panics, hangs,
and/or memory corruption.  It also gets rid of all the non-rgrp
calls to gfs2_glock_nq_m.

Signed-off-by: Bob Peterson <>
Signed-off-by: Steven Whitehouse <>
13 years agoGFS2: Fix metafs mounts
Steven Whitehouse [Fri, 8 Aug 2008 12:45:13 +0000 (13:45 +0100)]
GFS2: Fix metafs mounts

This patch is intended to fix the issues reported in bz #457798. Instead
of having the metafs as a separate filesystem, it becomes a second root
of gfs2. As a result it will appear as type gfs2 in /proc/mounts, but it
is still possible (for backwards compatibility purposes) to mount it as
type gfs2meta. A new mount flag "meta" is introduced so that its possible
to tell the two cases apart in /proc/mounts.

As a result it becomes possible to mount type gfs2 with -o meta and
get the same result as mounting type gfs2meta. So it is possible to
mount just the metafs on its own. Currently if you do this, its then
impossible to mount the "normal" root of the gfs2 filesystem without
first unmounting the metafs root. I'm not sure if thats a feature or
a bug :-)

Either way, this is a great improvement on the previous scheme and I've
verified that it works ok with bind mounts on both the "normal" root
and the metafs root in various combinations.

There were also a bunch of functions in super.c which didn't belong there,
so this moves them into ops_fstype.c where they can be static. Hopefully
the mount/umount sequence is now more obvious as a result.

Signed-off-by: Steven Whitehouse <>
Cc: Alexander Viro <>
13 years agoGFS2: Fix debugfs glock file iterator
Steven Whitehouse [Tue, 22 Jul 2008 21:58:03 +0000 (22:58 +0100)]
GFS2: Fix debugfs glock file iterator

Due to an incorrect iterator, some glocks were being missed from the
glock dumps obtained via debugfs. This patch fixes the problem and
ensures that we don't miss any glocks in future.

Signed-off-by: Steven Whitehouse <>
13 years agoLinux 2.6.27-rc3 v2.6.27-rc3
Linus Torvalds [Wed, 13 Aug 2008 01:55:39 +0000 (18:55 -0700)]
Linux 2.6.27-rc3

13 years agoMerge branch 'for-2.6.27' of git://
Linus Torvalds [Tue, 12 Aug 2008 23:39:22 +0000 (16:39 -0700)]
Merge branch 'for-2.6.27' of git://

* 'for-2.6.27' of git://
  fs/nfsd/export.c: Adjust error handling code involving auth_domain_put
  MAINTAINERS: mention lockd and sunrpc in nfs entries
  lockd: trivial sparse endian annotations

13 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Tue, 12 Aug 2008 23:38:45 +0000 (16:38 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/roland/infiniband

* 'for-linus' of git://
  IB/ehca: Discard double CQE for one WR
  IB/ehca: Check idr_find() return value
  IB/ehca: Repoll CQ on invalid opcode
  IB/ehca: Rename goto label in ehca_poll_cq_one()
  IB/ehca: Update qp_state on cached modify_qp()
  IPoIB/cm: Use vmalloc() to allocate rx_rings

13 years agoMerge branch 'release' of git://
Linus Torvalds [Tue, 12 Aug 2008 23:07:48 +0000 (16:07 -0700)]
Merge branch 'release' of git://git./linux/kernel/git/aegl/linux-2.6

* 'release' of git://
  [IA64] use bcd2bin/bin2bcd
  [IA64] Ensure cpu0 can access per-cpu variables in early boot code

13 years agofirmware/memmap: cleanup
Bernhard Walle [Tue, 12 Aug 2008 22:09:14 +0000 (15:09 -0700)]
firmware/memmap: cleanup

Various cleanup the drivers/firmware/memmap (after review by AKPM):

    - fix kdoc to conform to the standard
    - move kdoc from header to implementation files
    - remove superfluous WARN_ON() after kmalloc()
    - WARN_ON(x); if (!x) -> if(!WARN_ON(x))
    - improve some comments

Signed-off-by: Bernhard Walle <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agoALi M7101 PMU also available on Sun Netra's too
Alexander Clouter [Tue, 12 Aug 2008 22:09:12 +0000 (15:09 -0700)]
ALi M7101 PMU also available on Sun Netra's too

My Sun Netra T1 AC200 has one of these... bit harsh not letting me use it
and all :)

alex@woodchuck:~$ lspci -nn
00:01.0 PCI bridge [0604]: Sun Microsystems Computer Corp. Simba Advanced PCI Bridge [108e:5000] (rev 13)
00:01.1 PCI bridge [0604]: Sun Microsystems Computer Corp. Simba Advanced PCI Bridge [108e:5000] (rev 13)
01:03.0 Non-VGA unclassified device [0000]: ALi Corporation M7101 Power Management Controller [PMU] [10b9:7101]
01:05.1 Ethernet controller [0200]: Sun Microsystems Computer Corp. RIO GEM [108e:1101] (rev 01)
01:05.3 USB Controller [0c03]: Sun Microsystems Computer Corp. RIO USB [108e:1103] (rev 01)
01:07.0 ISA bridge [0601]: ALi Corporation M1533/M1535 PCI to ISA Bridge [Aladdin IV/V/V+] [10b9:1533]
01:0c.0 Bridge [0680]: Sun Microsystems Computer Corp. RIO EBUS [108e:1100] (rev 01)
01:0c.1 Ethernet controller [0200]: Sun Microsystems Computer Corp. RIO GEM [108e:1101] (rev 01)
01:0c.3 USB Controller [0c03]: Sun Microsystems Computer Corp. RIO USB [108e:1103] (rev 01)
01:0d.0 IDE interface [0101]: ALi Corporation M5229 IDE [10b9:5229] (rev c3)
02:08.0 SCSI storage controller [0100]: LSI Logic / Symbios Logic 53C896/897 [1000:000b] (rev 07)
02:08.1 SCSI storage controller [0100]: LSI Logic / Symbios Logic 53C896/897 [1000:000b] (rev 07)

Signed-off-by: Alexander Clouter <>
Cc: Wim Van Sebroeck <>
Cc: "David S. Miller" <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agoMake ioctl.h compatible with userland
Michael Abbott [Tue, 12 Aug 2008 22:09:11 +0000 (15:09 -0700)]
Make ioctl.h compatible with userland

The attached patch seems to already exist in a number of branches -- it
keeps popping up on Google for me, and is certainly already in Debian --
but is strangely absent from mainstream.

The problem appears to be that the patched file ends up as part of the
target toolchain, but unfortunately the gcc constant folding doesn't
appear to eliminate the __invalid_size_argument_for_IOC value early
enough.  Certainly compiling C++ programs which use _IO...  macros as
constants fails without this patch.

Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agodocsrc: fix getdelays printk formats
Randy Dunlap [Tue, 12 Aug 2008 22:09:10 +0000 (15:09 -0700)]
docsrc: fix getdelays printk formats

Fix printf format type warnings (seen on alpha & ia64):

Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 6 has type '__u64'
Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 7 has type '__u64'
Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 8 has type '__u64'
Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 9 has type '__u64'
Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 12 has type '__u64'
Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 13 has type '__u64'
Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 16 has type '__u64'
Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 17 has type '__u64'
Documentation/accounting/getdelays.c:214: warning: format '%15llu' expects type 'long long unsigned int', but argument 4 has type '__u64'
Documentation/accounting/getdelays.c:214: warning: format '%15llu' expects type 'long long unsigned int', but argument 5 has type '__u64'
Documentation/accounting/getdelays.c:221: warning: format '%llu' expects type 'long long unsigned int', but argument 2 has type '__u64'
Documentation/accounting/getdelays.c:221: warning: format '%llu' expects type 'long long unsigned int', but argument 3 has type '__u64'
Documentation/accounting/getdelays.c:221: warning: format '%llu' expects type 'long long unsigned int', but argument 4 has type '__u64'
Documentation/accounting/getdelays.c:221: warning: format '%llu' expects type 'long long unsigned int', but argument 5 has type '__u64'
Documentation/accounting/getdelays.c:221: warning: format '%llu' expects type 'long long unsigned int', but argument 6 has type '__u64'
Documentation/accounting/getdelays.c:236: warning: 'cmd_type' may be used uninitialized in this function

Signed-off-by: Randy Dunlap <>
Cc: Balbir Singh <>
Cc: Sam Ravnborg <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agodocsrc: fix crc32hash type
Randy Dunlap [Tue, 12 Aug 2008 22:09:08 +0000 (15:09 -0700)]
docsrc: fix crc32hash type

Fix differing signedness warning:

Documentation/pcmcia/crc32hash.c:29: warning: pointer targets in passing argument 1 of 'crc32' differ in signedness

Signed-off-by: Randy Dunlap <>
Acked-by: Dominik Brodowski <>
Cc: Sam Ravnborg <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agodocsrc: fix ifenslave type
Randy Dunlap [Tue, 12 Aug 2008 22:09:08 +0000 (15:09 -0700)]
docsrc: fix ifenslave type

Documentation/networking/ifenslave.c:1084: warning: pointer targets in assignment differ in signedness

>From include/linux/socket.h:
 * 1003.1g requires sa_family_t and that sa_data is char.

and from SUSv3:

The <sys/socket.h> header shall define the sockaddr structure that includes at least the following members:

sa_family_t  sa_family  Address family.
char         sa_data[]  Socket address (variable-length data).
<end SUSv3>

Signed-off-by: Randy Dunlap <>
Cc: Sam Ravnborg <>
Cc: "David S. Miller" <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agodocsrc: fix procfs example
Randy Dunlap [Tue, 12 Aug 2008 22:09:06 +0000 (15:09 -0700)]
docsrc: fix procfs example

Add MODULE_LICENSE() to DocBook/procfs_example.c since modpost complained
about a missing license there.

Remove tty procfs removal since the creation was deleted long ago

Signed-off-by: Randy Dunlap <>
Cc: <>
Cc: Sam Ravnborg <>
Cc: Alan Cox <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agodocsrc: build Documentation/ sources
Randy Dunlap [Tue, 12 Aug 2008 22:09:06 +0000 (15:09 -0700)]
docsrc: build Documentation/ sources

Currently source files in the Documentation/ sub-dir can easily bit-rot
since they are not generally buildable, either because they are hidden in
text files or because there are no Makefile rules for them.  This needs to
be fixed so that the source files remain usable and good examples of code
instead of bad examples.

Add the ability to build source files that are in the Documentation/ dir.
Add to Kconfig as "BUILD_DOCSRC" config symbol.

Use "CONFIG_BUILD_DOCSRC=1 make ..." to build objects from the
Documentation/ sources.  Or enable BUILD_DOCSRC in the *config system.
However, this symbol depends on HEADERS_CHECK since the header files need
to be installed (for userspace builds).

Built (using cross-tools) for x86-64, i386, alpha, ia64, sparc32,
sparc64, powerpc, sh, m68k, & mips.

Signed-off-by: Randy Dunlap <>
Reviewed-by: Sam Ravnborg <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agobyteorder: add include/linux/byteorder.h to define endian helpers
Harvey Harrison [Tue, 12 Aug 2008 22:09:05 +0000 (15:09 -0700)]
byteorder: add include/linux/byteorder.h to define endian helpers

Signed-off-by: Harvey Harrison <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agobyteorder: add a new include/linux/swab.h to define byteswapping functions
Harvey Harrison [Tue, 12 Aug 2008 22:09:04 +0000 (15:09 -0700)]
byteorder: add a new include/linux/swab.h to define byteswapping functions

Collect the implementations from include/linux/byteorder/swab.h, swabb.h
in swab.h

The functionality provided covers:
u16 swab16(u16 val) - return a byteswapped 16 bit value
u32 swab32(u32 val) - return a byteswapped 32 bit value
u64 swab64(u64 val) - return a byteswapped 64 bit value
u32 swahw32(u32 val) - return a wordswapped 32 bit value
u32 swahb32(u32 val) - return a high/low byteswapped 32 bit value

Similar to above, but return swapped value from a naturally-aligned pointer
u16 swab16p(u16 *p)
u32 swab32p(u32 *p)
u64 swab64p(u64 *p)
u32 swahw32p(u32 *p)
u32 swahb32p(u32 *p)

Similar to above, but swap the value in-place (in-situ)
void swab16s(u16 *p)
void swab32s(u32 *p)
void swab64s(u64 *p)
void swahw32s(u32 *p)
void swahb32s(u32 *p)

Arches can override any of these with an optimized version by defining an
inline in their asm/byteorder.h (example given for swab16()):

u16 __arch_swab16() {}
 #define __arch_swab16 __arch_swab16

Signed-off-by: Harvey Harrison <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agogenirq: switch /proc/irq/*/smp_affinity et al to seqfiles
Alexey Dobriyan [Tue, 12 Aug 2008 22:09:03 +0000 (15:09 -0700)]
genirq: switch /proc/irq/*/smp_affinity et al to seqfiles

Switch /proc/irq/*/smp_affinity , /proc/irq/default_smp_affinity to

cat(1) reads with 1024 chunks by default, with high enough NR_CPUS, there
will be -EINVAL.

As side effect, there are now two less users of the ->read_proc interface.

Signed-off-by: Alexey Dobriyan <>
Cc: Paul Jackson <>
Cc: Mike Travis <>
Cc: Al Viro <>
Cc: Ingo Molnar <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agoseq_file: add seq_cpumask(), seq_nodemask()
Alexey Dobriyan [Tue, 12 Aug 2008 22:09:02 +0000 (15:09 -0700)]
seq_file: add seq_cpumask(), seq_nodemask()

Short enough reads from /proc/irq/*/smp_affinity return -EINVAL for no
good reason.

This became noticed with NR_CPUS=4096 patches, when length of printed
representation of cpumask becase 1152, but cat(1) continued to read with
1024-byte chunks.  bitmap_scnprintf() in good faith fills buffer, returns
1023, check returns -EINVAL.

Fix it by switching to seq_file, so handler will just fill buffer and
doesn't care about offsets, length, filling EOF and all this crap.

For that add seq_bitmap(), and wrappers around it -- seq_cpumask() and

Signed-off-by: Alexey Dobriyan <>
Reviewed-by: Paul Jackson <>
Cc: Mike Travis <>
Cc: Al Viro <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agoreiserfs: removed duplicated #include
Huang Weiyi [Tue, 12 Aug 2008 22:09:01 +0000 (15:09 -0700)]
reiserfs: removed duplicated #include

Removed duplicated #include <linux/quotaops.h> in

Signed-off-by: Huang Weiyi <>
Signed-off-by: Jan Kara <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agofs/eventpoll.c: fix sys_epoll_create1() comment
Andrew Morton [Tue, 12 Aug 2008 22:09:01 +0000 (15:09 -0700)]
fs/eventpoll.c: fix sys_epoll_create1() comment

The `size' argument was removed.

Reported-by: Geert Uytterhoeven <>
Cc: Ulrich Drepper <>
Cc: Davide Libenzi <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agodrivers/char/rtc.c: removed duplicated include
Huang Weiyi [Tue, 12 Aug 2008 22:09:00 +0000 (15:09 -0700)]
drivers/char/rtc.c: removed duplicated include

Signed-off-by: Huang Weiyi <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agomm/sparse.c: removed duplicated include
Huang Weiyi [Tue, 12 Aug 2008 22:09:00 +0000 (15:09 -0700)]
mm/sparse.c: removed duplicated include

Signed-off-by: Huang Weiyi <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agomove kernel-doc comment for might_sleep directly before its defining block
Uwe Kleine-König [Tue, 12 Aug 2008 22:08:59 +0000 (15:08 -0700)]
move kernel-doc comment for might_sleep directly before its defining block

Signed-off-by: Uwe Kleine-König <>
Cc: Ingo Molnar <>
Cc: Randy Dunlap <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agolib/vsprintf.c: wrong conversion function used
Yi Yang [Tue, 12 Aug 2008 22:08:58 +0000 (15:08 -0700)]
lib/vsprintf.c: wrong conversion function used

Fix wrong conversion function used by strict_strtou*

Signed-off-by: Yi Yang <>
Reported-by: Swen Schillig <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agofbcon: prevent cursor disappearance after switching to 512 character font
Krzysztof Helt [Tue, 12 Aug 2008 22:08:57 +0000 (15:08 -0700)]
fbcon: prevent cursor disappearance after switching to 512 character font

Adjust and honor the vc_scrl_erase_char for 256 and 512 character fonts.

It fixes the issue with disappearing cursor during scrolling
(  The issue was
reported and tracked by Peter Hanzel.

Signed-off-by: Krzysztof Helt <>
Reported-by: Peter Hanzel <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agoatmel_lcdfb: add board parameter specify framebuffer memory size
Haavard Skinnemoen [Tue, 12 Aug 2008 22:08:57 +0000 (15:08 -0700)]
atmel_lcdfb: add board parameter specify framebuffer memory size

Specify how much physically continuous, DMA capable memory will be
allocated at driver initialization time.  This allow to create framebuffer
device with larger virtual resolution.  Combine with y-panning this can be
used to implement double buffering acceleration method.

Signed-off-by: Stanislaw Gruszka <>
Acked-by: Haavard Skinnemoen <>
Acked-by: Krzysztof Helt <>
Cc: Nicolas Ferre <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agoatmel_lcdfb: set ypanstep to 1 and enable y-panning on AT91
Haavard Skinnemoen [Tue, 12 Aug 2008 22:08:56 +0000 (15:08 -0700)]
atmel_lcdfb: set ypanstep to 1 and enable y-panning on AT91

Panning in the y-direction can be done by simply changing the DMA base
address.  This code is already in place, but FBIOPAN_DISPLAY will
currently fail because ypanstep is 0.

Set ypanstep to 1 to indicate that we do support y-panning and also set
the necessary acceleration flags on AT91 (AVR32 already have them.)

Signed-off-by: Haavard Skinnemoen <>
Acked-by: Krzysztof Helt <>
Cc: Nicolas Ferre <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agomatrox maven: convert to a new-style i2c driver
Jean Delvare [Tue, 12 Aug 2008 22:08:55 +0000 (15:08 -0700)]
matrox maven: convert to a new-style i2c driver

The legacy i2c model is going away soon, so switch to the new model.

Signed-off-by: Jean Delvare <>
Acked-by: Krzysztof Helt <>
Cc: Petr Vandrovec <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agomatroxfb: i2c structure templates clean-up
Jean Delvare [Tue, 12 Aug 2008 22:08:54 +0000 (15:08 -0700)]
matroxfb: i2c structure templates clean-up

Clean up the use of structure templates in i2c-matroxfb. In this case
it's more efficient to initialize the few fields we need individually.
This makes i2c-matroxfb.ko 16% smaller on my system.

Signed-off-by: Jean Delvare <>
Acked-by: Krzysztof Helt <>
Cc: Petr Vandrovec <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agomatrox maven: fix a broken error path
Jean Delvare [Tue, 12 Aug 2008 22:08:53 +0000 (15:08 -0700)]
matrox maven: fix a broken error path

I broke an error path with d03c21ec0be7787ff6b75dcf56c0e96209ccbfbd,
sorry about that.

The machine will crash if the i2c_attach_client() or maven_init_client()
calls fail, although nobody has yet reported this happening.

Signed-off-by: Jean Delvare <>
Acked-by: Krzysztof Helt <>
Cc: Petr Vandrovec <>
Cc: <> [2.6.25.x, 2.6.26.x]
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agodo_migrate_pages(): remove unused variable
MinChan Kim [Tue, 12 Aug 2008 22:08:52 +0000 (15:08 -0700)]
do_migrate_pages(): remove unused variable

Signed-off-by: MinChan Kim <>
Acked-by: Christoph Lameter <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agoGRU: fix preprocessor symbol for sparse
Randy Dunlap [Tue, 12 Aug 2008 22:08:51 +0000 (15:08 -0700)]
GRU: fix preprocessor symbol for sparse

Fix preprocessor symbol so that sparse sees it and does not generate

  drivers/misc/sgi-gru/grutables.h:286:2: error: "Unsupported architecture"
  drivers/misc/sgi-gru/grutables.h:286:2: error: "Unsupported architecture"
  drivers/misc/sgi-gru/grutables.h:286:2: error: "Unsupported architecture"
  drivers/misc/sgi-gru/grutables.h:286:2: error: "Unsupported architecture"
  drivers/misc/sgi-gru/grutlbpurge.c:185:11: error: undefined identifier 'GRUREGION'
  drivers/misc/sgi-gru/grutables.h:286:2: error: "Unsupported architecture"
  drivers/misc/sgi-gru/grutables.h:286:2: error: "Unsupported architecture"

Signed-off-by: Randy Dunlap <>
Cc: Jack Steiner <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agoradeonfb: fix accel engine hangs
David Miller [Tue, 12 Aug 2008 22:08:51 +0000 (15:08 -0700)]
radeonfb: fix accel engine hangs

Some chips appear to have the 2D engine hang during screen redraw,
typically in a sequence of copyarea operations. This appear to be
solved by adding a flush of the engine destination pixel cache
and waiting for the engine to be idle before issuing the accel
operation. The performance impact seems to be fairly small.

Here is a trace on an RV370 (PCI device ID 0x5b64), it records the
RBBM_STATUS register, then the source x/y, destination x/y, and
width/height used for the copy:

radeonfb_prim_copyarea: STATUS[00000140] src[210:70] dst[210:60] wh[a0:10]
radeonfb_prim_copyarea: STATUS[00000140] src[2b8:70] dst[2b8:60] wh[88:10]
radeonfb_prim_copyarea: STATUS[00000140] src[348:70] dst[348:60] wh[40:10]
radeonfb_prim_copyarea: STATUS[80020140] src[390:70] dst[390:60] wh[88:10]
radeonfb_prim_copyarea: STATUS[8002613f] src[40:80] dst[40:70] wh[28:10]
radeonfb_prim_copyarea: STATUS[80026139] src[a8:80] dst[a8:70] wh[38:10]
radeonfb_prim_copyarea: STATUS[80026133] src[e8:80] dst[e8:70] wh[80:10]
radeonfb_prim_copyarea: STATUS[8002612d] src[170:80] dst[170:70] wh[30:10]
radeonfb_prim_copyarea: STATUS[80026127] src[1a8:80] dst[1a8:70] wh[8:10]
radeonfb_prim_copyarea: STATUS[80026121] src[1b8:80] dst[1b8:70] wh[88:10]
radeonfb_prim_copyarea: STATUS[8002611b] src[248:80] dst[248:70] wh[68:10]

When things are going fine the copies complete before the next ROP is
even issued, but all of a sudden the 2D unit becomes active (bit 17 in
RBBM_STATUS) and the FIFO retry (bit 13) and FIFO pipeline busy (bit
14) are set as well.  The FIFO begins to backup until it becomes full.

What happens next is the radeon_fifo_wait() times out, and we access
the chip illegally leading to a bus error which usually wedges the
box.  None of this makes it to the console screen, of course :-)
radeon_fifo_wait() should be modified to reset the accelerator when
this timeout happens instead of programming the chip anyways.

radeonfb: FIFO Timeout !
ERROR(0): Cheetah error trap taken afsr[0010080005000000] afar[000007f900800e40] TL1(0)
ERROR(0): TPC[595114] TNPC[595118] O7[459788] TSTATE[11009601]
ERROR(0): TPC<radeonfb_copyarea+0xfc/0x248>
ERROR(0): M_SYND(0),  E_SYND(0), Privileged
ERROR(0): Highest priority error (0000080000000000) "Bus error response from system bus"
ERROR(0): D-cache idx[0] tag[0000000000000000] utag[0000000000000000] stag[0000000000000000]
ERROR(0): D-cache data0[0000000000000000] data1[0000000000000000] data2[0000000000000000] data3[0000000000000000]
ERROR(0): I-cache idx[0] tag[0000000000000000] utag[0000000000000000] stag[0000000000000000] u[0000000000000000] l[00\

ERROR(0): I-cache INSN0[0000000000000000] INSN1[0000000000000000] INSN2[0000000000000000] INSN3[0000000000000000]
ERROR(0): I-cache INSN4[0000000000000000] INSN5[0000000000000000] INSN6[0000000000000000] INSN7[0000000000000000]
ERROR(0): E-cache idx[800e40] tag[000000000e049f4c]
ERROR(0): E-cache data0[fffff8127d300180] data1[00000000004b5384] data2[0000000000000000] data3[0000000000000000]
Ker:xnel panic - not syncing: Irrecoverable deferred error trap.

Another quirk is that these copyarea calls will not happen until the
first drivers/char/vt.c:redraw_screen() occurs.  This will only happen
if you 1) VC switch or 2) run "consolechars" or 3) unblank the screen.

This seems to happen because until a redraw_screen() the screen scrolling
method used by fbcon is not finalized yet.  I've seen this with other fb
drivers too.

So if all you do is boot straight into X you will never see this bug on
the relevant chips.

Signed-off-by: David S. Miller <>
Signed-off-by: Benjamin Herrenschmidt <>
Cc: <> [2.6.25.x, 2.6.26.x]
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agoallocate structures for reservation tracking in hugetlbfs outside of spinlocks v2
Andy Whitcroft [Tue, 12 Aug 2008 22:08:49 +0000 (15:08 -0700)]
allocate structures for reservation tracking in hugetlbfs outside of spinlocks v2

[Andrew this should replace the previous version which did not check
the returns from the region prepare for errors.  This has been tested by
us and Gerald and it looks good.

Bah, while reviewing the locking based on your previous email I spotted
that we need to check the return from the vma_needs_reservation call for
allocation errors.  Here is an updated patch to correct this.  This passes
testing here.]

Signed-off-by: Andy Whitcroft <>
Tested-by: Gerald Schaefer <>
Cc: Mel Gorman <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agohugetlbfs: allocate structures for reservation tracking outside of spinlocks
Andy Whitcroft [Tue, 12 Aug 2008 22:08:47 +0000 (15:08 -0700)]
hugetlbfs: allocate structures for reservation tracking outside of spinlocks

In the normal case, hugetlbfs reserves hugepages at map time so that the
pages exist for future faults.  A struct file_region is used to track when
reservations have been consumed and where.  These file_regions are
allocated as necessary with kmalloc() which can sleep with the
mm->page_table_lock held.  This is wrong and triggers may-sleep warning
when PREEMPT is enabled.

Updates to the underlying file_region are done in two phases.  The first
phase prepares the region for the change, allocating any necessary memory,
without actually making the change.  The second phase actually commits the
change.  This patch makes use of this by checking the reservations before
the page_table_lock is taken; triggering any necessary allocations.  This
may then be safely repeated within the locks without any allocations being

Credit to Mel Gorman for diagnosing this failure and initial versions of
the patch.

Signed-off-by: Andy Whitcroft <>
Tested-by: Gerald Schaefer <>
Cc: Mel Gorman <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agoisight_firmware: fix a leak and double kfree()
Parag Warudkar [Tue, 12 Aug 2008 22:08:46 +0000 (15:08 -0700)]
isight_firmware: fix a leak and double kfree()

Signed-off-by: Parag Warudkar <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agocpuidle: make sysfs attributes sysdev class attributes
Rabin Vincent [Tue, 12 Aug 2008 22:08:45 +0000 (15:08 -0700)]
cpuidle: make sysfs attributes sysdev class attributes

These attributes are really sysdev class attributes.  The incorrect
definition leads to an oops because of recent changes which make sysdev
attributes use a different prototype.

Based on Andi's f718cd4add5aea9d379faff92f162571e356cc5f ("sched: make
scheduler sysfs attributes sysdev class devices")

Reported-by: Eric Sesterhenn <>
Signed-off-by: Rabin Vincent <>
Acked-by: Andi Kleen <>
Cc: "Li, Shaohua" <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agortc-isl1208: fix double removal of a sysfs entry
Alessandro Zummo [Tue, 12 Aug 2008 22:08:44 +0000 (15:08 -0700)]
rtc-isl1208: fix double removal of a sysfs entry

Signed-off-by: Alessandro Zummo <>
Cc: Herbert Valerio Riedel <>
Cc: Hartley Sweeten <>
Cc: David Brownell <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agoh8300: fix section mismatches
Yoshinori Sato [Tue, 12 Aug 2008 22:08:43 +0000 (15:08 -0700)]
h8300: fix section mismatches

WARNING: vmlinux.o(.text+0x2fdf): Section mismatch in reference from the variable .LM3 to the variable .init.text:___alloc_bootmem
The function .LM3() references
the variable __init ___alloc_bootmem.
This is often because .LM3 lacks a __init
annotation or the annotation of ___alloc_bootmem is wrong.

WARNING: vmlinux.o(.text+0x2ff5): Section mismatch in reference from the variable .LM4 to the variable .init.text:___alloc_bootmem
The function .LM4() references
the variable __init ___alloc_bootmem.
This is often because .LM4 lacks a __init
annotation or the annotation of ___alloc_bootmem is wrong.

WARNING: vmlinux.o(.text+0x300b): Section mismatch in reference from the variable .LM5 to the variable .init.text:___alloc_bootmem
The function .LM5() references
the variable __init ___alloc_bootmem.
This is often because .LM5 lacks a __init
annotation or the annotation of ___alloc_bootmem is wrong.

WARNING: vmlinux.o(.text+0x304b): Section mismatch in reference from the variable .LM10 to the variable .init.text:_free_area_init
The function .LM10() references
the variable __init _free_area_init.
This is often because .LM10 lacks a __init
annotation or the annotation of _free_area_init is wrong.

WARNING: vmlinux.o(.text+0x30a3): Section mismatch in reference from the variable .LM17 to the variable .init.text:_free_all_bootmem
The function .LM17() references
the variable __init _free_all_bootmem.
This is often because .LM17 lacks a __init
annotation or the annotation of _free_all_bootmem is wrong.

Signed-off-by: Yoshinori Sato <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agorevert "rtc: cdev lock_kernel() pushdown"
David Brownell [Tue, 12 Aug 2008 22:08:41 +0000 (15:08 -0700)]
revert "rtc: cdev lock_kernel() pushdown"

Revert commit 51a776fa7a7997e726d4a478eda0854c6f9143bd ("rtc: cdev
lock_kernel() pushdown").  The RTC framework does not need BKL

Signed-off-by: David Brownell <>
Cc: Jonathan Corbet <>
Cc: Alessandro Zummo <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agomemcg: fix oops in mem_cgroup_shrink_usage
Hugh Dickins [Tue, 12 Aug 2008 22:08:41 +0000 (15:08 -0700)]
memcg: fix oops in mem_cgroup_shrink_usage

Got an oops in mem_cgroup_shrink_usage() when testing loop over tmpfs:
yes, of course, loop0 has no mm: other entry points check but this didn't.

Signed-off-by: Hugh Dickins <>
Cc: KAMEZAWA Hiroyuki <>
Acked-by: Balbir Singh <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agocpu hotplug: s390 doesn't support additional_cpus anymore.
Heiko Carstens [Tue, 12 Aug 2008 22:08:40 +0000 (15:08 -0700)]
cpu hotplug: s390 doesn't support additional_cpus anymore.

s390 doesn't support the additional_cpus kernel parameter anymore since a
long time.  So we better update the code and documentation to reflect

Cc: Martin Schwidefsky <>
Signed-off-by: Heiko Carstens <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agopage allocator: use no-panic variant of alloc_bootmem() in alloc_large_system_hash()
Jan Beulich [Tue, 12 Aug 2008 22:08:39 +0000 (15:08 -0700)]
page allocator: use no-panic variant of alloc_bootmem() in alloc_large_system_hash()

..  since a failed allocation is being (initially) handled gracefully, and
panic()-ed upon failure explicitly in the function if retries with smaller
sizes failed.

Signed-off-by: Jan Beulich <>
Signed-off-by: David Howells <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agoquota: documentation for sending "below quota" messages via netlink and tiny doc...
Jan Kara [Tue, 12 Aug 2008 22:08:39 +0000 (15:08 -0700)]
quota: documentation for sending "below quota" messages via netlink and tiny doc update

Signed-off-by: Jan Kara <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agohugetlb: call arch_prepare_hugepage() for surplus pages
Gerald Schaefer [Tue, 12 Aug 2008 22:08:38 +0000 (15:08 -0700)]
hugetlb: call arch_prepare_hugepage() for surplus pages

The s390 software large page emulation implements shared page tables by
using page->index of the first tail page from a compound large page to
store page table information.  This is set up in arch_prepare_hugepage(),
which is called from alloc_fresh_huge_page_node().

A similar call to arch_prepare_hugepage() is missing for surplus large
pages that are allocated in alloc_buddy_huge_page(), which breaks the
software emulation mode for (surplus) large pages on s390.  This patch
adds the missing call to arch_prepare_hugepage().  It will have no effect
on other architectures where arch_prepare_hugepage() is a nop.

Also, use the correct order in the error path in alloc_fresh_huge_page_node().

Acked-by: Martin Schwidefsky <>
Signed-off-by: Gerald Schaefer <>
Acked-by: Nick Piggin <>
Acked-by: Adam Litke <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agofeature-removal-schedule.txt: remove the NCR53C9x entry
Adrian Bunk [Tue, 12 Aug 2008 22:08:37 +0000 (15:08 -0700)]
feature-removal-schedule.txt: remove the NCR53C9x entry

Now that the driver is removed we should also remove the entry in

Signed-off-by: Adrian Bunk <>
Acked-by: Christoph Hellwig <>
Cc: James Bottomley <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
13 years agoMerge branches 'ehca' and 'ipoib' into for-linus
Roland Dreier [Tue, 12 Aug 2008 20:52:54 +0000 (13:52 -0700)]
Merge branches 'ehca' and 'ipoib' into for-linus

13 years ago[IA64] use bcd2bin/bin2bcd
Adrian Bunk [Fri, 8 Aug 2008 16:34:45 +0000 (19:34 +0300)]
[IA64] use bcd2bin/bin2bcd

This patch changes ia64 to use the new bcd2bin/bin2bcd functions instead
of the obsolete BCD2BIN/BIN2BCD macros.

Signed-off-by: Adrian Bunk <>
Signed-off-by: Tony Luck <>
13 years agoIB/ehca: Discard double CQE for one WR
Alexander Schmidt [Tue, 12 Aug 2008 13:46:30 +0000 (15:46 +0200)]
IB/ehca: Discard double CQE for one WR

Under rare circumstances, the ehca hardware might erroneously generate
two CQEs for the same WQE, which is not compliant to the IB spec and
will cause unpredictable errors like memory being freed twice. To
avoid this problem, the driver needs to detect the second CQE and
discard it.

For this purpose, introduce an array holding as many elements as the
SQ of the QP, called sq_map. Each sq_map entry stores a "reported"
flag for one WQE in the SQ. When a work request is posted to the SQ,
the respective "reported" flag is set to zero. After the arrival of a
CQE, the flag is set to 1, which allows to detect the occurence of a
second CQE.

The mapping between WQE / CQE and the corresponding sq_map element is
implemented by replacing the lowest 16 Bits of the wr_id with the
index in the queue map. The original 16 Bits are stored in the sq_map
entry and are restored when the CQE is passed to the application.

Signed-off-by: Alexander Schmidt <>
Signed-off-by: Roland Dreier <>
13 years agoIB/ehca: Check idr_find() return value
Alexander Schmidt [Tue, 12 Aug 2008 13:46:27 +0000 (15:46 +0200)]
IB/ehca: Check idr_find() return value

The idr_find() function may fail when trying to get the QP that is
associated with a CQE, e.g. when a QP has been destroyed between the
generation of a CQE and the poll request for it.  In consequence, the
return value of idr_find() must be checked and the CQE must be
discarded when the QP cannot be found.

Signed-off-by: Alexander Schmidt <>
Signed-off-by: Roland Dreier <>
13 years agoIB/ehca: Repoll CQ on invalid opcode
Alexander Schmidt [Tue, 12 Aug 2008 13:46:20 +0000 (15:46 +0200)]
IB/ehca: Repoll CQ on invalid opcode

When the ehca driver detects an invalid opcode in a CQE, it currently
passes the CQE to the application and returns with success. This patch
changes the CQE handling to discard CQEs with invalid opcodes and to
continue reading the next CQE from the CQ.

Signed-off-by: Alexander Schmidt <>
Signed-off-by: Roland Dreier <>
13 years agoIB/ehca: Rename goto label in ehca_poll_cq_one()
Alexander Schmidt [Tue, 12 Aug 2008 13:46:13 +0000 (15:46 +0200)]
IB/ehca: Rename goto label in ehca_poll_cq_one()

Rename the "poll_cq_one_read_cqe" goto label to what it actually does,
namely "repoll".

Signed-off-by: Alexander Schmidt <>
Signed-off-by: Roland Dreier <>
13 years agoIB/ehca: Update qp_state on cached modify_qp()
Alexander Schmidt [Tue, 12 Aug 2008 13:46:07 +0000 (15:46 +0200)]
IB/ehca: Update qp_state on cached modify_qp()

Since the introduction of the port auto-detect mode for ehca, calls to
modify_qp() may be cached in the device driver when the ports are not
activated yet. When a modify_qp() call is cached, the qp state remains
untouched until the port is activated, which will leave the qp in the
reset state. In the reset state, however, it is not allowed to post SQ
WQEs, which confuses applications like ib_mad.

The solution for this problem is to immediately set the qp state as
requested by modify_qp(), even when the call is cached.

Signed-off-by: Alexander Schmidt <>
Signed-off-by: Roland Dreier <>
13 years ago[IA64] Ensure cpu0 can access per-cpu variables in early boot code
Tony Luck [Tue, 12 Aug 2008 17:34:20 +0000 (10:34 -0700)]
[IA64] Ensure cpu0 can access per-cpu variables in early boot code

ia64 handles per-cpu variables a litle differently from other architectures
in that it maps the physical memory allocated for each cpu at a constant
virtual address (0xffffffffffff0000). This mapping is not enabled until
the architecture specific cpu_init() function is run, which causes problems
since some generic code is run before this point. In particular when
CONFIG_PRINTK_TIME is enabled, the boot cpu will trap on the access to
per-cpu memory at the first printk() call so the boot will fail without
the kernel printing anything to the console.

Fix this by allocating percpu memory for cpu0 in the kernel data section
and doing all initialization to enable percpu access in head.S before
calling any generic code.

Other cpus must take care not to access per-cpu variables too early, but
their code path from start_secondary() to cpu_init() is all in arch/ia64

Signed-off-by: Tony Luck <>
13 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Tue, 12 Aug 2008 16:14:24 +0000 (09:14 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://
  ALSA: hda - support new AMD HDMI Audio (1002:970f)
  ALSA: hda_intel: ALSA HD Audio patch for Intel Ibex Peak DeviceIDs
  ALSA: wm8750: add missing VREF output
  ALSA: spitz: MONO -> MONO1
  ALSA: wm8750: it's MONO1, not MONO

13 years agoMerge branch 'core-fixes-for-linus-2' of git://
Linus Torvalds [Tue, 12 Aug 2008 15:49:53 +0000 (08:49 -0700)]
Merge branch 'core-fixes-for-linus-2' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'core-fixes-for-linus-2' of git://
  generic-ipi: fix stack and rcu interaction bug in smp_call_function_mask(), fix

13 years agoMerge git://
Linus Torvalds [Tue, 12 Aug 2008 15:40:19 +0000 (08:40 -0700)]
Merge git://git./linux/kernel/git/rusty/linux-2.6-for-linus

* git://
  fix spinlock recursion in hvc_console
  stop_machine: remove unused variable
  modules: extend initcall_debug functionality to the module loader
  export virtio_rng.h
  lguest: use get_user_pages_fast() instead of get_user_pages()
  mm: Make generic weak get_user_pages_fast and EXPORT_GPL it
  lguest: don't set MAC address for guest unless specified

13 years agoMerge branch 'agp-patches' of git://
Linus Torvalds [Tue, 12 Aug 2008 15:28:32 +0000 (08:28 -0700)]
Merge branch 'agp-patches' of git://git./linux/kernel/git/airlied/agp-2.6

* 'agp-patches' of git://
  agp: fix SIS 5591/5592 wrong PCI id
  intel/agp: rewrite GTT on resume
  agp: use dev_printk when possible
  amd64-agp: run fallback when no bridges found, not when driver registration fails
  intel_agp: official name for GM45 chipset

13 years agoALSA: hda - support new AMD HDMI Audio (1002:970f)
Libin Yang [Tue, 12 Aug 2008 10:25:46 +0000 (12:25 +0200)]
ALSA: hda - support new AMD HDMI Audio (1002:970f)

Signed-off-by: Libin Yang <>
Signed-off-by: Takashi Iwai <>
13 years agoALSA: hda_intel: ALSA HD Audio patch for Intel Ibex Peak DeviceIDs
Seth Heasley [Fri, 8 Aug 2008 22:56:39 +0000 (15:56 -0700)]
ALSA: hda_intel: ALSA HD Audio patch for Intel Ibex Peak DeviceIDs

This patch adds the Intel Ibex Peak (PCH) HD Audio Controller DeviceIDs.

Signed-off by: Seth Heasley <>
Signed-off-by: Takashi Iwai <>
13 years agoALSA: wm8750: add missing VREF output
Dmitry Baryshkov [Mon, 11 Aug 2008 22:45:31 +0000 (02:45 +0400)]
ALSA: wm8750: add missing VREF output

Add missing output VREF. After a65f0568f6cc8433877fb71dd7d36b551854b0bc
it's critical, since it makes chip routing initialisation to fail.

Signed-off-by: Dmitry Baryshkov <>
Acked-by: Mark Brown <>
Signed-off-by: Takashi Iwai <>
13 years agoALSA: spitz: MONO -> MONO1
Dmitry Baryshkov [Mon, 11 Aug 2008 22:45:30 +0000 (02:45 +0400)]
ALSA: spitz: MONO -> MONO1

Correct route name to be MONO1 instead of MONO to follow
recent fix in wm8750.

Signed-off-by: Dmitry Baryshkov <>
Acked-by: Mark Brown <>
Signed-off-by: Takashi Iwai <>
13 years agogeneric-ipi: fix stack and rcu interaction bug in smp_call_function_mask(), fix
Nick Piggin [Tue, 12 Aug 2008 08:05:13 +0000 (18:05 +1000)]
generic-ipi: fix stack and rcu interaction bug in smp_call_function_mask(), fix

> > Nick Piggin (1):
> >       generic-ipi: fix stack and rcu interaction bug in
> > smp_call_function_mask()
> I'm still not 100% sure that I have this patch right... I might have seen
> a lockup trace implicating the smp call function path... which may have
> been due to some other problem or a different bug in the new call function
> code, but if some more people can take a look at it before merging?

OK indeed it did have a couple of bugs. Firstly, I wasn't freeing the
data properly in the alloc && wait case. Secondly, I wasn't resetting
CSD_FLAG_WAIT in the for each cpu loop (so only the first CPU would

After those fixes, the patch boots and runs with the kmalloc commented
out (so it always executes the slowpath).

Signed-off-by: Ingo Molnar <>
13 years agofix spinlock recursion in hvc_console
Christian Borntraeger [Thu, 7 Aug 2008 07:18:34 +0000 (09:18 +0200)]
fix spinlock recursion in hvc_console

commit 611e097d7707741a336a0677d9d69bec40f29f3d
Author: Christian Borntraeger <>
hvc_console: rework setup to replace irq functions with callbacks
introduced a spinlock recursion problem.

request_irq tries to call the handler if the IRQ is shared.
The irq handler of hvc_console calls hvc_poll and hvc_kill
which might take the hvc_struct spinlock. Therefore, we have
to call request_irq outside the spinlock.

We can move the notifier_add safely outside the spinlock as ->data must
not be changed by the backend. Otherwise, tty_hangup would fail anyway.

Signed-off-by: Christian Borntraeger <>
Signed-off-by: Rusty Russell <>
13 years agostop_machine: remove unused variable
Li Zefan [Thu, 31 Jul 2008 02:31:02 +0000 (10:31 +0800)]
stop_machine: remove unused variable

Signed-off-by: Li Zefan <>
Signed-off-by: Rusty Russell <>
13 years agomodules: extend initcall_debug functionality to the module loader
Arjan van de Ven [Wed, 30 Jul 2008 19:49:02 +0000 (12:49 -0700)]
modules: extend initcall_debug functionality to the module loader

The kernel has this really nice facility where if you put "initcall_debug"
on the kernel commandline, it'll print which function it's going to
execute just before calling an initcall, and then after the call completes
it will

1) print if it had an error code

2) checks for a few simple bugs (like leaving irqs off)

3) print how long the init call took in milliseconds.

While trying to optimize the boot speed of my laptop, I have been loving
number 3 to figure out what to optimize...  ...  and then I wished that
the same thing was done for module loading.

This patch makes the module loader use this exact same functionality; it's
a logical extension in my view (since modules are just sort of late
binding initcalls anyway) and so far I've found it quite useful in finding
where things are too slow in my boot.

Signed-off-by: Arjan van de Ven <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Rusty Russell <>
13 years agoexport virtio_rng.h
Christian Borntraeger [Fri, 8 Aug 2008 09:15:07 +0000 (11:15 +0200)]
export virtio_rng.h

Hello Rusty,

The entropy device was added after we exported all virtio headers. This
patch adds virtio_rng.h to the exportable userspace headers.

Signed-off-by: Christian Borntraeger <>
Signed-off-by: Rusty Russell <>
13 years agolguest: use get_user_pages_fast() instead of get_user_pages()
Rusty Russell [Tue, 12 Aug 2008 22:52:53 +0000 (17:52 -0500)]
lguest: use get_user_pages_fast() instead of get_user_pages()

Using a simple page table thrashing program I measure a slight
improvement.  The program creates five processes.  Each touches 1000
pages then schedules the next process.  We repeat this 1000 times.  As
lguest only caches 4 cr3 values, this rebuilds a lot of shadow page
tables requiring virt->phys mappings.

Before: 5.93 seconds
After: 5.40 seconds

(Counts of slow vs fastpath in this usage are 6092 and 2852462 respectively.)

And more importantly for lguest, the code is simpler.

Signed-off-by: Rusty Russell <>
13 years agomm: Make generic weak get_user_pages_fast and EXPORT_GPL it
Rusty Russell [Tue, 12 Aug 2008 22:52:52 +0000 (17:52 -0500)]
mm: Make generic weak get_user_pages_fast and EXPORT_GPL it

Out of line get_user_pages_fast fallback implementation, make it a weak

Export the symbol to modules so lguest can use it.

Signed-off-by: Nick Piggin <>
Signed-off-by: Rusty Russell <>
13 years agolguest: don't set MAC address for guest unless specified
Rusty Russell [Tue, 12 Aug 2008 22:52:51 +0000 (17:52 -0500)]
lguest: don't set MAC address for guest unless specified

This shows up when trying to bridge:
tap0: received packet with  own address as source address

As Max Krasnyansky points out, there's no reason to give the guest the
same mac address as the TUN device.

Signed-off-by: Rusty Russell <>
Cc: Max Krasnyansky <>
13 years agoagp: fix SIS 5591/5592 wrong PCI id
Krzysztof Helt [Wed, 6 Aug 2008 16:48:45 +0000 (18:48 +0200)]
agp: fix SIS 5591/5592 wrong PCI id

The correct id is the id of the main host (5591) not
the id of the PCI-to-PCI bridge AGP (0001).
Output from "lspci -nv" shows that only the former
has AGP capabilities flag set:

00:00.0 0600: 1039:5591 (rev 02)
        Flags: bus master, medium devsel, latency 64
        Memory at ec000000 (32-bit, non-prefetchable) [size=32M]
        Capabilities: [c0] AGP version 1.0

00:02.0 0604: 1039:0001 (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0
        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
        I/O behind bridge: 0000c000-0000cfff
        Memory behind bridge: eb500000-eb5fffff
        Prefetchable memory behind bridge: eb300000-eb3fffff

Signed-off-by: Krzysztof Helt <>
Signed-off-by: Dave Airlie <>
13 years agointel/agp: rewrite GTT on resume
Keith Packard [Thu, 31 Jul 2008 05:48:07 +0000 (15:48 +1000)]
intel/agp: rewrite GTT on resume

On my Intel chipset (965GM), the GTT is entirely erased across
suspend/resume.  This patch simply re-plays the current mapping at resume
time to restore the table.=20

I noticed this once I started relying on persistent GTT mappings across VT
switch in our GEM work -- the old X server and DRM code carefully unbind
all memory from the GTT on VT switch, but GEM does not bother.

I placed the list management and rewrite code in the generic layer on the
assumption that it will be needed on other hardware, but I did not add the
rewrite call to anything other than the Intel resume function.

Keep a list of current GATT mappings.  At resume time, rewrite them into
the GATT.  This is needed on Intel (at least) as the entire GATT is
cleared across suspend/resume.

[ coding-style fixes]
Signed-off-by: Keith Packard <>
Cc: Dave Jones <>
Cc: Andi Kleen <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Dave Airlie <>
13 years agoagp: use dev_printk when possible
Bjorn Helgaas [Wed, 30 Jul 2008 19:26:51 +0000 (12:26 -0700)]
agp: use dev_printk when possible

Convert printks to use dev_printk().

Signed-off-by: Bjorn Helgaas <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Dave Airlie <>
13 years agoamd64-agp: run fallback when no bridges found, not when driver registration fails
Bjorn Helgaas [Wed, 30 Jul 2008 19:26:51 +0000 (12:26 -0700)]
amd64-agp: run fallback when no bridges found, not when driver registration fails

I think the intent was that if no bridges matched agp_amd64_pci_table[],
we would fall back to checking for any bridge with the AGP capability.
But in the current code, we execute the fallback path only when
pci_register_driver() itself fails, which is unrelated to whether any
matching devices were found.

This patch counts the AGP bridges found in the probe() method and executes
the fallback path when none is found.

Signed-off-by: Bjorn Helgaas <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Dave Airlie <>
13 years agointel_agp: official name for GM45 chipset
Zhenyu Wang [Wed, 30 Jul 2008 19:26:50 +0000 (12:26 -0700)]
intel_agp: official name for GM45 chipset

Signed-off-by: Zhenyu Wang <>
Cc: Dave Airlie <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Dave Airlie <>
13 years agoMerge branch 'sched-fixes-for-linus' of git://
Linus Torvalds [Mon, 11 Aug 2008 23:46:31 +0000 (16:46 -0700)]
Merge branch 'sched-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'sched-fixes-for-linus' of git://
  sched, cpu hotplug: fix set_cpus_allowed() use in hotplug callbacks
  sched: fix mysql+oltp regression
  sched_clock: delay using sched_clock()
  sched clock: couple local and remote clocks
  sched clock: simplify __update_sched_clock()
  sched: eliminate scd->prev_raw
  sched clock: clean up sched_clock_cpu()
  sched clock: revert various sched_clock() changes
  sched: move sched_clock before first use
  sched: test runtime rather than period in global_rt_runtime()
  sched: fix SCHED_HRTICK dependency
  sched: fix warning in hrtick_start_fair()

13 years agoMerge branch 'timers-fixes-for-linus' of git://
Linus Torvalds [Mon, 11 Aug 2008 23:46:11 +0000 (16:46 -0700)]
Merge branch 'timers-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-fixes-for-linus' of git://
  posix-timers: fix posix_timer_event() vs dequeue_signal() race
  posix-timers: do_schedule_next_timer: fix the setting of ->si_overrun

13 years agoMerge branch 'core-fixes-for-linus' of git://
Linus Torvalds [Mon, 11 Aug 2008 23:45:46 +0000 (16:45 -0700)]
Merge branch 'core-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'core-fixes-for-linus' of git://
  lockdep: fix debug_lock_alloc
  lockdep: increase MAX_LOCKDEP_KEYS
  generic-ipi: fix stack and rcu interaction bug in smp_call_function_mask()
  lockdep: fix overflow in the hlock shrinkage code
  lockdep: rename map_[acquire|release]() => lock_map_[acquire|release]()
  lockdep: handle chains involving classes defined in modules
  mm: fix mm_take_all_locks() locking order
  lockdep: annotate mm_take_all_locks()
  lockdep: spin_lock_nest_lock()
  lockdep: lock protection locks
  lockdep: map_acquire
  lockdep: shrink held_lock structure
  lockdep: re-annotate scheduler runqueues
  lockdep: lock_set_subclass - reset a held lock's subclass
  lockdep: change scheduler annotation
  debug_locks: set oops_in_progress if we will log messages.
  lockdep: fix combinatorial explosion in lock subgraph traversal

13 years agoMerge branch 'x86-fixes-for-linus' of git://
Linus Torvalds [Mon, 11 Aug 2008 23:44:35 +0000 (16:44 -0700)]
Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://
  x86: fix 2.6.27rc1 cannot boot more than 8CPUs
  x86: make "apic" an early_param() on 32-bit, NULL check
  EFI, x86: fix function prototype
  x86, pci-calgary: fix function declaration
  x86: work around gcc 3.4.x bug
  x86: make "apic" an early_param() on 32-bit
  x86, debug: tone down arch/x86/kernel/mpparse.c debugging printk
  x86_64: restore the proper NR_IRQS define so larger systems work.
  x86: Restore proper vector locking during cpu hotplug
  x86: Fix broken VMI in 2.6.27-rc..
  x86: fdiv bug detection fix

13 years agoMerge branch 'core/locking' into core/urgent
Ingo Molnar [Mon, 11 Aug 2008 22:11:49 +0000 (00:11 +0200)]
Merge branch 'core/locking' into core/urgent

13 years agoMerge branch 'sched/clock' into sched/urgent
Ingo Molnar [Mon, 11 Aug 2008 22:07:02 +0000 (00:07 +0200)]
Merge branch 'sched/clock' into sched/urgent

13 years agolockdep: fix debug_lock_alloc
Peter Zijlstra [Mon, 11 Aug 2008 20:45:51 +0000 (22:45 +0200)]
lockdep: fix debug_lock_alloc

When we enable DEBUG_LOCK_ALLOC but do not enable PROVE_LOCKING and or
LOCK_STAT, lock_alloc() and lock_release() turn into nops, even though
we should be doing hlock checking (check=1).

This causes a false warning and a lockdep self-disable.

Rectify this.

Signed-off-by: Peter Zijlstra <>
Signed-off-by: Ingo Molnar <>
13 years agox86: fix 2.6.27rc1 cannot boot more than 8CPUs
Yinghai Lu [Mon, 11 Aug 2008 20:36:04 +0000 (13:36 -0700)]
x86: fix 2.6.27rc1 cannot boot more than 8CPUs

Jeff Chua reported that booting a !bigsmp kernel on a 16-way box
hangs silently.

this is a long-standing issue, smp start AP cpu could check the
apic id >=8 etc before trying to start it.

achieve this by moving the def_to_bigsmp check later and skip the
apicid id > 8

[ clean up the message that is printed. ]

Reported-by: "Jeff Chua" <>
Signed-off-by: Yinghai Lu <>
Signed-off-by: Ingo Molnar <>
 arch/x86/kernel/setup.c   |    6 ------
 arch/x86/kernel/smpboot.c |   10 ++++++++++
 2 files changed, 10 insertions(+), 6 deletions(-)

13 years agomake struct scsi_dh_devlist's static
Adrian Bunk [Mon, 11 Aug 2008 18:59:21 +0000 (11:59 -0700)]
make struct scsi_dh_devlist's static

This patch makes several needlessly global struct scsi_dh_devlist's

Signed-off-by: Adrian Bunk <>
Signed-off-by: Chandra Seetharaman <>
Signed-off-by: Linus Torvalds <>
13 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Mon, 11 Aug 2008 17:44:43 +0000 (10:44 -0700)]
Merge branch 'for-linus' of git://

* 'for-linus' of git://
  mfd: tc6393 cleanup and update
  mfd: have TMIO drivers and subdevices depend on ARM
  mfd: TMIO MMC driver
  mfd: driver for the TMIO NAND controller
  mfd: t7l66 MMC platform data
  mfd: tc6387 MMC platform data
  mfd: Fix 7l66 and 6387 according to the new mfd-core API
  mfd: Fix tc6393 according to the new tmio.h
  mfd: driver for the TC6387XB TMIO controller.
  mfd: driver for the T7L66XB TMIO SoC
  mfd: TMIO MMC structures and accessors.

13 years agoMerge branch 'i2c-for-linus' of git://
Linus Torvalds [Mon, 11 Aug 2008 17:44:13 +0000 (10:44 -0700)]
Merge branch 'i2c-for-linus' of git://

* 'i2c-for-linus' of git://
  hwmon: (lm75) Drop legacy i2c driver
  i2c: correct some size_t printk formats
  i2c: Check for address business before creating clients
  i2c: Let users select algorithm drivers manually again
  i2c: Fix NULL pointer dereference in i2c_new_probed_device
  i2c: Fix oops on bus multiplexer driver loading

13 years agoMerge git://
Linus Torvalds [Mon, 11 Aug 2008 17:42:43 +0000 (10:42 -0700)]
Merge git://git./linux/kernel/git/wim/linux-2.6-watchdog

* git://
  [WATCHDOG] pcwd.c - fix open_allowed type.
  [WATCHDOG] fix watchdog/ixp4xx_wdt.c compilation
  [WATCHDOG] fix watchdog/wdt285.c compilation
  [WATCHDOG] fix watchdog/at91rm9200_wdt.c compilation
  [WATCHDOG] fix watchdog/shwdt.c compilation
  [WATCHDOG] fix watchdog/txx9wdt.c compilation

13 years agox86: make "apic" an early_param() on 32-bit, NULL check
Rene Herman [Mon, 11 Aug 2008 17:20:17 +0000 (19:20 +0200)]
x86: make "apic" an early_param() on 32-bit, NULL check

Cyrill Gorcunov observed:

> you turned it into early_param so now it's NULL injecting vulnerabled.
> Could you please add checking for NULL str param?

fix that.

Also, change the name of 'str' into 'arg', to make it more apparent
that this is an optional argument that can be NULL, not a string
parameter that is empty when unset.

Reported-by: Cyrill Gorcunov <>
Signed-off-by: Rene Herman <>
Signed-off-by: Ingo Molnar <>
13 years agoMerge branch 'merge' of git://
Linus Torvalds [Mon, 11 Aug 2008 17:40:28 +0000 (10:40 -0700)]
Merge branch 'merge' of git://git./linux/kernel/git/paulus/powerpc

* 'merge' of git://
  powerpc: Remove include/linux/harrier_defs.h
  powerpc: Do not ignore arch/powerpc/include
  powerpc: Delete completed "ppc removal" task from feature removal file
  powerpc/mm: Fix attribute confusion with htab_bolt_mapping()
  powerpc/pci: Don't keep ISA memory hole resources in the tree
  powerpc: Zero fill the return values of rtas argument buffer
  powerpc/4xx: Update defconfig files for 2.6.27-rc1
  powerpc/44x: Incorrect NOR offset in Warp DTS
  powerpc/44x: Warp DTS changes for board updates
  powerpc/4xx: Cleanup Warp for i2c driver changes.
  powerpc/44x: Adjust warp-nand resource end address

13 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Mon, 11 Aug 2008 17:38:36 +0000 (10:38 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jbarnes/pci-2.6

* 'for-linus' of git://
  PCI: Limit VPD length for Broadcom 5708S
  PCI PM: Export pci_pme_active to drivers
  PCI: remove duplicate symbol from pci_ids.h
  PCI: check the return value of device_create_bin_file() in pci_create_bus()
  PCI: fully restore MSI state at resume time
  DMA: make dma-coherent.c documentation kdoc-friendly
  PCI: make pci_register_driver() a macro
  PCI: add Broadcom 5708S to VPD length quirk