17 Oct, 2008

40 commits

  • This patch introduces the generic iommu_num_pages function. It can be used by
    a given memory area.

    Signed-off-by: Joerg Roedel
    Cc: "David S. Miller"
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: FUJITA Tomonori
    Cc: Muli Ben-Yehuda
    Cc: Dave Airlie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joerg Roedel
     
  • This is a preparation patch for introducing a generic iommu_num_pages function.

    Signed-off-by: Joerg Roedel
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: FUJITA Tomonori
    Cc: Muli Ben-Yehuda
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joerg Roedel
     
  • This is a preparation patch for introducing a generic iommu_num_pages function.

    Signed-off-by: Joerg Roedel
    Acked-by: David S. Miller
    Cc: FUJITA Tomonori
    Cc: Muli Ben-Yehuda
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joerg Roedel
     
  • This series of patches re-introduces the iommu_num_pages function so that
    it can be used by each architecture specific IOMMU implementations. The
    series also changes IOMMU implementations for X86, Alpha, PowerPC and
    UltraSparc. The other implementations are not yet changed because the
    modifications required are not obvious and I can't test them on real
    hardware.

    This patch:

    This is a preparation patch for introducing a generic iommu_num_pages function.

    Signed-off-by: Joerg Roedel
    Cc: "David S. Miller"
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: FUJITA Tomonori
    Cc: Muli Ben-Yehuda
    Cc: Dave Airlie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joerg Roedel
     
  • Nothing arch specific in get/settimeofday. The details of the timeval
    conversion varied a little from arch to arch, but all with the same
    results.

    Also add an extern declaration for sys_tz to linux/time.h because externs
    in .c files are fowned upon. I'll kill the externs in various other files
    in a sparate patch.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Christoph Hellwig
    Acked-by: David S. Miller [ sparc bits ]
    Cc: "Luck, Tony"
    Cc: Ralf Baechle
    Acked-by: Kyle McMartin
    Cc: Matthew Wilcox
    Cc: Grant Grundler
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • struct stat / compat_stat is the same on all architectures, so
    cp_compat_stat should be, too.

    Turns out it is, except that various architectures have slightly and some
    high2lowuid/high2lowgid or the direct assignment instead of the
    SET_UID/SET_GID that expands to the correct one anyway.

    This patch replaces the arch-specific cp_compat_stat implementations with
    a common one based on the x86-64 one.

    Signed-off-by: Christoph Hellwig
    Acked-by: David S. Miller [ sparc bits ]
    Acked-by: Kyle McMartin [ parisc bits ]
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • clk_get and clk_put may not be used from within interrupt context. Change
    comment to this function.

    Signed-off-by: Alex Raimondi
    Signed-off-by: Haavard Skinnemoen
    Acked-by: Russell King
    Cc: john stultz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alex Raimondi
     
  • Add documentation in kerneldoc for new printk format extensions

    This patch documents the new %pS/%pF options in printk in kernel doc.

    Hope I didn't miss any other extension.

    Signed-off-by: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andi Kleen
     
  • For this year's OLS I wrote a paper on successfull strategies to submit
    difficult kernel patches. Add a reference to it to SubmittingPatches.

    Signed-off-by: Andi Kleen
    Acked-by: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andi Kleen
     
  • This adds "panic_on_unrecovered_nmi" sysctl to
    Documentation/filesystems/proc.txt. The text is mainly taken from
    http://readlist.com/lists/vger.kernel.org/linux-kernel/43/217998.html.

    Signed-off-by: Bernhard Walle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bernhard Walle
     
  • Move print_tainted() kernel-doc to avoid the following error:

    Error(/var/linsrc/mmotm-2008-1002-1617//kernel/panic.c:155): cannot understand prototype: 'struct tnt '

    Signed-off-by: Randy Dunlap
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Remove Andrew Morton's http://www.zip.com.au/~akpm/ urls, update to new
    ones when necessary, delete references otherwise.

    There are still instances of that living in:
    Documentation/zh_CN/HOWTO
    Documentation/zh_CN/SubmittingPatches
    Documentation/ko_KR/HOWTO
    Documentation/ja_JP/SubmittingPatches

    Signed-off-by: Francois Cami
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FD Cami
     
  • People can use the real name an an index into MAINTAINERS to find the
    current email address.

    Signed-off-by: Francois Cami
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Francois Cami
     
  • We want all uses of memory barriers to be explained in the source code.

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

    Randy Dunlap
     
  • Commit 6dd06c9fbe025f542bce4cdb91790c0f91962722 ("module: make
    module_address_lookup safe") introduced double returns in the function
    kallsyms_lookup(), it's weird. The second one should be removed.

    Signed-off-by: WANG Cong
    Cc: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    WANG Cong
     
  • Thomas found that there is an unnecessary (always true) test in
    ep_send_events(). The callback never inserts into ->rdllink while the
    send loop is performed, and also does the ~EP_PRIVATE_BITS test. Given
    we're holding the mutex during this time, the conditions tested inside the
    loop are always true. This patch drops the test done inside the
    re-insertion loop.

    Signed-off-by: Davide Libenzi
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davide Libenzi
     
  • Only three of Atmel's AT91 processors (SAM9263, SAM9RL and CAP9) include a
    PWM controller.

    It should therefore only be possible to enable the misc/atmel_pwm.c driver
    on those processors (and not all AT91 processors).

    Signed-off-by: Andrew Victor
    Cc: Haavard Skinnemoen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Victor
     
  • Signed-off-by: Alberto Bertogli
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alberto Bertogli
     
  • With MAX_ARG_STRINGS set to 0x7FFFFFFF, and being passed to 'count()' and
    compat_count(), it would appear that the current max bounds check of
    fs/exec.c:394:

    if(++i > max)
    return -E2BIG;

    would never trigger. Since 'i' is of type int, so values would wrap and the
    function would continue looping.

    Simple fix seems to be chaning ++i to i++ and checking for '>='.

    Signed-off-by: Jason Baron
    Acked-by: Peter Zijlstra
    Cc: "Ollie Wild"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jason Baron
     
  • utsname() is quite expensive to calculate. Cache it in a local.

    text data bss dec hex filename
    before: 11136 720 16 11872 2e60 kernel/sys.o
    after: 11096 720 16 11832 2e38 kernel/sys.o

    Acked-by: Vegard Nossum
    Cc: "Eric W. Biederman"
    Acked-by: "Serge E. Hallyn"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • On sethostname() and setdomainname(), previous information may be retained
    if it was longer than than the new hostname/domainname.

    This can be demonstrated trivially by calling sethostname() first with a
    long name, then with a short name, and then calling uname() to retrieve
    the full buffer that contains the hostname (and possibly parts of the old
    hostname), one just has to look past the terminating zero.

    I don't know if we should really care that much (hence the RFC); the only
    scenarios I can possibly think of is administrator putting something
    sensitive in the hostname (or domain name) by accident, and changing it
    back will not undo the mistake entirely, though it's not like we can
    recover gracefully from "rm -rf /" either... The other scenario is
    namespaces (CLONE_NEWUTS) where some information may be unintentionally
    "inherited" from the previous namespace (a program wants to hide the
    original name and does clone + sethostname, but some information is still
    left).

    I think the patch may be defended on grounds of the principle of least
    surprise. But I am not adamant :-)

    (I guess the question now is whether userspace should be able to
    write embedded NULs into the buffer or not...)

    At least the observation has been made and the patch has been presented.

    Signed-off-by: Vegard Nossum
    Cc: "Eric W. Biederman"
    Cc: "Serge E. Hallyn"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vegard Nossum
     
  • defkeymap.c_shipped should be diffed if it is changed.
    Reported-by: Mike Galbraith

    COPYING, CREDITS, .mailmap should be diffed if they are changed.
    keywords.c_shipped & lex.c_shipped should be diffed when changed.
    parse.[ch]_shipped should be diffed when changed.
    Reported-by: Sam Ravnborg

    vsyscall* updates from a .gitignore patch by "Denis V. Lunev" .

    *.so.dbg from a .gitignore patch by Thomas Gleixner .

    binoffset from a .gitignore patch by Uwe Kleine-Koenig
    .

    Module.markers from a .gitignore patch by Matthew Wilcox
    .

    vmlinux*.lds* should be diffed if changed.
    Reported-by: Etienne Lorrain

    vmlinux.lds from a .gitignore patch by Daniel Guilak
    .

    *.scr should be diffed if changed.

    Lots of updates from http://lkml.org/lkml/2008/5/20/32 Reported-by: Bart
    Van Assche

    Use ncscope.* instead of *cscope* since the latter may catch too many files.

    Add *.elf, from a .gitignore patch by Eduard - Gabriel Munteanu .

    Make firmware entries match .gitignore entries.

    Make some entries less greedy by removing trailing '*'.

    Remove "make_times_h" (no such file).
    Remove "filelist" (no such file).
    Remove "dummy_sym.c" (no such file).
    Remove "gen-kdb_cmds.c" (no such file).
    Remove "gentbl" (no such file).
    Remove "kconfig.tk" (no such file).
    Remove "tkparse" (no such file).
    Remove "sim710_d.h" (no such file).
    Remove "53c8xx_d.h" (no such file).
    Add "syscalltab.h" (generated file).

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

    Randy Dunlap
     
  • Add a missing word to the explanation of the purpose of the zdisk and
    bzdisk make targets.

    Signed-off-by: Shane McDonald
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shane McDonald
     
  • Way too often, I have a machine that exhibits some kind of crappy
    behavior. The CPU looks wedged in the kernel or it is spending way too
    much system time and I wonder what is responsible.

    I try to run readprofile. But, of course, Ubuntu doesn't enable it by
    default. Dang!

    The reason we boot-time enable it is that it takes a big bufffer that we
    generally can only bootmem alloc. But, does it hurt to at least try and
    runtime-alloc it?

    To use:
    echo 2 > /sys/kernel/profile

    Then run readprofile like normal.

    This should fix the compile issue with allmodconfig. I've compile-tested
    on a bunch more configs now including a few more architectures.

    Signed-off-by: Dave Hansen
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Hansen
     
  • When a process wants to set the limit of open files to RLIM_INFINITY it
    gets EPERM even if it has CAP_SYS_RESOURCE capability.

    For example, BIND does:

    ...
    #elif defined(NR_OPEN) && defined(__linux__)
    /*
    * Some Linux kernels don't accept RLIM_INFINIT; the maximum
    * possible value is the NR_OPEN defined in linux/fs.h.
    */
    if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) {
    rl.rlim_cur = rl.rlim_max = NR_OPEN;
    unixresult = setrlimit(unixresource, &rl);
    if (unixresult == 0)
    return (ISC_R_SUCCESS);
    }
    #elif ...

    If we allow setting RLIMIT_NOFILE to RLIM_INFINITY we increase portability
    - you don't have to check if OS is linux and then use different schema for
    limits.

    The spec says "Specifying RLIM_INFINITY as any resource limit value on a
    successful call to setrlimit() shall inhibit enforcement of that resource
    limit." and we're presently not doing that.

    Cc: Michael Kerrisk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adam Tkac
     
  • It is written in the Documentation/sysrq.txt that oom-killer is enabled
    when we set "64" in /proc/sys/kernel/sysrq:

    Here is the list of possible values in /proc/sys/kernel/sysrq:
    64 - enable signalling of processes (term, kill, oom-kill)
    ^^^^^^^^

    but enable_mask is not set in sysrq_moom_op.

    Signed-off-by: Naohiro Ooiwa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Naohiro Ooiwa
     
  • It's somewhat unlikely that it happens, but right now a race window
    between interrupts or machine checks or oopses could corrupt the tainted
    bitmap because it is modified in a non atomic fashion.

    Convert the taint variable to an unsigned long and use only atomic bit
    operations on it.

    Unfortunately this means the intvec sysctl functions cannot be used on it
    anymore.

    It turned out the taint sysctl handler could actually be simplified a bit
    (since it only increases capabilities) so this patch actually removes
    code.

    [akpm@linux-foundation.org: remove unneeded include]
    Signed-off-by: Andi Kleen
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andi Kleen
     
  • When unpacking the cpio into the initramfs, mtimes are not preserved by
    default. This patch adds an INITRAMFS_PRESERVE_MTIME option that allows
    mtimes stored in the cpio image to be used when constructing the
    initramfs.

    For embedded applications that run exclusively out of the initramfs, this
    is invaluable:

    When building embedded application initramfs images, its nice to know when
    the files were actually created during the build process - that makes it
    easier to see what files were modified when so we can compare the files
    that are being used on the image with the files used during the build
    process. This might help (for example) to determine if the target system
    has all the updated files you expect to see w/o having to check MD5s etc.

    In our environment, the whole system runs off the initramfs partition, and
    seeing the modified times of the shared libraries (for example) helps us
    find bugs that may have been introduced by the build system incorrectly
    propogating outdated shared libraries into the image.

    Similarly, many of the initializion/configuration files in /etc might be
    dynamically built by the build system, and knowing when they were modified
    helps us sanity check whether the target system has the "latest" files
    etc.

    Finally, we might use last modified times to determine whether a hot fix
    should be applied or not to the running ramfs.

    Signed-off-by: Nye Liu
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nye Liu
     
  • Using "def_bool n" is pointless, simply using bool here appears more
    appropriate.

    Further, retaining such options that don't have a prompt and aren't
    selected by anything seems also at least questionable.

    Signed-off-by: Jan Beulich
    Cc: Ingo Molnar
    Cc: Tony Luck
    Cc: Thomas Gleixner
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Beulich
     
  • is_sync_wait() is used to distinguish between sync and async waits.
    Basically sync waits are the ones initialized with init_waitqueue_entry()
    and async ones with init_waitqueue_func_entry(). The sync/async
    distinction is used only in prepare_to_wait[_exclusive]() and its only
    function is to skip setting the current task state if the wait is async.
    This has a few problems.

    * No one uses it. None of func_entry users use prepare_to_wait()
    functions, so the code path never gets executed.

    * The distinction is bogus. Maybe back when func_entry is used only
    by aio but it's now also used by epoll and in future possibly by 9p
    and poll/select.

    * Taking @state as argument and ignoring it silenly depending on how
    @wait is initialized is just a bad error-prone API.

    * It prevents func_entry waits from using wait->private for no good
    reason.

    This patch kills is_sync_wait() and the associated code paths from
    prepare_to_wait[_exclusive](). As there was no user of these code paths,
    this patch doesn't cause any behavior difference.

    Signed-off-by: Tejun Heo
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     
  • Use the '%pF' format to get rid of an "#ifdef DEBUG" and make some printks
    atomic.

    This removes the last in-tree uses of print_fn_descriptor_symbol(). I
    marked print_fn_descriptor_symbol() deprecated and scheduled it for
    removal next year to give time for out-of-tree modules to be updated.

    parisc's print_fn_descriptor_symbol() is currently broken there (it needs
    to dereference the function pointer similar to ia64 and power). This
    patch shouldn't make anything worse, but it means we need to fix
    dereference_function_descriptor() instead of print_fn_descriptor_symbol()
    to get meaningful initcall_debug output.

    Signed-off-by: Bjorn Helgaas
    Cc: Jesse Barnes
    Cc: Kyle McMartin
    Cc: "Rafael J. Wysocki"
    Cc: Kay Sievers
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bjorn Helgaas
     
  • Signed-off-by: Danny ter Haar
    Cc: Patrick McHardy
    Cc: Mikael Starvik
    Cc: Avi Kivity
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Danny ter Haar
     
  • identify_ramdisk_image() returns 0 (not -1) if a gzipped ramdisk is found:

    if (buf[0] == 037 && ((buf[1] == 0213) || (buf[1] == 0236))) {
    printk(KERN_NOTICE
    "RAMDISK: Compressed image found at block %d\n",
    start_block);
    nblocks = 0;
    ^^^^^^^^^^^
    goto done;
    }

    ...

    done:
    sys_lseek(fd, start_block * BLOCK_SIZE, 0);
    kfree(buf);
    return nblocks;
    ^^^^^^^^^^^^^^

    Hence correct the typo in the comment, which has existed since the
    addition of compressed ramdisk support in 1.3.48.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     
  • It seems this is the right way around because otherwise the len usage in
    the outer loop would be pretty pointless.

    Signed-off-by: Ilpo Järvinen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ilpo Järvinen
     
  • First a file hello.c is created, then the file hello2.c is compiled.
    Change this to hello.c

    Signed-off-by: Frans Meulenbroeks
    Signed-off-by: Rob Landley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    frans
     
  • EEEPC_LAPTOP uses RFKILL, so the former should depend on RFKILL.
    Build errors happen when EEEPC_LAPTOP=y and RFKILL=m.

    eeepc-laptop.c:(.text+0xd5a7b): undefined reference to `rfkill_allocate'
    eeepc-laptop.c:(.text+0xd5b04): undefined reference to `rfkill_register'
    eeepc-laptop.c:(.text+0xd5b48): undefined reference to `rfkill_allocate'
    eeepc-laptop.c:(.text+0xd5bd4): undefined reference to `rfkill_register'
    eeepc-laptop.c:(.text+0xd5ece): undefined reference to `rfkill_unregister'
    eeepc-laptop.c:(.text+0xd5ef6): undefined reference to `rfkill_unregister'
    make[1]: *** [.tmp_vmlinux1] Error 1

    Signed-off-by: Randy Dunlap
    Cc: Corentin Chary
    Cc: Matthew Garrett
    Cc: Henrique de Moraes Holschuh
    Cc: Karol Kozimor
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /
    (d)) but is perhaps more readable.

    An extract of the semantic patch that makes this change is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @haskernel@
    @@

    #include

    @depends on haskernel@
    expression n,d;
    @@

    (
    - (n + d - 1) / d
    + DIV_ROUND_UP(n,d)
    |
    - (n + (d - 1)) / d
    + DIV_ROUND_UP(n,d)
    )

    @depends on haskernel@
    expression n,d;
    @@

    - DIV_ROUND_UP((n),d)
    + DIV_ROUND_UP(n,d)

    @depends on haskernel@
    expression n,d;
    @@

    - DIV_ROUND_UP(n,(d))
    + DIV_ROUND_UP(n,d)
    //

    Signed-off-by: Julia Lawall
    Cc: Jack Steiner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • This macro appears to have been unused for ages, and there are no
    invocations of it anywhere in the source tree.

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

    Robert P. J. Day
     
  • Remove a CVS keyword that wasn't updated for a long time from a comment.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Remove a CVS keyword that wasn't updated for a long time from a comment.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk