29 Apr, 2008

40 commits

  • Signed-off-by: Harvey Harrison
    Acked-by: OGAWA Hirofumi
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Signed-off-by: Harvey Harrison
    Cc: Petr Vandrovec
    Cc: Antonino Daplas
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Signed-off-by: Harvey Harrison
    Acked-by: Greg Kroah-Hartman
    Cc: Alan Stern
    Cc: David Brownell
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Signed-off-by: Harvey Harrison
    Cc: Dominik Brodowski
    Cc: Daniel Ritz
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Signed-off-by: Harvey Harrison
    Cc: John W. Linville
    Cc: Michael Buesch
    Cc: Daniel Drake
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Signed-off-by: Harvey Harrison
    Cc: Jeff Garzik
    Cc: Auke Kok
    Cc: John Ronciak
    Cc: Jesse Brandeburg
    Cc: Grant Grundler
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Signed-off-by: Harvey Harrison
    Cc: David Brownell
    Cc: Tony Jones
    Cc: Pierre Ossman
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Signed-off-by: Harvey Harrison
    Cc: Dmitry Torokhov
    Cc: Jiri Kosina
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Remove unnecessary temp variable from_buf in snsc_event.c

    Signed-off-by: Harvey Harrison
    Cc: Jiri Slaby
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Signed-off-by: Harvey Harrison
    Acked-by: Jiri Kosina
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Signed-off-by: Harvey Harrison
    Cc: Ed L. Cashin
    Cc: Jens Axboe
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Unaligned access is ok for the following arches:
    cris, m68k, mn10300, powerpc, s390, x86

    Arches that use the memmove implementation for native endian, and
    the byteshifting for the opposite endianness.
    h8300, m32r, xtensa

    Packed struct for native endian, byteshifting for other endian:
    alpha, blackfin, ia64, parisc, sparc, sparc64, mips, sh

    m86knommu is generic_be for Coldfire, otherwise unaligned access is ok.

    frv, arm chooses endianness based on compiler settings, uses the byteshifting
    versions. Remove the unaligned trap handler from frv as it is now unused.

    v850 is le, uses the byteshifting versions for both be and le.

    Remove the now unused asm-generic implementation.

    Signed-off-by: Harvey Harrison
    Acked-by: David S. Miller
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Create a linux/unaligned directory similar in spirit to the linux/byteorder
    folder to hold generic implementations collected from various arches.

    Currently there are five implementations:
    1) packed_struct.h: C-struct based, from asm-generic/unaligned.h
    2) le_byteshift.h: Open coded byte-swapping, heavily based on asm-arm
    3) be_byteshift.h: Open coded byte-swapping, heavily based on asm-arm
    4) memmove.h: taken from multiple implementations in tree
    5) access_ok.h: taken from x86 and others, unaligned access is ok.

    All of the new implementations checks for sizes not equal to 1,2,4,8
    and will fail to link.

    API additions:

    get_unaligned_{le16|le32|le64|be16|be32|be64}(p) which is meant to replace
    code of the form:
    le16_to_cpu(get_unaligned((__le16 *)p));

    put_unaligned_{le16|le32|le64|be16|be32|be64}(val, pointer) which is meant to
    replace code of the form:
    put_unaligned(cpu_to_le16(val), (__le16 *)p);

    The headers that arches should include from their asm/unaligned.h:

    access_ok.h : Wrappers of the byteswapping functions in asm/byteorder

    Choose a particular implementation for little-endian access:
    le_byteshift.h
    le_memmove.h (arch must be LE)
    le_struct.h (arch must be LE)

    Choose a particular implementation for big-endian access:
    be_byteshift.h
    be_memmove.h (arch must be BE)
    be_struct.h (arch must be BE)

    After including as needed from the above, include unaligned/generic.h and
    define your arch's get/put_unaligned as (for LE):

    Signed-off-by: Harvey Harrison
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Since isn't exported to userspace, there is little
    point checking that this is a GNU-compatible compiler.

    Signed-off-by: Robert P. J. Day
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • There is no "PNPACPI" driver interface as such. PNPACPI is an internal
    backend of PNP, and drivers just use the generic PNP interface.

    The drivers should depend on CONFIG_PNP, not CONFIG_PNPACPI.

    tpm_nsc.c doesn't use PNP at all, so we can just remove the dependency
    completely. It probably *should* use PNP to discover the device, but until it
    does, there's no point in depending on PNP.

    Signed-off-by: Bjorn Helgaas
    Cc: Kylene Jo Hall
    Cc: Marcel Selhorst
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bjorn Helgaas
     
  • Fix following warning:
    WARNING: vmlinux.o(.init.text+0x32804): Section mismatch in reference from the function init_nsc() to the function .devexit.text:tpm_nsc_remove()

    The function tpm_nsc_remove() are used outside __exit, so remove the __exit
    annotation to make sure the function is always avilable.

    Note: Trying to compare this module with other users of platform_device gve me
    the impression that this driver needs some work to match other users.

    Signed-off-by: Sam Ravnborg
    Cc: Kylene Hall
    Cc: Marcel Selhorst
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sam Ravnborg
     
  • Wrap PNP probe code in #ifdef CONFIG_PNP. We already do the same for
    CONFIG_PCI.

    Without this change, we'll have unresolved references to pnp_get_resource()
    function when CONFIG_PNP=n. (This is a new interface that's not in mainline
    yet.)

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bjorn Helgaas
     
  • Add support for the CB.ProbeUuid cache manager RPC op. This allows a modern
    OpenAFS server to quickly ask if the client has been rebooted.

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

    David Howells
     
  • The AFS RxRPC op CBGetCapabilities is actually CBTellMeAboutYourself.

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

    David Howells
     
  • Signed-off-by: Robert P. J. Day
    Acked-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • I implemented opstate_init() as a inline function in linux/edac.h.

    added calling opstate_init() to:
    i82443bxgx_edac.c
    i82860_edac.c
    i82875p_edac.c
    i82975x_edac.c

    I wrote a fixed patch of
    edac-fix-module-initialization-on-several-modules.patch,
    and tested building 2.6.25-rc7 with applying this. It was succeed.
    I think the patch is now correct.

    Cc: Alan Cox
    Signed-off-by: Hitoshi Mitake
    Signed-off-by: Doug Thompson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hitoshi Mitake
     
  • Collection of patches, merged into one, from Adrian that do the following:

    1) This patch makes the following needlessly global functions static:
    - edac_pci_get_log_pe()
    - edac_pci_get_log_npe()
    - edac_pci_get_panic_on_pe()
    - edac_pci_unregister_sysfs_instance_kobj()
    - edac_pci_main_kobj_setup()

    2) Remove unneeded function edac_device_find()

    3) Added #if 0 around function edac_pci_find()

    4) make the needlessly global edac_pci_generic_check() static

    5) Removed function edac_check_mc_devices()

    Doug Thompson modified Adrian's patches, to bettern represent
    the direction of EDAC, and make them one patch.

    Cc: Alan Cox
    Signed-off-by: Adrian Bunk
    Signed-off-by: Doug Thompson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Signed-off-by: Robert P. J. Day
    Acked-by: Doug Thompson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • Add a module parameter "sysbus_parity" to allow forcing system bus parity
    error checking on or off. Also add support to automatically disable system
    bus parity errors for processors which do not support it.

    If the sysbus_parity parameter is specified, sysbus parity detection will be
    forced on or off. If it is not specified, the driver will attempt to look at
    the CPU identifier string and determine if the CPU supports system bus parity.
    A blacklist was used instead of a whitelist so that system bus parity would
    be enabled by default and to minimize the chances of breaking things for those
    people already using the driver which for some reason have a processor that
    does not have a valid CPU identifier string.

    [akpm@linux-foundation.org: coding-style fixes]
    Cc: Alan Cox
    Signed-off-by: Peter Tyser
    Signed-off-by: Doug Thompson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Tyser
     
  • Add Intel 3100 chipset support to e752x EDAC driver.

    Cc: Alan Cox
    Signed-off-by: Andrei Konovalov
    Signed-off-by: Doug Thompson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrei Konovalov
     
  • Avoid a possible kmem_cache_create() failure by creating idr_layer_cache
    unconditionary at boot time rather than creating it on-demand when idr_init()
    is called the first time.

    This change also enables us to eliminate the check every time idr_init() is
    called.

    [akpm@linux-foundation.org: rename init_id_cache() to idr_init_cache()]
    [akpm@linux-foundation.org: fix alpha build]
    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • Some drivers have duplicated unlikely() macros. IS_ERR() already has
    unlikely() in itself.

    This patch cleans up such pointless code.

    Signed-off-by: Hirofumi Nakagawa
    Acked-by: David S. Miller
    Acked-by: Jeff Garzik
    Cc: Paul Clements
    Cc: Richard Purdie
    Cc: Alessandro Zummo
    Cc: David Brownell
    Cc: James Bottomley
    Cc: Michael Halcrow
    Cc: Anton Altaparmakov
    Cc: Al Viro
    Cc: Carsten Otte
    Cc: Patrick McHardy
    Cc: Paul Mundt
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hirofumi Nakagawa
     
  • Add async notification support to /dev/random.

    A little test case is below. Without this patch, you get:

    $ ./async-random
    Drained the pool
    Found more randomness

    With it, you get:

    $ ./async-random
    Drained the pool
    SIGIO
    Found more randomness

    #include
    #include
    #include
    #include
    #include

    static void handler(int sig)
    {
    printf("SIGIO\n");
    }

    int main(int argc, char **argv)
    {
    int fd, n, err, flags;

    if(signal(SIGIO, handler) < 0){
    perror("setting SIGIO handler");
    exit(1);
    }

    fd = open("/dev/random", O_RDONLY);
    if(fd < 0){
    perror("open");
    exit(1);
    }

    flags = fcntl(fd, F_GETFL);
    if (flags < 0){
    perror("getting flags");
    exit(1);
    }

    flags |= O_NONBLOCK;
    if (fcntl(fd, F_SETFL, flags) < 0){
    perror("setting flags");
    exit(1);
    }

    while((err = read(fd, &n, sizeof(n))) > 0) ;

    if(err == 0){
    printf("random returned 0\n");
    exit(1);
    }
    else if(errno != EAGAIN){
    perror("read");
    exit(1);
    }

    flags |= O_ASYNC;
    if (fcntl(fd, F_SETFL, flags) < 0){
    perror("setting flags");
    exit(1);
    }

    if (fcntl(fd, F_SETOWN, getpid()) < 0) {
    perror("Setting SIGIO");
    exit(1);
    }

    printf("Drained the pool\n");
    read(fd, &n, sizeof(n));
    printf("Found more randomness\n");

    return(0);
    }

    Signed-off-by: Jeff Dike
    Signed-off-by: Matt Mackall
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • - emphasize bits in the name
    - make zero bits lock-free
    - simplify logic

    Signed-off-by: Matt Mackall
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Mackall
     
  • Switch add_entropy_words to a byte-oriented interface, eliminating numerous
    casts and byte/word size rounding issues. This also reduces the overall
    bit/byte/word confusion in this code.

    We now mix a byte at a time into the word-based pool. This takes four times
    as many iterations, but should be negligible compared to hashing overhead.
    This also increases our pool churn, which adds some depth against some
    theoretical failure modes.

    The function name is changed to emphasize pool mixing and deemphasize entropy
    (the samples mixed in may not contain any). extract is added to the core
    function to make it clear that it extracts from the pool.

    Signed-off-by: Matt Mackall
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Mackall
     
  • The add_ptr variable wasn't used in a sensible way, use only i instead.
    i got reused later for a different purpose, use j instead.

    While we're here, put tap0 first in the tap list and add a comment.

    Signed-off-by: Matt Mackall
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Mackall
     
  • The urandom output pool (ie the fast path) fits in one cacheline, so
    this is pretty unnecessary. Further, the output path has already
    fetched the entire pool to hash it before calling in here.

    (This was the only user of prefetch_range in the kernel, and it passed
    in words rather than bytes!)

    Signed-off-by: Matt Mackall
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Mackall
     
  • - eliminate new_rotate
    - move input_rotate masking
    - simplify input_rotate update
    - move input_rotate update to end of inner loop for readability

    Signed-off-by: Matt Mackall
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Mackall
     
  • Earlier changes greatly reduce the number of times we grab the lock
    per output byte, so we shouldn't need this particular hack any more.

    Signed-off-by: Matt Mackall
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Mackall
     
  • At each extraction, we change (poolbits / 16) + 32 bits in the pool,
    or 96 bits in the case of the secondary pools. Thus, a brute-force
    backtracking attack on the pool state is less difficult than breaking
    the hash. In certain cases, this difficulty may be is reduced to 2^64
    iterations.

    Instead, hash the entire pool in one go, then feedback the whole hash
    (160 bits) in one go. This will make backtracking at least as hard as
    inverting the hash.

    Signed-off-by: Matt Mackall
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Mackall
     
  • - split the SHA variables apart into hash and workspace
    - rename data to extract
    - wipe extract and workspace after hashing

    Signed-off-by: Matt Mackall
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Mackall
     
  • Signed-off-by: Matt Mackall
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Mackall
     
  • No locking actually needed.

    Signed-off-by: Matt Mackall
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Mackall
     
  • Signed-off-by: Matt Mackall
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Mackall
     
  • Signed-off-by: Matt Mackall
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Mackall