14 Dec, 2006

2 commits

  • Virtually index, physically tagged cache architectures can get away
    without cache flushing when forking. This patch adds a new cache
    flushing function flush_cache_dup_mm(struct mm_struct *) which for the
    moment I've implemented to do the same thing on all architectures
    except on MIPS where it's a no-op.

    Signed-off-by: Ralf Baechle
    Signed-off-by: Linus Torvalds

    Ralf Baechle
     
  • Currently, to tell a task that it should go to the refrigerator, we set the
    PF_FREEZE flag for it and send a fake signal to it. Unfortunately there
    are two SMP-related problems with this approach. First, a task running on
    another CPU may be updating its flags while the freezer attempts to set
    PF_FREEZE for it and this may leave the task's flags in an inconsistent
    state. Second, there is a potential race between freeze_process() and
    refrigerator() in which freeze_process() running on one CPU is reading a
    task's PF_FREEZE flag while refrigerator() running on another CPU has just
    set PF_FROZEN for the same task and attempts to reset PF_FREEZE for it. If
    the refrigerator wins the race, freeze_process() will state that PF_FREEZE
    hasn't been set for the task and will set it unnecessarily, so the task
    will go to the refrigerator once again after it's been thawed.

    To solve first of these problems we need to stop using PF_FREEZE to tell
    tasks that they should go to the refrigerator. Instead, we can introduce a
    special TIF_*** flag and use it for this purpose, since it is allowed to
    change the other tasks' TIF_*** flags and there are special calls for it.

    To avoid the freeze_process()-refrigerator() race we can make
    freeze_process() to always check the task's PF_FROZEN flag after it's read
    its "freeze" flag. We should also make sure that refrigerator() will
    always reset the task's "freeze" flag after it's set PF_FROZEN for it.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Cc: Russell King
    Cc: David Howells
    Cc: Andi Kleen
    Cc: "Luck, Tony"
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Paul Mundt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

12 Dec, 2006

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (36 commits)
    [POWERPC] Generic BUG for powerpc
    [PPC] Fix compile failure do to introduction of PHY_POLL
    [POWERPC] Only export __mtdcr/__mfdcr if CONFIG_PPC_DCR is set
    [POWERPC] Remove old dcr.S
    [POWERPC] Fix SPU coredump code for max_fdset removal
    [POWERPC] Fix irq routing on some 32-bit PowerMacs
    [POWERPC] ps3: Add vuart support
    [POWERPC] Support ibm,dynamic-reconfiguration-memory nodes
    [POWERPC] dont allow pSeries_probe to succeed without initialising MMU
    [POWERPC] micro optimise pSeries_probe
    [POWERPC] Add SPURR SPR to sysfs
    [POWERPC] Add DSCR SPR to sysfs
    [POWERPC] Fix 440SPe CPU table entry
    [POWERPC] Add support for FP emulation for the e300c2 core
    [POWERPC] of_device_register: propagate device_create_file return code
    [POWERPC] Fix mmap of PCI resource with hack for X
    [POWERPC] iSeries: head_64.o needs to depend on lparmap.s
    [POWERPC] cbe_thermal: Fix initialization of sysfs attribute_group
    [POWERPC] Remove QE header files from lite5200.c
    [POWERPC] of_platform_make_bus_id(): make `magic' int
    ...

    Linus Torvalds
     
  • Make powerpc's __ilog2_u64() take a 64-bit argument.

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

    David Howells
     

11 Dec, 2006

5 commits


09 Dec, 2006

5 commits

  • Now we have a SPURR cpu feature bit, we can export it to userspace in
    sysfs.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Paul Mackerras

    Anton Blanchard
     
  • POWER6 adds a new SPR, the data stream control register (DSCR). It can
    be used to adjust how agressive the prefetch mechanisms are.

    Its possible we may want to context switch this, but for now just export
    it to userspace via sysfs so we can adjust it.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Paul Mackerras

    Anton Blanchard
     
  • This is the grungy swap all the occurrences in the right places patch that
    goes with the updates. At this point we have the same functionality as
    before (except that sgttyb() returns speeds not zero) and are ready to
    begin turning new stuff on providing nobody reports lots of bugs

    If you are a tty driver author converting an out of tree driver the only
    impact should be termios->ktermios name changes for the speed/property
    setting functions from your upper layers.

    If you are implementing your own TCGETS function before then your driver
    was broken already and its about to get a whole lot more painful for you so
    please fix it 8)

    Also fill in c_ispeed/ospeed on init for most devices, although the current
    code will do this for you anyway but I'd like eventually to lose that extra
    paranoia

    [akpm@osdl.org: bluetooth fix]
    [mp3@de.ibm.com: sclp fix]
    [mp3@de.ibm.com: warning fix for tty3270]
    [hugh@veritas.com: fix tty_ioctl powerpc build]
    [jdike@addtoit.com: uml: fix ->set_termios declaration]
    Signed-off-by: Alan Cox
    Signed-off-by: Martin Peschke
    Acked-by: Peter Oberparleiter
    Cc: Cornelia Huck
    Signed-off-by: Hugh Dickins
    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • In order to sort out our struct termios and add proper speed control we need
    to separate the kernel and user termios structures. Glibc is fine but the
    other libraries rely on the kernel exported struct termios and we need to
    extend this without breaking the ABI/API

    To do so we add a struct ktermios which is the kernel view of a termios
    structure and overlaps the struct termios with extra fields on the end for
    now. (That limitation will go away in later patches). Some platforms (eg
    alpha) planned ahead and thus use the same struct for both, others did not.

    This just adds the structures but does not use them, it seems a sensible
    splitting point for bisect if there are compile failures (not that I expect
    them)

    Signed-off-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Provide ilog2() fallbacks for powerpc for 32-bit numbers and 64-bit numbers on
    ppc64.

    Signed-off-by: David Howells
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     

08 Dec, 2006

14 commits

  • The e300c2 has no FPU. Its MSR[FP] is grounded to zero. If an attempt
    is made to execute a floating point instruction (including floating-point
    load, store, or move instructions), the e300c2 takes a floating-point
    unavailable interrupt.

    This patch adds support for FP emulation on the e300c2 by declaring a
    new CPU_FTR_FP_TAKES_FPUNAVAIL, where FP unavail interrupts are
    intercepted and redirected to the ProgramCheck exception path for
    correct emulation handling.

    (If we run out of CPU_FTR bits we could look to reclaim this bit by adding
    support to test the cpu_user_features for PPC_FEATURE_HAS_FPU instead)

    It adds a nop to the exception path for 32-bit processors with a FPU.

    Signed-off-by: Kim Phillips
    Signed-off-by: Kumar Gala

    Kim Phillips
     
  • The powerpc version of pci_resource_to_user() and associated hooks
    used by /proc/bus/pci and /sys/bus/pci mmap have been broken for some
    time on machines that don't have a 1:1 mapping of devices (basically
    on non-PowerMacs) and have PCI devices above 32 bits.

    This attempts to fix it as well as possible.

    The rule is supposed to be that pci_resource_to_user() always converts
    the resources back into a BAR values since that's what the /proc
    interface was supposed to deal with. However, for X to work on
    platforms where PCI MMIO is not mapped 1:1, it became a habit of
    platforms like powerpc to pass "fixed up" values there since X expects
    to be able to use values from /proc/bus/pci/devices as offsets to mmap
    of /dev/mem...

    So we keep that contraption here, causing also /sys/*/resource to
    expose fully absolute MMIO addresses instead of BAR values, which is
    ugly, but should still work as long as those are only used to calculate
    alignment within a page.

    X is still broken when built 32 bits on machines where PCI MMIO can be
    above 32-bit space unfortunately.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     
  • To test for the existence of an RTAS function, we typically do:

    foo_token = rtas_token("foo");
    if (foo_token == RTAS_UNKNOWN_SERVICE)
    return;

    Add a rtas_service_present method, which provides a more conventional
    boolean interface for testing the existence of an RTAS method.

    Signed-off-by: Nathan Lynch
    Signed-off-by: Paul Mackerras

    Nathan Lynch
     
  • The ack_irq macro is unused and conflicts with James' work to template
    the generic irq code. mask_irq and unmask_irq are also unused, so delete
    those macros too.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: Paul Mackerras

    Matthew Wilcox
     
  • The current PowerPC code makes pci_unmap_addr(), pci_unmap_addr_set(),
    and friends trivial for all 32-bit kernels. This is reasonable, since
    for those kernels it is true that pci_unmap_single() does not need the
    DMA address from the original DMA mapping -- in fact, it is a NOP.

    However, I recently tried the tg3 driver on a PowerPC 440SPe machine,
    which runs a 32-bit kernel and has non-cache-coherent PCI DMA. I
    found that the tg3 driver crashed in pci_dma_sync_single_for_cpu(),
    since for non-coherent systems, that function must invalidate the
    cache for the DMA address range requested, and therefore it does use
    the address passed in. tg3 uses a DMA address it stashes away with
    pci_unmap_addr_set() and retrieves with pci_unmap_addr(). Of course,
    since pci_unmap_addr() is defined to (0) right now, this doesn't work.

    It seems to me that the tg3 driver is using pci_unmap_addr() in a
    legitimate way -- I wouldn't want to have to teach all drivers that
    they should use pci_unmap_addr() if they only need the address for
    unmapping functions, but if they want the pci_dma_sync functions, then
    they have to store the DMA address without the helper macros.
    The right fix therefore seems to be in the definition of the macros in
    -- we should use the trivial versions only for 32-bit
    kernels for coherent systems, and the real versions for both 64-bit
    kernels and non-coherent systems.

    Signed-off-by: Roland Dreier
    Signed-off-by: Paul Mackerras

    Roland Dreier
     
  • It uses #ifdef __KERNEL__, so needs to be processed with unifdef.

    Signed-off-by: Arnd Bergann
    Acked-by: Geoff Levand
    Signed-off-by: Paul Mackerras

    Arnd Bergmann
     
  • Move pSeries_mach_cpu_die() into platforms/pseries/hotplug-cpu.c,
    this allows rtas_stop_self() to be static so remove the prototype.

    Wire up pSeries_mach_cpu_die() in the initcall, rather than statically
    in setup.c, the initcall will still run prior to the cpu hotplug code
    being callable, so there should be no change in behaviour.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     
  • Make the contents of the userspace asm/setup.h header consistent on all
    architectures:

    - export setup.h to userspace on all architectures
    - export only COMMAND_LINE_SIZE to userspace
    - frv: move COMMAND_LINE_SIZE from param.h
    - i386: remove duplicate COMMAND_LINE_SIZE from param.h
    - arm:
    - export ATAGs to userspace
    - change u8/u16/u32 to __u8/__u16/__u32

    Signed-off-by: Adrian Bunk
    Acked-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Pass struct dev pointer to dma_cache_sync()

    dma_cache_sync() is ill-designed in that it does not have a struct device
    pointer argument which makes proper support for systems that consist of a
    mix of coherent and non-coherent DMA devices hard. Change dma_cache_sync
    to take a struct device pointer as first argument and fix all its callers
    to pass it.

    Signed-off-by: Ralf Baechle
    Cc: James Bottomley
    Cc: "David S. Miller"
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ralf Baechle
     
  • dma_is_consistent() is ill-designed in that it does not have a struct
    device pointer argument which makes proper support for systems that consist
    of a mix of coherent and non-coherent DMA devices hard. Change
    dma_is_consistent to take a struct device pointer as first argument and fix
    the sole caller to pass it.

    Signed-off-by: Ralf Baechle
    Cc: James Bottomley
    Cc: "David S. Miller"
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ralf Baechle
     
  • Define elf_addr_t in linux/elf.h. The size of the type is determined using
    ELF_CLASS. This allows us to remove the defines that today are spread all
    over .c and .h files.

    Signed-off-by: Magnus Damm
    Cc: Daniel Jacobowitz
    Cc: Roland McGrath
    Cc: Jakub Jelinek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Magnus Damm
     
  • The last thing we agreed on was to remove the macros entirely for 2.6.19,
    on all architectures. Unfortunately, I think nobody actually _did_ that,
    so they are still there.

    [akpm@osdl.org: x86_64 fix]
    Cc: David Woodhouse
    Cc: Greg Schafer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     
  • 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
     
  • Introduce pagefault_{disable,enable}() and use these where previously we did
    manual preempt increments/decrements to make the pagefault handler do the
    atomic thing.

    Currently they still rely on the increased preempt count, but do not rely on
    the disabled preemption, this might go away in the future.

    (NOTE: the extra barrier() in pagefault_disable might fix some holes on
    machines which have too many registers for their own good)

    [heiko.carstens@de.ibm.com: s390 fix]
    Signed-off-by: Peter Zijlstra
    Acked-by: Nick Piggin
    Cc: Martin Schwidefsky
    Signed-off-by: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     

05 Dec, 2006

1 commit

  • CONFIG_LBD and CONFIG_LSF are spread into asm/types.h for no particularly
    good reason.

    Centralising the definition in linux/types.h means that arch maintainers
    don't need to bother adding it, as well as fixing the problem with
    x86-64 users being asked to make a decision that has absolutely no
    effect.

    The H8/300 porters seem particularly confused since I'm not aware of any
    microcontrollers that need to support 2TB filesystems.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: Linus Torvalds

    Matthew Wilcox
     

04 Dec, 2006

11 commits

  • Remove CPU_FTR_16M_PAGE from the cupfeatures mask at runtime on iSeries.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Paul Mackerras

    Stephen Rothwell
     
  • Adds utility routines used by 52xx device drivers and board support
    code. Main functionality is to add device nodes to the of_platform_bus,
    retrieve the IPB bus frequency, and find+ioremap device registers.

    Signed-off-by: Grant Likely
    Signed-off-by: Sylvain Munaut
    Signed-off-by: Paul Mackerras

    Grant Likely
     
  • There is no need to expose these settings outside the scope
    of the interrupt controller code itself.

    Signed-off-by: Sylvain Munaut
    Signed-off-by: Grant Likely
    Signed-off-by: Paul Mackerras

    Sylvain Munaut
     
  • To allow arch/powerpc/kernel/crash.c to build on 32-bit we need a
    definition of hard_irq_disable(). 32-bit doesn't support the lazy
    interrupt disabling mechanism, so on 32-bit hard_irq_disable() is
    simply local_irq_disable(). Add a definition for hard_irq_enable()
    just for completeness.

    This allows (KEXEC=y && PPC32=y) to build again. Broken since
    d04c56f73c30a5e593202ecfcf25ed43d42363a2.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     
  • "extern inline" generates a warning with -Wmissing-prototypes and I'm
    currently working on getting the kernel cleaned up for adding this to
    the CFLAGS since it will help us to avoid a nasty class of runtime
    errors.

    If there are places that really need a forced inline, __always_inline
    would be the correct solution.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Paul Mackerras

    Adrian Bunk
     
  • At least the ide driver calls pcibus_to_node, which is not
    defined when CONFIG_PCI is disabled. This adds a nop function
    for the !PCI case.

    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     
  • A few code paths need to check whether or not they are running
    on the PS3's LV1 hypervisor before making hcalls. This introduces
    a new firmware feature bit for this, FW_FEATURE_PS3_LV1.

    Now when both PS3 and IBM_CELL_BLADE are enabled, but not PSERIES,
    FW_FEATURE_PS3_LV1 and FW_FEATURE_LPAR get enabled at compile time,
    which is a bug. The same problem can also happen for (PPC_ISERIES &&
    !PPC_PSERIES && PPC_SOMETHING_ELSE). In order to solve this, I
    introduce a new CONFIG_PPC_NATIVE option that is set when at least
    one platform is selected that can run without a hypervisor and then
    turns the firmware feature check into a run-time option.

    The new cell oprofile support that was recently merged does not
    work on hypervisor based platforms like the PS3, therefore make
    it depend on PPC_CELL_NATIVE instead of PPC_CELL. This may change
    if we get oprofile support for PS3.

    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     
  • When renaming CONFIG_PS3 to CONFIG_PPC_PS3, a few occurrences have been
    missed.

    I also fixed up the alignment in arch/powerpc/platforms/Makefile.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Arnd Bergmann

    Geert Uytterhoeven
     
  • It may be desireable to build a kernel for cell without
    spufs, e.g. as the initial kboot kernel. This requires
    that the SPU specific parts of the core dump and the xmon
    code depend on CONFIG_SPU_BASE instead of CONFIG_PPC_CELL.

    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     
  • Adds a PS3 system bus driver. This system bus is a virtual bus used to present
    the PS3 system devices in the LDM.

    Signed-off-by: Geoff Levand
    Signed-off-by: Arnd Bergmann

    Geoff Levand
     
  • Adds some needed bits for a config option PS3_USE_LPAR_ADDR that disables
    the PS3 lpar address translation mechanism. This is a currently needed
    workaround for limitations in the design of the generic cell spu support.

    Signed-off-by: Geoff Levand
    Signed-off-by: Arnd Bergmann

    Geoff Levand