09 Dec, 2006

4 commits

  • This patch replaces bitreverse() by bitrev32. The only users of bitreverse()
    are crc32 itself and via-velocity.

    Cc: Jeff Garzik
    Cc: Matt Domsch
    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This patch provides two bit reverse functions and bit reverse table.

    - reverse the order of bits in a u32 value

    u8 bitrev8(u8 x);

    - reverse the order of bits in a u32 value

    u32 bitrev32(u32 x);

    - byte reverse table

    const u8 byte_rev_table[256];

    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This makes i386 use the generic BUG machinery. There are no functional
    changes from the old i386 implementation.

    The main advantage in using the generic BUG machinery for i386 is that the
    inlined overhead of BUG is just the ud2a instruction; the file+line(+function)
    information are no longer inlined into the instruction stream. This reduces
    cache pollution, and makes disassembly work properly.

    Signed-off-by: Jeremy Fitzhardinge
    Cc: Andi Kleen
    Cc: Hugh Dickens
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeremy Fitzhardinge
     
  • This patch adds common handling for kernel BUGs, for use by architectures as
    they wish. The code is derived from arch/powerpc.

    The advantages of having common BUG handling are:
    - consistent BUG reporting across architectures
    - shared implementation of out-of-line file/line data
    - implement CONFIG_DEBUG_BUGVERBOSE consistently

    This means that in inline impact of BUG is just the illegal instruction
    itself, which is an improvement for i386 and x86-64.

    A BUG is represented in the instruction stream as an illegal instruction,
    which has file/line information associated with it. This extra information is
    stored in the __bug_table section in the ELF file.

    When the kernel gets an illegal instruction, it first confirms it might
    possibly be from a BUG (ie, in kernel mode, the right illegal instruction).
    It then calls report_bug(). This searches __bug_table for a matching
    instruction pointer, and if found, prints the corresponding file/line
    information. If report_bug() determines that it wasn't a BUG which caused the
    trap, it returns BUG_TRAP_TYPE_NONE.

    Some architectures (powerpc) implement WARN using the same mechanism; if the
    illegal instruction was the result of a WARN, then report_bug(Q) returns
    CONFIG_DEBUG_BUGVERBOSE; otherwise it returns BUG_TRAP_TYPE_BUG.

    lib/bug.c keeps a list of loaded modules which can be searched for __bug_table
    entries. The architecture must call
    module_bug_finalize()/module_bug_cleanup() from its corresponding
    module_finalize/cleanup functions.

    Unsetting CONFIG_DEBUG_BUGVERBOSE will reduce the kernel size by some amount.
    At the very least, filename and line information will not be recorded for each
    but, but architectures may decide to store no extra information per BUG at
    all.

    Unfortunately, gcc doesn't have a general way to mark an asm() as noreturn, so
    architectures will generally have to include an infinite loop (or similar) in
    the BUG code, so that gcc knows execution won't continue beyond that point.
    gcc does have a __builtin_trap() operator which may be useful to achieve the
    same effect, unfortunately it cannot be used to actually implement the BUG
    itself, because there's no way to get the instruction's address for use in
    generating the __bug_table entry.

    [randy.dunlap@oracle.com: Handle BUG=n, GENERIC_BUG=n to prevent build errors]
    [bunk@stusta.de: include/linux/bug.h must always #include
    Cc: Andi Kleen
    Cc: Hugh Dickens
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Rusty Russell
    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeremy Fitzhardinge
     

08 Dec, 2006

10 commits

  • * 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6: (156 commits)
    [PATCH] x86-64: Export smp_call_function_single
    [PATCH] i386: Clean up smp_tune_scheduling()
    [PATCH] unwinder: move .eh_frame to RODATA
    [PATCH] unwinder: fully support linker generated .eh_frame_hdr section
    [PATCH] x86-64: don't use set_irq_regs()
    [PATCH] x86-64: check vector in setup_ioapic_dest to verify if need setup_IO_APIC_irq
    [PATCH] x86-64: Make ix86 default to HIGHMEM4G instead of NOHIGHMEM
    [PATCH] i386: replace kmalloc+memset with kzalloc
    [PATCH] x86-64: remove remaining pc98 code
    [PATCH] x86-64: remove unused variable
    [PATCH] x86-64: Fix constraints in atomic_add_return()
    [PATCH] x86-64: fix asm constraints in i386 atomic_add_return
    [PATCH] x86-64: Correct documentation for bzImage protocol v2.05
    [PATCH] x86-64: replace kmalloc+memset with kzalloc in MTRR code
    [PATCH] x86-64: Fix numaq build error
    [PATCH] x86-64: include/asm-x86_64/cpufeature.h isn't a userspace header
    [PATCH] unwinder: Add debugging output to the Dwarf2 unwinder
    [PATCH] x86-64: Clarify error message in GART code
    [PATCH] x86-64: Fix interrupt race in idle callback (3rd try)
    [PATCH] x86-64: Remove unwind stack pointer alignment forcing again
    ...

    Fixed conflict in include/linux/uaccess.h manually

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Make the locking self-test failures (of 'FAILURE' type) easier to debug by
    printing more information.

    Signed-off-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • Always build hweight8/16/32/64() functions into the kernel so that loadable
    modules may use them.

    I didn't remove GENERIC_HWEIGHT since ALPHA_EV67, ia64, and some variants
    of UltraSparc(64) provide their own hweight functions.

    Fixes config/build problems with NTFS=m and JOYSTICK_ANALOG=m.

    Kernel: arch/x86_64/boot/bzImage is ready (#19)
    Building modules, stage 2.
    MODPOST 94 modules
    WARNING: "hweight32" [fs/ntfs/ntfs.ko] undefined!
    WARNING: "hweight16" [drivers/input/joystick/analog.ko] undefined!
    WARNING: "hweight8" [drivers/input/joystick/analog.ko] undefined!
    make[1]: *** [__modpost] Error 1
    make: *** [modules] Error 2

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Burman Yan
     
  • There was lots of #ifdef noise in the kernel due to hotcpu_notifier(fn,
    prio) not correctly marking 'fn' as used in the !HOTPLUG_CPU case, and thus
    generating compiler warnings of unused symbols, hence forcing people to add
    #ifdefs.

    the compiler can skip truly unused functions just fine:

    text data bss dec hex filename
    1624412 728710 3674856 6027978 5bfaca vmlinux.before
    1624412 728710 3674856 6027978 5bfaca vmlinux.after

    [akpm@osdl.org: topology.c fix]
    Signed-off-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • This allows a hyphenated range of positive numbers in the string passed
    to command line helper function, get_options.

    Currently the command line option "isolcpus=" takes as its argument a
    list of cpus.

    Format: ,...,
    Valid values of include all cpus, 0 to "number of CPUs in
    system - 1". This can get extremely long when isolating the majority of
    cpus on a large system. The kernel isolcpus code would not need any
    changing to use this feature. To use it, the change would be in the
    command line format for 'isolcpus='
    Format:
    ,...,
    or
    - (must be a positive range in ascending
    order.)
    or a mixture
    ,...,-

    Signed-off-by: Derek Fults
    Cc: "Randy.Dunlap"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Derek Fults
     
  • Print the other (hopefully) known good pointer when list_head debugging
    too, which may yield additional clues.

    Also fix for 80-columns to win akpm brownie points.

    Signed-off-by: Dave Jones
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Jones
     
  • Make PRINTK_TIME depend on PRINTK. Only display/offer it if PRINTK is
    enabled.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Make radix tree lookups safe to be performed without locks. Readers are
    protected against nodes being deleted by using RCU based freeing. Readers
    are protected against new node insertion by using memory barriers to ensure
    the node itself will be properly written before it is visible in the radix
    tree.

    Each radix tree node keeps a record of their height (above leaf nodes).
    This height does not change after insertion -- when the radix tree is
    extended, higher nodes are only inserted in the top. So a lookup can take
    the pointer to what is *now* the root node, and traverse down it even if
    the tree is concurrently extended and this node becomes a subtree of a new
    root.

    "Direct" pointers (tree height of 0, where root->rnode points directly to
    the data item) are handled by using the low bit of the pointer to signal
    whether rnode is a direct pointer or a pointer to a radix tree node.

    When a reader wants to traverse the next branch, they will take a copy of
    the pointer. This pointer will be either NULL (and the branch is empty) or
    non-NULL (and will point to a valid node).

    [akpm@osdl.org: cleanups]
    [Lee.Schermerhorn@hp.com: bugfixes, comments, simplifications]
    [clameter@sgi.com: build fix]
    Signed-off-by: Nick Piggin
    Cc: "Paul E. McKenney"
    Signed-off-by: Lee Schermerhorn
    Cc: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     
  • Replace all uses of kmem_cache_t with struct kmem_cache.

    The patch was generated using the following script:

    #!/bin/sh
    #
    # Replace one string by another in all the kernel sources.
    #

    set -e

    for file in `find * -name "*.c" -o -name "*.h"|xargs grep -l $1`; do
    quilt add $file
    sed -e "1,\$s/$1/$2/g" $file >/tmp/$$
    mv /tmp/$$ $file
    quilt refresh
    done

    The script was run like this

    sh replace kmem_cache_t "struct kmem_cache"

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

07 Dec, 2006

1 commit

  • When a spinlock lockup occurs, arrange for the NMI code to emit an all-cpu
    backtrace, so we get to see which CPU is holding the lock, and where.

    Cc: Andi Kleen
    Cc: Ingo Molnar
    Cc: Badari Pulavarty
    Signed-off-by: Andrew Morton
    Signed-off-by: Andi Kleen

    Andrew Morton
     

05 Dec, 2006

1 commit

  • * master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc: (194 commits)
    [POWERPC] Add missing EXPORTS for mpc52xx support
    [POWERPC] Remove obsolete PPC_52xx and update CLASSIC32 comment
    [POWERPC] ps3: add a default zImage target
    [POWERPC] Add of_platform_bus support to mpc52xx psc uart driver
    [POWERPC] typo fix and whitespace cleanup on mpc52xx-uart driver
    [POWERPC] Fix debug printks for 32-bit resources in the PCI code
    [POWERPC] Replace kmalloc+memset with kzalloc
    [POWERPC] Linkstation / kurobox support
    [POWERPC] Add the e300c3 core to the CPU table.
    [POWERPC] ppc: m48t35 add missing bracket
    [POWERPC] iSeries: don't build head_64.o unnecessarily
    [POWERPC] iSeries: stop dt_mod.o being rebuilt unnecessarily
    [POWERPC] Fix cputable.h for combined build
    [POWERPC] Allow CONFIG_BOOTX_TEXT on iSeries
    [POWERPC] Allow xmon to build on legacy iSeries
    [POWERPC] Change ppc64_defconfig to use AUTOFS_V4 not V3
    [POWERPC] Tell firmware we can handle POWER6 compatible mode
    [POWERPC] Clean images in arch/powerpc/boot
    [POWERPC] Fix OF pci flags parsing
    [POWERPC] defconfig for lite5200 board
    ...

    Linus Torvalds
     

04 Dec, 2006

2 commits


02 Dec, 2006

2 commits

  • * master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (36 commits)
    Driver core: show drivers in /sys/module/
    Documentation/driver-model/platform.txt update/rewrite
    Driver core: platform_driver_probe(), can save codespace
    driver core: Use klist_remove() in device_move()
    driver core: Introduce device_move(): move a device to a new parent.
    Driver core: make drivers/base/core.c:setup_parent() static
    driver core: Introduce device_find_child().
    sysfs: sysfs_write_file() writes zero terminated data
    cpu topology: consider sysfs_create_group return value
    Driver core: Call platform_notify_remove later
    ACPI: Change ACPI to use dev_archdata instead of firmware_data
    Driver core: add dev_archdata to struct device
    Driver core: convert sound core to use struct device
    Driver core: change mem class_devices to be real devices
    Driver core: convert fb code to use struct device
    Driver core: convert firmware code to use struct device
    Driver core: convert mmc code to use struct device
    Driver core: convert ppdev code to use struct device
    Driver core: convert PPP code to use struct device
    Driver core: convert cpuid code to use struct device
    ...

    Linus Torvalds
     
  • Provide a function device_move() to move a device to a new parent device. Add
    auxilliary functions kobject_move() and sysfs_move_dir().
    kobject_move() generates a new uevent of type KOBJ_MOVE, containing the
    previous path (DEVPATH_OLD) in addition to the usual values. For this, a new
    interface kobject_uevent_env() is created that allows to add further
    environmental data to the uevent at the kobject layer.

    Signed-off-by: Cornelia Huck
    Acked-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Cornelia Huck
     

30 Nov, 2006

1 commit

  • Changes persistant -> persistent. www.dictionary.com does not know
    persistant (with an A), but should it be one of those things you can
    spell in more than one correct way, let me know.

    Signed-off-by: Jan Engelhardt
    Signed-off-by: Adrian Bunk

    Jan Engelhardt
     

30 Oct, 2006

1 commit

  • * master.kernel.org:/home/rmk/linux-2.6-arm:
    [ARM] 3914/1: [Jornada7xx] - Typo Fix in cpu-sa1110.c (b != B)
    [ARM] 3913/1: n2100: fix IRQ routing for second ethernet port
    [ARM] Add KBUILD_IMAGE target support
    [ARM] Fix suspend oops caused by PXA2xx PCMCIA driver
    [ARM] Fix i2c-pxa slave mode support
    [ARM] 3900/1: Fix VFP Division by Zero exception handling.
    [ARM] 3899/1: Fix the normalization of the denormal double precision number.
    [ARM] 3909/1: Disable UWIND_INFO for ARM (again)
    [ARM] Add __must_check to uaccess functions
    [ARM] Add realview SMP default configuration
    [ARM] Fix SMP irqflags support

    Linus Torvalds
     

29 Oct, 2006

1 commit

  • strstrip() does not remove the last blank from strings which only consist
    of blanks.

    Example:
    char string[] = " ";
    strstrip(string);

    results in " ", but should produce an empty string!

    The following patch solves this problem:

    Acked-by: Martin Schwidefsky
    Signed-off-by: Michael Holzheu
    Acked-by: Pekka Enberg
    Acked-by Joern Engel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Holzheu
     

28 Oct, 2006

1 commit


21 Oct, 2006

1 commit

  • Qooting Adrian:

    - net/sunrpc/svc.c uses highest_possible_node_id()

    - include/linux/nodemask.h says highest_possible_node_id() is
    out-of-line #if MAX_NUMNODES > 1

    - the out-of-line highest_possible_node_id() is in lib/cpumask.c

    - lib/Makefile: lib-$(CONFIG_SMP) += cpumask.o
    CONFIG_ARCH_DISCONTIGMEM_ENABLE=y, CONFIG_SMP=n, CONFIG_SUNRPC=y

    -> highest_possible_node_id() is used in net/sunrpc/svc.c
    CONFIG_NODES_SHIFT defined and > 0

    -> include/linux/numa.h: MAX_NUMNODES > 1

    -> compile error

    The bug is not present on architectures where ARCH_DISCONTIGMEM_ENABLE
    depends on NUMA (but m32r isn't the only affected architecture).

    So move the function into page_alloc.c

    Cc: Adrian Bunk
    Cc: Paul Jackson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

17 Oct, 2006

3 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
    Input: fm801-gp - handle errors from pci_enable_device()
    Input: gameport core - handle errors returned by device_bind_driver()
    Input: serio core - handle errors returned by device_bind_driver()
    Lockdep: fix compile error in drivers/input/serio/serio.c
    Input: serio - add lockdep annotations
    Lockdep: add lockdep_set_class_and_subclass() and lockdep_set_subclass()
    Input: atkbd - supress "too many keys" error message
    Input: i8042 - supress ACK/NAKs when blinking during panic
    Input: add missing exports to fix modular build

    Linus Torvalds
     
  • This library function should be in obj-y and not in lib-y. But when we do
    that it clashes unpleasantly with the assembly-language implementation in the
    ia64 architecture.

    Instead of trying to fix it all up, just remove the generic carta_random32 in
    the expectation that the recently-made-generic random32() will suffice.

    If/when perfmon is migrated to random32, ia64's private carta_random32
    implementation can also be removed.

    Cc: Stephane Eranian
    Cc: "Luck, Tony"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Make net_random() more widely available by calling it random32

    akpm: hopefully this will permit the removal of carta_random32. That needs
    confirmation from Stephane - this code looks somewhat more computationally
    expensive, and has a different (ie: callee-stateful) interface.

    [akpm@osdl.org: lots of build fixes, cleanups]
    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller
    Cc: Stephane Eranian
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Hemminger
     

13 Oct, 2006

1 commit


12 Oct, 2006

4 commits

  • lib/bitmap.c:bitmap_parse() is a library function that received as input a
    user buffer. This seemed to have originated from the way the write_proc
    function of the /proc filesystem operates.

    This has been reworked to not use kmalloc and eliminates a lot of
    get_user() overhead by performing one access_ok before using __get_user().

    We need to test if we are in kernel or user space (is_user) and access the
    buffer differently. We cannot use __get_user() to access kernel addresses
    in all cases, for example in architectures with separate address space for
    kernel and user.

    This function will be useful for other uses as well; for example, taking
    input for /sysfs instead of /proc, so it was changed to accept kernel
    buffers. We have this use for the Linux UWB project, as part as the
    upcoming bandwidth allocator code.

    Only a few routines used this function and they were changed too.

    Signed-off-by: Reinette Chatre
    Signed-off-by: Inaky Perez-Gonzalez
    Cc: Paul Jackson
    Cc: Joe Korty
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Reinette Chatre
     
  • This is a follow-up patch based on the review for perfmon2. This patch
    adds the carta_random32() library routine + carta_random32.h header file.

    This is fast, simple, and efficient pseudo number generator algorithm. We
    use it in perfmon2 to randomize the sampling periods. In this context, we
    do not need any fancy randomizer.

    Signed-off-by: stephane eranian
    Cc: David Mosberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephane Eranian
     
  • In order to encourage people to notice when they break the exported
    headers, add a config option which automatically runs the sanity checks
    when building vmlinux. That way, those who use allyesconfig will notice
    failures.

    Signed-off-by: David Woodhouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Woodhouse
     
  • We got several false bug reports because of enabled
    CONFIG_DETECT_SOFTLOCKUP. Disable soft lockup detection on s390, since it
    doesn't work on a virtualized architecture.

    Cc: Martin Schwidefsky
    Signed-off-by: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heiko Carstens
     

11 Oct, 2006

3 commits


06 Oct, 2006

1 commit


05 Oct, 2006

1 commit

  • Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
    of passing regs around manually through all ~1800 interrupt handlers in the
    Linux kernel.

    The regs pointer is used in few places, but it potentially costs both stack
    space and code to pass it around. On the FRV arch, removing the regs parameter
    from all the genirq function results in a 20% speed up of the IRQ exit path
    (ie: from leaving timer_interrupt() to leaving do_IRQ()).

    Where appropriate, an arch may override the generic storage facility and do
    something different with the variable. On FRV, for instance, the address is
    maintained in GR28 at all times inside the kernel as part of general exception
    handling.

    Having looked over the code, it appears that the parameter may be handed down
    through up to twenty or so layers of functions. Consider a USB character
    device attached to a USB hub, attached to a USB controller that posts its
    interrupts through a cascaded auxiliary interrupt controller. A character
    device driver may want to pass regs to the sysrq handler through the input
    layer which adds another few layers of parameter passing.

    I've build this code with allyesconfig for x86_64 and i386. I've runtested the
    main part of the code on FRV and i386, though I can't test most of the drivers.
    I've also done partial conversion for powerpc and MIPS - these at least compile
    with minimal configurations.

    This will affect all archs. Mostly the changes should be relatively easy.
    Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

    struct pt_regs *old_regs = set_irq_regs(regs);

    And put the old one back at the end:

    set_irq_regs(old_regs);

    Don't pass regs through to generic_handle_irq() or __do_IRQ().

    In timer_interrupt(), this sort of change will be necessary:

    - update_process_times(user_mode(regs));
    - profile_tick(CPU_PROFILING, regs);
    + update_process_times(user_mode(get_irq_regs()));
    + profile_tick(CPU_PROFILING);

    I'd like to move update_process_times()'s use of get_irq_regs() into itself,
    except that i386, alone of the archs, uses something other than user_mode().

    Some notes on the interrupt handling in the drivers:

    (*) input_dev() is now gone entirely. The regs pointer is no longer stored in
    the input_dev struct.

    (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
    something different depending on whether it's been supplied with a regs
    pointer or not.

    (*) Various IRQ handler function pointers have been moved to type
    irq_handler_t.

    Signed-Off-By: David Howells
    (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)

    David Howells
     

04 Oct, 2006

1 commit


03 Oct, 2006

1 commit

  • It is a non-standard heap-sort algorithm implementation because the index
    of child node is wrong . The sort function still outputs right result, but
    the performance is O( n * ( log(n) + 1 ) ) , about 10% ~ 20% worse than
    standard algorithm.

    Signed-off-by: keios
    Acked-by: Matt Mackall
    Acked-by: Zou Nan hai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    keios