22 Sep, 2007

4 commits

  • When a Fn key is used in combination with another key in ADB keyboards
    it will generate a Fn event and then a second event that can be a
    different key than pressed (Fn + F1 for instance can generate Fn +
    brightness down if it's configured like that). This enables the
    reporting of the Fn key to the input system.

    As Fn is a dead key for most purposes, it's useful to report it so
    applications can make use of it. One example is apple_mouse
    (https://jake.ruivo.org/uinputd/trunk/apple_mouse/) that emulates the
    second and third keys using a combination of keyboard keys and the mouse
    button. Other applications may use the KEY_FN as a modifier as well.
    I've been updating and using this patch for months without problems.

    Signed-off-by: Aristeu Rozanski
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Aristeu Rozanski
     
  • Pretty much everyone uses "__attribute__" or "attribute", no one uses
    "__attribute". This tweaks the three places in asm-powerpc where this
    comes up. While only asm-powerpc/types.h is interesting (for
    userspace), I did asm-powerpc/processor.h as well for consistency.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Paul Mackerras

    Mike Frysinger
     
  • Commit 69331af, "Fixes and cleanups for earlyprintk aka boot console",
    resulted in printk output prior to the initialization of the mpsc
    console driver not being printed. That commit causes the mpsc's
    CON_PRINTBUFFER flag to be cleared since udbg should have printed
    the previous output.

    I guess we can no longer ignore udbg. :)

    This patch provides udbg_putc() and udbg_getc() functions for the
    Marvell mv64x60 chips. These functions are enabled if an mv64x60
    port is to be used as the console as determined from the device tree.

    Signed-off-by: Dale Farnsworth
    Acked-by: Mark A. Greer
    Signed-off-by: Paul Mackerras

    Dale Farnsworth
     
  • This adds the option for the pmac_zilog driver to use the major/minor
    numbers recently allocated specifically for it (/dev/ttyPZn) instead
    of the /dev/ttySn numbers. The advantage of doing this is that it
    allows the pmac_zilog and 8250 drivers to coexist. The disadvantage
    of doing this is that it is a user-visible ABI change and it will
    break existing working setups on powermacs, and could be confusing to
    users.

    Signed-off-by: David Woodhouse
    Signed-off-by: Paul Mackerras

    David Woodhouse
     

20 Sep, 2007

36 commits

  • This patch includes a whole batch of smallish cleanups for
    drivers/mtd/physmap_of.c.

    - A bunch of uneeded #includes are removed
    - We switch to the modern linux/of.h etc. in place of
    asm/prom.h
    - Use some helper macros to avoid some ugly inline #ifdefs
    - A few lines of unreachable code are removed
    - A number of indentation / line-wrapping fixes
    - More consistent use of kernel idioms such as if (!p) instead
    of if (p == NULL)
    - Clarify some printk()s and other informative strings.
    - parse_obsolete_partitions() now returns 0 if no partition
    information is found, instead of returning -ENOENT which the caller
    had to handle specially.
    - (the big one) Despite the name, this driver really has
    nothing to do with drivers/mtd/physmap.c. The fact that the flash
    chips must be physically direct mapped is a constrant, but doesn't
    really say anything about the actual purpose of this driver, which is
    to instantiate MTD devices based on information from the device tree.
    Therefore the physmap name is replaced everywhere within the file with
    "of_flash". The file itself and the Kconfig option is not renamed for
    now (so that the diff is actually a diff). That can come later.

    Signed-off-by: David Gibson
    Signed-off-by: Josh Boyer

    David Gibson
     
  • According to PowerPC 440EPx documentation,
    MAL0 is comprised of four channels (two transmit and two receive).
    Each channel is dedicated to one of two EMAC cores.
    This patch fixes Sequoia DTS MAL0 entry and EMAC entries,
    assigning correct channel numbers to EMACs.

    Signed-off-by: Valentine Barshak
    Signed-off-by: Josh Boyer

    Valentine Barshak
     
  • According to PowerPC 440EP documentation,
    MAL0 consists of 6 channels (4 transmit channels and 2 receive channels)
    This patch fixes Bamboo DTS MAL0 "num-rx-chans" entry.

    Signed-off-by: Valentine Barshak
    Signed-off-by: Josh Boyer

    Valentine Barshak
     
  • The patch adds support for the 64-bit resources to the PCI
    iomap code.

    Signed-off-by: Valentine Barshak
    Acked-by: David Gibson
    Signed-off-by: Josh Boyer

    Valentine Barshak
     
  • Add myself as PowerPC 4xx maintainer and list the git tree

    Signed-off-by: Josh Boyer

    Josh Boyer
     
  • Implement udbg_getc() for 440, which fixes xmon input.

    Signed-off-by: Hollis Blanchard
    Acked-by: David Gibson
    Signed-off-by: Josh Boyer

    Hollis Blanchard
     
  • A new binding for flash devices was recently introduced. This updates the
    Sequoia DTS to use the new binding and enabled MTD in the defconfig.

    Signed-off-by: Josh Boyer
    Acked-by: David Gibson
    Acked-by: Stefan Roese

    Josh Boyer
     
  • A new binding for flash devices was recently introduced. This updates the
    Walnut DTS to use the new binding.

    Signed-off-by: Josh Boyer
    Acked-by: David Gibson

    Josh Boyer
     
  • The latest physmap_of driver has a small error where it will fail the probe
    with:

    physmap-flash: probe of fff00000.small-flas failed with error -2

    if there are no partition subnodes in the device tree and the old style binding
    is not used. Since partition definitions are optional, the probe should still
    succeed.

    Signed-off-by: Josh Boyer
    Acked-by: David Gibson

    Josh Boyer
     
  • Add a cuboot wrapper for the Bamboo board. Additionally, we enable MAC
    address fixups for both cuboot and treeboot.

    This also removes some obsoleted linker declarations that have been
    moved into ops.h

    Signed-off-by: Josh Boyer
    Acked-by: David Gibson

    Josh Boyer
     
  • Paul Mackerras
     
  • * 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
    [MIPS] cpu-bugs64.c: GCC 3.3 constraint workaround
    [MIPS] DEC: Initialise ioasic_ssr_lock

    Linus Torvalds
     
  • * master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb:
    V4L/DVB (6173a): Documentation: Remove reference to dead "cpia_pp=" boot-time option
    Revert "V4L/DVB (6173a): Documentation: Remove reference to dead "cpia_pp=" boot-time option"

    Linus Torvalds
     
  • * 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6:
    [XFS] Avoid replaying inode buffer initialisation log items if on-disk version is newer.
    [XFS] Ensure file size updates have been completed before writing inode to disk.
    [XFS] On-demand reaping of the MRU cache

    Linus Torvalds
     
  • * master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
    [SUNSAB]: Fix several bugs.

    Linus Torvalds
     
  • * master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6:
    ide: remove unused variables from drivers/ide/ppc/pmac.c
    ide: ST320413A has the same problem as ST340823A

    Linus Torvalds
     
  • * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
    [POWERPC] Fix timekeeping on PowerPC 601
    [POWERPC] Don't expose clock vDSO functions when CPU has no timebase
    [POWERPC] spusched: Fix null pointer dereference in find_victim

    Linus Torvalds
     
  • Randy Dunlap noticed an interesting "crashme" behaviour on his dual
    Prescott Xeon setup, where he gets page faults with the error code
    having a zero "user" bit, but the register state points back to user
    mode.

    This may be a CPU microcode buglet triggered by some strange instruction
    pattern that crashme generates, and loading a microcode update seems to
    possibly have fixed it.

    Regardless, we really should trust the register state more than the
    error code, since it's really the register state that determines whether
    we can actually send a signal, or whether we're in kernel mode and need
    to oops/kill the process in the case of a page fault.

    Cc: Randy Dunlap
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Add a workaround to address warnings generated on the "n" constraint by
    GCC 3.3 and below.

    Signed-off-by: Maciej W. Rozycki
    Signed-off-by: Ralf Baechle

    Maciej W. Rozycki
     
  • Fix the definition of the ioasic_ssr_lock spinlock to include a proper
    initialisation.

    Signed-off-by: Maciej W. Rozycki
    Signed-off-by: Ralf Baechle

    Maciej W. Rozycki
     
  • Nested class devices used to have 'device' symlink point to a real
    (physical) device instead of a parent class device. When converting
    subsystems to struct device we need to keep doing what class devices did if
    CONFIG_SYSFS_DEPRECATED is Y, otherwise parts of udev break.

    Signed-off-by: Dmitry Torokhov
    Cc: Kay Sievers
    Acked-by: Greg KH
    Tested-by: Anssi Hannula
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitry Torokhov
     
  • This patch fixes a crash caused by an interrupt coming in when an IRQ stack
    is being torn down. When this happens, handle_signal will loop, setting up
    the IRQ stack again because the tearing down had finished, and handling
    whatever signals had come in.

    However, to_irq_stack returns a mask of pending signals to be handled, plus
    bit zero is set if the IRQ stack was already active, and thus shouldn't be
    torn down. This causes a problem because when handle_signal goes around
    the loop, sig will be zero, and to_irq_stack will duly set bit zero in the
    returned mask, faking handle_signal into believing that it shouldn't tear
    down the IRQ stack and return thread_info pointers back to their original
    values.

    This will eventually cause a crash, as the IRQ stack thread_info will
    continue pointing to the original task_struct and an interrupt will look
    into it after it has been freed.

    The fix is to stop passing a signal number into to_irq_stack. Rather, the
    pending signals mask is initialized beforehand with the bit for sig already
    set. References to sig in to_irq_stack can be replaced with references to
    the mask.

    [akpm@linux-foundation.org: use UL]
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This patch proposes fixes to the reference counting of memory policy in the
    page allocation paths and in show_numa_map(). Extracted from my "Memory
    Policy Cleanups and Enhancements" series as stand-alone.

    Shared policy lookup [shmem] has always added a reference to the policy,
    but this was never unrefed after page allocation or after formatting the
    numa map data.

    Default system policy should not require additional ref counting, nor
    should the current task's task policy. However, show_numa_map() calls
    get_vma_policy() to examine what may be [likely is] another task's policy.
    The latter case needs protection against freeing of the policy.

    This patch adds a reference count to a mempolicy returned by
    get_vma_policy() when the policy is a vma policy or another task's
    mempolicy. Again, shared policy is already reference counted on lookup. A
    matching "unref" [__mpol_free()] is performed in alloc_page_vma() for
    shared and vma policies, and in show_numa_map() for shared and another
    task's mempolicy. We can call __mpol_free() directly, saving an admittedly
    inexpensive inline NULL test, because we know we have a non-NULL policy.

    Handling policy ref counts for hugepages is a bit trickier.
    huge_zonelist() returns a zone list that might come from a shared or vma
    'BIND policy. In this case, we should hold the reference until after the
    huge page allocation in dequeue_hugepage(). The patch modifies
    huge_zonelist() to return a pointer to the mempolicy if it needs to be
    unref'd after allocation.

    Kernel Build [16cpu, 32GB, ia64] - average of 10 runs:

    w/o patch w/ refcount patch
    Avg Std Devn Avg Std Devn
    Real: 100.59 0.38 100.63 0.43
    User: 1209.60 0.37 1209.91 0.31
    System: 81.52 0.42 81.64 0.34

    Signed-off-by: Lee Schermerhorn
    Acked-by: Andi Kleen
    Cc: Christoph Lameter
    Acked-by: Mel Gorman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lee Schermerhorn
     
  • 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

    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

    Pavel Emelyanov
     
  • 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
    hlist_heads.

    Signed-off-by: Pavel Emelyanov
    Signed-off-by: Alexey Dobriyan
    Acked-by: Serge Hallyn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Emelyanov
     
  • kernel/user.c: Convert list_for_each to list_for_each_entry in
    uid_hash_find()

    Signed-off-by: Matthias Kaehlcke
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthias Kaehlcke
     
  • 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 hooanon05@yahoo.co.jp 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

    Eric Sandeen
     
  • 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

    Andrew Morton
     
  • 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:
    [] proc_sys_readdir+0xd3/0x350
    PGD 203067 PUD 207063 PMD 7e216067 PTE 0
    Oops: 0000 [1] SMP
    CPU 1
    Modules linked in: lockd nfs_acl sunrpc
    Pid: 3335, comm: ls Not tainted 2.6.23-rc3-bloat #2
    RIP: 0010:[] [] 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:
    [] filldir+0x0/0xf0
    [] filldir+0x0/0xf0
    [] vfs_readdir+0xa7/0xc0
    [] sys_getdents+0x96/0xe0
    [] 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 [] proc_sys_readdir+0xd3/0x350
    RSP
    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

    Alexey Dobriyan
     
  • 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

    Eric Sandeen
     
  • 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

    Dave Airlie
     
  • 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

    Antonino A. Daplas
     
  • 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

    Jeremy Fitzhardinge
     
  • 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
    auto-load.

    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

    Kees Cook
     
  • 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
    munmap(2)'s.

    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

    Cliff Wickman
     
  • 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

    Atsushi Nemoto