linux-2.6
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 years agoamd64_edac: fix ECC checking
Doug Thompson [Mon, 3 Aug 2009 10:37:06 +0000 (12:37 +0200)] 
amd64_edac: fix ECC checking

On the good path of BIOS enabled ECC and no override, the value returned
is 1 by omission and thus is deemed failing by the probe-function.

Allow proper module initialization by clearing the retval explicitly.

Signed-off-by: Doug Thompson <dougthompson@xmission.com>
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
14 years agoALSA: hda - Read buffer overflow
Roel Kluin [Sun, 2 Aug 2009 11:30:45 +0000 (13:30 +0200)] 
ALSA: hda - 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: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: hda: Correct EAPD for Dell Inspiron 1525
Chengu Wang [Thu, 30 Jul 2009 11:43:55 +0000 (19:43 +0800)] 
ALSA: hda: Correct EAPD for Dell Inspiron 1525

The commit 24918b61b55c21e09a3e07cd82e1b3a8154782dc statically changes
the model from dell-bios to dell-3stack to solve the sound decreasing
regression (http://lkml.org/lkml/2008/9/12/203), however it leads to another
problem that the 2nd headphone jack doesn't work
(https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3987). So I think
the commit 249**2dc is just a workaround. I would like to give a true solution
here.

The datasheet for STAC9228 says, GPIO2 is the same pin as VOL DOWN, and
the EAPD pin is GPIO0. This is why the sound decreases if we set EAPD as
GPIO2. This patch changes EAPD to GPIO0 to solve the problem.

Signed-off-by: Chengu Wang <wangchengu@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: hda: warn on spurious response
Wu Fengguang [Sat, 1 Aug 2009 11:18:45 +0000 (19:18 +0800)] 
ALSA: hda: warn on spurious response

To help disclose hardware bugs.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: hda: remember last command for each codec
Wu Fengguang [Sat, 1 Aug 2009 11:17:14 +0000 (19:17 +0800)] 
ALSA: hda: remember last command for each codec

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: hda: read CORBWP inside reg_lock
Wu Fengguang [Sat, 1 Aug 2009 10:48:12 +0000 (18:48 +0800)] 
ALSA: hda: read CORBWP inside reg_lock

This converts the last CORBWP access outside of reg_lock.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: hda: take reg_lock in azx_init_cmd_io/azx_free_cmd_io
Wu Fengguang [Sat, 1 Aug 2009 10:47:41 +0000 (18:47 +0800)] 
ALSA: hda: take reg_lock in azx_init_cmd_io/azx_free_cmd_io

Just for safety.  azx_init_cmd_io() and azx_free_cmd_io() may be
called when switching to single command mode.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: hda: take cmd_mutex in probe_codec()
Wu Fengguang [Sat, 1 Aug 2009 10:46:46 +0000 (18:46 +0800)] 
ALSA: hda: take cmd_mutex in probe_codec()

Now that each codec will have its own module, it is possible
for the user to load one codec while another one is running.

So cmd_mutex would be a safe addition to probe_codec().

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: hda: track CIRB/CORB command/response states for each codec
Wu Fengguang [Sat, 1 Aug 2009 10:45:16 +0000 (18:45 +0800)] 
ALSA: hda: track CIRB/CORB command/response states for each codec

Recently we hit a bug in our dev board, whose HDMI codec#3 may emit
redundant/spurious responses, which were then taken as responses to
command for another onboard Realtek codec#2, and mess up both codecs.

Extend the azx_rb.cmds and azx_rb.res to array and track each codec's
commands/responses separately. This helps keep good codec safe from
broken ones.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: hda - Fix quirk for Toshiba Satellite A135-S4527
Takashi Iwai [Mon, 3 Aug 2009 06:23:52 +0000 (08:23 +0200)] 
ALSA: hda - Fix quirk for Toshiba Satellite A135-S4527

Use model=lenovo instead of model=dallas for Toshiba Satellite A135-S4527
with ALC861-VD codec.

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

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 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()

14 years agomlx4_en: Fix double pci unmapping.
Yevgeny Petrilin [Mon, 3 Aug 2009 03:22:18 +0000 (20:22 -0700)] 
mlx4_en: Fix double pci unmapping.

In cases of fragmented skb, with the data pointers being wrapped around
the TX buffer, the completion handling code would not forward the data
pointer and the firs fragment was unmapped several times, while others
were not unmapped at all.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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

14 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"

14 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>
14 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>
14 years agomISDN: Fix handling of receive buffer size in L1oIP
Andreas Eversberg [Mon, 27 Jul 2009 07:24:04 +0000 (07:24 +0000)] 
mISDN: Fix handling of receive buffer size in L1oIP

The size of receive buffer pointer was used to get size of
receive buffer instead of recvbuf_size itself, so only 4/8
bytes could be transfered.

This is a regression to 2.6.30 introduced by commit 8c90e11e3543d7de612194a042a148caeaab5f1d
mISDN: Use kernel_{send,recv}msg instead of open coding

Signed-off-by: Andreas Eversberg <andreas@eversberg.eu>
Signed-off-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 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>
14 years agopcnet32: VLB support fixes
Don Fry [Fri, 31 Jul 2009 08:45:29 +0000 (08:45 +0000)] 
pcnet32: VLB support fixes

VLB support has been broken since at least 2004-2005 period as some
changes introduced back then assumed that ->pci_dev is always valid,
lets try to fix it:

- remove duplicated SET_NETDEV_DEV() call

- call SET_NETDEV_DEV() only for PCI devices

- check for ->pci_dev validity in pcnet32_open()

[ Alternatively we may consider removing VLB support but there would not
  be much gain in it since an extra driver code needed for VLB support is
  minimal and quite simple. ]

This takes care of the following entry from Dan's list:

drivers/net/pcnet32.c +1889 pcnet32_probe1(298) warning: variable derefenced before check 'pdev'

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Don Fry <pcnet32@verizon.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopcnet32: remove superfluous NULL pointer check in pcnet32_probe1()
Don Fry [Fri, 31 Jul 2009 08:40:06 +0000 (08:40 +0000)] 
pcnet32: remove superfluous NULL pointer check in pcnet32_probe1()

Move the debug printk() into the proper place and remove superfluous
NULL pointer check in pcnet32_probe1().

This takes care of the following entry from Dan's list:

drivers/net/pcnet32.c +1889 pcnet32_probe1(298) warning: variable derefenced before check 'pdev'

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Don Fry <pcnet32@verizon.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: restore the original spinlock to protect unicast list
Jiri Pirko [Thu, 30 Jul 2009 01:06:12 +0000 (01:06 +0000)] 
net: restore the original spinlock to protect unicast list

There is a path when an assetion in dev_unicast_sync() appears.

igmp6_group_added -> dev_mc_add -> __dev_set_rx_mode ->
-> vlan_dev_set_rx_mode -> dev_unicast_sync

Therefore we cannot protect this list with rtnl. This patch restores the
original protecting this list with spinlock.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Tested-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: fix coherent dma mask setting
Dhananjay Phadke [Sat, 1 Aug 2009 21:36:16 +0000 (21:36 +0000)] 
netxen: fix coherent dma mask setting

Change default dma mask for NX3031 to 39 bit with ability
to update it to 64-bit (if firmware indicates support). Old
code was restricting it under 4GB (32-bit), sometimes causing
failure to allocate descriptor rings on heavily populated
system. NX2031 based NICs will still get 32-bit coherent mask.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agomISDN: Read buffer overflow
roel kluin [Fri, 31 Jul 2009 03:43:59 +0000 (03:43 +0000)] 
mISDN: Read buffer overflow

Check whether index is within bounds before testing the element.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agos6gmac: Read buffer overflow
roel kluin [Sat, 1 Aug 2009 20:20:13 +0000 (20:20 +0000)] 
s6gmac: Read buffer overflow

Check whether index is within bounds before testing the element.
In the last iteration i is PHY_MAX_ADDR. the condition
`!(p = pd->mii.bus->phy_map[PHY_MAX_ADDR])' is undefined and may
evaluate to false, which leads to a dereference of this invalid
phy_map in the phy_connect() below.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotulip: Read buffer overflow
roel kluin [Sat, 1 Aug 2009 20:26:52 +0000 (20:26 +0000)] 
tulip: 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: David S. Miller <davem@davemloft.net>
14 years agonet: net_assign_generic() fix
Eric Dumazet [Tue, 28 Jul 2009 02:36:15 +0000 (02:36 +0000)] 
net: net_assign_generic() fix

memcpy() should take into account size of pointers,
not only number of pointers to copy.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopppol2tp: calls unregister_pernet_gen_device() at unload time
Eric Dumazet [Tue, 28 Jul 2009 03:47:39 +0000 (03:47 +0000)] 
pppol2tp: calls unregister_pernet_gen_device() at unload time

Failure to call unregister_pernet_gen_device() can exhaust memory
if module is loaded/unloaded many times.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoppp: fix lost fragments in ppp_mp_explode() (resubmit)
Ben McKeegan [Tue, 28 Jul 2009 07:43:57 +0000 (07:43 +0000)] 
ppp: fix lost fragments in ppp_mp_explode() (resubmit)

This patch fixes the corner cases where the sum of MTU of the free
channels (adjusted for fragmentation overheads) is less than the MTU
of PPP link.  There are at least 3 situations where this case might
arise:

- some of the channels are busy

- the multilink session is running in a degraded state (i.e. with less
than its full complement of active channels)

- by design, where multilink protocol is being used to artificially
increase the effective link MTU of a single link.

Without this patch, at most 1 fragment is ever sent per free channel
for a given PPP frame and any remaining part of the PPP frame that
does not fit into those fragments is silently discarded.

This patch restores the original behaviour which was broken by commit
9c705260feea6ae329bc6b6d5f6d2ef0227eda0a 'ppp:ppp_mp_explode()
redesign'.  Once all 'free' channels have been given a fragment, an
additional fragment is queued to each available channel in turn, as many
times as necessary, until the entire PPP frame has been consumed.

Signed-off-by: Ben McKeegan <ben@netservers.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 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

14 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

14 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>
14 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

14 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>
14 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>
14 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

14 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>
14 years agoMerge branch 'thinkpad' into release
Len Brown [Sun, 2 Aug 2009 15:34:24 +0000 (11:34 -0400)] 
Merge branch 'thinkpad' into release

14 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

14 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

14 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>
14 years agoparisc: hppb.c - fix printk format strings
Helge Deller [Sun, 2 Aug 2009 13:42:39 +0000 (15:42 +0200)] 
parisc: hppb.c - fix printk format strings

Fix those warnings:
drivers/parisc/hppb.c: In function 'hppb_probe':
drivers/parisc/hppb.c:65: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'resource_size_t'
drivers/parisc/hppb.c:77: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'resource_size_t'
drivers/parisc/hppb.c:77: warning: format '%08x' expects type 'unsigned int', but argument 4 has type 'resource_size_t'

Signed-off-by: Helge Deller <deller@gmx.de>
14 years agoparisc: parisc-agp.c - use correct page_mask function
Helge Deller [Sun, 2 Aug 2009 13:35:43 +0000 (15:35 +0200)] 
parisc: parisc-agp.c - use correct page_mask function

Fix those compiler warnings, which indeed point to a bug:
drivers/char/agp/parisc-agp.c:228: warning: initialization from incompatible pointer type
drivers/char/agp/parisc-agp.c:201: warning: 'parisc_agp_page_mask_memory' defined but not used

Signed-off-by: Helge Deller <deller@gmx.de>
14 years agoparisc: sticore.c - check return values
Helge Deller [Sun, 2 Aug 2009 13:26:51 +0000 (15:26 +0200)] 
parisc: sticore.c - check return values

Signed-off-by: Helge Deller <deller@gmx.de>
14 years agonilfs2: fix missing unlock in error path of nilfs_mdt_write_page
Ryusuke Konishi [Sun, 2 Aug 2009 08:45:55 +0000 (17:45 +0900)] 
nilfs2: fix missing unlock in error path of nilfs_mdt_write_page

This adds a missing unlock of nilfs->ns_writer_mutex in
nilfs_mdt_write_page() function.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
14 years agoparisc: dino.c - check return value of pci_assign_resource()
Helge Deller [Sun, 2 Aug 2009 13:17:37 +0000 (15:17 +0200)] 
parisc: dino.c - check return value of pci_assign_resource()

Signed-off-by: Helge Deller <deller@gmx.de>
14 years agoparisc: hp_sdc_mlc.c - check return value of down_trylock()
Helge Deller [Sun, 2 Aug 2009 13:13:29 +0000 (15:13 +0200)] 
parisc: hp_sdc_mlc.c - check return value of down_trylock()

Signed-off-by: Helge Deller <deller@gmx.de>
14 years agosched: Fix race in cpupri introduced by cpumask_var changes
Gregory Haskins [Thu, 30 Jul 2009 14:57:28 +0000 (10:57 -0400)] 
sched: Fix race in cpupri introduced by cpumask_var changes

Background:

Several race conditions in the scheduler have cropped up
recently, which Steven and I have tracked down using ftrace.
The most recent one turns out to be a race in how the scheduler
determines a suitable migration target for RT tasks, introduced
recently with commit:

    commit 68e74568fbe5854952355e942acca51f138096d9
    Date:   Tue Nov 25 02:35:13 2008 +1030

        sched: convert struct cpupri_vec cpumask_var_t.

The original design of cpupri allowed lockless readers to
quickly determine a best-estimate target.  Races between the
pri_active bitmap and the vec->mask were handled in the
original code because we would detect and return "0" when this
occured.  The design was predicated on the *effective*
atomicity (*) of caching the result of cpus_and() between the
cpus_allowed and the vec->mask.

Commit 68e74568 changed the behavior such that vec->mask is
accessed multiple times.  This introduces a subtle race, the
result of which means we can have a result that returns "1",
but with an empty bitmap.

*) yes, we know cpus_and() is not a locked operator across the
   entire composite array, but it is implicitly atomic on a
   per-word basis which is all the design required to work.

Implementation:

Rather than forgoing the lockless design, or reverting to a
stack-based cpumask_t, we simply check for when the race has
been encountered and continue processing in the event that the
race is hit.  This renders the removal race as if the priority
bit had been atomically cleared as well, and allows the
algorithm to execute correctly.

Signed-off-by: Gregory Haskins <ghaskins@novell.com>
CC: Rusty Russell <rusty@rustcorp.com.au>
CC: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090730145728.25226.92769.stgit@dev.haskins.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agosched: Fix latencytop and sleep profiling vs group scheduling
Peter Zijlstra [Thu, 23 Jul 2009 18:13:26 +0000 (20:13 +0200)] 
sched: Fix latencytop and sleep profiling vs group scheduling

The latencytop and sleep accounting code assumes that any
scheduler entity represents a task, this is not so.

Cc: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf top: Add mwait_idle_with_hints to skip_symbols[]
Arnaldo Carvalho de Melo [Sun, 26 Jul 2009 22:06:19 +0000 (19:06 -0300)] 
perf top: Add mwait_idle_with_hints to skip_symbols[]

We skip the display of idle routine related symbols because
they are typically rather erratic and confusing: they depend
on the IRQ rate or sometimes they dominate the profile if
they are polling based.

Add mwait_idle_with_hints too, this is one of the idle
routines on x86.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf tools: Fix faulty check
Stoyan Gaydarov [Thu, 30 Jul 2009 10:25:29 +0000 (05:25 -0500)] 
perf tools: Fix faulty check

This patch fixes a spelling error that has resulted from copy
and pasting. The location of the error was found using a
semantic patch but the semantic patch was not trying to find
these errors. After looking things over it seemed logical that
this change was needed. Please review it and then include the
patch if it is in fact the correct change.

Signed-off-by: Stoyan Gaydarov <sgayda2@uiuc.edu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1248949529-20891-1-git-send-email-sgayda2@uiuc.edu>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf report: Update for the new FORK/EXIT events
Peter Zijlstra [Thu, 23 Jul 2009 14:52:41 +0000 (16:52 +0200)] 
perf report: Update for the new FORK/EXIT events

Since FORK is now also issued for threads, detect those by
comparing the parent and child PID.

Teach it about EXIT events and ignore them.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf_counter: Full task tracing
Peter Zijlstra [Thu, 23 Jul 2009 12:46:33 +0000 (14:46 +0200)] 
perf_counter: Full task tracing

In order to be able to distinguish between no samples due to
inactivity and no samples due to task ended, Arjan asked for
PERF_EVENT_EXIT events. This is useful to the boot delay
instrumentation (bootchart) app.

This patch changes the PERF_EVENT_FORK to be emitted on every
clone, and adds PERF_EVENT_EXIT to be emitted on task exit,
after the task's counters have been closed.

This task tracing is controlled through: attr.comm || attr.mmap
and through the new attr.task field.

Suggested-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Anton Blanchard <anton@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
[ cleaned up perf_counter.h a bit ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf_counter: Collapse inherit on read()
Peter Zijlstra [Fri, 24 Jul 2009 12:42:10 +0000 (14:42 +0200)] 
perf_counter: Collapse inherit on read()

Currently the counter value returned by read() is the value of
the parent counter, to which child counters are only fed back
on child exit.

Thus read() can return rather erratic (and meaningless) numbers
depending on the state of the child processes.

Change this by always iterating the full child hierarchy on
read() and sum all counters.

Suggested-by: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agotracing, perf_counter: Add help text to CONFIG_EVENT_PROFILE
Peter Zijlstra [Wed, 29 Jul 2009 08:50:09 +0000 (10:50 +0200)] 
tracing, perf_counter: Add help text to CONFIG_EVENT_PROFILE

Explain what tracepoint profiling sources are about.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Jeff Garzik <jeff@garzik.org>
LKML-Reference: <1248856508.6987.3041.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoparisc: includecheck fix for ccio-dma.c
Jaswinder Singh Rajput [Wed, 8 Jul 2009 15:27:20 +0000 (15:27 +0000)] 
parisc: includecheck fix for ccio-dma.c

fix the following 'make includecheck' warning:

  drivers/parisc/ccio-dma.c: linux/proc_fs.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
14 years agoparisc: Set correct bit in protection flags
John David Anglin [Mon, 13 Jul 2009 01:44:37 +0000 (01:44 +0000)] 
parisc: Set correct bit in protection flags

Signed-off-by: John David Anglin <dave@hiauly1.hia.nrc.ca>
Signed-off-by: Helge Deller <deller@gmx.de>
14 years agoparisc: isa-eeprom - Fix loff_t usage
Michael Buesch [Mon, 20 Jul 2009 22:58:44 +0000 (22:58 +0000)] 
parisc: isa-eeprom - Fix loff_t usage

loff_t is a signed type. If userspace passes a negative ppos, the "count"
range check is weakened. "count"s bigger than HPEE_MAX_LENGTH will pass the check.
Also, if ppos is negative, the readb(eisa_eeprom_addr + *ppos) will poke in random
memory.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: stable@kernel.org
Signed-off-by: Helge Deller <deller@gmx.de>
14 years agoparisc: fixed faulty check in lba_pci
Stoyan Gaydarov [Thu, 30 Jul 2009 10:25:19 +0000 (10:25 +0000)] 
parisc: fixed faulty check in lba_pci

This patche fixes a spelling error that has resulted from copy and pasting.
The location of the error was found using a semantic patch but the semantic
patch was not trying to find these errors. After looking things over it
seemed logical that this change was needed.

Signed-off-by: Stoyan Gaydarov <sgayda2@uiuc.edu>
Signed-off-by: Helge Deller <deller@gmx.de>
14 years agoparisc: Fix read buffer overflow in pdc_stable driver
Roel Kluin [Sun, 2 Aug 2009 08:02:28 +0000 (08:02 +0000)] 
parisc: Fix read buffer overflow in pdc_stable driver

Check whether index is within bounds before testing the element.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
14 years agoparisc: Fix GOT overflow during module load on 64bit kernel
John David Anglin [Sun, 2 Aug 2009 10:34:08 +0000 (12:34 +0200)] 
parisc: Fix GOT overflow during module load on 64bit kernel

Signed-off-by: John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Signed-off-by: Helge Deller <deller@gmx.de>
14 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>
14 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>
14 years agocifs: reinstate original behavior when uid=/gid= options are specified
Jeff Layton [Fri, 31 Jul 2009 10:56:09 +0000 (06:56 -0400)] 
cifs: reinstate original behavior when uid=/gid= options are specified

This patch fixes the regression reported here:

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

commit 4ae1507f6d266d0cc3dd36e474d83aad70fec9e4 changed the default
behavior when the uid= or gid= option was specified for a mount. The
existing behavior was to always clobber the ownership information
provided by the server when these options were specified. The above
commit changed this behavior so that these options simply provided
defaults when the server did not provide this information (unless
"forceuid" or "forcegid" were specified)

This patch reverts this change so that the default behavior is restored.
It also adds "noforceuid" and "noforcegid" options to make it so that
ownership information from the server is preserved, even when the mount
has uid= or gid= options specified.

It also adds a couple of printk notices that pop up when forceuid or
forcegid options are specified without a uid= or gid= option.

Reported-by: Tom Chiverton <bugzilla.kernel.org@falkensweb.com>
Reviewed-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
14 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>
14 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>
14 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>
14 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>
14 years agonilfs2: fix oops due to inconsistent state in page with discrete b-tree nodes
Ryusuke Konishi [Tue, 28 Jul 2009 08:55:29 +0000 (17:55 +0900)] 
nilfs2: fix oops due to inconsistent state in page with discrete b-tree nodes

Andrea Gelmini gave me a report that a kernel oops hit on a nilfs
filesystem with a 1KB block size when doing rsync.

This turned out to be caused by an inconsistency of dirty state
between a page and its buffers storing b-tree node blocks.

If the page had multiple buffers split over multiple logs, and if the
logs were written at a time, a dirty flag remained in the page even
every dirty flag in the buffers was cleared.

This will fix the failure by dropping the dirty flag properly for
pages with the discrete multiple b-tree nodes.

Reported-by: Andrea Gelmini <andrea.gelmini@gmail.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Tested-by: Andrea Gelmini <andrea.gelmini@gmail.com>
Cc: stable@kernel.org
14 years agoperf_counter tools: Fix link errors with older toolchains
Ingo Molnar [Sat, 1 Aug 2009 11:15:36 +0000 (13:15 +0200)] 
perf_counter tools: Fix link errors with older toolchains

On older distros (F8 for example) the perf build could fail
with such missing symbols:

    LINK perf
/usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../lib64/libbfd.a(bfd.o): In function `bfd_demangle':
(.text+0x2b3): undefined reference to `cplus_demangle'
/usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../lib64/libbfd.a(bfd.o): In function `bfd_demangle':

Link in -liberty too.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoblock: Update topology documentation
Martin K. Petersen [Fri, 31 Jul 2009 15:49:13 +0000 (11:49 -0400)] 
block: Update topology documentation

Update topology comments and sysfs documentation based upon discussions
with Neil Brown.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
14 years agoblock: Stack optimal I/O size
Martin K. Petersen [Fri, 31 Jul 2009 15:49:12 +0000 (11:49 -0400)] 
block: Stack optimal I/O size

When stacking block devices ensure that optimal I/O size is scaled
accordingly.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
14 years agoblock: Add a wrapper for setting minimum request size without a queue
Martin K. Petersen [Fri, 31 Jul 2009 15:49:11 +0000 (11:49 -0400)] 
block: Add a wrapper for setting minimum request size without a queue

Introduce blk_limits_io_min() and make blk_queue_io_min() call it.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
14 years agoblock: Make blk_queue_stack_limits use the new stacking interface
Martin K. Petersen [Fri, 31 Jul 2009 15:49:10 +0000 (11:49 -0400)] 
block: Make blk_queue_stack_limits use the new stacking interface

blk_queue_stack_limits() has been superceded by blk_stack_limits() and
disk_stack_limits().  Wrap the function call for now, we'll deprecate it
later.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
14 years agoLinux 2.6.31-rc5 v2.6.31-rc5
Linus Torvalds [Sat, 1 Aug 2009 00:40:45 +0000 (17:40 -0700)] 
Linux 2.6.31-rc5

14 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

14 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

14 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()

14 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

14 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

14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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