12 years agoMerge branch 'x86-fixes-for-linus' of git://
Linus Torvalds [Thu, 19 Feb 2009 17:14:35 +0000 (09:14 -0800)]
Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://
  x86, mce: fix ifdef for 64bit thermal apic vector clear on shutdown
  x86, mce: use force_sig_info to kill process in machine check
  x86, mce: reinitialize per cpu features on resume
  x86, rcu: fix strange load average and ksoftirqd behavior

12 years agoMerge branch 'tracing-fixes-for-linus' of git://
Linus Torvalds [Thu, 19 Feb 2009 17:14:22 +0000 (09:14 -0800)]
Merge branch 'tracing-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'tracing-fixes-for-linus' of git://
  tracing: limit the number of loops the ring buffer self test can make
  tracing: have function trace select kallsyms
  tracing: disable tracing while testing ring buffer
  tracing/function-graph-tracer: trace the idle tasks

12 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Thu, 19 Feb 2009 16:35:52 +0000 (08:35 -0800)]
Merge branch 'for-linus' of git://

* 'for-linus' of git://
  [S390] fix "mem=" handling in case of standby memory
  [S390] Fix timeval regression on s390
  [S390] sclp: handle empty event buffers

12 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Thu, 19 Feb 2009 16:35:29 +0000 (08:35 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://
  sound: virtuoso: revert "do not overwrite EEPROM on Xonar D2/D2X"
  ALSA: jack - Use card->shortname for input name
  ALSA: usb-audio - Workaround for misdetected sample rate with CM6207
  ALSA: usb-audio - Fix non-continuous rate detection
  sound: usb-audio: fix uninitialized variable with M-Audio MIDI interfaces
  Revert "Sound: hda - Restore PCI configuration space with interrupts off"

12 years ago[S390] fix "mem=" handling in case of standby memory
Heiko Carstens [Thu, 19 Feb 2009 14:19:01 +0000 (15:19 +0100)]
[S390] fix "mem=" handling in case of standby memory

Standby memory detected with the sclp interface gets always registered
with add_memory calls without considering the limitationt that the
"mem=" kernel paramater implies.
So fix this and only register standby memory that is below the specified
This fixes zfcpdump since it uses "mem=32M". In case there is appr.
2GB standby memory present all of usable memory would be used for the
struct pages needed for standby memory.

Signed-off-by: Heiko Carstens <>
Signed-off-by: Martin Schwidefsky <>
12 years ago[S390] Fix timeval regression on s390
Christian Borntraeger [Thu, 19 Feb 2009 14:19:00 +0000 (15:19 +0100)]
[S390] Fix timeval regression on s390

commit aa5e97ce4bbc9d5daeec16b1d15bb3f6b7b4f4d4
[PATCH] improve precision of process accounting.

Introduced a timing regression:
-bash-3.2# time ls
real    0m0.006s
user    0m1.754s
sys     0m1.094s

The problem was introduced by an error in cputime_to_timeval.
Cputime is now 1/4096 microsecond, therefore, we have to divide
the remainder with 4096 to get the microseconds.

Signed-off-by: Christian Borntraeger <>
Signed-off-by: Martin Schwidefsky <>
12 years ago[S390] sclp: handle empty event buffers
Peter Oberparleiter [Thu, 19 Feb 2009 14:18:59 +0000 (15:18 +0100)]
[S390] sclp: handle empty event buffers

Handle a malformed hardware response which some versions of the
Support Element (SE) may present during SE restart and which otherwise
would result in an endless loop in function sclp_dispatch_evbufs.

Signed-off-by: Peter Oberparleiter <>
Signed-off-by: Martin Schwidefsky <>
12 years agoMerge branch 'fix/usb-audio' into for-linus
Takashi Iwai [Thu, 19 Feb 2009 12:58:05 +0000 (13:58 +0100)]
Merge branch 'fix/usb-audio' into for-linus

12 years agoMerge branch 'fix/misc' into for-linus
Takashi Iwai [Thu, 19 Feb 2009 12:58:01 +0000 (13:58 +0100)]
Merge branch 'fix/misc' into for-linus

12 years agoMerge branch 'fix/hda' into for-linus
Takashi Iwai [Thu, 19 Feb 2009 12:57:52 +0000 (13:57 +0100)]
Merge branch 'fix/hda' into for-linus

12 years agoMerge branch 'tip/tracing/urgent' of git://
Ingo Molnar [Thu, 19 Feb 2009 09:16:45 +0000 (10:16 +0100)]
Merge branch 'tip/tracing/urgent' of git://git./linux/kernel/git/rostedt/linux-2.6-trace into tracing/urgent

12 years agosound: virtuoso: revert "do not overwrite EEPROM on Xonar D2/D2X"
Clemens Ladisch [Tue, 17 Feb 2009 08:50:30 +0000 (09:50 +0100)]
sound: virtuoso: revert "do not overwrite EEPROM on Xonar D2/D2X"

This reverts commit 7e86c0e6850504ec9516b953f316a47277825e33 ("do not
overwrite EEPROM on Xonar D2/D2X") because it did not actually help with
the problem.

More user reports show that the overwriting of the EEPROM is not
triggered by using this driver but by installing Linux, and that the
installation of any other operating system (even one without any CMI8788
driver) has the same effect.  In other words, the presence of this
driver does not have any effect on the occurrence of the error.  (So
far, the available evidence seems to point to a BIOS bug.)

Furthermore, it turns out that the EEPROM chip is protected against
stray write commands by the command format and by requiring a separate
write-enable command, so the error scenario in the previous commit (that
SPI writes can be misinterpreted as an EEPROM write command) is not even
theoretically possible.

The mixer control that was removed as a consequence of the previous
commit can only be partially emulated in userspace, which also means it
cannot be seen be the in-kernel OSS API emulation, so it is better to
revert that change.

Signed-off-by: Clemens Ladisch <>
Cc: <>
Signed-off-by: Takashi Iwai <>
12 years agotracing: limit the number of loops the ring buffer self test can make
Steven Rostedt [Thu, 19 Feb 2009 03:50:01 +0000 (22:50 -0500)]
tracing: limit the number of loops the ring buffer self test can make

Impact: prevent deadlock if ring buffer gets corrupted

This patch adds a paranoid check to make sure the ring buffer consumer
does not go into an infinite loop. Since the ring buffer has been set
to read only, the consumer should not loop for more than the ring buffer
size. A check is added to make sure the consumer does not loop more than
the ring buffer size.

Signed-off-by: Steven Rostedt <>
12 years agotracing: have function trace select kallsyms
Steven Rostedt [Thu, 19 Feb 2009 03:06:18 +0000 (22:06 -0500)]
tracing: have function trace select kallsyms

Impact: fix output of function tracer to be useful

The function tracer is pretty useless if KALLSYMS is not configured.
Unless you are good at reading hex values, the function tracer should
select the KALLSYMS configuration.

Also, the dynamic function tracer will fail its self test if KALLSYMS
is not selected.

Signed-off-by: Steven Rostedt <>
12 years agotracing: disable tracing while testing ring buffer
Steven Rostedt [Wed, 18 Feb 2009 23:33:57 +0000 (18:33 -0500)]
tracing: disable tracing while testing ring buffer

Impact: fix to prevent hard lockup on self tests

If one of the tracers are broken and is constantly filling the ring
buffer while the test of the ring buffer is running, it will hang
the box. The reason is that the test is a consumer that will not
stop till the ring buffer is empty. But if the tracer is broken and
is constantly producing input to the buffer, this test will never
end. The result is a lockup of the box.

This happened when KALLSYMS was not defined and the dynamic ftrace
test constantly filled the ring buffer, because the filter failed
and all functions were being traced. Something was being called
that constantly filled the buffer.

Signed-off-by: Steven Rostedt <>
12 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Thu, 19 Feb 2009 02:33:04 +0000 (18:33 -0800)]
Merge branch 'for-linus' of git://

* 'for-linus' of git://
  block: fix deadlock in blk_abort_queue() for drivers that readd to timeout list
  block: fix booting from partitioned md array
  block: revert part of 18ce3751ccd488c78d3827e9f6bf54e6322676fb
  cciss: PCI power management reset for kexec
  paride/pg.c: xs(): &&/|| confusion
  fs/bio: bio_alloc_bioset: pass right object ptr to mempool_free
  block: fix bad definition of BIO_RW_SYNC
  bsg: Fix sense buffer bug in SG_IO

12 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Thu, 19 Feb 2009 01:55:15 +0000 (17:55 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/drzeus/mmc

* 'for-linus' of git://
  omap_hsmmc: Change while(); loops with finite version
  omap_hsmmc: recover from transfer failures
  omap_hsmmc: only MMC1 allows HCTL.SDVS != 1.8V
  omap_hsmmc: card detect irq bugfix
  sdhci: fix led naming
  mmc_test: fix basic read test
  s3cmci: Fix hangup in do_pio_write()
  Revert "sdhci: force high speed capability on some controllers"
  MMC: fix bug - SDHC card capacity not correct

12 years agoinotify: fix GFP_KERNEL related deadlock
Ingo Molnar [Wed, 18 Feb 2009 22:48:43 +0000 (14:48 -0800)]
inotify: fix GFP_KERNEL related deadlock

Enhanced lockdep coverage of __GFP_NOFS turned up this new lockdep

[ 1093.677775]
[ 1093.677781] =================================
[ 1093.680031] [ INFO: inconsistent lock state ]
[ 1093.680031] 2.6.29-rc5-tip-01504-gb49eca1-dirty #1
[ 1093.680031] ---------------------------------
[ 1093.680031] inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-W} usage.
[ 1093.680031] kswapd0/308 [HC0[0]:SC0[0]:HE1:SE1] takes:
[ 1093.680031]  (&inode->inotify_mutex){+.+.?.}, at: [<c0205942>] inotify_inode_is_dead+0x20/0x80
[ 1093.680031] {RECLAIM_FS-ON-W} state was registered at:
[ 1093.680031]   [<c01696b9>] mark_held_locks+0x43/0x5b
[ 1093.680031]   [<c016baa4>] lockdep_trace_alloc+0x6c/0x6e
[ 1093.680031]   [<c01cf8b0>] kmem_cache_alloc+0x20/0x150
[ 1093.680031]   [<c040d0ec>] idr_pre_get+0x27/0x6c
[ 1093.680031]   [<c02056e3>] inotify_handle_get_wd+0x25/0xad
[ 1093.680031]   [<c0205f43>] inotify_add_watch+0x7a/0x129
[ 1093.680031]   [<c020679e>] sys_inotify_add_watch+0x20f/0x250
[ 1093.680031]   [<c010389e>] sysenter_do_call+0x12/0x35
[ 1093.680031]   [<ffffffff>] 0xffffffff
[ 1093.680031] irq event stamp: 60417
[ 1093.680031] hardirqs last  enabled at (60417): [<c018d5f5>] call_rcu+0x53/0x59
[ 1093.680031] hardirqs last disabled at (60416): [<c018d5b9>] call_rcu+0x17/0x59
[ 1093.680031] softirqs last  enabled at (59656): [<c0146229>] __do_softirq+0x157/0x16b
[ 1093.680031] softirqs last disabled at (59651): [<c0106293>] do_softirq+0x74/0x15d
[ 1093.680031]
[ 1093.680031] other info that might help us debug this:
[ 1093.680031] 2 locks held by kswapd0/308:
[ 1093.680031]  #0:  (shrinker_rwsem){++++..}, at: [<c01b0502>] shrink_slab+0x36/0x189
[ 1093.680031]  #1:  (&type->s_umount_key#4){+++++.}, at: [<c01e6d77>] shrink_dcache_memory+0x110/0x1fb
[ 1093.680031]
[ 1093.680031] stack backtrace:
[ 1093.680031] Pid: 308, comm: kswapd0 Not tainted 2.6.29-rc5-tip-01504-gb49eca1-dirty #1
[ 1093.680031] Call Trace:
[ 1093.680031]  [<c016947a>] valid_state+0x12a/0x13d
[ 1093.680031]  [<c016954e>] mark_lock+0xc1/0x1e9
[ 1093.680031]  [<c016a5b4>] ? check_usage_forwards+0x0/0x3f
[ 1093.680031]  [<c016ab74>] __lock_acquire+0x2c6/0xac8
[ 1093.680031]  [<c01688d9>] ? register_lock_class+0x17/0x228
[ 1093.680031]  [<c016b3d3>] lock_acquire+0x5d/0x7a
[ 1093.680031]  [<c0205942>] ? inotify_inode_is_dead+0x20/0x80
[ 1093.680031]  [<c08824c4>] __mutex_lock_common+0x3a/0x4cb
[ 1093.680031]  [<c0205942>] ? inotify_inode_is_dead+0x20/0x80
[ 1093.680031]  [<c08829ed>] mutex_lock_nested+0x2e/0x36
[ 1093.680031]  [<c0205942>] ? inotify_inode_is_dead+0x20/0x80
[ 1093.680031]  [<c0205942>] inotify_inode_is_dead+0x20/0x80
[ 1093.680031]  [<c01e6672>] dentry_iput+0x90/0xc2
[ 1093.680031]  [<c01e67a3>] d_kill+0x21/0x45
[ 1093.680031]  [<c01e6a46>] __shrink_dcache_sb+0x27f/0x355
[ 1093.680031]  [<c01e6dc5>] shrink_dcache_memory+0x15e/0x1fb
[ 1093.680031]  [<c01b05ed>] shrink_slab+0x121/0x189
[ 1093.680031]  [<c01b0d12>] kswapd+0x39f/0x561
[ 1093.680031]  [<c01ae499>] ? isolate_pages_global+0x0/0x233
[ 1093.680031]  [<c0157eae>] ? autoremove_wake_function+0x0/0x43
[ 1093.680031]  [<c01b0973>] ? kswapd+0x0/0x561
[ 1093.680031]  [<c0157daf>] kthread+0x41/0x82
[ 1093.680031]  [<c0157d6e>] ? kthread+0x0/0x82
[ 1093.680031]  [<c01043ab>] kernel_thread_helper+0x7/0x10

inotify_handle_get_wd() does idr_pre_get() which does a
kmem_cache_alloc() without __GFP_FS - and is hence deadlockable under
extreme MM pressure.

Signed-off-by: Ingo Molnar <>
Acked-by: Peter Zijlstra <>
Cc: MinChan Kim <>
Cc: Nick Piggin <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agospi-gpio: sanitize MISO bitvalue
Michael Buesch [Wed, 18 Feb 2009 22:48:41 +0000 (14:48 -0800)]
spi-gpio: sanitize MISO bitvalue

gpio_get_value() returns 0 or nonzero, but getmiso() expects 0 or 1.
Sanitize the value to a 0/1 boolean.

Signed-off-by: Michael Buesch <>
Acked-by: David Brownell <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agoBernhard has moved
Bernhard Walle [Wed, 18 Feb 2009 22:48:40 +0000 (14:48 -0800)]
Bernhard has moved

Since I don't work for SUSE any more and the address is
invalid, correct it in the copyright headers and documentation.

Signed-off-by: Bernhard Walle <>
Cc: Greg KH <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agox86: dell-laptop: depends on POWER_SUPPLY
Randy Dunlap [Wed, 18 Feb 2009 22:48:39 +0000 (14:48 -0800)]
x86: dell-laptop: depends on POWER_SUPPLY

Build breaks when DELL_LAPTOP=y and POWER_SUPPLY=m.  DELL_LAPTOP needs to
depend on POWER_SUPPLY.

dell-laptop.c:(.text+0x1ef3c4): undefined reference to `power_supply_is_system_supplied'
dell-laptop.c:(.text+0x1ef45e): undefined reference to `power_supply_is_system_supplied'

Signed-off-by: Randy Dunlap <>
Cc: Matthew Garrett <>
Cc: Ingo Molnar <>
Cc: Thomas Gleixner <>
Cc: "H. Peter Anvin" <>
Cc: Len Brown <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agovt: Declare PIO_CMAP/GIO_CMAP as compatbile ioctls.
Bill Nottingham [Wed, 18 Feb 2009 22:48:39 +0000 (14:48 -0800)]
vt: Declare PIO_CMAP/GIO_CMAP as compatbile ioctls.

Otherwise, these don't work when called from 32-bit userspace on 64-bit

Cc: Jiri Kosina <>
Cc: Alan Cox <>
Cc: <> [2.6.25.x, 2.6.26.x, 2.6.27.x, 2.6.28.x]
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agofbdev/drm: fix Kconfig submenu mess in "Graphics support"
Krzysztof Helt [Wed, 18 Feb 2009 22:48:38 +0000 (14:48 -0800)]
fbdev/drm: fix Kconfig submenu mess in "Graphics support"

Submenus of the graphics support "Support for frame buffer devices" and
"Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)" are
broken in half after latest changes for Intel 915 mode setting support.

The DRM subsection is broken because one option is put outside the choice
section it depends on.

The frame buffers part is broken then due to circular dependency.  Fix
this by make Intel frame buffers depend on CONFIG_INTEL_AGP.

Kconfigs are broken by d2f59357700487a8b944f4f7777d1e97cf5ea2ed
("drm/i915: select framebuffer support automatically").

This is probably not only way to fix this.

Signed-off-by: Krzysztof Helt <>
Cc: Ingo Molnar <>
Cc: Dave Airlie <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agofloppy: request and release only the ports we actually use
Philippe De Muyter [Wed, 18 Feb 2009 22:48:36 +0000 (14:48 -0800)]
floppy: request and release only the ports we actually use

The floppy driver requests an I/O port it doesn't need, and sometimes this
causes a conflict with a motherboard device reported by PNPBIOS.

This patch makes the floppy driver request and release only the ports it
actually uses.  It also factors out the request/release stuff and the
io-ports list so they're all in one place now.

The current floppy driver uses only these ports:

    0x3f2 (FD_DOR)
    0x3f4 (FD_STATUS)
    0x3f5 (FD_DATA)
    0x3f7 (FD_DCR/FD_DIR)

but it requests 0x3f2-0x3f5 and 0x3f7, which includes the unused port

Some BIOSes report 0x3f3 as a motherboard resource.  The PNP system driver
reserves that, which causes a conflict when the floppy driver requests
0x3f2-0x3f5 later.

Philippe reported that this conflict broke the floppy driver between
2.6.11 and 2.6.22.  His PNPBIOS reports these devices:

    $ cat 00:07/id 00:07/resources # motherboard device
    state = active
    io 0x80-0x80
    io 0x10-0x1f
    io 0x22-0x3f
    io 0x44-0x5f
    io 0x90-0x9f
    io 0xa2-0xbf
    io 0x3f0-0x3f1
    io 0x3f3-0x3f3

    $ cat 00:03/id 00:03/resources # floppy device
    state = active
    io 0x3f4-0x3f5
    io 0x3f2-0x3f2


Signed-off-by: Bjorn Helgaas <>
Signed-off-by: Philippe De Muyter <>
Reported-by: Philippe De Muyter <>
Tested-by: Philippe De Muyter <>
Cc: Adam M Belay <>
Cc: Robert Hancock <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agojsm: additional device support
Adam Lackorzynski [Wed, 18 Feb 2009 22:48:34 +0000 (14:48 -0800)]
jsm: additional device support

I have a Digi Neo 8 PCI card (114f:00b1) Serial controller: Digi
International Digi Neo 8 (rev 05)

that works with the jsm driver after using the following patch.

Signed-off-by: Adam Lackorzynski <>
Cc: Scott H Kilau <>
Cc: Wendy Xiong <>
Acked-by: Alan Cox <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agomm: fix memmap init for handling memory hole
KAMEZAWA Hiroyuki [Wed, 18 Feb 2009 22:48:33 +0000 (14:48 -0800)]
mm: fix memmap init for handling memory hole

Now, early_pfn_in_nid(PFN, NID) may returns false if PFN is a hole.
and memmap initialization was not done. This was a trouble for
sparc boot.

To fix this, the PFN should be initialized and marked as PG_reserved.
This patch changes early_pfn_in_nid() return true if PFN is a hole.

Signed-off-by: KAMEZAWA Hiroyuki <>
Reported-by: David Miller <>
Tested-by: KOSAKI Motohiro <>
Cc: Mel Gorman <>
Cc: Heiko Carstens <>
Cc: <> [2.6.25.x, 2.6.26.x, 2.6.27.x, 2.6.28.x]
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agomm: clean up for early_pfn_to_nid()
KAMEZAWA Hiroyuki [Wed, 18 Feb 2009 22:48:32 +0000 (14:48 -0800)]
mm: clean up for early_pfn_to_nid()

What's happening is that the assertion in mm/page_alloc.c:move_freepages()
is triggering:

BUG_ON(page_zone(start_page) != page_zone(end_page));

Once I knew this is what was happening, I added some annotations:

if (unlikely(page_zone(start_page) != page_zone(end_page))) {
printk(KERN_ERR "move_freepages: Bogus zones: "
       "start_page[%p] end_page[%p] zone[%p]\n",
       start_page, end_page, zone);
printk(KERN_ERR "move_freepages: "
       "start_zone[%p] end_zone[%p]\n",
       page_zone(start_page), page_zone(end_page));
printk(KERN_ERR "move_freepages: "
       "start_pfn[0x%lx] end_pfn[0x%lx]\n",
       page_to_pfn(start_page), page_to_pfn(end_page));
printk(KERN_ERR "move_freepages: "
       "start_nid[%d] end_nid[%d]\n",
       page_to_nid(start_page), page_to_nid(end_page));

And here's what I got:

move_freepages: Bogus zones: start_page[2207d0000] end_page[2207dffc0] zone[fffff8103effcb00]
move_freepages: start_zone[fffff8103effcb00] end_zone[fffff8003fffeb00]
move_freepages: start_pfn[0x81f600] end_pfn[0x81f7ff]
move_freepages: start_nid[1] end_nid[0]

My memory layout on this box is:

[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x0081ff5d
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[8] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00020000
[    0.000000]     1: 0x00800000 -> 0x0081f7ff
[    0.000000]     1: 0x0081f800 -> 0x0081fe50
[    0.000000]     1: 0x0081fed1 -> 0x0081fed8
[    0.000000]     1: 0x0081feda -> 0x0081fedb
[    0.000000]     1: 0x0081fedd -> 0x0081fee5
[    0.000000]     1: 0x0081fee7 -> 0x0081ff51
[    0.000000]     1: 0x0081ff59 -> 0x0081ff5d

So it's a block move in that 0x81f600-->0x81f7ff region which triggers
the problem.

This patch:

Declaration of early_pfn_to_nid() is scattered over per-arch include
files, and it seems it's complicated to know when the declaration is used.
 I think it makes fix-for-memmap-init not easy.

This patch moves all declaration to include/linux/mm.h

After this,
     -> Use static definition in include/linux/mm.h
     -> Use generic definition in mm/page_alloc.c
     -> per-arch back end function will be called.

Signed-off-by: KAMEZAWA Hiroyuki <>
Tested-by: KOSAKI Motohiro <>
Reported-by: David Miller <>
Cc: Mel Gorman <>
Cc: Heiko Carstens <>
Cc: <> [2.6.25.x, 2.6.26.x, 2.6.27.x, 2.6.28.x]
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agofs/super.c: add lockdep annotation to s_umount
Peter Zijlstra [Wed, 18 Feb 2009 22:48:30 +0000 (14:48 -0800)]
fs/super.c: add lockdep annotation to s_umount

Li Zefan said:

Thread 1:
  for ((; ;))
      mount -t cpuset xxx /mnt > /dev/null 2>&1
      cat /mnt/cpus > /dev/null 2>&1
      umount /mnt > /dev/null 2>&1

Thread 2:
  for ((; ;))
      mount -t cpuset xxx /mnt > /dev/null 2>&1
      umount /mnt > /dev/null 2>&1

(Note: It is irrelevant which cgroup subsys is used.)

After a while a lockdep warning showed up:

[ INFO: possible recursive locking detected ]
2.6.28 #479
mount/13554 is trying to acquire lock:
 (&type->s_umount_key#19){--..}, at: [<c049d888>] sget+0x5e/0x321

but task is already holding lock:
 (&type->s_umount_key#19){--..}, at: [<c049da0c>] sget+0x1e2/0x321

other info that might help us debug this:
1 lock held by mount/13554:
 #0:  (&type->s_umount_key#19){--..}, at: [<c049da0c>] sget+0x1e2/0x321

stack backtrace:
Pid: 13554, comm: mount Not tainted 2.6.28-mc #479
Call Trace:
 [<c044ad2e>] validate_chain+0x4c6/0xbbd
 [<c044ba9b>] __lock_acquire+0x676/0x700
 [<c044bb82>] lock_acquire+0x5d/0x7a
 [<c049d888>] ? sget+0x5e/0x321
 [<c061b9b8>] down_write+0x34/0x50
 [<c049d888>] ? sget+0x5e/0x321
 [<c049d888>] sget+0x5e/0x321
 [<c045a2e7>] ? cgroup_set_super+0x0/0x3e
 [<c045959f>] ? cgroup_test_super+0x0/0x2f
 [<c045bcea>] cgroup_get_sb+0x98/0x2e7
 [<c045cfb6>] cpuset_get_sb+0x4a/0x5f
 [<c049dfa4>] vfs_kern_mount+0x40/0x7b
 [<c049e02d>] do_kern_mount+0x37/0xbf
 [<c04af4a0>] do_mount+0x5c3/0x61a
 [<c04addd2>] ? copy_mount_options+0x2c/0x111
 [<c04af560>] sys_mount+0x69/0xa0
 [<c0403251>] sysenter_do_call+0x12/0x31

The cause is after alloc_super() and then retry, an old entry in list
fs_supers is found, so grab_super(old) is called, but both functions hold
s_umount lock:

struct super_block *sget(...)
if (test) {
list_for_each_entry(old, &type->fs_supers, s_instances) {
if (!test(old, data))
if (!grab_super(old))  <--- 2nd: down_write(&old->s_umount);
goto retry;
if (s)
return old;
if (!s) {
s = alloc_super(type);   <--- 1th: down_write(&s->s_umount)
if (!s)
return ERR_PTR(-ENOMEM);
goto retry;

It seems like a false positive, and seems like VFS but not cgroup needs to
be fixed.

Peter said:

We can simply put the new s_umount instance in a but lockdep doesn't
particularly cares about subclass order.

If there's any issue with the callers of sget() assuming the s_umount lock
being of sublcass 0, then there is another annotation we can use to fix
that, but lets not bother with that if this is sufficient.


Signed-off-by: Peter Zijlstra <>
Tested-by: Li Zefan <>
Reported-by: Li Zefan <>
Cc: Al Viro <>
Cc: Paul Menage <>
Cc: Arjan van de Ven <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agoatmel_serial might lose modem status change
Atsushi Nemoto [Wed, 18 Feb 2009 22:48:28 +0000 (14:48 -0800)]
atmel_serial might lose modem status change

I found a problem of handling of modem status of atmel_serial driver.

With the commit 1ecc26 ("atmel_serial: split the interrupt handler"),
handling of modem status signal was splitted into two parts.  The
atmel_tasklet_func() compares new status with irq_status_prev, but
irq_status_prev is not correct if signal status was changed while the port
is closed.

Here is a sequence to cause problem:

1. Remote side sets CTS (and DSR).
2. Local side close the port.
3. Local side clears RTS and DTR.
4. Remote side clears CTS and DSR.
5. Local side reopen the port.  hw_stopped becomes 1.
6. Local side sets RTS and DTR.
7. Remote side sets CTS and DSR.

Then CTS change interrupt can be received, but since CTS bit in
irq_status_prev and new status is same, uart_handle_cts_change() will not
be called (so hw_stopped will not be cleared, i.e.  cannot send any data).

I suppose irq_status_prev should be initialized at somewhere in open

Itai Levi pointed out that we need to initialize atmel_port->irq_status
as well here. His analysis is as follows:

> Regarding the second part of the patch (which resets irq_status_prev),
> it turns out that both versions of the patch (mine and Atsushi's)
> still leave enough room for faulty behavior when opening the port.
> This is because we are not resetting both irq_status_prev and
> irq_status in atmel_startup() to CSR, which leads faulty behavior in
> the following sequences:
> First case:
> 1. closing the port while CTS line = 1 (TX not allowed)
> 2. setting CTS line = 0 (TX allowed)
> 3. opening the port
> 4. transmitting one char
> 5. Cannot transmit more chars, although CTS line is 0
> Second case:
> 1. closing the port while CTS line = 0 (TX allowed)
> 2. setting CTS line = 1 (TX not allowed)
> 3. opening the port
> 4. receiving some chars
> 5. Now we can transmit, although CTS line is 1
> This reason for this is that the tasklet is scheduled as a result of
> TX or RX interrupts (not a status change!), in steps 4 above. Inside
> the tasklet, the atmel_port->irq_status (which holds the value from
> the previous session) is compared to atmel_port->irq_status_prev.
> Hence, a status-change of the CTS line is faultily detected.
> Both cases were verified on 9260 hardware.

[ folded with patch from Itai Levi]
Signed-off-by: Atsushi Nemoto <>
Signed-off-by: Haavard Skinnemoen <>
Cc: Remy Bohmer <>
Cc: Marc Pignat <>
Cc: Itai Levi <>
Cc: Alan Cox <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agoatmel-mci: fix initialization of dma slave data
Dan Williams [Wed, 18 Feb 2009 22:48:26 +0000 (14:48 -0800)]
atmel-mci: fix initialization of dma slave data

The conversion of atmel-mci to dma_request_channel missed the
initialization of the channel dma_slave information.  The filter_fn passed
to dma_request_channel is responsible for initializing the channel's
private data.  This implementation has the additional benefit of enabling
a generic client-channel data passing mechanism.

Reviewed-by: Atsushi Nemoto <>
Signed-off-by: Dan Williams <>
Acked-by: Haavard Skinnemoen <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agolis3lv02d: add axes knowledge of HP Pavilion dv5 models
Giuseppe Bilotta [Wed, 18 Feb 2009 22:48:25 +0000 (14:48 -0800)]
lis3lv02d: add axes knowledge of HP Pavilion dv5 models

Add support for HP Pavilion dv5.

Since Intel-based models have an inverted x axis, while AMD-based models
have an inverted y axis, we introduce a new macro that special-cases axis
orientation based on two DMI entries: HP dv5 axis configuration is then
based on both the PRODUCT and BOARD name.

Signed-off-by: Giuseppe Bilotta <>
Cc: Eric Piel <>
Cc: Pavel Machek <>
Tested-by: Palatis Tseng <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agolis3lv02d: support both one- and two-byte sensors
Giuseppe Bilotta [Wed, 18 Feb 2009 22:48:24 +0000 (14:48 -0800)]
lis3lv02d: support both one- and two-byte sensors

Sensors responding with 0x3B to WHO_AM_I only have one data register per
direction, thus returning a signed byte from the position which is
occupied by the MSB in sensors responding with 0x3A.

Since multiple sensors share the reply to WHO_AM_I, we rename the defines
to better indicate what they identify (family of single and double
precision sensors).

We support both kind of sensors by checking for the sensor type on init
and defining appropriate data-access routines and sensor limits (for the
joystick) depending on what we find.

[ coding-style fixes]
Signed-off-by: Giuseppe Bilotta <>
Acked-by: Eric Piel <>
Cc: Pavel Machek <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agohp accelerometer: add freefall detection
Pavel Machek [Wed, 18 Feb 2009 22:48:23 +0000 (14:48 -0800)]
hp accelerometer: add freefall detection

This adds freefall handling to hp_accel driver.  According to HP, it
should just work, without us having to set the chip up by hand.

hpfall.c is example .c program that parks the disk when accelerometer
detects free fall.  It should work; for now, it uses fixed 20seconds
protection period.

Signed-off-by: Pavel Machek <>
Cc: Thomas Renninger <>
Cc: √Čric Piel <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agoeeepc: should depend on INPUT
Alexey Dobriyan [Wed, 18 Feb 2009 22:48:22 +0000 (14:48 -0800)]
eeepc: should depend on INPUT

Otherwise with INPUT=m, EEEPC_LAPTOP=y one gets

drivers/built-in.o: In function `input_sync':
eeepc-laptop.c:(.text+0x18ce51): undefined reference to `input_event'
drivers/built-in.o: In function `input_report_key':
eeepc-laptop.c:(.text+0x18ce73): undefined reference to `input_event'
drivers/built-in.o: In function `eeepc_hotk_check':
eeepc-laptop.c:(.text+0x18d05f): undefined reference to `input_allocate_device'
eeepc-laptop.c:(.text+0x18d10f): undefined reference to `input_register_device'
eeepc-laptop.c:(.text+0x18d131): undefined reference to `input_free_device'
drivers/built-in.o: In function `eeepc_backlight_exit':
eeepc-laptop.c:(.text+0x18d546): undefined reference to `input_unregister_device'

Signed-off-by: Alexey Dobriyan <>
Cc: Len Brown <>
Cc: Ingo Molnar <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agopm: fix build for CONFIG_PM unset
Rafael J. Wysocki [Wed, 18 Feb 2009 22:48:21 +0000 (14:48 -0800)]
pm: fix build for CONFIG_PM unset

Compilation of kprobes.c with CONFIG_PM unset is broken due to some broken
config dependncies.  Fix that.

Signed-off-by: Rafael J. Wysocki <>
Reported-by: Ingo Molnar <>
Tested-by: Masami Hiramatsu <>
Cc: Len Brown <>
Acked-by: Pavel Machek <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agocgroups: fix possible use after free
Li Zefan [Wed, 18 Feb 2009 22:48:20 +0000 (14:48 -0800)]
cgroups: fix possible use after free

In cgroup_kill_sb(), root is freed before sb is detached from the list, so
another sget() may find this sb and call cgroup_test_super(), which will
access the root that has been freed.

Reported-by: Al Viro <>
Signed-off-by: Li Zefan <>
Acked-by: Paul Menage <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agomm: task dirty accounting fix
Nick Piggin [Wed, 18 Feb 2009 22:48:18 +0000 (14:48 -0800)]
mm: task dirty accounting fix

YAMAMOTO-san noticed that task_dirty_inc doesn't seem to be called properly for
cases where set_page_dirty is not used to dirty a page (eg. mark_buffer_dirty).

Additionally, there is some inconsistency about when task_dirty_inc is
called.  It is used for dirty balancing, however it even gets called for

So rather than increment it in a set_page_dirty wrapper, move it down to
exactly where the dirty page accounting stats are incremented.

Cc: YAMAMOTO Takashi <>
Signed-off-by: Nick Piggin <>
Acked-by: Peter Zijlstra <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agotimerfd: add flags check
Davide Libenzi [Wed, 18 Feb 2009 22:48:18 +0000 (14:48 -0800)]
timerfd: add flags check

As requested by Michael, add a missing check for valid flags in
timerfd_settime(), and make it return EINVAL in case some extra bits are

Michael said:
If this is to be any use to userland apps that want to check flag
support (perhaps it is too late already), then the sooner we get it
into the kernel the better: 2.6.29 would be good; earlier stables as
well would be even better.

[ remove unused TFD_FLAGS_SET]
Acked-by: Michael Kerrisk <>
Signed-off-by: Davide Libenzi <>
Cc: <> [2.6.27.x, 2.6.28.x]
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agoPavel has moved
Pavel Machek [Wed, 18 Feb 2009 22:48:16 +0000 (14:48 -0800)]
Pavel has moved

My address will stop working some day, so put working one into
MAINTAINERS/CREDITS.  It would be cool to get this to 2.6.29...  it should
not really break anything.

Signed-off-by: Pavel Machek <>
Cc: Jiri Kosina <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agoseq_file: properly cope with pread
Eric Biederman [Wed, 18 Feb 2009 22:48:16 +0000 (14:48 -0800)]
seq_file: properly cope with pread

Currently seq_read assumes that the offset passed to it is always the
offset it passed to user space.  In the case pread this assumption is
broken and we do the wrong thing when presented with pread.

To solve this I introduce an offset cache inside of struct seq_file so we
know where our logical file position is.  Then in seq_read if we try to
read from another offset we reset our data structures and attempt to go to
the offset user space wanted.

[ restore FMODE_PWRITE]
[ seq_open needs its fmode opened up to take advantage of this]
Signed-off-by: Eric Biederman <>
Cc: Alexey Dobriyan <>
Cc: Al Viro <>
Cc: Paul Turner <>
Cc: <> [2.6.25.x, 2.6.26.x, 2.6.27.x, 2.6.28.x]
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agovfs: separate FMODE_PREAD/FMODE_PWRITE into separate flags
Paul Turner [Wed, 18 Feb 2009 22:48:15 +0000 (14:48 -0800)]
vfs: separate FMODE_PREAD/FMODE_PWRITE into separate flags

Separate FMODE_PREAD and FMODE_PWRITE into separate flags to reflect the
reality that the read and write paths may have independent restrictions.

A git grep verifies that these flags are always cleared together so this
new behavior will only apply to interfaces that change to clear flags

This is required for "seq_file: properly cope with pread", a post-2.6.25
regression fix.

[ add comment]
Signed-off-by: Paul Turner <>
Cc: Eric Biederman <>
Cc: Alexey Dobriyan <>
Cc: Al Viro <>
Cc: <> [2.6.25.x, 2.6.26.x, 2.6.27.x, 2.6.28.x]
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agocgroups: update documentation about css_set hash table
Li Zefan [Wed, 18 Feb 2009 22:48:14 +0000 (14:48 -0800)]
cgroups: update documentation about css_set hash table

The css_set hash table was introduced in 2.6.26, so update the
documentation accordingly.

Signed-off-by: Li Zefan <>
Acked-by: Paul Menage <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agoaoe: ignore vendor extension AoE responses
Ed Cashin [Wed, 18 Feb 2009 22:48:13 +0000 (14:48 -0800)]
aoe: ignore vendor extension AoE responses

The Welland ME-747K-SI AoE target generates unsolicited AoE responses that
are marked as vendor extensions.  Instead of ignoring these packets, the
aoe driver was generating kernel messages for each unrecognized response
received.  This patch corrects the behavior.

Signed-off-by: Ed Cashin <>
Reported-by: <>
Tested-by: <>
Cc: <>
Cc: Alex Buell <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agovmalloc: add __get_vm_area_caller()
Benjamin Herrenschmidt [Wed, 18 Feb 2009 22:48:12 +0000 (14:48 -0800)]
vmalloc: add __get_vm_area_caller()

We have get_vm_area_caller() and __get_vm_area() but not

On powerpc, I use __get_vm_area() to separate the ranges of addresses
given to vmalloc vs.  ioremap (various good reasons for that) so in order
to be able to implement the new caller tracking in /proc/vmallocinfo, I
need a "_caller" variant of it.

(akpm: needed for ongoing powerpc development, so merge it early)

[ coding-style fixes]
Signed-off-by: Benjamin Herrenschmidt <>
Reviewed-by: KOSAKI Motohiro <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
12 years agoomap_hsmmc: Change while(); loops with finite version
Jean Pihet [Fri, 6 Feb 2009 15:42:51 +0000 (16:42 +0100)]
omap_hsmmc: Change while(); loops with finite version

Replace the infinite 'while() ;' loops
with a finite loop version.

Signed-off-by: Jean Pihet <>
Acked-by: Tony Lindgren <>
Signed-off-by: Pierre Ossman <>
12 years agoomap_hsmmc: recover from transfer failures
Jean Pihet [Wed, 11 Feb 2009 21:11:39 +0000 (13:11 -0800)]
omap_hsmmc: recover from transfer failures

Timeouts during a command that has a data phase can result in the next
command issued after the command that failed not being processed, i.e.  no
interrupt ever occurs to indicate the command has completed.  This failure
can result in a deadlock.

This patch resets the data state machine to clear the error in case of a
command timeout.

Tested on OMAP3430 chip and intensive MMC/SD device removal while
transferring data.

Signed-off-by: Andy Lowe <>
Signed-off-by: Jean Pihet <>
Signed-off-by: Adrian Hunter <>
Signed-off-by: Andrew Morton <>
Acked-by: Tony Lindgren <>
Signed-off-by: Pierre Ossman <>
12 years agoomap_hsmmc: only MMC1 allows HCTL.SDVS != 1.8V
David Brownell [Tue, 17 Feb 2009 22:49:01 +0000 (14:49 -0800)]
omap_hsmmc: only MMC1 allows HCTL.SDVS != 1.8V

Based on a patch from Tony Lindgren ... after initialization,
never change HCTL.SDVS except for MMC1.  The other controller
instances only support 1.8V in that field, although they can
suport other card/SDIO/eMMC/... voltages with level shifting
solutions such as external transceivers.

MMC2 behavior sanity tested on Overo/WLAN, OMAP3430 SDP, and
custom hardware.  MMC1 also sanity tested on those platforms
plus Beagle.  This also fixes a bug preventing MMC2 (and also
presumably MMC3) from powering down when requested.

Signed-off-by: David Brownell <>
Acked-by: Tony Lindgren <>
Signed-off-by: Pierre Ossman <>
12 years agoomap_hsmmc: card detect irq bugfix
David Brownell [Wed, 4 Feb 2009 22:42:03 +0000 (14:42 -0800)]
omap_hsmmc: card detect irq bugfix

Work around lockdep issue when card detect IRQ handlers run in
thread context ... it forces IRQF_DISABLED, which prevents all
access to twl4030 card detect signals.

Signed-off-by: David Brownell <>
Acked-by: Tony Lindgren <>
Signed-off-by: Pierre Ossman <>
12 years agosdhci: fix led naming
Helmut Schaa [Sat, 14 Feb 2009 15:22:39 +0000 (16:22 +0100)]
sdhci: fix led naming

Fix the led device naming for the sdhci driver.

The led class documentation defines the led name to have the
form "devicename:colour:function" while not applicable sections
should be left blank.

To comply with the documentation the led device name is changed
from "mmc*" to "mmc*::".

Signed-off-by: Helmut Schaa <>
Signed-off-by: Pierre Ossman <>
12 years agommc_test: fix basic read test
Rabin Vincent [Fri, 13 Feb 2009 17:25:26 +0000 (22:55 +0530)]
mmc_test: fix basic read test

Due to a typo in the Basic Read test, it's currently identical to the
Basic Write test.  Fix this.

Signed-off-by: Rabin Vincent <>
Signed-off-by: Pierre Ossman <>
12 years agos3cmci: Fix hangup in do_pio_write()
Yauhen Kharuzhy [Wed, 11 Feb 2009 21:25:52 +0000 (13:25 -0800)]
s3cmci: Fix hangup in do_pio_write()

This commit fixes the regression what was added by commit
088a78af978d0c8e339071a9b2bca1f4cb368f30 "s3cmci: Support transfers
which are not multiple of 32 bits."

fifo_free() now returns amount of available space in FIFO buffer in
bytes.  But do_pio_write() writes to FIFO 32-bit words.  Condition for
return from cycle is (fifo_free() == 0), but when fifo has 1..3 bytes
of free space then this condition will never be true and system hangs.

This patch changes condition in the while() to (fifo_free() > 3).

Signed-off-by: Yauhen Kharuzhy <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Pierre Ossman <>
12 years agoALSA: jack - Use card->shortname for input name
Takashi Iwai [Wed, 18 Feb 2009 15:46:27 +0000 (16:46 +0100)]
ALSA: jack - Use card->shortname for input name

Currently the jack layer refers to card->longname as a part of
its input device name string.  However, longname is often really long
and way too ugly as an identifier, such as,
"HDA Intel at 0xf8400000 irq 21".

This patch changes the code to use card->shortname instead.
The shortname string contains usually the h/w vendor and product
names but without messy I/O port or IRQ numbers.

Signed-off-by: Takashi Iwai <>
12 years agoblock: fix deadlock in blk_abort_queue() for drivers that readd to timeout list
Hannes Reinecke [Wed, 18 Feb 2009 09:30:15 +0000 (10:30 +0100)]
block: fix deadlock in blk_abort_queue() for drivers that readd to timeout list

blk_abort_queue() iterates the timeout list and aborts each request on the
list, but if the driver error handling readds a request to the timeout list
during this processing, we could be looping forever. Fix this by splicing
current entries to a local list and run over that list instead.

Signed-off-by: Jens Axboe <>
12 years agoblock: fix booting from partitioned md array
Neil Brown [Wed, 18 Feb 2009 09:33:59 +0000 (10:33 +0100)]
block: fix booting from partitioned md array

Hi Tejun,

 it looks like your commit:

   block: don't depend on consecutive minor space

 broke a particular case for booting from partitioned md/raid devices.
 That is the second time this has been broken recently.  The previous
 time was fixed by

   block: do_mounts - accept root=<non-existant partition>

 Because the data isn't available when an md device is first created
 (we add disks and set it up after creation), the initial partition
 scan finds nothing.  It is not until the device is opened that
 another partition scan happens and finds something.

 So at the point where the kernel parameter "root=/dev/md_d0p1" is
 being parsed, md_d0 exists, but md_d0p1 does not.
 However if we let blk_lookup_devt return the correct device number
 even though the device doesn't exist, then the attempt to mount it
 will successfully find the partition.

 I have tried in the past to find a way to get the partition table to
 be read as soon as the array is assembled but that proved impossible
 (at the time).  I don't remember the details, and could possibly
 revisit it.  However it would be really nice if blk_lookup_devt
 could be adjusted to again accept non existant partitions.

Signed-off-by: Jens Axboe <>
12 years agoblock: revert part of 18ce3751ccd488c78d3827e9f6bf54e6322676fb
Jens Axboe [Tue, 17 Feb 2009 12:59:08 +0000 (13:59 +0100)]
block: revert part of 18ce3751ccd488c78d3827e9f6bf54e6322676fb

The above commit added WRITE_SYNC and switched various places to using
that for committing writes that will be waited upon immediately after
submission. However, this causes a performance regression with AS and CFQ
for ext3 at least, since sync_dirty_buffer() will submit some writes with
WRITE_SYNC while ext3 has sumitted others dependent writes without the sync
flag set. This causes excessive anticipation/idling in the IO scheduler
because sync and async writes get interleaved, causing a big performance
regression for the below test case (which is meant to simulate sqlite
like behaviour).

---- test case ----

int main(int argc, char **argv)

int fdes, i;
FILE *fp;
struct timeval start;
struct timeval end;
struct timeval res;

gettimeofday(&start, NULL);
for (i=0; i<ROWS; i++) {
fp = fopen("test_file", "a");
fprintf(fp, "Some Text Data\n");
fdes = fileno(fp);
gettimeofday(&end, NULL);

timersub(&end, &start, &res);
fprintf(stdout, "time to write %d lines is %ld(msec)\n", ROWS,
(res.tv_sec*1000000 + res.tv_usec)/1000);

return 0;


Thanks to for tracking down this performance
regression and providing a test case.

Signed-off-by: Jens Axboe <>
12 years agocciss: PCI power management reset for kexec
Chip Coldwell [Mon, 16 Feb 2009 12:11:56 +0000 (13:11 +0100)]
cciss: PCI power management reset for kexec

The kexec kernel resets the CCISS hardware in three steps:

1. Use PCI power management states to reset the controller in the
   kexec kernel.

2. Clear the MSI/MSI-X bits in PCI configuration space so that MSI
   initialization in the kexec kernel doesn't fail.

3. Use the CCISS "No-op" message to determine when the controller
   firmware has recovered from the PCI PM reset.

[ cleanups]
Signed-off-by: Mike Miller <>
Cc: Randy Dunlap <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Jens Axboe <>
12 years agoparide/pg.c: xs(): &&/|| confusion
Roel Kluin [Mon, 16 Feb 2009 12:11:55 +0000 (13:11 +0100)]
paride/pg.c: xs(): &&/|| confusion

&&/|| confusion

Signed-off-by: Roel Kluin <>
Cc: Bartlomiej Zolnierkiewicz <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Jens Axboe <>
12 years agofs/bio: bio_alloc_bioset: pass right object ptr to mempool_free
Subhash Peddamallu [Mon, 16 Feb 2009 09:27:07 +0000 (10:27 +0100)]
fs/bio: bio_alloc_bioset: pass right object ptr to mempool_free

When freeing from bio pool use right ptr to account for bs->front_pad,
instead of bio ptr,

Signed-off-by: Subhash Peddamallu <>
Signed-off-by: Jens Axboe <>
12 years agoblock: fix bad definition of BIO_RW_SYNC
Jens Axboe [Mon, 16 Feb 2009 09:25:40 +0000 (10:25 +0100)]
block: fix bad definition of BIO_RW_SYNC

We can't OR shift values, so get rid of BIO_RW_SYNC and use BIO_RW_SYNCIO
and BIO_RW_UNPLUG explicitly. This brings back the behaviour from before

Signed-off-by: Jens Axboe <>
12 years agobsg: Fix sense buffer bug in SG_IO
Boaz Harrosh [Tue, 3 Feb 2009 06:47:29 +0000 (07:47 +0100)]
bsg: Fix sense buffer bug in SG_IO

When submitting requests via SG_IO, which does a sync io, a
bsg_command is not allocated. So an in-Kernel sense_buffer was not
set. However when calling blk_execute_rq() with no sense buffer
one is provided from the stack. Now bsg at blk_complete_sgv4_hdr_rq()
would check if rq->sense_len and a sense was requested by sg_io_v4
the rq->sense was copy_user() back, but by now it is already mangled
stack memory.

I have fixed that by forcing a sense_buffer when calling bsg_map_hdr().
The bsg_command->sense is provided in the write/read path like before,
and on-the-stack buffer is provided when doing SG_IO.

I have also fixed a dprintk message to print rq->errors in hex because
of the scsi bit-field use of this member. For other block devices it
does not matter anyway.

Signed-off-by: Boaz Harrosh <>
Acked-by: FUJITA Tomonori <>
Signed-off-by: Jens Axboe <>
12 years agoRevert "sdhci: force high speed capability on some controllers"
Pierre Ossman [Mon, 2 Feb 2009 20:13:49 +0000 (21:13 +0100)]
Revert "sdhci: force high speed capability on some controllers"

This reverts commit a4b76193774b463b922cab2f92450efb20d29ef0.

It turned out that the controller had problem running at the
higher speed, so go back to trusting the hardware capability

Signed-off-by: Pierre Ossman <>
12 years agoMMC: fix bug - SDHC card capacity not correct
Yi Li [Thu, 5 Feb 2009 07:31:57 +0000 (15:31 +0800)]
MMC: fix bug - SDHC card capacity not correct

Signed-off-by: Yi Li <>
Signed-off-by: Bryan Wu <>
Signed-off-by: Pierre Ossman <>
12 years agoAdd support for VT6415 PCIE PATA IDE Host Controller
Zlatko Calusic [Wed, 18 Feb 2009 00:33:34 +0000 (01:33 +0100)]
Add support for VT6415 PCIE PATA IDE Host Controller

Signed-off-by: Zlatko Calusic <>
Signed-off-by: Linus Torvalds <>
12 years agoUSB/PCI: Fix resume breakage of controllers behind cardbus bridges
Rafael J. Wysocki [Fri, 13 Feb 2009 22:41:12 +0000 (23:41 +0100)]
USB/PCI: Fix resume breakage of controllers behind cardbus bridges

If a USB PCI controller is behind a cardbus bridge, we are trying to
restore its configuration registers too early, before the cardbus
bridge is operational.  To fix this, call pci_restore_state() from
usb_hcd_pci_resume() and remove usb_hcd_pci_resume_early() which is
no longer necessary (the configuration spaces of USB controllers that
are not behind cardbus bridges will be restored by the PCI PM core
with interrupts disabled anyway).

This patch fixes the regression from 2.6.28 tracked as

[ Side note: the proper long-term fix is probably to just force the
  unplug event at suspend time instead of doing a plug/unplug at resume
  time, but this patch is fine regardless  - Linus ]

Signed-off-by: Rafael J. Wysocki <>
Reported-by: Miles Lane <>
Signed-off-by: Linus Torvalds <>
12 years agox86, mce: fix ifdef for 64bit thermal apic vector clear on shutdown
Andi Kleen [Thu, 12 Feb 2009 12:39:35 +0000 (13:39 +0100)]
x86, mce: fix ifdef for 64bit thermal apic vector clear on shutdown

Impact: Bugfix

The ifdef for the apic clear on shutdown for the 64bit intel thermal
vector was incorrect and never triggered. Fix that.

Signed-off-by: Andi Kleen <>
Acked-by: Thomas Gleixner <>
Signed-off-by: H. Peter Anvin <>
12 years agox86, mce: use force_sig_info to kill process in machine check
Andi Kleen [Thu, 12 Feb 2009 12:39:33 +0000 (13:39 +0100)]
x86, mce: use force_sig_info to kill process in machine check

Impact: bug fix (with tolerant == 3)

do_exit cannot be called directly from the exception handler because
it can sleep and the exception handler runs on the exception stack.
Use force_sig() instead.

Based on a earlier patch by Ying Huang who debugged the problem.

Signed-off-by: Andi Kleen <>
Acked-by: Thomas Gleixner <>
Signed-off-by: H. Peter Anvin <>
12 years agox86, mce: reinitialize per cpu features on resume
Andi Kleen [Thu, 12 Feb 2009 12:39:26 +0000 (13:39 +0100)]
x86, mce: reinitialize per cpu features on resume

Impact: Bug fix

This fixes a long standing bug in the machine check code. On resume the
boot CPU wouldn't get its vendor specific state like thermal handling
reinitialized. This means the boot cpu wouldn't ever get any thermal
events reported again.

Call the respective initialization functions on resume

v2: Remove ancient init because they don't have a resume device anyways.
    Pointed out by Thomas Gleixner.
v3: Now fix the Subject too to reflect v2 change

Signed-off-by: Andi Kleen <>
Acked-by: Thomas Gleixner <>
Signed-off-by: H. Peter Anvin <>
12 years agoMerge branch 'sched-fixes-for-linus' of git://
Linus Torvalds [Tue, 17 Feb 2009 22:30:06 +0000 (14:30 -0800)]
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

12 years agoMerge branch 'timers-fixes-for-linus' of git://
Linus Torvalds [Tue, 17 Feb 2009 22:29:42 +0000 (14:29 -0800)]
Merge branch 'timers-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-fixes-for-linus' of git://
  timers: more consistently use clock vs timer

12 years agoMerge branch 'tracing-fixes-for-linus' of git://
Linus Torvalds [Tue, 17 Feb 2009 22:29:15 +0000 (14:29 -0800)]
Merge branch 'tracing-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'tracing-fixes-for-linus' of git://
  doc: mmiotrace.txt, buffer size control change
  trace: mmiotrace to the tracer menu in Kconfig
  mmiotrace: count events lost due to not recording

12 years agoMerge branch 'x86-fixes-for-linus' of git://
Linus Torvalds [Tue, 17 Feb 2009 22:27:39 +0000 (14:27 -0800)]
Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://
  x86, vm86: fix preemption bug
  x86, olpc: fix model detection without OFW
  x86, hpet: fix for LS21 + HPET = boot hang
  x86: CPA avoid repeated lazy mmu flush
  x86: warn if arch_flush_lazy_mmu_cpu is called in preemptible context
  x86/paravirt: make arch_flush_lazy_mmu/cpu disable preemption
  x86, pat: fix warn_on_once() while mapping 0-1MB range with /dev/mem
  x86/cpa: make sure cpa is safe to call in lazy mmu mode
  x86, ptrace, mm: fix double-free on race

12 years agoMerge branch 'core-fixes-for-linus' of git://
Linus Torvalds [Tue, 17 Feb 2009 22:26:35 +0000 (14:26 -0800)]
Merge branch 'core-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'core-fixes-for-linus' of git://
  iommu: fix Intel IOMMU write-buffer flushing
  futex: fix reference leak

Trivial conflicts fixed manually in drivers/pci/intel-iommu.c

12 years agoMerge branch 'merge' of git://
Linus Torvalds [Tue, 17 Feb 2009 22:23:49 +0000 (14:23 -0800)]
Merge branch 'merge' of git://git./linux/kernel/git/benh/powerpc

* 'merge' of git://
  powerpc/vsx: Fix VSX alignment handler for regs 32-63
  powerpc/ps3: Move ps3_mm_add_memory to device_initcall
  powerpc/mm: Fix numa reserve bootmem page selection
  powerpc/mm: Fix _PAGE_CHG_MASK to protect _PAGE_SPECIAL

12 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Tue, 17 Feb 2009 22:23:35 +0000 (14:23 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jbarnes/pci-2.6

* 'for-linus' of git://
  PCI: Documentation: fix minor PCIe HOWTO thinko
  PCI: fix missing kernel-doc and typos
  PCI: fix struct pci_platform_pm_ops kernel-doc
  PCI: fix rom.c kernel-doc warning
  PCI/MSI: fix msi_mask() shift fix

12 years agoMerge git://
Linus Torvalds [Tue, 17 Feb 2009 22:22:59 +0000 (14:22 -0800)]
Merge git://git./linux/kernel/git/herbert/crypto-2.6

* git://
  crypto: lrw - Fix big endian support

12 years agoMerge git://
Linus Torvalds [Tue, 17 Feb 2009 22:19:14 +0000 (14:19 -0800)]
Merge git://git./linux/kernel/git/mason/btrfs-unstable

* git://
  Btrfs: hold trans_mutex when using btrfs_record_root_in_trans
  Btrfs: make a lockdep class for the extent buffer locks
  Btrfs: fs/btrfs/volumes.c: remove useless kzalloc
  Btrfs: remove unused code in split_state()
  Btrfs: remove btrfs_init_path
  Btrfs: balance_level checks !child after access
  Btrfs: Avoid using __GFP_HIGHMEM with slab allocator
  Btrfs: don't clean old snapshots on sync(1)
  Btrfs: use larger metadata clusters in ssd mode
  Btrfs: process mount options on mount -o remount,
  Btrfs: make sure all pending extent operations are complete

12 years agoMerge branch 'upstream-linus' of git://
Linus Torvalds [Tue, 17 Feb 2009 22:16:02 +0000 (14:16 -0800)]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://
  sata_nv: give up hardreset on nf2
  libata-sff: fix 32-bit PIO ATAPI regression

12 years agoMerge git://
Linus Torvalds [Tue, 17 Feb 2009 22:15:23 +0000 (14:15 -0800)]
Merge git://git./linux/kernel/git/sam/kbuild-fixes

* git://
  kbuild: create the source symlink earlier in the objdir
  scripts: add x86 64 bit support to the script
  scripts: add x86 register parser to
  kbuild: add sys_* entries for syscalls in tags
  kbuild: fix tags generation of config symbols
  bootgraph: fix for use with dot symbols
  kbuild: add vmlinux to kernel rpm
  kbuild,setlocalversion: shorten the make time when using svn

12 years agoMerge branch 'hwmon-for-linus' of git://
Linus Torvalds [Tue, 17 Feb 2009 22:14:15 +0000 (14:14 -0800)]
Merge branch 'hwmon-for-linus' of git://

* 'hwmon-for-linus' of git://
  MAINTAINERS: Switch hdaps to Frank Seidel
  hwmon: Fix ACPI resource check error handling
  hwmon: (f71882fg) Hide misleading error message

12 years agoMerge branch 'for_linus' of git://
Linus Torvalds [Tue, 17 Feb 2009 22:09:03 +0000 (14:09 -0800)]
Merge branch 'for_linus' of git://git./linux/kernel/git/mchehab/linux-2.6

* 'for_linus' of git://
  V4L/DVB (10626): ivtv: fix regression in get sliced vbi format
  V4L/DVB (10625): ivtv: fix decoder crash regression
  V4L/DVB (10619): gspca - main: Destroy the URBs at disconnection time.
  V4L/DVB (10572): Revert commit dda06a8e4610757def753ee3a541a0b1a1feb36b
  V4L/DVB (10533): fix LED status output
  V4L/DVB (10532): Correction of Stereo detection/setting and signal strength indication
  V4L/DVB (10527): tuner: fix TUV1236D analog/digital setup
  V4L/DVB (10516a): zoran: Update MAINTAINERS entry

12 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Tue, 17 Feb 2009 22:08:26 +0000 (14:08 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jikos/hid

* 'for-linus' of git://
  HID: fix bus endianity in file2alias
  HID: move tmff and zpff devices from ignore_list to blacklist
  HID: unlock properly on error paths in hidraw_ioctl()
  HID: blacklist Powercom USB UPS

12 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Tue, 17 Feb 2009 22:08:03 +0000 (14:08 -0800)]
Merge branch 'for-linus' of git://

* 'for-linus' of git://
  mfd: Fix sm501_register_gpio section mismatch
  mfd: fix sm501 section mismatches
  mfd: terminate pcf50633 i2c_device_id list
  mfd: Ensure all WM8350 IRQs are masked at startup
  mfd: fix htc-egpio iomem resource handling using resource_size
  mfd: Fix TWL4030 build on some ARM variants
  mfd: wm8350 tries reaches -1
  mfd: Mark WM835x USB_SLV_500MA bit as accessible
  mfd: Improve diagnostics for WM8350 ID register probe
  mfd: Initialise WM8350 interrupts earlier
  mfd: Fix egpio kzalloc return test

12 years agoMerge git://
Linus Torvalds [Tue, 17 Feb 2009 22:07:18 +0000 (14:07 -0800)]
Merge git://git./linux/kernel/git/wim/linux-2.6-watchdog

* git://
  [WATCHDOG] iTCO_wdt: fix SMI_EN regression 2

12 years agoMerge branch 'for-upstream' of git://
Linus Torvalds [Tue, 17 Feb 2009 22:05:59 +0000 (14:05 -0800)]
Merge branch 'for-upstream' of git://git./linux/kernel/git/dvrabel/uwb

* 'for-upstream' of git://
  wusb: whci-hcd: always lock whc->lock with interrupts disabled

12 years agoFRV: __pte_to_swp_entry doesn't expand correctly
Roel Kluin [Mon, 16 Feb 2009 12:49:16 +0000 (12:49 +0000)]
FRV: __pte_to_swp_entry doesn't expand correctly

The macro doesn't expand correctly when its parameter isn't 'pte'.

Signed-off-by: Roel Kluin <>
Signed-off-by: David Howells <>
Signed-off-by: Linus Torvalds <>
12 years agoMerge branch 'for_linus' of git://
Linus Torvalds [Tue, 17 Feb 2009 22:05:05 +0000 (14:05 -0800)]
Merge branch 'for_linus' of git://git./linux/kernel/git/tytso/ext4

* 'for_linus' of git://
  ext4: Fix NULL dereference in ext4_ext_migrate()'s error handling
  ext4: Implement range_cyclic in ext4_da_writepages instead of write_cache_pages
  ext4: Initialize preallocation list_head's properly
  ext4: Fix lockdep warning
  ext4: Fix to read empty directory blocks correctly in 64k
  jbd2: Avoid possible NULL dereference in jbd2_journal_begin_ordered_truncate()
  Revert "ext4: wait on all pending commits in ext4_sync_fs()"
  jbd2: Fix return value of jbd2_journal_start_commit()

12 years agoMerge branch 'kvm-updates/2.6.29' of git://
Linus Torvalds [Tue, 17 Feb 2009 22:04:32 +0000 (14:04 -0800)]
Merge branch 'kvm-updates/2.6.29' of git://git./virt/kvm/kvm

* 'kvm-updates/2.6.29' of git://
  KVM: VMX: Flush volatile msrs before emulating rdmsr
  KVM: Fix assigned devices circular locking dependency
  KVM: x86: fix LAPIC pending count calculation
  KVM: Fix INTx for device assignment
  KVM: MMU: Map device MMIO as UC in EPT
  KVM: x86: disable kvmclock on non constant TSC hosts
  KVM: PIT: fix i8254 pending count read
  KVM: Fix racy in kvm_free_assigned_irq
  KVM: Add kvm_arch_sync_events to sync with asynchronize events
  KVM: mmu_notifiers release method
  KVM: Avoid using CONFIG_ in userspace visible headers
  KVM: ia64: fix fp fault/trap handler

12 years agoMerge git://
Linus Torvalds [Tue, 17 Feb 2009 22:04:00 +0000 (14:04 -0800)]
Merge git://git./linux/kernel/git/rusty/linux-2.6-for-linus

* git://
  cpumask: Use cpu_*_mask accessors code: alpha
  cpumask: fix powernow-k8: partial revert of 2fdf66b491ac706657946442789ec644cc317e1a

12 years agoFix Intel IOMMU write-buffer flushing
David Woodhouse [Fri, 13 Feb 2009 23:18:03 +0000 (23:18 +0000)]
Fix Intel IOMMU write-buffer flushing

This is the cause of the DMA faults and disk corruption that people have
been seeing. Some chipsets neglect to report the RWBF "capability" --
the flag which says that we need to flush the chipset write-buffer when
changing the DMA page tables, to ensure that the change is visible to
the IOMMU.

Override that bit on the affected chipsets, and everything is happy

Thanks to Chris and Bhavesh and others for helping to debug.

Signed-off-by: David Woodhouse <>
Tested-by: Chris Wright <>
Reviewed-by: Bhavesh Davda <>
Signed-off-by: Linus Torvalds <>
12 years agoFix incomplete __mntput locking
Al Viro [Mon, 16 Feb 2009 02:38:12 +0000 (02:38 +0000)]
Fix incomplete __mntput locking

Getting this wrong caused

WARNING: at fs/namespace.c:636 mntput_no_expire+0xac/0xf2()

due to optimistically checking cpu_writer->mnt outside the spinlock.

Here's what we really want:
 * we know that nobody will set cpu_writer->mnt to mnt from now on
 * all changes to that sucker are done under cpu_writer->lock
 * we want the laziest equivalent of
if (likely(cpu_writer->mnt != mnt)) {
/* do stuff */
  that would make sure we won't miss earlier setting of ->mnt done by
  another CPU.

Anyway, for now we just move the spin_lock() earlier and move the test
into the properly locked region.

Signed-off-by: Al Viro <>
Reported-and-tested-by: Li Zefan <>
Signed-off-by: Linus Torvalds <>
12 years agox86, rcu: fix strange load average and ksoftirqd behavior
Paul E. McKenney [Tue, 17 Feb 2009 14:01:30 +0000 (06:01 -0800)]
x86, rcu: fix strange load average and ksoftirqd behavior

Damien Wyart reported high ksoftirqd CPU usage (20%) on an
otherwise idle system.

The function-graph trace Damien provided:

>   799.521187 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.521371 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.521555 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.521738 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.521934 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.522068 |   1)  ksoftir-2324  |               |                rcu_check_callbacks() {
>   799.522208 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.522392 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.522575 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.522759 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.522956 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.523074 |   1)  ksoftir-2324  |               |                  rcu_check_callbacks() {
>   799.523214 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.523397 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.523579 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.523762 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.523960 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.524079 |   1)  ksoftir-2324  |               |                  rcu_check_callbacks() {
>   799.524220 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.524403 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.524587 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
>   799.524770 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
> [ . . . ]

Shows rcu_check_callbacks() being invoked way too often. It should be called
once per jiffy, and here it is called no less than 22 times in about
3.5 milliseconds, meaning one call every 160 microseconds or so.

Why do we need to call rcu_pending() and rcu_check_callbacks() from the
idle loop of 32-bit x86, especially given that no other architecture does

The following patch removes the call to rcu_pending() and
rcu_check_callbacks() from the x86 32-bit idle loop in order to
reduce the softirq load on idle systems.

Reported-by: Damien Wyart <>
Signed-off-by: Paul E. McKenney <>
Signed-off-by: Ingo Molnar <>
12 years agoMAINTAINERS: Switch hdaps to Frank Seidel
Frank Seidel [Tue, 17 Feb 2009 18:59:54 +0000 (19:59 +0100)]
MAINTAINERS: Switch hdaps to Frank Seidel

As Rovert Love doesn't any more seem to be realy active on hdaps
driver i'll happily take it over.

Signed-off-by: Frank Seidel <>
Cc: Robert Love <>
Signed-off-by: Jean Delvare <>
12 years agohwmon: Fix ACPI resource check error handling
Hans de Goede [Tue, 17 Feb 2009 18:59:54 +0000 (19:59 +0100)]
hwmon: Fix ACPI resource check error handling

This patch fixes a number of cases where things were not properly
cleaned up when acpi_check_resource_conflict() returned an error,
causing oopses such as the one reported here:

Signed-off-by: Hans de Goede <>
Signed-off-by: Jean Delvare <>
12 years agohwmon: (f71882fg) Hide misleading error message
Jean Delvare [Tue, 17 Feb 2009 18:59:54 +0000 (19:59 +0100)]
hwmon: (f71882fg) Hide misleading error message

If the F71882FG chip is at address 0x4e, then the probe at 0x2e will
fail with the following message in the logs:
f71882fg: Not a Fintek device

This is misleading because there is a Fintek device, just at a
different address. So I propose to degrade this message to a debug

Signed-off-by: Jean Delvare <>
Acked-by: Hans de Goede <>
12 years agotracing/function-graph-tracer: trace the idle tasks
Frederic Weisbecker [Tue, 17 Feb 2009 17:35:34 +0000 (18:35 +0100)]
tracing/function-graph-tracer: trace the idle tasks

When the function graph tracer is activated, it iterates over the task_list
to allocate a stack to store the return addresses.

But the per cpu idle tasks are not iterated by using
do_each_thread / while_each_thread.

So we have to iterate on them manually.

This fixes somes weirdness in the traces and many losses of traces.
Examples on two cpus:

 0)   Xorg-4287    |   2.906 us    |              }
 0)   Xorg-4287    |   3.965 us    |            }
 0)   Xorg-4287    |   5.302 us    |          }
 0)   Xorg-4287    =>    <idle>-0

 0)    <idle>-0    |   2.861 us    |                        }
 0)    <idle>-0    |   0.526 us    |                        set_normalized_timespec();
 0)    <idle>-0    |   7.201 us    |                      }
 0)    <idle>-0    |   8.214 us    |                    }
 0)    <idle>-0    |               |                    clockevents_program_event() {
 0)    <idle>-0    |               |                      lapic_next_event() {
 0)    <idle>-0    |   0.510 us    |                        native_apic_mem_write();
 0)    <idle>-0    |   1.546 us    |                      }
 0)    <idle>-0    |   2.583 us    |                    }
 0)    <idle>-0    | + 12.435 us   |                  }
 0)    <idle>-0    | + 13.470 us   |                }
 0)    <idle>-0    |   0.608 us    |                _spin_unlock_irqrestore();
 0)    <idle>-0    | + 23.270 us   |              }
 0)    <idle>-0    | + 24.336 us   |            }
 0)    <idle>-0    | + 25.417 us   |          }
 0)    <idle>-0    |   0.593 us    |          _spin_unlock();
 0)    <idle>-0    | + 41.869 us   |        }
 0)    <idle>-0    | + 42.906 us   |      }
 0)    <idle>-0    | + 95.035 us   |    }
 0)    <idle>-0    |   0.540 us    |    menu_reflect();
 0)    <idle>-0    | ! 100.404 us  |  }
 0)    <idle>-0    |   0.564 us    |  mce_idle_callback();
 0)    <idle>-0    |               |  enter_idle() {
 0)    <idle>-0    |   0.526 us    |    mce_idle_callback();
 0)    <idle>-0    |   1.757 us    |  }
 0)    <idle>-0    |               |  cpuidle_idle_call() {
 0)    <idle>-0    |               |    menu_select() {
 0)    <idle>-0    |   0.525 us    |      pm_qos_requirement();
 0)    <idle>-0    |   0.518 us    |      tick_nohz_get_sleep_length();
 0)    <idle>-0    |   2.621 us    |    }
 1)    <idle>-0    |   0.518 us    |              touch_softlockup_watchdog();
 1)    <idle>-0    | + 14.355 us   |            }
 1)    <idle>-0    | + 22.840 us   |          }
 1)    <idle>-0    | + 25.949 us   |        }
 1)    <idle>-0    |               |        handle_irq() {
 1)    <idle>-0    |   0.511 us    |          irq_to_desc();
 1)    <idle>-0    |               |          handle_edge_irq() {
 1)    <idle>-0    |   0.638 us    |            _spin_lock();
 1)    <idle>-0    |               |            ack_apic_edge() {
 1)    <idle>-0    |   0.510 us    |              irq_to_desc();
 1)    <idle>-0    |               |              move_native_irq() {
 1)    <idle>-0    |   0.510 us    |                irq_to_desc();
 1)    <idle>-0    |   1.532 us    |              }
 1)    <idle>-0    |   0.511 us    |              native_apic_mem_write();
 1)    <idle>-0    =>    cat-5073

 1)    cat-5073    |   3.731 us    |                    }
 1)    cat-5073    |               |                    run_local_timers() {
 1)    cat-5073    |   0.533 us    |                      hrtimer_run_queues();
 1)    cat-5073    |               |                      raise_softirq() {
 1)    cat-5073    |               |                        __raise_softirq_irqoff() {
 1)    cat-5073    |               |                          /* nr: 1 */
 1)    cat-5073    |   2.718 us    |                        }
 1)    cat-5073    |   3.814 us    |                      }

Signed-off-by: Frederic Weisbecker <>
Cc: Steven Rostedt <>
Cc: Arnaldo Carvalho de Melo <>
Signed-off-by: Ingo Molnar <>
12 years agoV4L/DVB (10626): ivtv: fix regression in get sliced vbi format
Hans Verkuil [Mon, 16 Feb 2009 07:25:32 +0000 (04:25 -0300)]
V4L/DVB (10626): ivtv: fix regression in get sliced vbi format

The new v4l2_subdev_call used s_fmt instead of g_fmt.

Thanks-to: Andy Walls <>
Signed-off-by: Hans Verkuil <>
Signed-off-by: Mauro Carvalho Chehab <>
12 years agoV4L/DVB (10625): ivtv: fix decoder crash regression
Hans Verkuil [Sat, 14 Feb 2009 22:58:33 +0000 (19:58 -0300)]
V4L/DVB (10625): ivtv: fix decoder crash regression

The video_ioctl2 conversion of ivtv in kernel 2.6.27 introduced a bug
causing decoder commands to crash. The decoder commands should have been
handled from the video_ioctl2 default handler, ensuring correct mapping
of the argument between user and kernel space. Unfortunately they ended
up before the video_ioctl2 call, causing random crashes.

Thanks to for testing and helping me track down the

Signed-off-by: Hans Verkuil <>
Signed-off-by: Mauro Carvalho Chehab <>
12 years agoV4L/DVB (10619): gspca - main: Destroy the URBs at disconnection time.
Adam Baker [Wed, 4 Feb 2009 18:33:21 +0000 (15:33 -0300)]
V4L/DVB (10619): gspca - main: Destroy the URBs at disconnection time.

If a device using the gspca framework is unplugged while it is still streaming
then the call that is used to free the URBs that have been allocated occurs
after the pointer it uses becomes invalid at the end of gspca_disconnect.
Make another cleanup call in gspca_disconnect while the pointer is still
valid (multiple calls are OK as destroy_urbs checks for pointers already
being NULL.

Signed-off-by: Adam Baker <>
Signed-off-by: Jean-Francois Moine <>
Signed-off-by: Mauro Carvalho Chehab <>
12 years agoV4L/DVB (10572): Revert commit dda06a8e4610757def753ee3a541a0b1a1feb36b
Mauro Carvalho Chehab [Mon, 16 Feb 2009 18:27:44 +0000 (15:27 -0300)]
V4L/DVB (10572): Revert commit dda06a8e4610757def753ee3a541a0b1a1feb36b

On Mon, 02 Feb 2009, Hartmut wrote:

This change set is wrong. The affected functions cannot be called from
an interrupt context, because they may process large buffers. In this
case, interrupts are disabled for a long time. Functions, like
dvb_dmx_swfilter_packets(), could be called only from a tasklet.

This change set does hide some strong design bugs in dm1105.c and

Please revert this change set and do fix the bugs in dm1105.c and
au0828-dvb.c (and other files).

On Sun, 15 Feb 2009, Oliver Endriss wrote:

This changeset _must_ be reverted! It breaks all kernels since 2.6.27
for applications which use DVB and require a low interrupt latency.

It is a very bad idea to call the demuxer to process data buffers with
interrupts disabled!

On Mon, 16 Feb 2009, Trent Piepho wrote:

I agree, this is bad.  The demuxer is far too much work to be done with
IRQs off.  IMHO, even doing it under a spin-lock is excessive.  It should
be a mutex.  Drivers should use a work-queue to feed the demuxer.

Thank you for testing this changeset and discovering the issues on it.

Cc: Trent Piepho <>
Cc: Hartmut <>
Cc: Oliver Endriss <>
Cc: Andreas Oberritter <>
Signed-off-by: Mauro Carvalho Chehab <>
12 years agoV4L/DVB (10533): fix LED status output
Tobias Lorenz [Thu, 12 Feb 2009 17:56:19 +0000 (14:56 -0300)]
V4L/DVB (10533): fix LED status output

This patch closes one of my todos that was since long on my list.
Some people reported clicks and glitches in the audio stream,
correlated to the LED color changing cycle.
Thanks to Rick Bronson <>.

Signed-off-by: Tobias Lorenz <>
Signed-off-by: Mauro Carvalho Chehab <>