07 May, 2010

1 commit

  • Reimplement stop_machine using cpu_stop. As cpu stoppers are
    guaranteed to be available for all online cpus,
    stop_machine_create/destroy() are no longer necessary and removed.

    With resource management and synchronization handled by cpu_stop, the
    new implementation is much simpler. Asking the cpu_stop to execute
    the stop_cpu() state machine on all online cpus with cpu hotplug
    disabled is enough.

    stop_machine itself doesn't need to manage any global resources
    anymore, so all per-instance information is rolled into struct
    stop_machine_data and the mutex and all static data variables are
    removed.

    The previous implementation created and destroyed RT workqueues as
    necessary which made stop_machine() calls highly expensive on very
    large machines. According to Dimitri Sivanich, preventing the dynamic
    creation/destruction makes booting faster more than twice on very
    large machines. cpu_stop resources are preallocated for all online
    cpus and should have the same effect.

    Signed-off-by: Tejun Heo
    Acked-by: Rusty Russell
    Acked-by: Peter Zijlstra
    Cc: Oleg Nesterov
    Cc: Dimitri Sivanich

    Tejun Heo
     

13 Apr, 2010

39 commits

  • Suggested by Peter Zijlstra

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Conflicts:
    lib/Kconfig.debug

    David S. Miller
     
  • Found by kmemleak.

    If request_resource() fails, we leak the struct resource we
    allocated to represent the IOMMU mapping area.

    This actually happens on sun4v machines because the IOMEM area is only
    reported sans the IOMMU region, unlike all previous systems. I'll
    need to fix that at some point, but for now fix the leak.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The only reference we store to this memory is in the form of a
    physical address, so kmemleak can't see it.

    Add a kmemleak_not_leak() annotation.

    It's probably useful to be able to look at a dump of these things
    either via debugfs or similar, and thus we could at some point store
    them in some kind of table and therefore get rid of this annotation.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Only missing thing was an _sdata marker in vmlinux.lds.S

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Signed-off-by: David S. Miller

    David S. Miller
     
  • It's the only way we'll be able to implement the function
    graph tracer properly.

    A positive is that we no longer have to worry about the
    linker over-optimizing the tail call, since we don't
    use a tail call any more.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • This keeps us from having to use kstat_irqs_cpu() from the NMI handler,
    the former of which is a profiled function.

    Instead we use a currently empty slot in the cpu_data

    Signed-off-by: David S. Miller

    David S. Miller
     
  • These include the timer implementation, perf events support, and the
    performance counter register (pcr) programming layer.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Signed-off-by: David S. Miller

    David S. Miller
     
  • The generic stack tracer does this job just as well.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Check function_trace_stop at ftrace_caller

    Toss mcount_call and dummy call of ftrace_stub, unnecessary.

    Document problems we'll have if the final kernel image link
    ever turns on relaxation.

    Properly size 'ftrace_call' so it looks right when inspecting
    instructions under gdb et al.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • If we are in an NMI then doing a plain raw_local_irq_disable() will
    write PIL_NORMAL_MAX into %pil, which is lower than PIL_NMI, and thus
    we'll re-enable NMIs and recurse.

    Doing a simple:

    %pil = %pil | PIL_NORMAL_MAX

    does what we want, if we're already at PIL_NMI (15) we leave it at
    that setting, else we set it to PIL_NORMAL_MAX (14).

    This should get the function tracer working on sparc64.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • This gets rid of a local function (is_kernel_stack()) which tries to
    do the same thing, yet poorly in that it doesn't handle IRQ stacks
    properly.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • * master.kernel.org:/home/rmk/linux-2.6-arm: (21 commits)
    ARM: Fix ioremap_cached()/ioremap_wc() for SMP platforms
    ARM: 6043/1: AT91 slow-clock resume: Don't wait for a disabled PLL to lock
    ARM: 6031/1: fix Thumb-2 decompressor
    ARM: 6029/1: ep93xx: gpio.c: local functions should be static
    ARM: 6028/1: ARM: add MAINTAINERS for U300
    ARM: 6024/1: bcmring: fix missing down on semaphore in dma.c
    MXC: mach_armadillo5x0: Add USB Host support.
    ARM mach-mx3: duplicated include
    ARM mach-mx3: duplicated include
    imx31: add watchdog device on litekit board.
    imx3: Add watchdog platform device support
    MXC: mach-mx31_3ds: add support for freescale mc13783 power management device.
    MXC: mach-mx31_3ds: Add SPI1 device support.
    MXC: mach-mx31_3ds: Add support for on board NAND Flash.
    MXC: mach-mx31_3ds: Update variable names over recent mach name modification.
    imx31: fix parent clock for rtc
    i.MX51: remove NFC AXI static mapping
    i.MX51: determine silicon revision dynamically
    i.MX51: map TZIC dynamically
    i.MX51: Use correct clock for gpt
    ...

    Linus Torvalds
     
  • The ebase is relative to CKSEG0 not CAC_BASE. On a 32-bit kernel they
    are the same thing, for a 64-bit kernel they are not.

    It happens to kind of work on a 64-bit kernel as they both reference
    the same physical memory. However since the CPU uses the CKSEG0 base,
    determining if a J instruction will reach always gives the wrong result
    unless we use the same number the CPU uses.

    Signed-off-by: David Daney
    To: linux-mips@linux-mips.org
    Patchwork: http://patchwork.linux-mips.org/patch/1093/
    Signed-off-by: Ralf Baechle

    David Daney
     
  • While playing with the out-of-tree MAE driver module, the system would
    panic after a while in the db1200 custom wait code after wakeup due to
    a clobbered k0 register being used as target address of a store op.

    Remove the custom wait implementation and revert back to the Alchemy-
    recommended implementation already set as default.

    Signed-off-by: Manuel Lauss
    To: Linux-MIPS
    Patchwork: http://patchwork.linux-mips.org/patch/1092/
    Signed-off-by: Ralf Baechle

    Manuel Lauss
     
  • Signed-off-by: Ralf Baechle

    Ralf Baechle
     
  • Commit b3594a089f1c17ff919f8f78505c3f20e1f6f8ce (lmo) rsp.
    351336929ccf222ae38ff0cb7a8dd5fd5c6236a0 (kernel.org) break non-GPL modules
    that use __vmalloc() or any of the vmap(), vm_map_ram(), etc functions on
    MIPS.

    All those functions are EXPORT_SYMBOL() so are meant to be allowed to be
    used by non-GPL kernel modules. These calls all take page protection as
    an argument which is normally a constant like PAGE_KERNEL.

    This commit causes all protection constants like PAGE_KERNEL to not be
    constants and instead to contain the GPL-only symbol _page_cachable_default.

    This means that all calls to __vmalloc(), vmap(), etc, cause non-GPL
    modules to fail to link with the complaint that they are trying to use the
    GPL-only symbol _page_cachable_default...

    Change EXPORT_SYMBOL_GPL(_page_cachable_default) to EXPORT_SYMBOL() for
    non-GPL modules that call __vmalloc(), vmap(), vm_map_ram() etc.

    Signed-off-by: Anton Altaparmakov
    Cc: Chris Dearman
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: http://patchwork.linux-mips.org/patch/1084/
    Signed-off-by: Ralf Baechle

    Anton Altaparmakov
     
  • The M3 workaround needs to cmpare the region and VPN2 fields only.

    Signed-off-by: Ralf Baechle

    Ralf Baechle
     
  • Since 2083e8327aeeaf818b0e4522a9d2539835c60423, the SPROM is now registered
    in the board_prom_init callback, but it references variables and functions
    which are declared below. Move the variables and functions above
    board_prom_init.

    Signed-off-by: Florian Fainelli
    To: linux-mips@linux-mips.org
    Patchwork: http://patchwork.linux-mips.org/patch/1077/
    Signed-off-by: Ralf Baechle

    Florian Fainelli
     
  • This is needed for the fix of the M3 workaround.

    Signed-off-by: Ralf Baechle

    Ralf Baechle
     
  • Previously it was unconditionally used on all Sibyte family SOCs. The
    M3 bug has to be handled in the TLB exception handler which is extremly
    performance sensitive, so this modification is expected to deliver around
    2-3% performance improvment. This is important as required changes to the
    M3 workaround will make it more costly.

    Signed-off-by: Ralf Baechle

    Ralf Baechle
     
  • To avoid a glitch during GPIO initialisation read GPIO output register
    values left by the firmware.

    Signed-off-by: Maxime Bizon
    To: linux-mips@linux-mips.org
    Patchwork: http://patchwork.linux-mips.org/patch/903/
    Signed-off-by: Ralf Baechle

    Maxime Bizon
     
  • Signed-off-by: Florian Fainelli
    To: Maxime Bizon
    Cc: linux-mips@linux-mips.org
    Patchwork: http://patchwork.linux-mips.org/patch/1017/
    Signed-off-by: Ralf Baechle

    Florian Fainelli
     
  • Fix typo: CONFIG_BCMCPU_IS_63xx does not exist;
    CONFIG_BCM63XX_CPU_63xx is the valid config option.

    Signed-off-by: Maxime Bizon
    To: linux-mips@linux-mips.org
    Cc: Maxime Bizon
    Patchwork: http://patchwork.linux-mips.org/patch/901/
    Signed-off-by: Ralf Baechle

    Maxime Bizon
     
  • The BCm63xx SOC has two uarts. Some boards use the second one for
    bluetooth. This patch changes platform device registration code to
    handle this. Changes to the UART driver were already merged in
    6a2c7eabfd09ca7986bf96b8958a87ca041a19d8.

    Signed-off-by: Maxime Bizon
    To: linux-mips@linux-mips.org
    Cc: Maxime Bizon
    Patchwork: http://patchwork.linux-mips.org/patch/900/
    Signed-off-by: Ralf Baechle

    Maxime Bizon
     
  • bcm63xx_gpio_init is already called from prom_init to allow board to use
    them early, so we can remove the unneeded arch_initcall.

    Signed-off-by: Maxime Bizon
    To: linux-mips@linux-mips.org
    Cc: Maxime Bizon
    Patchwork: http://patchwork.linux-mips.org/patch/899/
    Signed-off-by: Ralf Baechle

    Maxime Bizon
     
  • The DWVS0 board is a BCM6358-based board with an on-board OHCI controler.

    Signed-off-by: Florian Fainelli
    To: linux-mips@linux-mips.org
    Patchwork: http://patchwork.linux-mips.org/patch/1015/
    Signed-off-by: Ralf Baechle

    Florian Fainelli
     
  • Signed-off-by: Florian Fainelli
    To: linux-mips@linux-mips.org
    Patchwork: http://patchwork.linux-mips.org/patch/1014/
    Signed-off-by: Ralf Baechle

    Florian Fainelli
     
  • The number of GPIOs on BCM6338 is 8, while BCM6345 has only 16 GPIOs
    available.

    Signed-off-by: Florian Fainelli
    To: linux-mips@linux-mips.org
    Patchwork: http://patchwork.linux-mips.org/patch/1016/
    Signed-off-by: Ralf Baechle

    Florian Fainelli
     
  • arch/mips/lib/libgcc.h:21: ERROR: open brace '{' following union go on the same line

    Signed-off-by: Andrea Gelmini
    To: linux-kernel@vger.kernel.org
    Cc: Paul Mundt
    Cc: linux-mips@linux-mips.org
    Cc: linux-sh@vger.kernel.org
    Patchwork: http://patchwork.linux-mips.org/patch/1007/
    Signed-off-by: Ralf Baechle

    Andrea Gelmini
     
  • As per chapter 15 "Errata: Issue of Out-of-order in loongson"[1] to work
    around the Loongson 2F erratum we need to do:

    "When switching from user mode to kernel mode, you should flush the
    branch target history such as BTB and RAS."

    [1] Chinese version: http://www.loongson.cn/uploadfile/file/200808211
    [2] English version of chapter 15:
    http://groups.google.com.hk/group/loongson-dev/msg/e0d2e220958f10a6?dmode=source

    Signed-off-by: Wu Zhangjin
    Cc: linux-mips@linux-mips.org
    Cc: Shinya Kuribayashi
    Patchwork: http://patchwork.linux-mips.org/patch/1066/
    Signed-off-by: Ralf Baechle

    Wu Zhangjin
     
  • This is a follow on to the vdso patch.

    Since all processes now have signal trampolines permanently mapped, we
    can use those instead of putting the trampoline on the stack and
    invalidating the corresponding icache across all CPUs. We also get rid
    of a bunch of ICACHE_REFILLS_WORKAROUND_WAR code.

    [Ralf: GDB 7.1 which has the necessary modifications to allow backtracing
    over signal frames will supposedly be released tomorrow. The old signal
    frame format obsoleted by this patch exists in two variations, for sane
    processors and for those requiring ICACHE_REFILLS_WORKAROUND_WAR. So
    there was never a GDB which did support backtracing over signal frames
    on all MIPS systems. This convinved me this series should be applied and
    pushed upstream as soon as possible.]

    Signed-off-by: David Daney
    To: linux-mips@linux-mips.org
    Patchwork: http://patchwork.linux-mips.org/patch/974/
    Signed-off-by: Ralf Baechle

    David Daney
     
  • This is a preliminary patch to add a vdso to all user processes. Still
    missing are ELF headers and .eh_frame information. But it is enough to
    allow us to move signal trampolines off of the stack. Note that emulation
    of branch delay slots in the FPU emulator still requires the stack.

    We allocate a single page (the vdso) and write all possible signal
    trampolines into it. The stack is moved down by one page and the vdso is
    mapped into this space.

    Signed-off-by: David Daney
    To: linux-mips@linux-mips.org
    Patchwork: http://patchwork.linux-mips.org/patch/975/
    Signed-off-by: Ralf Baechle

    David Daney
     
  • Signed-off-by: David Daney
    To: linux-mips@linux-mips.org
    Patchwork: http://patchwork.linux-mips.org/patch/976/
    Signed-off-by: Ralf Baechle

    David Daney
     
  • On AR7, we already redefine PHYS_OFFSET to match the system specifities, it
    is however not sufficient when unsing dma_{map,unmap}_single, specifically
    in the ethernet driver, we must also adjust CAC_ADDR and UNCAC_ADDR for DMA
    to work correctly. This patch fixes the following issue, seen in cpmac_open:

    ops[#1]:
    Cpu 0
    $ 0 : 00000000 10008400 a0f5b120 00000000
    $ 4 : 94c59000 94270f64 00000020 00000010
    $ 8 : 00000010 94103ce0 0000000a 94c03400
    $12 : ffffffff 94c03408 94c03410 00000001
    $16 : a0f5ba20 00000041 94c592c0 94c59200
    $20 : 94c59000 000005ee 00002000 9438c8f0
    $24 : 00000010 00000000
    $28 : 94fac000 94fadd58 94390000 942724a8
    Hi : 00000000
    Lo : 00000001
    epc : 94272518 cpmac_open+0x208/0x3f8
    Not tainted
    ra : 942724a8 cpmac_open+0x198/0x3f8
    Status: 10008403 KERNEL EXL IE
    Cause : 3080000c
    BadVA : 00000000
    PrId : 00018448 (MIPS 4KEc)
    Modules linked in:
    Process ifconfig (pid: 278, threadinfo=94fac000, task=94e79590, tls=00000000)
    Stack : 7f8da120 2ab05cb0 94c59000 943356f0 00000000 943d0000 94c59000 943356f0
    94c59030 943d0000 943c27c0 94fade10 00000000 94fade20 94c59000 9428e5a4
    00000000 94c59000 00000041 94289768 94c59000 00000041 00001002 00001043
    00000000 9428d810 00000000 94fade10 7f8da4e8 9428e6b8 00000000 7f8da4a8
    7f8da4e8 00008914 00000000 942f7f2c 00000000 00000008 00408000 00008913
    ...
    Call Trace:
    [] cpmac_open+0x208/0x3f8
    [] dev_open+0x164/0x264
    [] dev_change_flags+0xd0/0x1bc
    [] devinet_ioctl+0x2d8/0x908
    [] sock_ioctl+0x29c/0x2fc
    [] vfs_ioctl+0x2c/0x7c
    [] do_vfs_ioctl+0x5dc/0x630
    [] sys_ioctl+0x50/0x88
    [] stack_done+0x20/0x3c

    Signed-off-by: peter fuerst
    Signed-off-by: Florian Fainelli
    To: linux-mips@linux-mips.org
    Patchwork: http://patchwork.linux-mips.org/patch/1050/
    Signed-off-by: Ralf Baechle

    Florian Fainelli
     
  • Seems I trimmed one too many lines in
    29ca2d81bd2a62fa86bc9a72ddadcf03d7daf795 (lmo) rsp
    7084338eb8eb0cc021ba86c340157bad397f3f0b (kernel.org) which led to no
    functioning Ethernet on my WAG54Gv2. This patch restores the AWOL line.

    Signed-off-by: Alexander Clouter
    To: linux-mips@linux-mips.org
    Patchwork: http://patchwork.linux-mips.org/patch/1065/
    Signed-off-by: Ralf Baechle

    Alexander Clouter
     
  • Seems in my whitespace cleanup 0f2536082d01448daeced8d9e82c3ba1751fefa3
    (lmo) rsp. 8c2961da46abd85a71d20f2b169bf80618e (kernel.org) caused AR7
    to no longer get as far as init. Fixed my phat fingering.

    Signed-off-by: Alexander Clouter
    To: linux-mips@linux-mips.org
    Patchwork: http://patchwork.linux-mips.org/patch/1064/
    Signed-off-by: Ralf Baechle

    Alexander Clouter