GitHub/moto-9609/android_kernel_motorola_exynos9610.git
15 years agoMIPS: Wire up accept4 syscall.
Ralf Baechle [Mon, 3 Aug 2009 16:27:19 +0000 (17:27 +0100)]
MIPS: Wire up accept4 syscall.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: VPE: Delete unused function get_tc_unused().
Ralf Baechle [Mon, 3 Aug 2009 11:57:52 +0000 (12:57 +0100)]
MIPS: VPE: Delete unused function get_tc_unused().

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: VPE: Fix bogus indentation.
Ralf Baechle [Mon, 3 Aug 2009 11:56:39 +0000 (12:56 +0100)]
MIPS: VPE: Fix bogus indentation.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: VPE: Make various functions static.
Ralf Baechle [Mon, 3 Aug 2009 11:54:35 +0000 (12:54 +0100)]
MIPS: VPE: Make various functions static.

None of these is used outside the VPE loader.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: VPE: Free relocation chain on error.
Ralf Baechle [Mon, 3 Aug 2009 11:26:40 +0000 (12:26 +0100)]
MIPS: VPE: Free relocation chain on error.

This may happen if a bad sequence of relocations is being encountered.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: VPE: Fix compiler warning.
Raghu Gandham [Fri, 10 Jul 2009 09:01:32 +0000 (02:01 -0700)]
MIPS: VPE: Fix compiler warning.

Signed-off-by: Raghu Gandham <raghu@mips.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: Module: Make error messages unique.
Ralf Baechle [Mon, 3 Aug 2009 09:50:19 +0000 (10:50 +0100)]
MIPS: Module: Make error messages unique.

There were three different errors resulting in a "dangerous relocation"
message.  Add the relocation type to the messgages to make them more
useful.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: Octeon: Run IPI code with interrupts disabled.
David Daney [Fri, 31 Jul 2009 21:30:07 +0000 (14:30 -0700)]
MIPS: Octeon: Run IPI code with interrupts disabled.

In mm/slab.c the function do_ccupdate_local requires that interrupts be
disabled.  If they are not, we panic with CONFIG_DEBUG_SLAB.

So we disable interrupts while processing IPIs.  Also these are not shared
irqs, so get rid of the IRQF_SHARED flag.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: Jazz: Fix read buffer overflow
Roel Kluin [Fri, 31 Jul 2009 12:52:51 +0000 (14:52 +0200)]
MIPS: Jazz: Fix read buffer overflow

Check whether index is within bounds before testing the element.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: Use DIV_ROUND_CLOSEST
Julia Lawall [Sun, 2 Aug 2009 08:48:08 +0000 (10:48 +0200)]
MIPS: Use DIV_ROUND_CLOSEST

The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d
but is perhaps more readable.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@haskernel@
@@

#include <linux/kernel.h>

@depends on haskernel@
expression x,__divisor;
@@

- (((x) + ((__divisor) / 2)) / (__divisor))
+ DIV_ROUND_CLOSEST(x,__divisor)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: MTX-1: Request button GPIO before setting its direction
Florian Fainelli [Sat, 1 Aug 2009 21:51:20 +0000 (23:51 +0200)]
MIPS: MTX-1: Request button GPIO before setting its direction

This patch fixes the following warning at boot time:
WARNING: at drivers/gpio/gpiolib.c:83 0x8021d5e0()
autorequest GPIO-207
Modules linked in:
Call Trace:[<8011e0ec>] 0x8011e0ec
[<80110a28>] 0x80110a28
[<80110a28>] 0x80110a28
[..snip..]

The current code does not request the GPIO and attempts
to set its direction, which is a violation of the GPIO API.
This patch also unhardcode the GPIO we request and use
the one we defined in the button driver.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: AR7: Override CFLAGS with -Werror
Florian Fainelli [Fri, 24 Jul 2009 11:19:10 +0000 (13:19 +0200)]
MIPS: AR7: Override CFLAGS with -Werror

Now that we have removed all warnings from the ar7 board code we can use
-Werror like on other MIPS boards.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: AR7: Remove unused tnetd7200_get_clock function
Florian Fainelli [Fri, 24 Jul 2009 11:18:42 +0000 (13:18 +0200)]
MIPS: AR7: Remove unused tnetd7200_get_clock function

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: AR7: Use DMA_BIT_MASK(nn) instead of deprecated DMA_nnBIT_MASK
Florian Fainelli [Fri, 24 Jul 2009 11:18:16 +0000 (13:18 +0200)]
MIPS: AR7: Use DMA_BIT_MASK(nn) instead of deprecated DMA_nnBIT_MASK

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: AR7: Fix build failures when CONFIG_SERIAL_8250 is not enabled
Florian Fainelli [Fri, 24 Jul 2009 11:24:15 +0000 (13:24 +0200)]
MIPS: AR7: Fix build failures when CONFIG_SERIAL_8250 is not enabled

This patch fixes the following build failure when CONFIG_SERIAL_8250
is not enabled in the kernel configuration:
arch/mips/ar7/built-in.o: In function 'ar7_register_devices':
platform.c:(.init.text+0x61c): undefined reference to 'early_serial_setup'
platform.c:(.init.text+0x61c): relocation truncated to fit: R_MIPS_26 against 'early_serial_setup'
platform.c:(.init.text+0x68c): undefined reference to 'early_serial_setup'
platform.c:(.init.text+0x68c): relocation truncated to fit: R_MIPS_26 against 'early_serial_setup'

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: Fix read buffer overflow
Roel Kluin [Wed, 29 Jul 2009 20:02:53 +0000 (22:02 +0200)]
MIPS: Fix read buffer overflow

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: AR7: Fix build warning on memory.c
Florian Fainelli [Tue, 21 Jul 2009 10:38:10 +0000 (12:38 +0200)]
MIPS: AR7: Fix build warning on memory.c

This patch fixes the following build warning:
arch/mips/ar7/memory.c: In function 'memsize':
arch/mips/ar7/memory.c:55: warning: passing argument 1 of 'writel' makes integer from pointer without a cast

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: Octeon PCIe: Make hardware and software bus numbers match.
David Daney [Wed, 15 Jul 2009 01:16:50 +0000 (18:16 -0700)]
MIPS: Octeon PCIe: Make hardware and software bus numbers match.

Some SiliconImage PCIe SATA controlers are not detected when the bus
numbers differ.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: RBTX4939: Fix IOC pin-enable register updating
Atsushi Nemoto [Wed, 15 Jul 2009 13:03:56 +0000 (22:03 +0900)]
MIPS: RBTX4939: Fix IOC pin-enable register updating

The rbtx4939_update_ioc_pen() expects txx9_ce_res[] already initialized.
Call it after tx4939_setup().

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: Simplify and correct interrupt handling for MSP4200
Shane McDonald [Sun, 12 Jul 2009 16:42:06 +0000 (10:42 -0600)]
MIPS: Simplify and correct interrupt handling for MSP4200

The current interrupt handling code for the MSP4200 always masks an
interrupt before acknowledging it.  This is not required, as that will be
handled by the level interrupt handler.  This change simplifies the MSP4200
code to remove the masking in the ack routine, and makes sure that the
minimum required operation is performed for masking and acking, rather
than always both masking and acking the interrupt.

Signed-off-by: Shane McDonald <mcdonald.shane@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: MSPxxxx: define MIPS34K_MISSED_ITLB_WAR for other PMC-Sierra SoC
Florian Fainelli [Mon, 27 Apr 2009 14:47:23 +0000 (16:47 +0200)]
MIPS: MSPxxxx: define MIPS34K_MISSED_ITLB_WAR for other PMC-Sierra SoC

Trying to build a PMC-Sierra MSP4200 VoIP gateway defconfig will not work
since MIPS34K_MISSED_ITLB_WAR is not defined for all boards supported
within pmc-serria/msp71xx. This patch defines MIPS34K_MISSED_ITLB_WAR to
prevent such build failures:

  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-mips
  CC      arch/mips/kernel/asm-offsets.s
In file included fromlinux-msp71xx/linux-2.6.29/arch/mips/include/asm/bitops.h:24,
                 from include/linux/bitops.h:17,
                 from include/linux/kernel.h:15,
                 from include/linux/sched.h:52,
                 from arch/mips/kernel/asm-offsets.c:13:
linux-msp71xx/linux-2.6.29/arch/mips/include/asm/war.h:241:2: error: #error Check setting of MIPS34K_MISSED_ITLB_WAR for your
platform

This fixes a compile error when building for the MSP4200 boards.  Identical
patches to fix this were send by

  Florian Fainelli <florian@openwrt.org>
  Shane McDonald <mcdonald.shane@gmail.com>

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: MSP71xx: fix build failures on msp_irq_slp.c
Florian Fainelli [Mon, 27 Apr 2009 14:59:48 +0000 (16:59 +0200)]
MIPS: MSP71xx: fix build failures on msp_irq_slp.c

Trying to build MSP4200 VoIP defconfig also fails on msp_irq_slp.c with a
non-existing reference to mask_slp_irq, which is in turn mask_msp_slp_irq.
Passed that, we will also miss a comma when calling
set_irq_chip_and_handler. This patch fixes both issues.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Shane McDonald <mcdonald.shane@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: Fix loading of modules with unresolved weak symbols
Gabor Juhos [Mon, 13 Jul 2009 09:14:24 +0000 (11:14 +0200)]
MIPS: Fix loading of modules with unresolved weak symbols

Loading of modules with unresolved weak symbols fails on MIPS
since '88173507e4fc1e7ecd111b0565e8cba0cb7dae6d'.

Modules: handle symbols that have a zero value

The module subsystem cannot handle symbols that are zero.  If symbols
are present that have a zero value then the module resolver prints out a
message that these symbols are unresolved.

We have to use IS_ERR_VALUE() to check that a symbol has been resolved
or not.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: SMTC: Move cross VPE writes to after a TC is assigned to VPE.
Kurt Martin [Thu, 9 Jul 2009 02:22:35 +0000 (19:22 -0700)]
MIPS: SMTC: Move cross VPE writes to after a TC is assigned to VPE.

Signed-off-by: Chris Dearman <chris@mips.com>
Signed-off-by: Raghu Gandham <raghu@mips.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[PATCH] MIPS: SMTC: Fix compile error
Raghu Gandham [Thu, 9 Jul 2009 00:00:44 +0000 (17:00 -0700)]
[PATCH] MIPS: SMTC: Fix compile error

Commit fc03bc1715ca0ad4ccfe97aab16bcc9e7129c1a4 breaks when SMTC support
is enabled on Malta.

Signed-off-by: Raghu Gandham <raghu@mips.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: Avoid clobbering struct pt_regs in kthreads
David Daney [Wed, 8 Jul 2009 17:07:50 +0000 (10:07 -0700)]
MIPS: Avoid clobbering struct pt_regs in kthreads

The resume() implementation octeon_switch.S examines the saved cp0_status
register.  We were clobbering the entire pt_regs structure in kernel
threads leading to random crashes.

When switching away from a kernel thread, the saved cp0_status is examined
and if bit 30 is set it is cleared and the CP2 state saved into the pt_regs
structure.  Since the kernel thread stack overlaid the pt_regs structure
this resulted in a corrupt stack.  When the kthread with the corrupt stack
was resumed, it could crash if it used any of the data in the stack that was
clobbered.

We fix it by moving the kernel thread stack down so it doesn't overlay
pt_regs.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: AR7: Remove unused inclusions of <linux/version.h>.
Huang Weiyi [Wed, 8 Jul 2009 22:14:37 +0000 (06:14 +0800)]
MIPS: AR7: Remove unused inclusions of <linux/version.h>.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: MIPSsim: Fix unbalance brace in mipssim get_c0_compare_int()
Yoichi Yuasa [Wed, 8 Jul 2009 06:08:19 +0000 (15:08 +0900)]
MIPS: MIPSsim: Fix unbalance brace in mipssim get_c0_compare_int()

cc1: warnings being treated as errors
arch/mips/mipssim/sim_time.c: In function 'get_c0_compare_int':
arch/mips/mipssim/sim_time.c:103: warning: ISO C90 forbids mixed declarations and code
arch/mips/mipssim/sim_time.c:116: error: expected declaration or statement at end of input
make[1]: *** [arch/mips/mipssim/sim_time.o] Error 1

Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: Fix compile for !CONFIG_SMP
Alexander Clouter [Sun, 5 Jul 2009 11:00:55 +0000 (12:00 +0100)]
MIPS: Fix compile for !CONFIG_SMP

Commit fc03bc1715ca0ad4ccfe97aab16bcc9e7129c1a4 breaks compiling MIPS
with SMP disabled.  This patch fixes that.

Signed-off-by: Alexander Clouter <alex@digriz.org.uk>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: Drop mmap_sem in pagefault oom path
Akinobu Mita [Fri, 3 Jul 2009 16:33:09 +0000 (01:33 +0900)]
MIPS: Drop mmap_sem in pagefault oom path

Fix the pagefault oom path which does not drop mm->mmap_sem.
This was introduced by commit c7c1e3846bac1e4b8a8941f6a194812e28b0a519

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: Eleminate filenames from comments
Ralf Baechle [Mon, 6 Jul 2009 08:13:17 +0000 (09:13 +0100)]
MIPS: Eleminate filenames from comments

They tend to get not updated when files are moved around or copied and
lack any obvious use.  While at it zap some only too obvious comments and
as per Shinya's suggestion, add a copyright header to extable.c.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
15 years ago[PATCH] MIPS: Cavium: Move swapped comments to their rightful place.
Ralf Baechle [Sun, 5 Jul 2009 18:23:30 +0000 (19:23 +0100)]
[PATCH] MIPS: Cavium: Move swapped comments to their rightful place.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMerge branch 'for-linus' of git://neil.brown.name/md
Linus Torvalds [Mon, 3 Aug 2009 04:31:40 +0000 (21:31 -0700)]
Merge branch 'for-linus' of git://neil.brown.name/md

* 'for-linus' of git://neil.brown.name/md:
  md: Use revalidate_disk to effect changes in size of device.
  md: allow raid5_quiesce to work properly when reshape is happening.
  md/raid5: set reshape_position correctly when reshape starts.
  md: Handle growth of v1.x metadata correctly.
  md: avoid array overflow with bad v1.x metadata
  md: when a level change reduces the number of devices, remove the excess.
  md: Push down data integrity code to personalities.
  md/raid6: release spare page at ->stop()

15 years agomd: Use revalidate_disk to effect changes in size of device.
NeilBrown [Mon, 3 Aug 2009 00:59:58 +0000 (10:59 +1000)]
md: Use revalidate_disk to effect changes in size of device.

As revalidate_disk calls check_disk_size_change, it will cause
any capacity change of a gendisk to be propagated to the blockdev
inode.  So use that instead of mucking about with locks and
i_size_write.

Also add a call to revalidate_disk in do_md_run and a few other places
where the gendisk capacity is changed.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agomd: allow raid5_quiesce to work properly when reshape is happening.
NeilBrown [Mon, 3 Aug 2009 00:59:58 +0000 (10:59 +1000)]
md: allow raid5_quiesce to work properly when reshape is happening.

The ->quiesce method is not supposed to stop resync/recovery/reshape,
just normal IO.
But in raid5 we don't have a way to know which stripes are being
used for normal IO and which for resync etc, so we need to wait for
all stripes to be idle to be sure that all writes have completed.

However reshape keeps at least some stripe busy for an extended period
of time, so a call to raid5_quiesce can block for several seconds
needlessly.
So arrange for reshape etc to pause briefly while raid5_quiesce is
trying to quiesce the array so that the active_stripes count can
drop to zero.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agomd/raid5: set reshape_position correctly when reshape starts.
NeilBrown [Mon, 3 Aug 2009 00:59:57 +0000 (10:59 +1000)]
md/raid5: set reshape_position correctly when reshape starts.

As the internal reshape_progress counter is the main driver
for reshape, the fact that reshape_position sometimes starts with the
wrong value has minimal effect.  It is visible in sysfs and that
is all.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agomd: Handle growth of v1.x metadata correctly.
NeilBrown [Mon, 3 Aug 2009 00:59:57 +0000 (10:59 +1000)]
md: Handle growth of v1.x metadata correctly.

The v1.x metadata does not have a fixed size and can grow
when devices are added.
If it grows enough to require an extra sector of storage,
we need to update the 'sb_size' to match.

Without this, md can write out an incomplete superblock with a
bad checksum, which will be rejected when trying to re-assemble
the array.

Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
15 years agomd: avoid array overflow with bad v1.x metadata
NeilBrown [Mon, 3 Aug 2009 00:59:56 +0000 (10:59 +1000)]
md: avoid array overflow with bad v1.x metadata

We trust the 'desc_nr' field in v1.x metadata enough to use it
as an index in an array.  This isn't really safe.
So range-check the value first.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agomd: when a level change reduces the number of devices, remove the excess.
NeilBrown [Mon, 3 Aug 2009 00:59:55 +0000 (10:59 +1000)]
md: when a level change reduces the number of devices, remove the excess.

When an array is changed from RAID6 to RAID5, fewer drives are
needed.  So any device that is made superfluous by the level
conversion must be marked as not-active.
For the RAID6->RAID5 conversion, this will be a drive which only
has 'Q' blocks on it.

Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
15 years agomd: Push down data integrity code to personalities.
Andre Noll [Mon, 3 Aug 2009 00:59:47 +0000 (10:59 +1000)]
md: Push down data integrity code to personalities.

This patch replaces md_integrity_check() by two new public functions:
md_integrity_register() and md_integrity_add_rdev() which are both
personality-independent.

md_integrity_register() is called from the ->run and ->hot_remove
methods of all personalities that support data integrity.  The
function iterates over the component devices of the array and
determines if all active devices are integrity capable and if their
profiles match. If this is the case, the common profile is registered
for the mddev via blk_integrity_register().

The second new function, md_integrity_add_rdev() is called from the
->hot_add_disk methods, i.e. whenever a new device is being added
to a raid array. If the new device does not support data integrity,
or has a profile different from the one already registered, data
integrity for the mddev is disabled.

For raid0 and linear, only the call to md_integrity_register() from
the ->run method is necessary.

Signed-off-by: Andre Noll <maan@systemlinux.org>
Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
Linus Torvalds [Sun, 2 Aug 2009 21:15:46 +0000 (14:15 -0700)]
Merge git://git./linux/kernel/git/wim/linux-2.6-watchdog

* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
  [WATCHDOG] Fix COH 901 327 watchdog enablement

15 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
Linus Torvalds [Sun, 2 Aug 2009 21:15:27 +0000 (14:15 -0700)]
Merge branch 'release' of git://git./linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  eeepc-laptop: fix hot-unplug on resume
  ACPI: Ingore the memory block with zero block size in course of memory hotplug
  ACPI: Don't treat generic error as ACPI error code in acpi memory hotplug driver
  ACPI: bind workqueues to CPU 0 to avoid SMI corruption
  ACPI: root-only read protection on /sys/firmware/acpi/tables/*
  thinkpad-acpi: fix incorrect use of TPACPI_BRGHT_MODE_ECNVRAM
  thinkpad-acpi: restrict procfs count value to sane upper limit
  thinkpad-acpi: remove dock and bay subdrivers
  thinkpad-acpi: disable broken bay and dock subdrivers
  hp-wmi: check that an input device exists in resume handler
  Revert "ACPICA: Remove obsolete acpi_os_validate_address interface"

15 years agoTTY: Maintainer change
Greg Kroah-Hartman [Sat, 1 Aug 2009 04:28:16 +0000 (21:28 -0700)]
TTY: Maintainer change

Clearly, I am a glutton for punishment.  I'll see if I can see Alan's
changes through to the end, otherwise I'll be fending off a lot of bug
reports for usb-serial devices.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMake pci_claim_resource() use request_resource() rather than insert_resource()
Linus Torvalds [Sun, 2 Aug 2009 21:04:19 +0000 (14:04 -0700)]
Make pci_claim_resource() use request_resource() rather than insert_resource()

This function has traditionally used "insert_resource()", because before
commit cebd78a8c5 ("Fix pci_claim_resource") it used to just insert the
resource into whatever root resource tree that was indicated by
"pcibios_select_root()".

So there Matthew fixed it to actually look up the proper parent
resource, which means that now it's actively wrong to then traverse the
resource tree any more: we already know exactly where the new resource
should go.

And when we then did commit a76117dfd6 ("x86: Use pci_claim_resource"),
which changed the x86 PCI code from the open-coded

pr = pci_find_parent_resource(dev, r);
if (!pr || request_resource(pr, r) < 0) {

to using

if (pci_claim_resource(dev, idx) < 0) {

that "insert_resource()" now suddenly became a problem, and causes a
regression covered by

http://bugzilla.kernel.org/show_bug.cgi?id=13891

which this fixes.

Reported-and-tested-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Matthew Wilcox <willy@linux.intel.com>
Cc: Andrew Patterson <andrew.patterson@hp.com>
Cc: Linux PCI <linux-pci@vger.kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years ago[WATCHDOG] Fix COH 901 327 watchdog enablement
Linus Walleij [Mon, 20 Jul 2009 22:40:46 +0000 (00:40 +0200)]
[WATCHDOG] Fix COH 901 327 watchdog enablement

Since the COH 901 327 found in U300 is clocked at 32 kHz we need
to wait for the interrupt clearing flag to propagate through
hardware in order not to accidentally fire off any interrupts
when we enable them.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
15 years agoMerge branch 'misc-2.6.31' into release
Len Brown [Sun, 2 Aug 2009 16:55:51 +0000 (12:55 -0400)]
Merge branch 'misc-2.6.31' into release

15 years agoMerge branch 'bugzilla-13825' into release
Len Brown [Sun, 2 Aug 2009 16:36:01 +0000 (12:36 -0400)]
Merge branch 'bugzilla-13825' into release

15 years agoeeepc-laptop: fix hot-unplug on resume
Alan Jenkins [Mon, 29 Jun 2009 08:40:07 +0000 (09:40 +0100)]
eeepc-laptop: fix hot-unplug on resume

OOPS on resume when the wireless adaptor is disabled during suspend was
introduced by "eeepc-laptop: read rfkill soft-blocked state on resume".

Unable to handle kernel NULL pointer dereference

Process s2disk
Tainted: G W
IP: klist_put

Call trace:
? klist_del
? device_del
? device_unregister
? pci_stop_dev
? pci_stop_bus
? pci_remove_device
? eeepc_rfkill_hotplug [eeepc_laptop]
? eeepc_hotk_resume [eeepc_laptop]
? acpi_device_resume
? device_resume
? hibernation_snapshot

It appears the PCI device is removed twice.  The eeepc_rfkill_hotplug()
call from the resume handler is racing against the call from the ACPI
notifier callback.  The ACPI notification is triggered by the resume
handler when it refreshes the value of CM_ASL_WLAN.

The fix is to serialize hotplug calls using a workqueue.

http://bugzilla.kernel.org/show_bug.cgi?id=13825

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Acked-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoMerge branch 'memhotplug-crash' into release
Len Brown [Sun, 2 Aug 2009 16:27:26 +0000 (12:27 -0400)]
Merge branch 'memhotplug-crash' into release

15 years agoACPI: Ingore the memory block with zero block size in course of memory hotplug
Zhao Yakui [Tue, 7 Jul 2009 02:56:11 +0000 (10:56 +0800)]
ACPI: Ingore the memory block with zero block size in course of memory hotplug

If the memory block size is zero, ignore it and don't do the memory hotplug
flowchart. Otherwise it will complain the following warning message:
  >System RAM resource 0 - ffffffffffffffff cannot be added

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI: Don't treat generic error as ACPI error code in acpi memory hotplug driver
Zhao Yakui [Fri, 3 Jul 2009 02:49:03 +0000 (10:49 +0800)]
ACPI: Don't treat generic error as ACPI error code in acpi memory hotplug driver

Don't treat the generic error as ACPI error code. Otherwise when the generic
code is returned, it will complain the following warning messag:
   >ACPI Exception (acpi_memhotplug-0171): UNKNOWN_STATUS_CODE,
Cannot get acpi bus device [20080609]
   >ACPI: Cannot find driver data
   > ACPI Error (utglobal-0127): Unknown exception code: 0xFFFFFFED [20080609]
   > Pid: 85, comm: kacpi_notify Not tainted 2.6.27.19-5-default #1
     Call Trace:
     [<ffffffff8020da29>] show_trace_log_lvl+0x41/0x58
     [<ffffffff8049a3da>] dump_stack+0x69/0x6f
    .....

At the same time when the generic error code is returned, the ACPI_EXCEPTION
is replaced by the printk.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoMerge branch 'bugzilla-13751' into release
Len Brown [Sun, 2 Aug 2009 16:10:02 +0000 (12:10 -0400)]
Merge branch 'bugzilla-13751' into release

15 years agoACPI: bind workqueues to CPU 0 to avoid SMI corruption
Bjorn Helgaas [Wed, 29 Jul 2009 21:54:25 +0000 (15:54 -0600)]
ACPI: bind workqueues to CPU 0 to avoid SMI corruption

On some machines, a software-initiated SMI causes corruption unless the
SMI runs on CPU 0.  An SMI can be initiated by any AML, but typically it's
done in GPE-related methods that are run via workqueues, so we can avoid
the known corruption cases by binding the workqueues to CPU 0.

References:
    http://bugzilla.kernel.org/show_bug.cgi?id=13751
    https://bugs.launchpad.net/bugs/157171
    https://bugs.launchpad.net/bugs/157691

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoMerge branch 'thinkpad' into release
Len Brown [Sun, 2 Aug 2009 15:34:24 +0000 (11:34 -0400)]
Merge branch 'thinkpad' into release

15 years agoMerge branch 'bugzilla-13865' into release
Len Brown [Sun, 2 Aug 2009 15:33:01 +0000 (11:33 -0400)]
Merge branch 'bugzilla-13865' into release

15 years agoMerge branch 'bugzilla-13620-revert' into release
Len Brown [Sun, 2 Aug 2009 15:31:32 +0000 (11:31 -0400)]
Merge branch 'bugzilla-13620-revert' into release

15 years agoACPI: root-only read protection on /sys/firmware/acpi/tables/*
Len Brown [Thu, 30 Jul 2009 20:00:53 +0000 (16:00 -0400)]
ACPI: root-only read protection on /sys/firmware/acpi/tables/*

they were world readable.

Signed-off-by: Len Brown <len.brown@intel.com>
15 years agothinkpad-acpi: fix incorrect use of TPACPI_BRGHT_MODE_ECNVRAM
Henrique de Moraes Holschuh [Sat, 1 Aug 2009 15:04:20 +0000 (12:04 -0300)]
thinkpad-acpi: fix incorrect use of TPACPI_BRGHT_MODE_ECNVRAM

HBRV-based default selection of backlight control strategy didn't work
well, at least the X41 defines it but doesn't use it and I don't think
it will stop there.

Switch to a white/blacklist.  All models that have HBRV defined have
been included in the list, and initially all ATI GPUs will get
ECNVRAM, and the Intel GPUs will get UCMS_STEP.

Symptoms of incorrect backlight mode selection are:

1. Non-working backlight control through sysfs;

2. Backlight gets reset to the lowest level at every shutdown, reboot
   and when thinkpad-acpi gets unloaded;

This fixes a regression in 2.6.30, bugzilla #13826

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Reported-by: Tobias Diedrich <ranma+kernel@tdiedrich.de>
Cc: stable@kernel.org
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agothinkpad-acpi: restrict procfs count value to sane upper limit
Michael Buesch [Sat, 1 Aug 2009 15:04:19 +0000 (12:04 -0300)]
thinkpad-acpi: restrict procfs count value to sane upper limit

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agothinkpad-acpi: remove dock and bay subdrivers
Henrique de Moraes Holschuh [Sat, 1 Aug 2009 15:04:18 +0000 (12:04 -0300)]
thinkpad-acpi: remove dock and bay subdrivers

The standard ACPI dock driver can handle the hotplug bays and docks of
the ThinkPads just fine (including batteries) as of 2.6.27, and the
code in thinkpad-acpi for the dock and bay subdrivers is currently
broken anyway...

Userspace needs some love to support the two-stage ejection nicely,
but it is simple enough to do through udev rules (you don't even need
HAL) so this wouldn't justify fixing the dock and bay subdrivers,
either.

That leaves warm-swap bays (_EJ3) support for thinkpad-acpi, as well
as support for the weird dock of the model 570, but since such support
has never left the "experimental" stage, it is also not a strong
enough reason to find a way to fix this code.

Users of ThinkPads with warm-swap bays are urged to request that _EJ3
support be added to the regular ACPI dock driver, if such feature is
indeed useful for them.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agothinkpad-acpi: disable broken bay and dock subdrivers
Henrique de Moraes Holschuh [Sat, 1 Aug 2009 15:04:17 +0000 (12:04 -0300)]
thinkpad-acpi: disable broken bay and dock subdrivers

Currently, the ThinkPad-ACPI bay and dock drivers are completely
broken, and cause a NULL pointer derreference in kernel mode (and,
therefore, an OOPS) when they try to issue events (i.e. on dock,
undock, bay ejection, etc).

OTOH, the standard ACPI dock driver can handle the hotplug bays and
docks of the ThinkPads just fine (including batteries) as of 2.6.27.
In fact, it does a much better job of it than thinkpad-acpi ever did.

It is just not worth the hassle to find a way to fix this crap without
breaking the (deprecated) thinkpad-acpi dock/bay ABI.  This is old,
deprecated code that sees little testing or use.

As a quick fix suitable for -stable backports, mark the thinkpad-acpi
bay and dock subdrivers as BROKEN in Kconfig.  The dead code will be
removed by a later patch.

This fixes bugzilla #13669, and should be applied to 2.6.27 and later.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Reported-by: Joerg Platte <jplatte@naasa.net>
Cc: stable@kernel.org
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agodo_sigaltstack: small cleanups
Linus Torvalds [Sat, 1 Aug 2009 18:18:56 +0000 (11:18 -0700)]
do_sigaltstack: small cleanups

The previous commit ("do_sigaltstack: avoid copying 'stack_t' as a
structure to user space") fixed a real bug.  This one just cleans up the
copy from user space to that gcc can generate better code for it (and so
that it looks the same as the later copy back to user space).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agodo_sigaltstack: avoid copying 'stack_t' as a structure to user space
Linus Torvalds [Sat, 1 Aug 2009 17:34:56 +0000 (10:34 -0700)]
do_sigaltstack: avoid copying 'stack_t' as a structure to user space

Ulrich Drepper correctly points out that there is generally padding in
the structure on 64-bit hosts, and that copying the structure from
kernel to user space can leak information from the kernel stack in those
padding bytes.

Avoid the whole issue by just copying the three members one by one
instead, which also means that the function also can avoid the need for
a stack frame.  This also happens to match how we copy the new structure
from user space, so it all even makes sense.

[ The obvious solution of adding a memset() generates horrid code, gcc
  does really stupid things. ]

Reported-by: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoLinux 2.6.31-rc5
Linus Torvalds [Sat, 1 Aug 2009 00:40:45 +0000 (17:40 -0700)]
Linux 2.6.31-rc5

15 years agoMerge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
Linus Torvalds [Fri, 31 Jul 2009 19:17:37 +0000 (12:17 -0700)]
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs

* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: bump up nr_to_write in xfs_vm_writepage
  xfs: reduce bmv_count in xfs_vn_fiemap

15 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Fri, 31 Jul 2009 19:10:26 +0000 (12:10 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  io context: fix ref counting
  block: make the end_io functions be non-GPL exports
  block: fix improper kobject release in blk_integrity_unregister
  block: always assign default lock to queues
  mg_disk: Add missing ready status check on mg_write()
  mg_disk: fix issue with data integrity on error in mg_write()
  mg_disk: fix reading invalid status when use polling driver
  mg_disk: remove prohibited sleep operation

15 years agoMerge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 31 Jul 2009 19:09:57 +0000 (12:09 -0700)]
Merge branch 'timers-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  clocksource: Save mult_orig in clocksource_disable()

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
Linus Torvalds [Fri, 31 Jul 2009 19:09:22 +0000 (12:09 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/drzeus/mmc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc:
  mmc: orphan subsystem
  imxmmc: Remove unnecessary semicolons
  cb710: use SG_MITER_TO_SG/SG_MITER_FROM_SG
  sdhci: use SG_MITER_TO_SG/SG_MITER_FROM_SG
  lib/scatterlist: add a flags to signalize mapping direction

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Fri, 31 Jul 2009 19:09:02 +0000 (12:09 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: sound/aoa: Add kmalloc NULL tests
  ALSA: hda - Increase PCM stream name buf in patch_realtek.c
  sound: mpu401.c: Buffer overflow
  sound: aedsp16: Buffer overflow
  ALSA: hda: fix out-of-bound hdmi_eld.sad[] write
  ALSA: hda - Add quirk for Dell Studio 1555

15 years agoclocksource: Save mult_orig in clocksource_disable()
Magnus Damm [Tue, 28 Jul 2009 21:09:55 +0000 (14:09 -0700)]
clocksource: Save mult_orig in clocksource_disable()

To fix the common case where ->enable() does not set up
mult, make sure mult_orig is saved in mult on disable.

Also add comments to explain why we do this.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Cc: johnstul@us.ibm.com
Cc: lethal@linux-sh.org
Cc: akpm@linux-foundation.org
LKML-Reference: <20090618152432.10136.9932.sendpatchset@rx1.opensource.se>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
15 years agommc: orphan subsystem
Pierre Ossman [Fri, 31 Jul 2009 10:27:28 +0000 (12:27 +0200)]
mmc: orphan subsystem

I do not have the time to take care of this, so remove myself as
maintainer.

Signed-off-by: Pierre Ossman <pierre@ossman.eu>
15 years agoimxmmc: Remove unnecessary semicolons
Joe Perches [Sun, 28 Jun 2009 16:26:31 +0000 (09:26 -0700)]
imxmmc: Remove unnecessary semicolons

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Signed-off-by: Pierre Ossman <pierre@ossman.eu>
15 years agocb710: use SG_MITER_TO_SG/SG_MITER_FROM_SG
Sebastian Andrzej Siewior [Mon, 22 Jun 2009 07:18:05 +0000 (09:18 +0200)]
cb710: use SG_MITER_TO_SG/SG_MITER_FROM_SG

the code allready uses flush_kernel_dcache_page(). This patch updates the
driver to the recent sg API changes which require that either SG_MITER_TO_SG
or SG_MITER_FROM_SG is set. SG_MITER_TO_SG calls flush_kernel_dcache_page()
in sg_mitter_stop()

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Acked-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Pierre Ossman <pierre@ossman.eu>
15 years agosdhci: use SG_MITER_TO_SG/SG_MITER_FROM_SG
Sebastian Andrzej Siewior [Thu, 18 Jun 2009 07:33:32 +0000 (09:33 +0200)]
sdhci: use SG_MITER_TO_SG/SG_MITER_FROM_SG

so the page will be flushed on unmap on ARCH which need it.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Signed-off-by: Pierre Ossman <pierre@ossman.eu>
15 years agolib/scatterlist: add a flags to signalize mapping direction
Sebastian Andrzej Siewior [Thu, 18 Jun 2009 08:19:12 +0000 (10:19 +0200)]
lib/scatterlist: add a flags to signalize mapping direction

sg_miter_start() is currently unaware of the direction of the copy
process (to or from the scatter list). It is important to know the
direction because the page has to be flushed in case the data written
is seen on a different mapping in user land on cache incoherent
architectures.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Pierre Ossman <pierre@ossman.eu>
15 years agoMerge branch 'fix/oss' into for-linus
Takashi Iwai [Fri, 31 Jul 2009 08:17:45 +0000 (10:17 +0200)]
Merge branch 'fix/oss' into for-linus

* fix/oss:
  sound: mpu401.c: Buffer overflow
  sound: aedsp16: Buffer overflow

15 years agoMerge branch 'fix/misc' into for-linus
Takashi Iwai [Fri, 31 Jul 2009 08:17:44 +0000 (10:17 +0200)]
Merge branch 'fix/misc' into for-linus

* fix/misc:
  ALSA: sound/aoa: Add kmalloc NULL tests

15 years agoMerge branch 'fix/hda' into for-linus
Takashi Iwai [Fri, 31 Jul 2009 08:17:42 +0000 (10:17 +0200)]
Merge branch 'fix/hda' into for-linus

* fix/hda:
  ALSA: hda - Increase PCM stream name buf in patch_realtek.c
  ALSA: hda: fix out-of-bound hdmi_eld.sad[] write
  ALSA: hda - Add quirk for Dell Studio 1555

15 years agoALSA: sound/aoa: Add kmalloc NULL tests
Julia Lawall [Fri, 31 Jul 2009 06:32:03 +0000 (08:32 +0200)]
ALSA: sound/aoa: Add kmalloc NULL tests

Check that the result of kzalloc is not NULL before a dereference.

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression *x;
identifier f;
constant char *C;
@@

x = \(kmalloc\|kcalloc\|kzalloc\)(...);
... when != x == NULL
    when != x != NULL
    when != (x || ...)
(
kfree(x)
|
f(...,C,...,x,...)
|
*f(...,x,...)
|
*x->f
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Increase PCM stream name buf in patch_realtek.c
Takashi Iwai [Fri, 31 Jul 2009 08:05:11 +0000 (10:05 +0200)]
ALSA: hda - Increase PCM stream name buf in patch_realtek.c

The name buf with size 16 is too short for some codec names, e.g.
truncated like "ALC861-VD Analo".  Now the size is doubled.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoio context: fix ref counting
Li Zefan [Fri, 31 Jul 2009 06:55:48 +0000 (08:55 +0200)]
io context: fix ref counting

Commit d9c7d394a8ebacb60097b192939ae9f15235225e
("block: prevent possible io_context->refcount overflow") mistakenly
changed atomic_inc(&ioc->nr_tasks) to atomic_long_inc(&ioc->refcount).

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Nikanth Karthikesan <knikanth@suse.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agoxfs: bump up nr_to_write in xfs_vm_writepage
Eric Sandeen [Fri, 31 Jul 2009 05:02:17 +0000 (00:02 -0500)]
xfs: bump up nr_to_write in xfs_vm_writepage

VM calculation for nr_to_write seems off.  Bump it way
up, this gets simple streaming writes zippy again.
To be reviewed again after Jens' writeback changes.

Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Cc: Chris Mason <chris.mason@oracle.com>
Reviewed-by: Felix Blyakher <felixb@sgi.com>
Signed-off-by: Felix Blyakher <felixb@sgi.com>
15 years agoxfs: reduce bmv_count in xfs_vn_fiemap
Eric Sandeen [Mon, 27 Jul 2009 02:52:01 +0000 (21:52 -0500)]
xfs: reduce bmv_count in xfs_vn_fiemap

commit 6321e3ed2acf3ee9643cdd403e1c88605d7944ba caused
the full bmv_count's worth of getbmapx structures to get
allocated; telling it to do MAXEXTNUM was a bit insane,
resulting in ENOMEM every time.

Chop it down to something reasonable, the number of slots
in the caller's input buffer.  If this is too large the
caller may get ENOMEM but the reason should not be a
mystery, and they can try again with something smaller.

We add 1 to the value because in the normal getbmap
world, bmv_count includes the header and xfs_getbmap does:

        nex = bmv->bmv_count - 1;
        if (nex <= 0)
                return XFS_ERROR(EINVAL);

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Felix Blyakher <felixb@sgi.com>
15 years agomd/raid6: release spare page at ->stop()
Dan Williams [Fri, 31 Jul 2009 02:39:15 +0000 (12:39 +1000)]
md/raid6: release spare page at ->stop()

Add missing call to safe_put_page from stop() by unifying open coded
raid5_conf_t de-allocation under free_conf().

Cc: <stable@kernel.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoMerge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 30 Jul 2009 23:46:58 +0000 (16:46 -0700)]
Merge branch 'tracing-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  tracing/stat: Fix seqfile memory leak
  function-graph: Fix seqfile memory leak
  trace_stack: Fix seqfile memory leak
  profile: Suppress warning about large allocations when profile=1 is specified

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
Linus Torvalds [Thu, 30 Jul 2009 23:46:48 +0000 (16:46 -0700)]
Merge git://git./linux/kernel/git/mason/btrfs-unstable

* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  Btrfs: be more polite in the async caching threads
  Btrfs: preserve commit_root for async caching

15 years agoMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx
Linus Torvalds [Thu, 30 Jul 2009 23:46:31 +0000 (16:46 -0700)]
Merge branch 'next' of git://git./linux/kernel/git/djbw/async_tx

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx:
  dmaengine: at_hdmac: add DMA slave transfers
  dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller
  dmaengine: dmatest: correct thread_count while using multiple thread per channel
  dmaengine: dmatest: add a maximum number of test iterations
  drivers/dma: Remove unnecessary semicolons
  drivers/dma/fsldma.c: Remove unnecessary semicolons
  dmaengine: move HIGHMEM64G restriction to ASYNC_TX_DMA
  fsldma: do not clear bandwidth control bits on the 83xx controller
  fsldma: enable external start for the 83xx controller
  fsldma: use PCI Read Multiple command

15 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
Linus Torvalds [Thu, 30 Jul 2009 23:46:17 +0000 (16:46 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jack/linux-udf-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6:
  udf: Fix loading of VAT inode when drive wrongly reports number of recorded blocks

15 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
Linus Torvalds [Thu, 30 Jul 2009 23:46:06 +0000 (16:46 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jack/linux-quota-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-quota-2.6:
  quota: Silence lockdep on quota_on

15 years agoMerge git://git.infradead.org/users/cbou/battery-2.6.31
Linus Torvalds [Thu, 30 Jul 2009 23:45:53 +0000 (16:45 -0700)]
Merge git://git.infradead.org/users/cbou/battery-2.6.31

* git://git.infradead.org/users/cbou/battery-2.6.31:
  Add ds2782 battery gas gauge driver
  olpc_battery: Ensure that the TRICKLE bit is checked
  olpc_battery: Fix up eeprom read function

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes
Linus Torvalds [Thu, 30 Jul 2009 23:45:37 +0000 (16:45 -0700)]
Merge git://git./linux/kernel/git/steve/gfs2-2.6-fixes

* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes:
  GFS2: remove dcache entries for remote deleted inodes
  GFS2: Fix incorrent statfs consistency check
  GFS2: Don't put unlikely reclaim candidates on the reclaim list.
  GFS2: Don't try and dealloc own inode
  GFS2: Fix panic in glock memory shrinker
  GFS2: keep statfs info in sync on grows
  GFS2: Shrink the shrinker

15 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Thu, 30 Jul 2009 23:45:20 +0000 (16:45 -0700)]
Merge branch 'merge' of git://git./linux/kernel/git/benh/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc: Update defconfigs for embedded 6xx/7xxx, 8xx, 8{3,5,6}xxx
  powerpc/86xx: Update GE Fanuc sbc310 default configuration
  powerpc/86xx: Update defconfig for GE Fanuc's PPC9A
  cpm_uart: Don't use alloc_bootmem in cpm_uart_cpm2.c
  powerpc/83xx: Fix PCI IO base address on MPC837xE-RDB boards
  powerpc/85xx: Don't scan for TBI PHY addresses on MPC8569E-MDS boards
  powerpc/85xx: Fix ethernet link detection on MPC8569E-MDS boards
  powerpc/mm: Fix SMP issue with MMU context handling code

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
Linus Torvalds [Thu, 30 Jul 2009 23:45:03 +0000 (16:45 -0700)]
Merge git://git./linux/kernel/git/rusty/linux-2.6-for-linus

* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  lguest and virtio: cleanup struct definitions to Linux style.
  lguest: update commentry
  lguest: fix comment style
  virtio: refactor find_vqs
  virtio: delete vq from list
  virtio: fix memory leak on device removal
  lguest: fix descriptor corruption in example launcher
  lguest: dereferencing freed mem in add_eventfd()

15 years agokprobes: Use kernel_text_address() for checking probe address
Masami Hiramatsu [Tue, 28 Jul 2009 23:47:23 +0000 (19:47 -0400)]
kprobes: Use kernel_text_address() for checking probe address

Use kernel_text_address() for checking probe address instead of
__kernel_text_address(), because __kernel_text_address() returns true
for init functions even after relaseing those functions.

That will hit a BUG() in text_poke().

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoAlan doesn't want to maintain tty code any more
Linus Torvalds [Thu, 30 Jul 2009 23:40:37 +0000 (16:40 -0700)]
Alan doesn't want to maintain tty code any more

Not that anybody can blame him.  It's a morass.  But hey, it's way
better than it _used_ to be, though, so thanks for all the fish.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agohp-wmi: check that an input device exists in resume handler
Frans Pop [Thu, 30 Jul 2009 21:16:05 +0000 (17:16 -0400)]
hp-wmi: check that an input device exists in resume handler

Some systems may not support input events, or registering the input
handler may have failed. So check that an input device exists before
trying to set the docking and tablet mode state during resume.

Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=13865

Reported-and-tested-by: Cédric Godin <cedric@belbone.be>
Signed-off-by: Frans Pop <elendil@planet.nl>
Acked-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoquota: Silence lockdep on quota_on
Jan Kara [Wed, 22 Jul 2009 16:12:17 +0000 (18:12 +0200)]
quota: Silence lockdep on quota_on

Commit d01730d74d2b0155da50d44555001706294014f7 didn't completely fix
the problem since we still take dqio_mutex and i_mutex in the wrong
order. Move taking of i_mutex further down (luckily it's needed only
for updating inode flags) below where dqio_mutex is taken.

Tested-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
15 years agoudf: Fix loading of VAT inode when drive wrongly reports number of recorded blocks
Jan Kara [Tue, 14 Jul 2009 17:30:23 +0000 (19:30 +0200)]
udf: Fix loading of VAT inode when drive wrongly reports number of recorded blocks

VAT inode is located in the last block recorded block of the medium. When the
drive errorneously reports number of recorded blocks, we failed to load the VAT
inode and thus mount the medium. This patch makes kernel try to read VAT inode
from the last block of the device if it is different from the last recorded
block.

Signed-off-by: Jan Kara <jack@suse.cz>
15 years agoBtrfs: be more polite in the async caching threads
Chris Mason [Thu, 30 Jul 2009 14:04:48 +0000 (10:04 -0400)]
Btrfs: be more polite in the async caching threads

The semaphore used by the async caching threads can prevent a
transaction commit, which can make the FS appear to stall.  This
releases the semaphore more often when a transaction commit is
in progress.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
15 years agoBtrfs: preserve commit_root for async caching
Yan Zheng [Thu, 30 Jul 2009 13:40:40 +0000 (09:40 -0400)]
Btrfs: preserve commit_root for async caching

The async block group caching code uses the commit_root pointer
to get a stable version of the extent allocation tree for scanning.
This copy of the tree root isn't going to change and it significantly
reduces the complexity of the scanning code.

During a commit, we have a loop where we update the extent allocation
tree root.  We need to loop because updating the root pointer in
the tree of tree roots may allocate blocks which may change the
extent allocation tree.

Right now the commit_root pointer is changed inside this loop.  It
is more correct to change the commit_root pointer only after all the
looping is done.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>