16 years agoFix user namespace exiting OOPs
Pavel Emelyanov [Wed, 19 Sep 2007 05:46:45 +0000 (22:46 -0700)]
Fix user namespace exiting OOPs

It turned out, that the user namespace is released during the do_exit() in
exit_task_namespaces(), but the struct user_struct is released only during the
put_task_struct(), i.e.  MUCH later.

On debug kernels with poisoned slabs this will cause the oops in
uid_hash_remove() because the head of the chain, which resides inside the
struct user_namespace, will be already freed and poisoned.

Since the uid hash itself is required only when someone can search it, i.e.
when the namespace is alive, we can safely unhash all the user_struct-s from
it during the namespace exiting.  The subsequent free_uid() will complete the
user_struct destruction.

For example simple program

   #include <sched.h>

   char stack[2 * 1024 * 1024];

   int f(void *foo)
    return 0;

   int main(void)
    clone(f, stack + 1 * 1024 * 1024, 0x10000000, 0);
    return 0;

run on kernel with CONFIG_USER_NS turned on will oops the
kernel immediately.

This was spotted during OpenVZ kernel testing.

Signed-off-by: Pavel Emelyanov <>
Signed-off-by: Alexey Dobriyan <>
Acked-by: "Serge E. Hallyn" <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agoConvert uid hash to hlist
Pavel Emelyanov [Wed, 19 Sep 2007 05:46:44 +0000 (22:46 -0700)]
Convert uid hash to hlist

Surprisingly, but (spotted by Alexey Dobriyan) the uid hash still uses
list_heads, thus occupying twice as much place as it could.  Convert it to

Signed-off-by: Pavel Emelyanov <>
Signed-off-by: Alexey Dobriyan <>
Acked-by: Serge Hallyn <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agokernel/user.c: Use list_for_each_entry instead of list_for_each
Matthias Kaehlcke [Wed, 19 Sep 2007 05:46:43 +0000 (22:46 -0700)]
kernel/user.c: Use list_for_each_entry instead of list_for_each

kernel/user.c: Convert list_for_each to list_for_each_entry in

Signed-off-by: Matthias Kaehlcke <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agoext34: ensure do_split leaves enough free space in both blocks
Eric Sandeen [Wed, 19 Sep 2007 05:46:42 +0000 (22:46 -0700)]
ext34: ensure do_split leaves enough free space in both blocks

The do_split() function for htree dir blocks is intended to split a leaf
block to make room for a new entry.  It sorts the entries in the original
block by hash value, then moves the last half of the entries to the new
block - without accounting for how much space this actually moves.  (IOW,
it moves half of the entry *count* not half of the entry *space*).  If by
chance we have both large & small entries, and we move only the smallest
entries, and we have a large new entry to insert, we may not have created
enough space for it.

The patch below stores each record size when calculating the dx_map, and
then walks the hash-sorted dx_map, calculating how many entries must be
moved to more evenly split the existing entries between the old block and
the new block, guaranteeing enough space for the new entry.

The dx_map "offs" member is reduced to u16 so that the overall map size
does not change - it is temporarily stored at the end of the new block, and
if it grows too large it may be overwritten.  By making offs and size both
u16, we won't grow the map size.

Also add a few comments to the functions involved.

This fixes the testcase reported by on the
linux-ext4 list, "ext3 dir_index causes an error"

Thanks to Andreas Dilger for discussing the problem & solution with me.

Signed-off-by: Eric Sandeen <>
Signed-off-by: Andreas Dilger <>
Tested-by: Junjiro Okajima <>
Cc: Theodore Ts'o <>
Cc: <>
Cc: <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agodisable sys_timerfd() for 2.6.23
Andrew Morton [Wed, 19 Sep 2007 05:46:41 +0000 (22:46 -0700)]
disable sys_timerfd() for 2.6.23

There is still some confusion and disagreement over what this interface should
actually do.  So it is best that we disable it in 2.6.23 until we get that
fully sorted out.

(sys_timerfd() was present in 2.6.22 but it was apparently broken, so here we
assume that nobody is using it yet).

Cc: Michael Kerrisk <>
Cc: Davide Libenzi <>
Acked-by: Linus Torvalds <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agonfs: fix oops re sysctls and V4 support
Alexey Dobriyan [Wed, 19 Sep 2007 05:46:40 +0000 (22:46 -0700)]
nfs: fix oops re sysctls and V4 support

NFS unregisters sysctls only if V4 support is compiled in.  However, sysctl
table is not V4 specific, so unregister it always.

Steps to reproduce:

[build nfs.ko with CONFIG_NFS_V4=n]
modrobe nfs
rmmod nfs
ls /proc/sys

Unable to handle kernel paging request at ffffffff880661c0 RIP:
 [<ffffffff802af8e3>] proc_sys_readdir+0xd3/0x350
PGD 203067 PUD 207063 PMD 7e216067 PTE 0
Oops: 0000 [1] SMP
Modules linked in: lockd nfs_acl sunrpc
Pid: 3335, comm: ls Not tainted 2.6.23-rc3-bloat #2
RIP: 0010:[<ffffffff802af8e3>]  [<ffffffff802af8e3>] proc_sys_readdir+0xd3/0x350
RSP: 0018:ffff81007fd93e78  EFLAGS: 00010286
RAX: ffffffff880661c0 RBX: ffffffff80466370 RCX: ffffffff880661c0
RDX: 00000000000014c0 RSI: ffff81007f3ad020 RDI: ffff81007efd8b40
RBP: 0000000000000018 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000001 R11: ffffffff802a8570 R12: ffffffff880661c0
R13: ffff81007e219640 R14: ffff81007efd8b40 R15: ffff81007ded7280
FS:  00002ba25ef03060(0000) GS:ffff81007ff81258(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: ffffffff880661c0 CR3: 000000007dfaf000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process ls (pid: 3335, threadinfo ffff81007fd92000, task ffff81007d8a0000)
Stack:  ffff81007f3ad150 ffffffff80283f30 ffff81007fd93f48 ffff81007efd8b40
 ffff81007ee00440 0000000422222222 0000000200035593 ffffffff88037e9a
 2222222222222222 ffffffff80466500 ffff81007e416400 ffff81007e219640
Call Trace:
 [<ffffffff80283f30>] filldir+0x0/0xf0
 [<ffffffff80283f30>] filldir+0x0/0xf0
 [<ffffffff802840c7>] vfs_readdir+0xa7/0xc0
 [<ffffffff80284376>] sys_getdents+0x96/0xe0
 [<ffffffff8020bb3e>] system_call+0x7e/0x83

Code: 41 8b 14 24 85 d2 74 dc 49 8b 44 24 08 48 85 c0 74 e7 49 3b
RIP  [<ffffffff802af8e3>] proc_sys_readdir+0xd3/0x350
 RSP <ffff81007fd93e78>
CR2: ffffffff880661c0
Kernel panic - not syncing: Fatal exception

Signed-off-by: Alexey Dobriyan <>
Acked-by: Trond Myklebust <>
Cc: "J. Bruce Fields" <>
Cc: <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agodir_index: error out instead of BUG on corrupt dx dirs
Eric Sandeen [Wed, 19 Sep 2007 05:46:38 +0000 (22:46 -0700)]
dir_index: error out instead of BUG on corrupt dx dirs

Convert asserts (BUGs) in dx_probe from bad on-disk data to recoverable
errors with helpful warnings.  With help catching other asserts from Duane
Griffin <>

Signed-off-by: Eric Sandeen <>
Acked-by: Duane Griffin <>
Acked-by: Theodore Ts'o <>
Cc: <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agointel-agp: Fix i830 mask variable that changed with G33 support
Dave Airlie [Wed, 19 Sep 2007 05:46:35 +0000 (22:46 -0700)]
intel-agp: Fix i830 mask variable that changed with G33 support

The mask on i830 should be 0x70 always, later chips 0xF0 should be okay.

Signed-off-by: Dave Airlie <>
Acked-by: Zhenyu Wang <>
Cc: Michael Haas <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agointelfb: Fix bug in DPLL disable
Antonino A. Daplas [Wed, 19 Sep 2007 05:46:34 +0000 (22:46 -0700)]
intelfb: Fix bug in DPLL disable

Reported in Kernel Bugzilla 9006

Fix an obvious bug in DPLL disable.

Signed-off-by: Antonino Daplas <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agoxen: don't bother trying to set cr4
Jeremy Fitzhardinge [Wed, 19 Sep 2007 05:46:33 +0000 (22:46 -0700)]
xen: don't bother trying to set cr4

Xen ignores all updates to cr4, and some versions will kill the domain if
you try to change its value.  Just ignore all changes.

Signed-off-by: Jeremy Fitzhardinge <>
Cc: Andi Kleen <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agopci: fix unterminated pci_device_id lists
Kees Cook [Wed, 19 Sep 2007 05:46:32 +0000 (22:46 -0700)]
pci: fix unterminated pci_device_id lists

Fix a couple drivers that do not correctly terminate their pci_device_id
lists.  This results in garbage being spewed into modules.pcimap when the
module happens to not have 28 NULL bytes following the table, and/or the
last PCI ID is actually truncated from the table when calculating the
modules.alias PCI aliases, cause those unfortunate device IDs to not

Signed-off-by: Kees Cook <>
Acked-by: Corey Minyard <>
Cc: David Woodhouse <>
Acked-by: Jeff Garzik <>
Cc: Greg KH <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agomspec: handle shrinking virtual memory areas
Cliff Wickman [Wed, 19 Sep 2007 05:46:31 +0000 (22:46 -0700)]
mspec: handle shrinking virtual memory areas

The shrinking of a virtual memory area that is mmap(2)'d to a memory
special file (device drivers/char/mspec.c) can cause a panic.

If the mapped size of the vma (vm_area_struct) is very large, mspec allocates
a large vma_data structure with vmalloc(). But such a vma can be shrunk by
an munmap(2).  The current driver uses the current size of each vma to
deduce whether its vma_data structure was allocated by kmalloc() or vmalloc().
So if the vma was shrunk it appears to have been allocated by kmalloc(),
and mspec attempts to free it with kfree().  This results in a panic.

This patch avoids the panic (by preserving the type of the allocation) and
also makes mspec work correctly as the vma is split into pieces by the

All vma's derived from such a split vma share the same vma_data structure that
represents all the pages mapped into this set of vma's.  The mpec driver
must be made capable of using the right portion of the structure for each
member vma.  In other words, it must index into the array of page addresses
using the portion of the array that represents the current vma. This is
enabled by storing the vma group's vm_start in the vma_data structure.

The shared vma_data's are not protected by mm->mmap_sem in the fork() case
so the reference count is left as atomic_t.

Signed-off-by: Cliff Wickman <>
Acked-by: Jes Sorensen <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agortc: rtc-ds1553.c should use resource_size_t for base address
Atsushi Nemoto [Wed, 19 Sep 2007 05:46:30 +0000 (22:46 -0700)]
rtc: rtc-ds1553.c should use resource_size_t for base address

Currently the rtc driver, rtc-ds1552.c uses an unsigned long to store the
base mmio address of the NVRAM/RTC.  This breaks on 32-bit systems with
larger physical addresses.

Signed-off-by: Atsushi Nemoto <>
Cc: David Brownell <>
Cc: Alessandro Zummo <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agortc-ds1742.c should use resource_size_t for base address
David Gibson [Wed, 19 Sep 2007 05:46:28 +0000 (22:46 -0700)]
rtc-ds1742.c should use resource_size_t for base address

Currently the rtc driver, rtc-ds1742.c uses an unsigned long to store the
base mmio address of the NVRAM/RTC.  This breaks on systems like PowerPC
440, which is a 32-bit core with 36-bit physical addresses: IO on the
system, including the RTC, is typically above the 4GB point, and cannot fit
into an unsigned long.

This patch fixes the problem by replacing the unsigned long with a
resource_size_t.  Tested on Ebony (PPC440) (with additional patches to
instantiate the ds1742 platform device appropriately).

Signed-off-by: David Gibson <>
Acked-by: Atsushi Nemoto <>
Cc: Alessandro Zummo <>
Cc: David Brownell <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agoFix UTS corruption during clone(CLONE_NEWUTS)
Alexey Dobriyan [Wed, 19 Sep 2007 05:46:27 +0000 (22:46 -0700)]
Fix UTS corruption during clone(CLONE_NEWUTS)

struct utsname is copied from master one without any exclusion.

Here is sample output from one proggie doing


and another

clone(,, CLONE_NEWUTS, ...)

hostname = 'aaaaaaaaaaaaaaaaaaaaaaaaabbbbb'
hostname = 'bbbaaaaaaaaaaaaaaaaaaaaaaaaaaa'
hostname = 'aaaaaaaabbbbbbbbbbbbbbbbbbbbbb'
hostname = 'aaaaaaaaaaaaaaaaaaaaaaaaaabbbb'
hostname = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaabb'
hostname = 'aaabbbbbbbbbbbbbbbbbbbbbbbbbbb'
hostname = 'bbbbbbbbbbbbbbbbaaaaaaaaaaaaaa'

Hostname is sometimes corrupted.

Yes, even _the_ simplest namespace activity had bug in it. :-(

Signed-off-by: Alexey Dobriyan <>
Acked-by: Serge Hallyn <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agoFix failure to resume from initrds
Nigel Cunningham [Wed, 19 Sep 2007 05:46:25 +0000 (22:46 -0700)]
Fix failure to resume from initrds

Commit 831441862956fffa17b9801db37e6ea1650b0f69 (Freezer: make kernel
threads nonfreezable by default) breaks freezing when attempting to resume
from an initrd, because the init (which is freezeable) spins while waiting
for another thread to run /linuxrc, but doesn't check whether it has been
told to enter the refrigerator.  The original patch replaced a call to
try_to_freeze() with a call to yield().  I believe a simple reversion is
wrong because if !CONFIG_PM_SLEEP, try_to_freeze() is a noop.  It should
still yield.

Signed-off-by: Nigel Cunningham <>
Acked-by: Rafael J. Wysocki <>
Acked-by: Pavel Machek <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agouml: use correct type in BLKGETSIZE ioctl
Nicolas George [Wed, 19 Sep 2007 05:46:21 +0000 (22:46 -0700)]
uml: use correct type in BLKGETSIZE ioctl

I found a type mismatch in UML that makes host block devices unusable as ubd
devices on x86_64 and other 64 bits systems (segfault of the mm subsystem):

In block/ioctl.c, the following lines show that the BLKGETSIZE ioctl expects
a pointer to a long:

if ((bdev->bd_inode->i_size >> 9) > ~0UL)
return -EFBIG;
return put_ulong(arg, bdev->bd_inode->i_size >> 9);

In arch/um/os-Linux/file.c, os_file_size calls it with an int.

The ioctl_list man page should be fixed as well.

Cc: Jeff Dike <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agoFix "Fix DAC960 driver on machines which don't support 64-bit DMA"
Andrew Morton [Wed, 19 Sep 2007 05:46:19 +0000 (22:46 -0700)]
Fix "Fix DAC960 driver on machines which don't support 64-bit DMA"


drivers/block/DAC960.c: In function 'DAC960_V1_EnableMemoryMailboxInterface':
drivers/block/DAC960.c:1168: error: 'DMA_32BIT_MASK' undeclared (first use in this function)
drivers/block/DAC960.c:1168: error: (Each undeclared identifier is reported only

Cc: <>
Cc: <>
Cc: Alessandro Polverini <>
Cc: Jeff Garzik <>
Cc: Matthew Wilcox <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
16 years agoMerge branch 'release' of git://
Linus Torvalds [Mon, 17 Sep 2007 05:24:49 +0000 (22:24 -0700)]
Merge branch 'release' of git://git./linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://
  ACPI: thinkpad-acpi: bump up version to 0.16
  ACPI: thinkpad-acpi: revert new 2.6.23 CONFIG_THINKPAD_ACPI_INPUT_ENABLED option
  ACPI: fix CONFIG_NET=n acpi_bus_generate_netlink_event build failure
  msi-laptop: replace ',' with ';'
  ACPI: (more) delete CONFIG_ACPI_PROCFS_SLEEP (again)

16 years agoPull thinkpad into release branch
Len Brown [Mon, 17 Sep 2007 04:58:40 +0000 (00:58 -0400)]
Pull thinkpad into release branch

16 years agoACPI: thinkpad-acpi: bump up version to 0.16
Henrique de Moraes Holschuh [Tue, 4 Sep 2007 14:13:16 +0000 (11:13 -0300)]
ACPI: thinkpad-acpi: bump up version to 0.16

Name it thinkpad-acpi version 0.16 to avoid any confusion with some 0.15
thinkpad-acpi development snapshots and backports that had input layer
support, but no hotkey_report_mode support.

Signed-off-by: Henrique de Moraes Holschuh <>
Signed-off-by: Len Brown <>
16 years agoACPI: thinkpad-acpi: revert new 2.6.23 CONFIG_THINKPAD_ACPI_INPUT_ENABLED option
Henrique de Moraes Holschuh [Tue, 4 Sep 2007 14:13:15 +0000 (11:13 -0300)]
ACPI: thinkpad-acpi: revert new 2.6.23 CONFIG_THINKPAD_ACPI_INPUT_ENABLED option

Revert new 2.6.23 CONFIG_THINKPAD_ACPI_INPUT_ENABLED Kconfig option because
it would create a legacy we don't want to support.

CONFIG_THINKPAD_ACPI_INPUT_ENABLED was added to try to fix an issue that is
now moot with the addition of the netlink ACPI event report interface to
the ACPI core.

Now that ACPI core can send events over netlink, we can use a different
strategy to keep backwards compatibility with older userspace, without the
need for the CONFIG_THINKPAD_ACPI_INPUT_ENABLED games.  And it arrived
before CONFIG_THINKPAD_ACPI_INPUT_ENABLED made it to a stable mainline
kernel, even, which is Good.

This patch is in sync with some changes to thinkpad-acpi backports, that
will keep things sane for userspace across different combinations of kernel
versions, thinkpad-acpi backports (or the lack thereof), and userspace

Unless a module parameter is used, thinkpad-acpi will now behave in such a
way that it will work well (by default) with userspace that still uses only
the old ACPI procfs event interface and doesn't care for thinkpad-acpi
input devices.

It will also always work well with userspace that has been updated to use
both the thinkpad-acpi input devices, and ACPI core netlink event
interface, regardless of any module parameter.

The module parameter was added to allow thinkpad-acpi to work with
userspace that has been partially updated to use thinkpad-acpi input
devices, but not the new ACPI core netlink event interface.  To use this
mode of hot key reporting, one has to specify the hotkey_report_mode=2
module parameter.

The thinkpad-acpi driver exports the value of hotkey_report_mode through
sysfs, as well.  thinkpad-acpi backports to older kernels, that do not
support the new ACPI core netlink interface, have code to allow userspace
to switch hotkey_report_mode at runtime through sysfs.  This capability
will not be provided in mainline thinkpad-acpi as it is not needed there.

Signed-off-by: Henrique de Moraes Holschuh <>
Cc: Michael S. Tsirkin <>
Cc: Hugh Dickins <>
Cc: Richard Hughes <>
Signed-off-by: Len Brown <>
16 years agoPull misc into release branch
Len Brown [Mon, 17 Sep 2007 04:28:58 +0000 (00:28 -0400)]
Pull misc into release branch

16 years agoMerge branch 'master' of
Linus Torvalds [Mon, 17 Sep 2007 04:15:36 +0000 (21:15 -0700)]
Merge branch 'master' of /linux/kernel/git/davem/sparc-2.6

* 'master' of
  [SPARC64]: Warn user if cpu is ignored.
  [SPARC64]: Fix lockdep, particularly on SMP.
  [SPARC64]: Update defconfig.

16 years agoMerge branch 'master' of
Linus Torvalds [Mon, 17 Sep 2007 04:14:54 +0000 (21:14 -0700)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

* 'master' of
  [VLAN]: Fix net_device leak.
  [PPP] generic: Fix receive path data clobbering & non-linear handling
  [PPP] generic: Call skb_cow_head before scribbling over skb
  [NET] skbuff: Add skb_cow_head
  [BRIDGE]: Kill clone argument to br_flood_*
  [PPP] pppoe: Fill in header directly in __pppoe_xmit
  [PPP] pppoe: Fix data clobbering in __pppoe_xmit and return value
  [PPP] pppoe: Fix skb_unshare_check call position
  [SCTP]: Convert bind_addr_list locking to RCU
  [SCTP]: Add RCU synchronization around sctp_localaddr_list
  [PKT_SCHED]: sch_cbq.c: Shut up uninitialized variable warning
  [PKTGEN]: srcmac fix
  [IPV6]: Fix source address selection.
  [IPV4]: Just increment OutDatagrams once per a datagram.
  [IPV6]: Just increment OutDatagrams once per a datagram.
  [IPV6]: Fix unbalanced socket reference with MSG_CONFIRM.
  [NET_SCHED] protect action config/dump from irqs
  [NET]: Fix two issues wrt. SO_BINDTODEVICE.

16 years agoFix non-ISA link error in drivers/scsi/advansys.c
Matthew Wilcox [Sun, 16 Sep 2007 23:01:26 +0000 (17:01 -0600)]
Fix non-ISA link error in drivers/scsi/advansys.c

When CONFIG_ISA is disabled, the isa_driver support will not be compiled
in.  Define stubs so that we don't get link-time errors.

Signed-off-by: Matthew Wilcox <>
Signed-off-by: Linus Torvalds <>
16 years ago[VLAN]: Fix net_device leak.
Al Viro [Sun, 16 Sep 2007 23:43:04 +0000 (16:43 -0700)]
[VLAN]: Fix net_device leak.

In "[VLAN]: Move device registation to seperate function" (commit
e89fe42cd03c8fd3686df82d8390a235717a66de), a pile of code got moved
to register_vlan_dev(), including grabbing a reference to underlying
device.  However, original dev_hold() had been left behind, so we
leak a reference to net_device now...

Signed-off-by: Al Viro <>
Signed-off-by: David S. Miller <>
16 years ago[PPP] generic: Fix receive path data clobbering & non-linear handling
Herbert Xu [Sun, 16 Sep 2007 23:22:13 +0000 (16:22 -0700)]
[PPP] generic: Fix receive path data clobbering & non-linear handling

This patch adds missing pskb_may_pull calls to deal with non-linear
packets that may arrive from pppoe or pppol2tp.

It also copies cloned packets before writing over them.

Signed-off-by: Herbert Xu <>
Signed-off-by: David S. Miller <>
16 years ago[PPP] generic: Call skb_cow_head before scribbling over skb
Herbert Xu [Sun, 16 Sep 2007 23:21:42 +0000 (16:21 -0700)]
[PPP] generic: Call skb_cow_head before scribbling over skb

It's rude to write over data that other people are still using.  So call
skb_cow_head before PPP proceeds to modify the skb data.

Signed-off-by: Herbert Xu <>
Signed-off-by: David S. Miller <>
16 years ago[NET] skbuff: Add skb_cow_head
Herbert Xu [Sun, 16 Sep 2007 23:21:16 +0000 (16:21 -0700)]
[NET] skbuff: Add skb_cow_head

This patch adds an optimised version of skb_cow that avoids the copy if
the header can be modified even if the rest of the payload is cloned.

This can be used in encapsulating paths where we only need to modify the
header.  As it is, this can be used in PPPOE and bridging.

Signed-off-by: Herbert Xu <>
Signed-off-by: David S. Miller <>
16 years ago[BRIDGE]: Kill clone argument to br_flood_*
Herbert Xu [Sun, 16 Sep 2007 23:20:48 +0000 (16:20 -0700)]
[BRIDGE]: Kill clone argument to br_flood_*

The clone argument is only used by one caller and that caller can clone
the packet itself.  This patch moves the clone call into the caller and
kills the clone argument.

Signed-off-by: Herbert Xu <>
Signed-off-by: David S. Miller <>
16 years ago[PPP] pppoe: Fill in header directly in __pppoe_xmit
Herbert Xu [Sun, 16 Sep 2007 23:20:21 +0000 (16:20 -0700)]
[PPP] pppoe: Fill in header directly in __pppoe_xmit

This patch removes the hdr variable (which is copied into the skb)
and instead sets the header directly in the skb.

It also uses __skb_push instead of skb_push since we've just checked
using skb_cow for enough head room.

Signed-off-by: Herbert Xu <>
Signed-off-by: David S. Miller <>
16 years ago[PPP] pppoe: Fix data clobbering in __pppoe_xmit and return value
Herbert Xu [Sun, 16 Sep 2007 23:19:50 +0000 (16:19 -0700)]
[PPP] pppoe: Fix data clobbering in __pppoe_xmit and return value

The function __pppoe_xmit modifies the skb data and therefore it needs
to copy and skb data if it's cloned.

In fact, it currently allocates a new skb so that it can return 0 in
case of error without freeing the original skb.  This is totally wrong
because returning zero is meant to indicate congestion whereupon pppoe
is supposed to wake up the upper layer once the congestion subsides.

This makes sense for ppp_async and ppp_sync but is out-of-place for
pppoe.  This patch makes it always return 1 and free the skb.

Signed-off-by: Herbert Xu <>
Signed-off-by: David S. Miller <>
16 years ago[PPP] pppoe: Fix skb_unshare_check call position
Herbert Xu [Sun, 16 Sep 2007 23:19:20 +0000 (16:19 -0700)]
[PPP] pppoe: Fix skb_unshare_check call position

The skb_unshare_check call needs to be made before pskb_may_pull,
not after.

Signed-off-by: Herbert Xu <>
Signed-off-by: David S. Miller <>
16 years ago[SCTP]: Convert bind_addr_list locking to RCU
Vlad Yasevich [Sun, 16 Sep 2007 23:03:28 +0000 (16:03 -0700)]
[SCTP]: Convert bind_addr_list locking to RCU

Since the sctp_sockaddr_entry is now RCU enabled as part of
the patch to synchronize sctp_localaddr_list, it makes sense to
change all handling of these entries to RCU.  This includes the
sctp_bind_addrs structure and it's list of bound addresses.

This list is currently protected by an external rw_lock and that
looks like an overkill.  There are only 2 writers to the list:
bind()/bindx() calls, and BH processing of ASCONF-ACK chunks.
These are already seriealized via the socket lock, so they will
not step on each other.  These are also relatively rare, so we
should be good with RCU.

The readers are varied and they are easily converted to RCU.

Signed-off-by: Vlad Yasevich <>
Acked-by: Paul E. McKenney <>
Acked-by: Sridhar Samdurala <>
Signed-off-by: David S. Miller <>
16 years ago[SCTP]: Add RCU synchronization around sctp_localaddr_list
Vlad Yasevich [Sun, 16 Sep 2007 23:02:12 +0000 (16:02 -0700)]
[SCTP]: Add RCU synchronization around sctp_localaddr_list

sctp_localaddr_list is modified dynamically via NETDEV_UP
and NETDEV_DOWN events, but there is not synchronization
between writer (even handler) and readers.  As a result,
the readers can access an entry that has been freed and
crash the sytem.

Signed-off-by: Vlad Yasevich <>
Acked-by: Paul E. McKenney <>
Acked-by: Sridhar Samdurala <>
Signed-off-by: David S. Miller <>
16 years ago[PKT_SCHED]: sch_cbq.c: Shut up uninitialized variable warning
Satyam Sharma [Sun, 16 Sep 2007 21:54:05 +0000 (14:54 -0700)]
[PKT_SCHED]: sch_cbq.c: Shut up uninitialized variable warning

net/sched/sch_cbq.c: In function 'cbq_enqueue':
net/sched/sch_cbq.c:383: warning: 'ret' may be used uninitialized in this function

has been verified to be a bogus case. So let's shut it up.

Signed-off-by: Satyam Sharma <>
Acked-by: Patrick McHardy <>
Signed-off-by: Andrew Morton <>
Signed-off-by: David S. Miller <>
16 years ago[PKTGEN]: srcmac fix
Adit Ranadive [Sun, 16 Sep 2007 21:52:15 +0000 (14:52 -0700)]
[PKTGEN]: srcmac fix

From: Adit Ranadive <>

Signed-off-by: Andrew Morton <>
Signed-off-by: David S. Miller <>
16 years ago[IPV6]: Fix source address selection.
Jiri Kosina [Sun, 16 Sep 2007 21:48:21 +0000 (14:48 -0700)]
[IPV6]: Fix source address selection.

The commit 95c385 broke proper source address selection for cases in which
there is a address which is makred 'deprecated'. The commit mistakenly
changed ifa->flags to ifa_result->flags (probably copy/paste error from a
few lines above) in the 'Rule 3' address selection code.

The patch restores the previous RFC-compliant behavior.

Signed-off-by: Jiri Kosina <>
Signed-off-by: David S. Miller <>
16 years ago[SPARC64]: Warn user if cpu is ignored.
David S. Miller [Sun, 16 Sep 2007 21:45:06 +0000 (14:45 -0700)]
[SPARC64]: Warn user if cpu is ignored.

When NR_CPUS is smaller than the cpu probed, let the user
know that the cpu won't be used.

Suggested by Al Viro.

Signed-off-by: David S. Miller <>
16 years ago[SPARC64]: Fix lockdep, particularly on SMP.
David S. Miller [Sun, 16 Sep 2007 18:51:15 +0000 (11:51 -0700)]
[SPARC64]: Fix lockdep, particularly on SMP.

As noted by Al Viro, when we try to call prom_set_trap_table()
in the SMP trampoline code we try to take the PROM call spinlock
which doesn't work because the current thread pointer isn't
valid yet and lockdep depends upon that being correct.

Furthermore, we cannot set the current thread pointer register
because it can't be properly dereferenced until we return from
prom_set_trap_table().  Kernel TLB misses only work after that

So do the PROM call to set the trap table directly instead of
going through the OBP library C code, and thus avoid the lock

These calls are guarenteed to be serialized fully.

Since there are now no calls to the prom_set_trap_table{_sun4v}()
library functions, they can be deleted.

Signed-off-by: David S. Miller <>
16 years ago[SPARC64]: Update defconfig.
David S. Miller [Sun, 16 Sep 2007 16:52:36 +0000 (09:52 -0700)]
[SPARC64]: Update defconfig.

Signed-off-by: David S. Miller <>
16 years agoclockevents: prevent stale tick update on offline cpu
Thomas Gleixner [Sun, 16 Sep 2007 13:36:43 +0000 (15:36 +0200)]
clockevents: prevent stale tick update on offline cpu

Taking a cpu offline removes the cpu from the online mask before the
CPU_DEAD notification is done. The clock events layer does the cleanup
of the dead CPU from the CPU_DEAD notifier chain. tick_do_timer_cpu is
used to avoid xtime lock contention by assigning the task of jiffies
xtime updates to one CPU. If a CPU is taken offline, then this
assignment becomes stale. This went unnoticed because most of the time
the offline CPU went dead before the online CPU reached __cpu_die(),
where the CPU_DEAD state is checked. In the case that the offline CPU did
not reach the DEAD state before we reach __cpu_die(), the code in there
goes to sleep for 100ms. Due to the stale time update assignment, the
system is stuck forever.

Take the assignment away when a cpu is not longer in the cpu_online_mask.
We do this in the last call to tick_nohz_stop_sched_tick() when the offline
CPU is on the way to the final play_dead() idle entry.

Signed-off-by: Thomas Gleixner <>
16 years agoclockevents: do not shutdown the oneshot broadcast device
Thomas Gleixner [Sun, 16 Sep 2007 13:36:43 +0000 (15:36 +0200)]
clockevents: do not shutdown the oneshot broadcast device

When a cpu goes offline it is removed from the broadcast masks. If the
mask becomes empty the code shuts down the broadcast device. This is
wrong, because the broadcast device needs to be ready for the online
cpu going idle (into a c-state, which stops the local apic timer).

Signed-off-by: Thomas Gleixner <>
16 years agoclockevents: Enforce oneshot broadcast when broadcast mask is set on resume
Thomas Gleixner [Sun, 16 Sep 2007 13:36:43 +0000 (15:36 +0200)]
clockevents: Enforce oneshot broadcast when broadcast mask is set on resume

The jinxed VAIO refuses to resume without hitting keys on the keyboard
when this is not enforced. It is unclear why the cpu ends up in a lower
C State without notifying the clock events layer, but enforcing the
oneshot broadcast here is safe.

Signed-off-by: Thomas Gleixner <>
16 years agoACPI: Reevaluate C/P/T states when a cpu becomes online
Venkatesh Pallipadi [Sun, 16 Sep 2007 13:36:43 +0000 (15:36 +0200)]
ACPI: Reevaluate C/P/T states when a cpu becomes online

Reevaluate C/P/T states when a cpu becomes online. This avoids
the caching of the broadcast information in the clockevents layer.

Signed-off-by: Venkatesh Pallipadi <>
Signed-off-by: Thomas Gleixner <>
Cc: Len Brown <>
16 years agotimekeeping: Prevent time going backwards on resume
Thomas Gleixner [Sun, 16 Sep 2007 13:36:43 +0000 (15:36 +0200)]
timekeeping: Prevent time going backwards on resume

Timekeeping resume adjusts xtime by adding the slept time in seconds and
resets the reference value of the clock source (clock->cycle_last).
clock->cycle last is used to calculate the delta between the last xtime
update and the readout of the clock source in __get_nsec_offset(). xtime
plus the offset is the current time. The resume code ignores the delta
which had already elapsed between the last xtime update and the actual
time of suspend. If the suspend time is short, then we can see time
going backwards on resume.

offs_s = clock->read() - clock->cycle_last;
now = xtime + offs_s;
timekeeping_suspend_time = read_rtc();

sleep_time = read_rtc() - timekeeping_suspend_time;
xtime.tv_sec += sleep_time;
clock->cycle_last = clock->read();
offs_r = clock->read() - clock->cycle_last;
now = xtime + offs_r;

if sleep_time_seconds == 0 and offs_r < offs_s, then time goes

Fix this by storing the offset from the last xtime update and add it to
xtime during resume, when we reset clock->cycle_last:

sleep_time = read_rtc() - timekeeping_suspend_time;
xtime.tv_sec += sleep_time;
xtime += offs_s; /* Fixup xtime offset at suspend time */
clock->cycle_last = clock->read();
offs_r = clock->read() - clock->cycle_last;
now = xtime + offs_r;

Thanks to Marcelo for tracking this down on the OLPC and providing the
necessary details to analyze the root cause.

Signed-off-by: Thomas Gleixner <>
Cc: John Stultz <>
Cc: Tosatti <>
16 years agotimekeeping: access rtc outside of xtime lock
Thomas Gleixner [Sun, 16 Sep 2007 13:36:43 +0000 (15:36 +0200)]
timekeeping: access rtc outside of xtime lock

Lockdep complains about the access of rtc in timekeeping_suspend
inside the interrupt disabled region of the write locked xtime lock.
Move the access outside.

Signed-off-by: Thomas Gleixner <>
Cc: John Stultz <>
16 years agoMerge branch 'upstream-linus' of
Linus Torvalds [Sun, 16 Sep 2007 00:35:57 +0000 (17:35 -0700)]
Merge branch 'upstream-linus' of /linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-linus' of
  drivers/net/pcmcia/3c589_cs: fix port configuration switcheroo
  sk98lin: resurrect driver
  ucc_geth: fix compilation
  mv643xx_eth: Fix tx_bytes stats calculation
  As struct iw_point is bi-directional payload, we should copy back the content
  [PATCH] bcm43xx: Fix cancellation of work queue crashes
  spidernet: fix interrupt reason recognition
  ehea: fix last_rx update
  ehea: propagate physical port state
  Fix a lock problem in generic phy code
  sky2: restore multicast list on resume and other ops
  atl1: disable broken 64-bit DMA

16 years agodrivers/net/pcmcia/3c589_cs: fix port configuration switcheroo
Jeff Garzik [Sat, 15 Sep 2007 23:41:43 +0000 (19:41 -0400)]
drivers/net/pcmcia/3c589_cs: fix port configuration switcheroo

10base2 and 10baseT were accidentally switched.

Noticed by Andreas HÃŒbner, forwarded by Alan Cox.

Signed-off-by: Jeff Garzik <>
16 years agosk98lin: resurrect driver
Stephen Hemminger [Sat, 15 Sep 2007 23:35:14 +0000 (19:35 -0400)]
sk98lin: resurrect driver

This reverts commit e1abecc48938fbe1966ea6e78267fc673fa59295.

The driver works on some hardware that skge doesn't handle yet.

Signed-off-by: Stephen Hemminger <>
Signed-off-by: Jeff Garzik <>
16 years agoucc_geth: fix compilation
Anton Vorontsov [Thu, 13 Sep 2007 15:23:33 +0000 (19:23 +0400)]
ucc_geth: fix compilation

Currently qe_bd_t is used in the macro call -- dma_unmap_single,
which is a no-op on PPC32, thus error is hidden today. Starting
with 2.6.24, macro will be replaced by the empty static function,
and erroneous use of qe_bd_t will trigger compilation error.

Signed-off-by: Anton Vorontsov <>
Signed-off-by: Jeff Garzik <>
16 years agomv643xx_eth: Fix tx_bytes stats calculation
Dale Farnsworth [Fri, 14 Sep 2007 18:23:16 +0000 (11:23 -0700)]
mv643xx_eth: Fix tx_bytes stats calculation

Reported by Corey Minyard <>

Signed-off-by: Jeff Garzik <>
16 years agoMerge branch 'fixes-jgarzik' of git://
Jeff Garzik [Sat, 15 Sep 2007 23:29:07 +0000 (19:29 -0400)]
Merge branch 'fixes-jgarzik' of git://git./linux/kernel/git/linville/wireless-2.6 into upstream-fixes

16 years agosparc64 (and others): fix tty_ioctl.c build
Tony Breeds [Sat, 15 Sep 2007 00:03:01 +0000 (17:03 -0700)]
sparc64 (and others): fix tty_ioctl.c build


Several architectures are still broken.  Put temporary-for-2.6.23 ifdef guards
around the offending code.

Signed-off-by: Tony Breeds <>
Cc: Alan Cox <>
Cc: Paul Mackerras <>
Cc: Benjamin Herrenschmidt <>
Cc: Heiko Carstens <>
Cc: "David S. Miller" <>
Signed-off-by: Andrew Morton <>
Signed-off-by:: Linus Torvalds <>

16 years ago[IPV4]: Just increment OutDatagrams once per a datagram.
YOSHIFUJI Hideaki [Sat, 15 Sep 2007 00:15:19 +0000 (17:15 -0700)]
[IPV4]: Just increment OutDatagrams once per a datagram.

Signed-off-by: YOSHIFUJI Hideaki <>
Signed-off-by: David S. Miller <>
16 years ago[IPV6]: Just increment OutDatagrams once per a datagram.
YOSHIFUJI Hideaki [Sat, 15 Sep 2007 00:15:01 +0000 (17:15 -0700)]
[IPV6]: Just increment OutDatagrams once per a datagram.

Signed-off-by: YOSHIFUJI Hideaki <>
Signed-off-by: David S. Miller <>
16 years agoMerge git://
Linus Torvalds [Sat, 15 Sep 2007 00:07:33 +0000 (17:07 -0700)]
Merge git://

* git://
  [patch 1/2] Xtensa: enable arbitary tty speed setting ioctls
  [patch 2/2] xtensa console.c: remove duplicate #include
  [XTENSA] Add support for cache-aliasing
  [XTENSA] Add kernel module support
  [XTENSA] Add support for executable/non-executable feature in the mmu
  [XTENSA] Use the generic version of get_order
  [XTENSA] Initialize semaphore_wake_lock
  [XTENSA] Add typecast macro for constants
  [XTENSA] Fix timer instabilities.
  [XTENSA] Fix fadvise64_64
  [XTENSA] Remove extraneous include statement
  [XTENSA] Move string-io functions to io.c from pci.c
  [XTENSA] Move pre-initialized structures to init_task.c
  [XTENSA] Add freestanding option to CFLAGS
  [XTENSA] Add getpgrp system-call to unistd.h
  [XTENSA] add missing system calls
  [XTENSA] fix wrong usage of __init and __initdata in traps.c

16 years ago[IPV6]: Fix unbalanced socket reference with MSG_CONFIRM.
YOSHIFUJI Hideaki [Fri, 14 Sep 2007 23:45:40 +0000 (16:45 -0700)]
[IPV6]: Fix unbalanced socket reference with MSG_CONFIRM.

Signed-off-by: YOSHIFUJI Hideaki <>
Signed-off-by: David S. Miller <>
16 years ago[NET_SCHED] protect action config/dump from irqs
Jamal Hadi Salim [Wed, 12 Sep 2007 14:32:59 +0000 (16:32 +0200)]
[NET_SCHED] protect action config/dump from irqs

(with no apologies to C Heston)

On Mon, 2007-10-09 at 21:00 +0800, Herbert Xu wrote:
On Sun, Sep 02, 2007 at 01:11:29PM +0000, Christian Kujau wrote:
> >
> > after upgrading to 2.6.23-rc5 (and applying davem's fix [0]), lockdep
> > was quite noisy when I tried to shape my external (wireless) interface:
> >
> > [ 6400.534545] FahCore_78.exe/3552 just changed the state of lock:
> > [ 6400.534713]  (&dev->ingress_lock){-+..}, at: [<c038d595>]
> > netif_receive_skb+0x2d5/0x3c0
> > [ 6400.534941] but this lock took another, soft-read-irq-unsafe lock in the
> > past:
> > [ 6400.535145]  (police_lock){-.--}
> This is a genuine dead-lock.  The police lock can be taken
> for reading with softirqs on.  If a second CPU tries to take
> the police lock for writing, while holding the ingress lock,
> then a softirq on the first CPU can dead-lock when it tries
> to get the ingress lock.

Signed-off-by: Jamal Hadi Salim <>
Acked-by: Herbert Xu <>
Signed-off-by: David S. Miller <>
16 years ago[NET]: Fix two issues wrt. SO_BINDTODEVICE.
David S. Miller [Fri, 14 Sep 2007 23:41:03 +0000 (16:41 -0700)]
[NET]: Fix two issues wrt. SO_BINDTODEVICE.

1) Comments suggest that setting optlen to zero will unbind
   the socket from whatever device it might be attached to.  This
   hasn't been the case since at least 2.2.x because the first thing
   this function does is return -EINVAL if 'optlen' is less than

   This check also means that passing in a two byte string doesn't
   work so well.  It's almost as if this code was testing with "eth?"
   patterned strings and nothing else :-)

   Fix this by breaking the logic of this facility out into a
   seperate function which validates optlen more appropriately.

   The optlen==0 and small string cases now work properly.

2) We should reset the cached route of the socket after we have made
   the device binding changes, not before.

Reported by Ben Greear.

Signed-off-by: David S. Miller <>
16 years agoMerge branch 'for-linus' of
Linus Torvalds [Fri, 14 Sep 2007 21:04:13 +0000 (14:04 -0700)]
Merge branch 'for-linus' of /linux/kernel/git/cooloney/blackfin-2.6

* 'for-linus' of
  Blackfin arch: fix some bugs in lib/string.h functions found by our string testing modules
  Blackfin arch: fix the aliased write macros
  Blackfin arch: Update/Fix PM support add new pm_ops valid

16 years agoMerge
Linus Torvalds [Fri, 14 Sep 2007 21:02:04 +0000 (14:02 -0700)]

  [ARM] 4567/1: Fix 'Oops - undefined instruction' when CONFIG_VFP=y on non VFP device
  [ARM] realview: disable second GIC on RevB MPCore platforms

16 years agoMerge branch 'upstream' of git://
Linus Torvalds [Fri, 14 Sep 2007 21:00:35 +0000 (14:00 -0700)]
Merge branch 'upstream' of git://

* 'upstream' of git://
  [MIPS] 20Kc: Disable use of WAIT instruction.
  [MIPS] Workaround for 4Kc machine check exception
  [MIPS] Malta: Fix off by one bug in interrupt handler.
  [MIPS] No ide_default_io_base() if PCI IDE was not found
  [MIPS] Add #include <linux/profile.h> to arch/mips/kernel/time.c
  [MIPS] N32 needs to use compat_sys_futimesat
  [MIPS] rtlx: Fix build error.
  [MIPS] rtlx: fix int vs. long bug.

16 years agoKVM: MMU: Fix rare oops on guest context switch
Avi Kivity [Fri, 14 Sep 2007 17:26:06 +0000 (20:26 +0300)]
KVM: MMU: Fix rare oops on guest context switch

A guest context switch to an uncached cr3 can require allocation of
shadow pages, but we only recycle shadow pages in kvm_mmu_page_fault().

Move shadow page recycling to mmu_topup_memory_caches(), which is called
from both the page fault handler and from guest cr3 reload.

Signed-off-by: Avi Kivity <>
Signed-off-by: Linus Torvalds <>
16 years agoMerge branch 'master' of ssh://
Linus Torvalds [Fri, 14 Sep 2007 20:59:05 +0000 (13:59 -0700)]
Merge branch 'master' of ssh:///linux/kernel/git/mchehab/v4l-dvb

* 'master' of ssh://
  V4L/DVB (6220a): fix build error for et61x251 driver
  V4L/DVB (6188): Avoid a NULL pointer dereference during mpeg_open()
  V4L/DVB (6173a): Documentation: Remove reference to dead "cpia_pp=" boot-time option
  V4L/DVB (6148): Fix a warning at saa7191_probe
  V4L/DVB (6147): Pwc: Fix a broken debug message
  V4L/DVB (6144): Fix mux setup for composite sound on AverTV 307
  V4L/DVB (6095): ivtv: fix VIDIOC_G_ENC_INDEX flag handling

16 years agoCorrectly close old nfsd/lockd sockets.
Neil Brown [Fri, 14 Sep 2007 14:28:08 +0000 (10:28 -0400)]
Correctly close old nfsd/lockd sockets.

Commit aaf68cfbf2241d24d46583423f6bff5c47e088b3 added a bias
to sk_inuse, so this test for an unused socket now fails.  So no
sockets get closed because they are old (they might get closed
if the client closed them).

This bug has existed since 2.6.21-rc1.

Thanks to Wolfgang Walter for finding and reporting the bug.

Cc: Wolfgang Walter <>
Signed-off-by: Neil Brown <>
Signed-off-by: J. Bruce Fields <>
Signed-off-by: Linus Torvalds <>
16 years agoFix kernel buuild with (CONFIG_COMPAT && ! CONFIG_BLOCK) [Thu, 13 Sep 2007 23:28:56 +0000 (01:28 +0200)]
Fix kernel buuild with (CONFIG_COMPAT && ! CONFIG_BLOCK)

Commit 02a5e0acb3cb85d80d0fe834e366d38a92bbaa22 ("BLOCK: Hide the
contents of linux/bio.h if CONFIG_BLOCK=n") broke the kernel build for

    CC      fs/compat_ioctl.o
  In file included from include/linux/raid/md_k.h:19,
                   from include/linux/raid/md.h:54,
                   from fs/compat_ioctl.c:25:
  include/linux/raid/../../../drivers/md/dm-bio-list.h: In bio_list_:
  include/linux/raid/../../../drivers/md/dm-bio-list.h:40: error: dereferencing pointer to incomplete type
  include/linux/raid/../../../drivers/md/dm-bio-list.h: In bio_list_:
  include/linux/raid/../../../drivers/md/dm-bio-list.h:48: error: dereferencing pointer to incomplete type
  include/linux/raid/../../../drivers/md/dm-bio-list.h:51: error: dereferencing pointer to incomplete type
  include/linux/raid/../../../drivers/md/dm-bio-list.h: In bio_list_:
  include/linux/raid/../../../drivers/md/dm-bio-list.h:64: error: dereferencing pointer to incomplete type
  include/linux/raid/../../../drivers/md/dm-bio-list.h: In bio_list_merge_:
  include/linux/raid/../../../drivers/md/dm-bio-list.h:78: error: dereferencing pointer to incomplete type
  include/linux/raid/../../../drivers/md/dm-bio-list.h: In bio_list_:
  include/linux/raid/../../../drivers/md/dm-bio-list.h:90: error: dereferencing pointer to incomplete type
  include/linux/raid/../../../drivers/md/dm-bio-list.h:94: error: dereferencing pointer to incomplete type
  make[1]: *** [fs/compat_ioctl.o] Error 1
  make: *** [fs] Error 2

Signed-off-by: Andreas Herrmann <>
Acked-By: David Howells <>
Signed-off-by: Linus Torvalds <>
16 years agoshared tag queue barrier comment
Nick Piggin [Fri, 14 Sep 2007 06:41:12 +0000 (08:41 +0200)]
shared tag queue barrier comment

Should add some comments for the tag barriers (they won't be so important
if we can switch over to the explicit _lock bitops, but for now we should
make it clear).

Jens' original patch said a barrier after the test_and_clear_bit was also
required. I can't see why (and it would prevent the use of the _lock bitop).

Acked-by: Jens Axboe <>
Signed-off-by: Linus Torvalds <>

16 years agoAs struct iw_point is bi-directional payload, we should copy back the content
Masakazu Mokuno [Fri, 14 Sep 2007 18:35:38 +0000 (14:35 -0400)]
As struct iw_point is bi-directional payload, we should copy back the content
on return from ioctl calls

Signed-off-by: Masakazu Mokuno <>
Signed-off-by: John W. Linville <>
16 years ago[PATCH] bcm43xx: Fix cancellation of work queue crashes
Larry Finger [Tue, 4 Sep 2007 19:14:20 +0000 (14:14 -0500)]
[PATCH] bcm43xx: Fix cancellation of work queue crashes

A crash upon booting that is caused by bcm43xx has been reported [1] and
found to be due to a work queue being reinitialized while work on that
queue is still pending. This fix modifies the shutdown of work queues and
prevents periodic work from being requeued during shutdown. With this patch,
no more crashes on reboot were observed by the original reporter. I do not
get that particular failure on my system; however, when running a large
number of ifdown/ifup sequences, my system would kernel panic with the
'caps lock' light blinking at roughly a 1 Hz rate. In addition, there were
infrequent failures in the firmware that resulted in 'IRQ READY TIMEOUT'
errors. With this patch, no more of the first type of failure occur, and
incidence of the second type is greatly reduced.


Signed-off-by: Larry Finger <>
Acked-by: Michael Buesch <>
Signed-off-by: John W. Linville <>
16 years ago[MIPS] 20Kc: Disable use of WAIT instruction.
Ralf Baechle [Fri, 14 Sep 2007 18:08:43 +0000 (19:08 +0100)]
[MIPS] 20Kc: Disable use of WAIT instruction.

Another issue with 20Kc's WAIT, waiting for more details.  With the
2.6.23 release immindent simply disable the use of WAIT instead of a
more fancy workaround.

Signed-off-by: Ralf Baechle <>
16 years ago[MIPS] Workaround for 4Kc machine check exception
Maciej W. Rozycki [Wed, 23 Aug 2006 13:26:50 +0000 (14:26 +0100)]
[MIPS] Workaround for 4Kc machine check exception

Signed-off-by: Maciej W. Rozycki <>
Signed-off-by: Ralf Baechle <>
16 years ago[MIPS] Malta: Fix off by one bug in interrupt handler.
Ralf Baechle [Thu, 13 Sep 2007 16:36:22 +0000 (17:36 +0100)]
[MIPS] Malta: Fix off by one bug in interrupt handler.

Fairly cosmetic as it would only affect VSMP / SMTC kernels that don't
use vectored interrupts.

Found by Beth.

Signed-off-by: Ralf Baechle <>
16 years ago[MIPS] No ide_default_io_base() if PCI IDE was not found
Atsushi Nemoto [Tue, 4 Sep 2007 14:02:02 +0000 (23:02 +0900)]
[MIPS] No ide_default_io_base() if PCI IDE was not found

Revert b5438582090406e2ccb4169d9b2df7c9939ae42b and add
no_pci_devices() check to avoid crash due to early calling of

Signed-off-by: Atsushi Nemoto <>
Signed-off-by: Ralf Baechle <>
16 years ago[MIPS] Add #include <linux/profile.h> to arch/mips/kernel/time.c
Yoichi Yuasa [Thu, 13 Sep 2007 04:13:28 +0000 (13:13 +0900)]
[MIPS] Add #include <linux/profile.h> to arch/mips/kernel/time.c

It refer to CPU_PROFILING.

arch/mips/kernel/time.c: In function 'local_timer_interrupt':
arch/mips/kernel/time.c:142: error: implicit declaration of function 'profile_tick'
arch/mips/kernel/time.c:142: error: 'CPU_PROFILING' undeclared (first use in this function)
arch/mips/kernel/time.c:142: error: (Each undeclared identifier is reported only once
arch/mips/kernel/time.c:142: error: for each function it appears in.)

Signed-off-by: Yoichi Yuasa <>
Signed-off-by: Ralf Baechle <>
16 years ago[MIPS] N32 needs to use compat_sys_futimesat
Johannes Dickgreber [Wed, 12 Sep 2007 16:22:04 +0000 (18:22 +0200)]
[MIPS] N32 needs to use compat_sys_futimesat

Signed-off-by: Ralf Baechle <>
16 years ago[MIPS] rtlx: Fix build error.
Ralf Baechle [Wed, 12 Sep 2007 15:32:54 +0000 (16:32 +0100)]
[MIPS] rtlx: Fix build error.

  CC      arch/mips/kernel/rtlx.o
cc1: warnings being treated as errors
arch/mips/kernel/rtlx.c:59: warning: 'irq' defined but not used
arch/mips/kernel/rtlx.c:60: warning: 'irq_num' defined but not used

Signed-off-by: Ralf Baechle <>
16 years ago[MIPS] rtlx: fix int vs. long bug.
Ralf Baechle [Wed, 12 Sep 2007 15:31:12 +0000 (16:31 +0100)]
[MIPS] rtlx: fix int vs. long bug.

  CC      arch/mips/kernel/rtlx.o
arch/mips/kernel/rtlx.c: In function 'rtlx_init':
arch/mips/kernel/rtlx.c:114: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'

Signed-off-by: Ralf Baechle <>
16 years agoV4L/DVB (6220a): fix build error for et61x251 driver
Linus Torvalds [Fri, 14 Sep 2007 00:09:01 +0000 (21:09 -0300)]
V4L/DVB (6220a): fix build error for et61x251 driver

Signed-off-by: Mauro Carvalho Chehab <>
16 years agoV4L/DVB (6188): Avoid a NULL pointer dereference during mpeg_open()
Steven Toth [Fri, 7 Sep 2007 01:48:35 +0000 (22:48 -0300)]
V4L/DVB (6188): Avoid a NULL pointer dereference during mpeg_open()

Bug: With a hardware encoder board installed as cx88[1] and a
non-encoder boards installed as cx88[0], an OOPS is generated
during cx8802_get_device() called from mpeg_open().

Signed-off-by: Steven Toth <>
Signed-off-by: Mauro Carvalho Chehab <>
16 years agoV4L/DVB (6173a): Documentation: Remove reference to dead "cpia_pp=" boot-time option
Robert P. J. Day [Mon, 3 Sep 2007 12:35:04 +0000 (09:35 -0300)]
V4L/DVB (6173a): Documentation: Remove reference to dead "cpia_pp=" boot-time option

Since this boot-time option was removed in commit
9ab7e323af9f9efad3e20a14faa4d947adfac381, delete the reference to it.

Signed-off-by: Robert P. J. Day <>
Signed-off-by: Mauro Carvalho Chehab <>
16 years agoV4L/DVB (6148): Fix a warning at saa7191_probe
Mauro Carvalho Chehab [Mon, 3 Sep 2007 15:01:51 +0000 (12:01 -0300)]
V4L/DVB (6148): Fix a warning at saa7191_probe

saa7191.c: In function 'saa7191_probe':
saa7191.c:596: warning: passing argument 3 of
'saa7191_write_block' discards qualifiers from pointer target type

Signed-off-by: Mauro Carvalho Chehab <>
16 years agoV4L/DVB (6147): Pwc: Fix a broken debug message
Jean Delvare [Mon, 3 Sep 2007 14:51:51 +0000 (11:51 -0300)]
V4L/DVB (6147): Pwc: Fix a broken debug message

Commit 85237f202d46d55c1bffe0c5b1aa3ddc0f1dce4d introduced the
following warning (with CONFIG_USB_PWC_DEBUG=y):
drivers/media/video/pwc/pwc-if.c: In function "pwc_video_close":
drivers/media/video/pwc/pwc-if.c:1211: warning: "i" may be used uninitialized in this function

This is true, and can cause a broken debug message to be logged.
Here's a fix.

Signed-off-by: Jean Delvare <>
Signed-off-by: Mauro Carvalho Chehab <>
16 years agoV4L/DVB (6144): Fix mux setup for composite sound on AverTV 307
Stas Sergeev [Sun, 2 Sep 2007 06:56:18 +0000 (03:56 -0300)]
V4L/DVB (6144): Fix mux setup for composite sound on AverTV 307

Right now the composite sound input doesn't work on AverTV 307 because of
the wrong mux setup.  The composite sound is routed via an external
4channel multiplexer controlled by GPIO, while the code assumes an internal
multiplexer instead.

Presumably this was a copy/paste error, and noone have ever tested the

With the attached patch it works properly, which gives me an ability to
finally watch the cable TV under linux.

Signed-off-by: Stas Sergeev <>
Signed-off-by: Andrew Morton <>
Acked-by: Nickolay V. Shmyrev <>
Signed-off-by: Mauro Carvalho Chehab <>
16 years agoV4L/DVB (6095): ivtv: fix VIDIOC_G_ENC_INDEX flag handling
Hans Verkuil [Thu, 23 Aug 2007 20:48:41 +0000 (17:48 -0300)]
V4L/DVB (6095): ivtv: fix VIDIOC_G_ENC_INDEX flag handling

Due to a documentation bug (the type mask is 3 bits long, not 2) the wrong
frame types were filled in: the B and P frame types were swapped.

This bug also hid a second bug: when a capture is stopped a last entry is
written into the pgm index buffer with internal type 0, denoting the end
of the program. This entry wasn't ignored, instead it was accidentally
returned to the caller as a P frame.

Signed-off-by: Hans Verkuil <>
Signed-off-by: Mauro Carvalho Chehab <>
16 years agoMerge
Linus Torvalds [Thu, 13 Sep 2007 15:43:38 +0000 (08:43 -0700)]
Merge /pub/scm/linux/kernel/git/gregkh/usb-2.6

  Revert "usb-storage: implement autosuspend"
  USB: disable autosuspend by default for non-hubs

16 years agoFix race with shared tag queue maps
Jens Axboe [Thu, 13 Sep 2007 12:26:53 +0000 (14:26 +0200)]
Fix race with shared tag queue maps

There's a race condition in blk_queue_end_tag() for shared tag maps,
users include stex (promise supertrak thingy) and qla2xxx.  The former
at least has reported bugs in this area, not sure why we haven't seen
any for the latter.  It could be because the window is narrow and that
other conditions in the qla2xxx code hide this.  It's a real bug,
though, as the stex smp users can attest.

We need to ensure two things - the tag bit clearing needs to happen
AFTER we cleared the tag pointer, as the tag bit clearing/setting is
what protects this map.  Secondly, we need to ensure that the visibility
of the tag pointer and tag bit clear are ordered properly.

[ I removed the SMP barriers - "test_and_clear_bit()" already implies
  all the required barriers.  -- Linus ]

Also see

Signed-off-by: Jens Axboe <>
Signed-off-by: Linus Torvalds <>
16 years agoFix this Paul Simon song's name
Jean Delvare [Thu, 13 Sep 2007 10:19:46 +0000 (12:19 +0200)]
Fix this Paul Simon song's name

Signed-off-by: Jean Delvare <>
Signed-off-by: Linus Torvalds <>
16 years agoradeonfb: fix chip definition for Radeon Xpress 200M 0x5975 [Tue, 11 Sep 2007 18:37:37 +0000 (20:37 +0200)]
radeonfb: fix chip definition for Radeon Xpress 200M 0x5975

This fixes a problem introduced with commit
The commit added a wrong chip definition to radeonfb which causes
a blank console on my Laptop if radeonfb is loaded.

The patch
 - renames PCI_CHIP_RS485_5975 to PCI_CHIP_RS482_5975
 - corrects the chip family (RS480 instead of R300) for 0x5975
 - ensures that PCI IDs are in ascending order in ati_ids.h

Signed-off-by: Andreas Herrmann <>
Tentatively-acked-by: Ben Herrenschmidt <>
Signed-off-by: Linus Torvalds <>
16 years agoradeonfb: fix setting of PPLL_REF_DIV for RV370 5B60. [Tue, 11 Sep 2007 18:22:28 +0000 (20:22 +0200)]
radeonfb: fix setting of PPLL_REF_DIV for RV370 5B60.

As observed with various Radeon X300 cards console goes blank
without that fix.

Acked-by: Benjamin Herrenschmidt <>
Signed-off-by: Andreas Herrmann <>
Signed-off-by: Linus Torvalds <>
16 years ago[ARM] 4567/1: Fix 'Oops - undefined instruction' when CONFIG_VFP=y on non VFP device
Tzachi Perelstein [Sun, 9 Sep 2007 13:24:59 +0000 (14:24 +0100)]
[ARM] 4567/1: Fix 'Oops - undefined instruction' when CONFIG_VFP=y on non VFP device

vfp_init() takes care of the condition when CONFIG_VFP=y but no real VFP
device exists. However, when this condition is true, a compiler might
misplace code lines in a way that will break this support. (To be more
specific - fmrx(FPSID) might be executed before vfp_testing_entry
assignment, which will end up with Oops - undefined instruction).
This patch adds a barrier() to guarantee the right execution ordering.

Signed-off-by: Assaf Hoffman
Signed-off-by: Russell King <>
16 years ago[ARM] realview: disable second GIC on RevB MPCore platforms
Russell King [Mon, 3 Sep 2007 08:43:54 +0000 (09:43 +0100)]
[ARM] realview: disable second GIC on RevB MPCore platforms

The second GIC asserts a permanent interrupt on Rev.B MPCore platforms.
Disable initialisation of this GIC to avoid unbootable systems.

Signed-off-by: Russell King <>
16 years agoRevert "usb-storage: implement autosuspend"
Greg Kroah-Hartman [Thu, 13 Sep 2007 13:01:24 +0000 (06:01 -0700)]
Revert "usb-storage: implement autosuspend"

This reverts commit 8dfe4b14869fd185ca25ee88b02ada58a3005eaf.

There are a number of issues still remaining in usb-storage autosuspend,
so, to be safe, we need to revert this for now.

Acked-by: Oliver Neukum <>
Signed-off-by: Greg Kroah-Hartman <>
16 years agoUSB: disable autosuspend by default for non-hubs
Alan Stern [Mon, 20 Aug 2007 14:48:05 +0000 (10:48 -0400)]
USB: disable autosuspend by default for non-hubs

This patch (as965) disables autosuspend by default for all USB devices
other than hubs.  We are seeing too many devices that can't suspend or
resume properly, the blacklist is growing unreasonably quickly, and
this sort of thing should be handled in userspace.

Signed-off-by: Alan Stern <>
Cc: stable <>
Signed-off-by: Greg Kroah-Hartman <>
16 years agospidernet: fix interrupt reason recognition
Ishizaki Kou [Mon, 20 Aug 2007 13:13:27 +0000 (22:13 +0900)]
spidernet: fix interrupt reason recognition

This patch solves a problem that the spidernet driver sometimes fails
to handle IRQ.

The problem happens because,
- In Cell architecture, interrupts may arrive at an interrupt
  controller, even if they are masked by the setting on registers of
  devices. It happens when interrupt packets are sent just before
  the interrupts are masked.
- spidernet interrupt handler compares interrupt reasons with
  interrupt masks, so when such interrupts occurs, spidernet interrupt
  handler returns IRQ_NONE.
- When all of interrupt handler return IRQ_NONE, linux kernel disables
  the IRQ and it no longer delivers interrupts to the interrupt handlers.

spidernet doesn't work after above sequence, because it can't receive

This patch changes spidernet interrupt handler that it compares
interrupt reason with SPIDER_NET_INTX_MASK_VALUE.

Signed-off-by: Kou Ishizaki <>
Signed-off-by: Jeff Garzik <>
16 years agoehea: fix last_rx update
Jan-Bernd Themann [Fri, 7 Sep 2007 10:30:24 +0000 (12:30 +0200)]
ehea: fix last_rx update

Update last_rx in registered device struct instead of
in the dummy device.

Signed-off-by: Jan-Bernd Themann <>
Signed-off-by: Jeff Garzik <>
16 years agoehea: propagate physical port state
Jan-Bernd Themann [Fri, 7 Sep 2007 10:30:17 +0000 (12:30 +0200)]
ehea: propagate physical port state

Introduces a module parameter to decide whether the physical
port link state is propagated to the network stack or not.
It makes sense not to take the physical port state into account
on machines with more logical partitions that communicate
with each other. This is always possible no matter what the physical
port state is. Thus eHEA can be considered as a switch there.

Signed-off-by: Jan-Bernd Themann <>
Signed-off-by: Jeff Garzik <>
16 years agoFix a lock problem in generic phy code
Hans-Jürgen Koch [Fri, 31 Aug 2007 12:30:08 +0000 (14:30 +0200)]
Fix a lock problem in generic phy code

Lock debugging finds a problem in phy.c and phy_device.c,
this patch fixes it. Tested on an AT91SAM9263-EK board,
kernel 2.6.23-rc4.

Signed-off-by: Hans J. Koch <>
Signed-off-by: Jeff Garzik <>
16 years agosky2: restore multicast list on resume and other ops
Stephen Hemminger [Wed, 5 Sep 2007 15:56:19 +0000 (16:56 +0100)]
sky2: restore multicast list on resume and other ops

Need to restore multicast settings on resume and after 'ethtool -r'.

Signed-off-by: Stephen Hemminger <>
Signed-off-by: Jeff Garzik <>