28 May, 2010

40 commits

  • There are more architectures that don't support ARCH_HAS_SG_CHAIN than
    those that support it. This removes removes ARCH_HAS_SG_CHAIN in
    asm-generic/scatterlist.h and lets arhictectures to define it.

    It's clearer than defining ARCH_HAS_SG_CHAIN asm-generic/scatterlist.h and
    undefing it in arhictectures that don't support it.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • Signed-off-by: FUJITA Tomonori
    Acked-by: Matt Turner
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • Signed-off-by: FUJITA Tomonori
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • Cc: FUJITA Tomonori
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • There are only two ways to define sg_dma_len(); use sg->dma_length or
    sg->length. This patch introduces NEED_SG_DMA_LENGTH that enables
    architectures to choose sg->dma_length or sg->length.

    Signed-off-by: FUJITA Tomonori
    Cc: Arnd Bergmann
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: Russell King
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • This is the first half of the attempt to use asm-generic/scatterlist.h
    on every architecture.

    There are only two ways to define scatterlist structure. So it's easy
    to convert every architecture to use asm-generic/scatterlist.h.

    This patch:

    The trick for ISA_DMA_THRESHOLD in asm-generic/scatterlist.h doesn't work
    for powerpc. This lets architectures defin ISA_DMA_THRESHOLD.

    Hopefully, we can remove ISA_DMA_THRESHOLD in the future; we can do better
    to decide if the bouncing is necessary or not.

    Signed-off-by: FUJITA Tomonori
    Cc: Arnd Bergmann
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: Russell King
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • This adds three new types of kernel "crashes" in the lkdtm driver to
    trigger hardlockups, softlockups and task hung states at will.

    The first two are useful to test the new generic lockup detector and check
    its further regressions. The latter one is a bonus to check the hung task
    detector regressions even though it's not currently in rework.

    Signed-off-by: Frederic Weisbecker
    Cc: Simon Kagstrom
    Cc: Ingo Molnar
    Cc: Don Zickus
    Cc: Cyrill Gorcunov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Frederic Weisbecker
     
  • Add the necessary parts to be enable the use of LZO-compressed initramfs
    build into the kernel.

    Signed-off-by: Albin Tonnerre
    Cc: "H. Peter Anvin"
    Cc: Michal Marek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Albin Tonnerre
     
  • radix_tree_prev_hole() used LONG_MAX to detect underflow; however,
    ULONG_MAX is clearly what was intended, both here and by its only user
    (count_history_pages at mm/readahead.c).

    Reviewed-by: Wu Fengguang
    Signed-off-by: Cesar Eduardo Barros
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Cesar Eduardo Barros
     
  • The aio compat code was not converting the struct iovecs from 32bit to
    64bit pointers, causing either EINVAL to be returned from io_getevents, or
    EFAULT as the result of the I/O. This patch passes a compat flag to
    io_submit to signal that pointer conversion is necessary for a given iocb
    array.

    A variant of this was tested by Michael Tokarev. I have also updated the
    libaio test harness to exercise this code path with good success.
    Further, I grabbed a copy of ltp and ran the
    testcases/kernel/syscall/readv and writev tests there (compiled with -m32
    on my 64bit system). All seems happy, but extra eyes on this would be
    welcome.

    [akpm@linux-foundation.org: coding-style fixes]
    [akpm@linux-foundation.org: fix CONFIG_COMPAT=n build]
    Signed-off-by: Jeff Moyer
    Reported-by: Michael Tokarev
    Cc: Zach Brown
    Cc: [2.6.35.1]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Moyer
     
  • It was reported in http://lkml.org/lkml/2010/3/8/309 that 32 bit readv and
    writev AIO operations were not functioning properly. It turns out that
    the code to convert the 32bit io vectors to 64 bits was never written.
    The results of that can be pretty bad, but in my testing, it mostly ended
    up in generating EFAULT as we walked off the list of I/O vectors provided.

    This patch set fixes the problem in my environment. are greatly
    appreciated.

    This patch:

    Factor out code that will be used by both compat_do_readv_writev and the
    compat aio submission code paths.

    Signed-off-by: Jeff Moyer
    Reported-by: Michael Tokarev
    Cc: Zach Brown
    Cc: [2.6.35.1]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Moyer
     
  • Most distros turn the console verbosity down and that means a backtrace
    after a panic never makes it to the console. I assume we haven't seen
    this because a panic is often preceeded by an oops which will have called
    console_verbose. There are however a lot of places we call panic
    directly, and they are broken.

    Use console_verbose like we do in the oops path to ensure a directly
    called panic will print a backtrace.

    Signed-off-by: Anton Blanchard
    Acked-by: Greg Kroah-Hartman
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Blanchard
     
  • Use ERR_CAST(x) rather than ERR_PTR(PTR_ERR(x)). The former makes more
    clear what is the purpose of the operation, which otherwise looks like a
    no-op.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    type T;
    T x;
    identifier f;
    @@

    T f (...) { }

    @@
    expression x;
    @@

    - ERR_PTR(PTR_ERR(x))
    + ERR_CAST(x)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • Add ARCH_KMALLOC_MINALIGN description in "Platform Issues" section.

    Signed-off-by: FUJITA Tomonori
    Cc: "David S. Miller"
    Cc: Matt Mackall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • Handing DMA mapping errors is essential. Let's put it in the more
    appropriate place rather than the end of the doc.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • Now we have . Architectures should use it
    instead of inventing the own scatterlist struct. Let's update the
    description.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • Add the concrete DMA mapping error handling for SCSI drivers on the
    queuecommand path.

    Signed-off-by: FUJITA Tomonori
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • Since 2.6.5, it had been commented, 'for backwards compatibility,
    removed in 2.7.x'. Since 2.6.31, it have been marked as __deprecated.

    I think that we can remove the API safely now.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • dma_sync_single() is deprecated and will be removed soon.

    No functional change since dma_sync_single is the wrapper of
    dma_sync_single_for_cpu.

    saa7134-go7007.c is commented out but anyway let's replace it.

    Signed-off-by: FUJITA Tomonori
    Cc: Greg Kroah-Hartman
    Cc: Ben Hutchings
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • Adds the concrete DMA mapping error handling for Networking drivers on the
    transmit path.

    Signed-off-by: FUJITA Tomonori
    Acked-by: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • sync_single_range_for_cpu and sync_single_range_for_device hooks are
    unnecessary because sync_single_for_cpu and sync_single_for_device can
    be used instead.

    Signed-off-by: FUJITA Tomonori
    Reviewed-by: Konrad Rzeszutek Wilk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • swiotlb_sync_single_range_for_cpu and swiotlb_sync_single_range_for_device
    are unnecessary because swiotlb_sync_single_for_cpu and
    swiotlb_sync_single_for_device can be used instead.

    Signed-off-by: FUJITA Tomonori
    Reviewed-by: Konrad Rzeszutek Wilk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • sync_single_range_for_cpu and sync_single_range_for_device hooks in
    swiotlb_dma_ops are unnecessary because sync_single_for_cpu and
    sync_single_for_device are used there.

    Signed-off-by: FUJITA Tomonori
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Becky Bruce
    Reviewed-by: Konrad Rzeszutek Wilk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • sync_single_range_for_cpu and sync_single_range_for_device hooks in
    swiotlb_dma_ops are unnecessary because sync_single_for_cpu and
    sync_single_for_device are used there.

    Signed-off-by: FUJITA Tomonori
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Reviewed-by: Konrad Rzeszutek Wilk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • sync_single_range_for_cpu and sync_single_range_for_device hooks in
    swiotlb_dma_ops are unnecessary because sync_single_for_cpu and
    sync_single_for_device are used there.

    Signed-off-by: FUJITA Tomonori
    Cc: Tony Luck
    Cc: Fenghua Yu
    Reviewed-by: Konrad Rzeszutek Wilk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • Reduces text by eliminating multiple __FILE__ uses.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Joe Perches
    Cc: Doug Thompson
    Cc: Mauro Carvalho Chehab
    Cc: Tim Small
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • This patch moves the definition of struct rnd_state and the inline
    __seed() function to linux/random.h. It renames the static __random32()
    function to prandom32() and exports it for use in modules.

    prandom32() is useful as a privately-seeded pseudo random number generator
    that can give the same result every time it is initialized.

    For FCoE FC-BB-6 VN2VN mode self-selected unique FC address generation, we
    need an pseudo-random number generator seeded with the 64-bit world-wide
    port name. A truly random generator or one seeded with randomness won't
    do because the same sequence of numbers should be generated each time we
    boot or the link comes up.

    A prandom32_seed() inline function is added to the header file. It is
    inlined not for speed, but so the function won't be expanded in the base
    kernel, but only in the module that uses it.

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

    Joe Eykholt
     
  • Cosmetic, no changes in the compiled code. Just s/NULL/SIG_DFL/ to make
    it more readable and grep-friendly.

    Note: probably SIG_IGN makes more sense, we could kill ignore_signals().
    But then kernel_init() should do flush_signal_handlers() before exec().

    Signed-off-by: Oleg Nesterov
    Cc: Cedric Le Goater
    Cc: Dave Hansen
    Cc: Eric Biederman
    Cc: Herbert Poetzl
    Cc: Mathias Krause
    Acked-by: Roland McGrath
    Acked-by: Serge Hallyn
    Cc: Sukadev Bhattiprolu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • copy_process(pid => &init_struct_pid) doesn't do attach_pid/etc.

    It shouldn't, but this means that the idle threads run with the wrong
    pids copied from the caller's task_struct. In x86 case the caller is
    either kernel_init() thread or keventd.

    In particular, this means that after the series of cpu_up/cpu_down an
    idle thread (which never exits) can run with .pid pointing to nowhere.

    Change fork_idle() to initialize idle->pids[] correctly. We only set
    .pid = &init_struct_pid but do not add .node to list, INIT_TASK() does
    the same for the boot-cpu idle thread (swapper).

    Signed-off-by: Oleg Nesterov
    Cc: Cedric Le Goater
    Cc: Dave Hansen
    Cc: Eric Biederman
    Cc: Herbert Poetzl
    Cc: Mathias Krause
    Acked-by: Roland McGrath
    Acked-by: Serge Hallyn
    Cc: Sukadev Bhattiprolu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • "statically initialize struct pid for swapper" commit 820e45db says:

    Statically initialize a struct pid for the swapper process (pid_t == 0)
    and attach it to init_task. This is needed so task_pid(), task_pgrp()
    and task_session() interfaces work on the swapper process also.

    OK, but:

    - it doesn't make sense to add init_task.pids[].node into
    init_struct_pid.tasks[], and in fact this just wrong.

    idle threads are special, they shouldn't be visible on any
    global list. In particular do_each_pid_task(init_struct_pid)
    shouldn't see swapper.

    This is the actual reason why kill(0, SIGKILL) from /sbin/init
    (which starts with 0,0 special pids) crashes the kernel. The
    signal sent to pgid/sid == 0 must never see idle threads, even
    if the previous patch fixed the crash itself.

    - we have other idle threads running on the non-boot CPUs, see
    the next patch.

    Change INIT_STRUCT_PID/INIT_PID_LINK to create the empty/unhashed
    hlist_head/hlist_node. Like any other idle thread swapper can never exit,
    so detach_pid()->__hlist_del() is not possible, but we could change
    INIT_PID_LINK() to set pprev = &next if needed.

    All we need is the valid swapper->pids[].pid == &init_struct_pid.

    Reported-by: Mathias Krause
    Signed-off-by: Oleg Nesterov
    Cc: Cedric Le Goater
    Cc: Dave Hansen
    Cc: Eric Biederman
    Cc: Herbert Poetzl
    Cc: Mathias Krause
    Acked-by: Roland McGrath
    Acked-by: Serge Hallyn
    Cc: Sukadev Bhattiprolu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • The trivial /sbin/init doing

    int main(void)
    {
    kill(0, SIGKILL)
    }

    crashes the kernel.

    This happens because __kill_pgrp_info(init_struct_pid) also sends SIGKILL
    to the swapper process which runs with the uninitialized ->thread_group.

    Change INIT_TASK() to initialize ->thread_group properly.

    Note: the real problem is that the swapper process must not be visible to
    signals, see the next patch. But this change is right anyway and fixes
    the crash.

    Reported-and-tested-by: Mathias Krause
    Signed-off-by: Oleg Nesterov
    Cc: Cedric Le Goater
    Cc: Dave Hansen
    Cc: Eric Biederman
    Cc: Herbert Poetzl
    Cc: Mathias Krause
    Acked-by: Roland McGrath
    Acked-by: Serge Hallyn
    Acked-by: Sukadev Bhattiprolu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • On a system with a substantial number of processors, the early default
    pid_max of 32k will not be enough. A system with 1664 CPU's, there are
    25163 processes started before the login prompt. It's estimated that with
    2048 CPU's we will pass the 32k limit. With 4096, we'll reach that limit
    very early during the boot cycle, and processes would stall waiting for an
    available pid.

    This patch increases the early maximum number of pids available, and
    increases the minimum number of pids that can be set during runtime.

    [akpm@linux-foundation.org: fix warnings]
    Signed-off-by: Hedi Berriche
    Signed-off-by: Mike Travis
    Signed-off-by: Robin Holt
    Acked-by: Linus Torvalds
    Cc: Ingo Molnar
    Cc: Pavel Machek
    Cc: Alan Cox
    Cc: Greg KH
    Cc: Rik van Riel
    Cc: John Stoffel
    Cc: Jack Steiner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hedi Berriche
     
  • Fix the maintenance access functions to farend RapidIO devices.
    1. Fixed shift of the given offset, to open the maintenance window
    2. Mask offset to limit access to the opened maintenance window
    3. Added extended destid part to rowtear register, required for 16bit mode

    This method is matching maintenance transactions generation described
    by Freescale in the appnote AN2932. With this modification full access
    to a 16MB maintenance window is possible, this patch is required for
    IDT cps switches. For easier handling of the access routines, the
    access was limited to aligned memory regions. This should be no problem
    because all registers are 32bit wide.

    Signed-off-by: Thomas Moll
    Tested-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Li Yang
    Cc: Kumar Gala
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Moll
     
  • Fix to use correct default value for routing table entries.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Li Yang
    Cc: Kumar Gala
    Cc: Thomas Moll
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add switch specific domain routines required for 16-bit routing support in
    switches with hierarchical implementation of routing tables.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Li Yang
    Cc: Kumar Gala
    Cc: Thomas Moll
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Modify the way how RapidIO switch operations are declared. Multiple
    assignments through the linker script replaced by single initialization
    call.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Li Yang
    Cc: Kumar Gala
    Cc: Thomas Moll
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add debug configuration option for RapidIO subsystem.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Li Yang
    Cc: Kumar Gala
    Cc: Thomas Moll
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Li Yang
    Cc: Kumar Gala
    Cc: Thomas Moll
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add the functionality to enable Input receiver and Output transmitter of
    every port, to allow non-maintenance traffic.

    Signed-off-by: Thomas Moll
    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Li Yang
    Cc: Kumar Gala
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Moll
     
  • Add Machine Check exception handling into RapidIO port driver for
    Freescale SoCs (MPC85xx).

    Signed-off-by: Alexandre Bounine
    Tested-by: Thomas Moll
    Cc: Matt Porter
    Cc: Li Yang
    Cc: Kumar Gala
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine