20 Dec, 2007

17 commits

  • PowerPC currently doesn't implement pci_set_dma_mask(), which means drivers
    calling it will get the generic version in drivers/pci/pci.c.

    The powerpc dma mapping ops include a dma_set_mask() hook, which luckily is
    not implemented by anyone - so there is no bug in the fact that the hook
    is currently never called.

    However in future we'll add implementation(s) of dma_set_mask(), and so we
    need pci_set_dma_mask() to call the hook.

    To save adding a hook to the dma mapping ops, pci-set_consistent_dma_mask()
    simply calls the dma_set_mask() hook and then copies the new mask into
    dev.coherenet_dma_mask.

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

    Michael Ellerman
     
  • We have multiple calls to has_feature being inlined, but gcc can't
    be sure that the store via get_paca() doesn't alias the path to
    cur_cpu_spec->feature.

    Reorder to put the calls to read_purr and read_spurr adjacent to each
    other. To add a sense of consistency, reorder the remaining lines to
    perform parallel steps on purr and scaled purr of each line instead of
    calculating and then using one value before going on to the next.

    In addition, we can tell gcc that no SPURR means no PURR. The test is
    completely hidden in the PURR case, and in the !PURR case the second test
    is eliminated resulting in the simple register copy in the out-of-line
    branch.

    Further, gcc sees get_paca()->system_time referenced several times and
    allocates a register to address it (shadowing r13) instead of caching its
    value. Reading into a local varable saves the shadow of r13 and removes
    a potentially duplicate load (between the nested if and its parent).

    Signed-off-by: Milton Miller
    Signed-off-by: Paul Mackerras

    Milton Miller
     
  • If CPU_FTR_PURR is not set, we will never set cpu_purr_data->initialized.
    Checking via __get_cpu_var on 64 bit avoids one dependent load compared
    to cpu_has_feature in the not-present case, and is always required when
    it is present. The code is under CONFIG_VIRT_CPU_ACCOUNTING so 32 bit
    will not be affected.

    Signed-off-by: Milton Miller
    Signed-off-by: Paul Mackerras

    Milton Miller
     
  • timer_interrupt() was calculating per_cpu_offset several times, having to
    start from the toc because of potential aliasing issues.

    Placing both decrementer per_cpu varables in a struct and calculating
    the address once with __get_cpu_var results in better code on both 32
    and 64 bit.

    Signed-off-by: Milton Miller
    Signed-off-by: Paul Mackerras

    Milton Miller
     
  • Use __get_cpu_var(x) instead of per_cpu(x, smp_processor_id()), as it
    is optimized on ppc64 to access the current cpu's per-cpu offset directly;
    it's local_paca.offset instead of TOC->paca[local_paca->processor_id].offset.

    This is the trivial portion, two functions with one use each.

    Signed-off-by: Milton Miller
    Signed-off-by: Paul Mackerras

    Milton Miller
     
  • as its only called from time_init, which is __init.

    Also remove unneeded forward declaration.

    Signed-off-by: Milton Miller
    Signed-off-by: Paul Mackerras

    Milton Miller
     
  • The per-processor interrupt request register and current processor
    priority register are only accessed on the current cpu. In fact the
    hypervisor doesn't even let us choose which cpu's registers to access.

    The only function to use cpu twice is xics_migrate_irqs_away, not a fast
    path. But we can cache the result of get_hard_processor_id() instead of
    calling get_hard_smp_processor_id(cpu) in a loop across the call to rtas.

    Years ago the irq code passed smp_processor_id into get_irq, I thought
    we might initialize the CPPR third party at boot as an extra measure of
    saftey, and it made the code symmetric with the qirr (queued interrupt
    for software generated interrupts), but now it is just extra and
    sometimes unneeded work to pass it down.

    Signed-off-by: Milton Miller
    Signed-off-by: Paul Mackerras

    Milton Miller
     
  • This splits the machine definition for celleb into two definitions,
    one for celleb_beat, and the other for celleb_native. Though this
    looks complex because of sorting some functions, there are no
    more semantic changes than that for the splitting.

    Signed-off-by: Kou Ishizaki
    Acked-by: Arnd Bergmann
    Signed-off-by: Paul Mackerras

    Ishizaki Kou
     
  • This makes mmio_nvram_init() callable unconditionally by providing
    a dummy definition when CONFIG_MMIO_NVRAM is not defined.

    Signed-off-by: Kou Ishizaki
    Acked-by: Arnd Bergmann
    Signed-off-by: Paul Mackerras

    Ishizaki Kou
     
  • Implement MSI support for PA Semi PWRficient platforms. MSI is done
    through a special range of sources on the openpic controller, and they're
    unfortunately breaking the usual concepts of how sources are programmed:

    * The source is calculated as 512 + the value written into the MSI
    register
    * The vector for this source is added to the source and reported
    through IACK

    This means that for simplicity, it makes much more sense to just set the
    vector to 0 for the source, since that's really the vector we expect to
    see from IACK.

    Also, the affinity/priority registers will affect 16 sources at a
    time. To avoid most (simple) users from being limited by this, allocate
    16 sources per device but use only one. This means that there's a total
    of 32 sources.

    If we get usage scenarions that need more sources, the allocator should
    probably be revised to take an alignment argument and size, not just do
    natural alignment.

    Finally, since I'm already touching the MPIC names on pasemi, rename
    the base one from the somewhat odd " PAS-OPIC " to "PASEMI-OPIC".

    Signed-off-by: Olof Johansson
    Acked-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Olof Johansson
     
  • Commit fbd568a3e61a7decb8a754ad952aaa5b5c82e9e5 ("Change
    synchronize_kernel to _rcu and _sched") changed the deprecated
    synchronize_kernel() in HvLpEvent_unregisterHandler() to
    synchronize_rcu(). It turns out that it should have been
    synchronize_sched().

    Signed-off-by: Stephen Rothwell
    Acked-by: Paul E. McKenney
    Signed-off-by: Paul Mackerras

    Stephen Rothwell
     
  • Many operations, as currently used in the wrapper, assume they can
    pass NULL and have it be treated as the root node. However, libfdt-wrapper
    converts NULL to -1, which is only appropriate when searching for nodes,
    and will cause an error otherwise.

    Signed-off-by: Scott Wood
    Acked-by: David Gibson
    Signed-off-by: Paul Mackerras

    Scott Wood
     
  • fdt_wrapper_create_node passes a variable called offset to offset_devp(),
    which uses said parameter to initialize a local variable called offset.

    Due to one of the odder aspects of the C language, the result is an
    undefined variable, with no error or warning.

    Signed-off-by: Scott Wood
    Acked-by: David Gibson
    Signed-off-by: Paul Mackerras

    Scott Wood
     
  • Here's a dumb simple implementation of fake NUMA nodes for PowerPC.
    Fake NUMA nodes can be specified using the following command line option

    numa=fake=

    node range is of the format ,,...

    Each of the rangeX parameters is passed using memparse(). I find this
    useful for fake NUMA emulation on my simple PowerPC machine. I've
    tested it on a non-numa box with the following arguments:

    numa=fake=1G
    numa=fake=1G,2G
    name=fake=1G,512M,2G
    numa=fake=1500M,2800M mem=3500M
    numa=fake=1G mem=512M
    numa=fake=1G mem=1G

    Signed-off-by: Balbir Singh
    Acked-by: Olof Johansson
    Signed-off-by: Paul Mackerras

    Balbir Singh
     
  • The machine initcall macros allow initcalls to be registered which
    test machine_is() before executing the initcall.

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

    Grant Likely
     
  • Optimize MPIC IPIs, by passing in the IPI number as the argument to the
    handler, since all we did was translate it back based on which mpic
    the interrupt came though on (and that was always the primary mpic).

    Signed-off-by: Olof Johansson
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Olof Johansson
     
  • …cell-2.6 into for-2.6.25

    Paul Mackerras
     

19 Dec, 2007

19 commits

  • This adds platform_suspend_ops for PMU based machines, directly in
    the PMU driver. This allows suspending via /sys/power/state
    on powerbooks.

    The patch also replaces the PMU ioctl with a simple call to
    pm_suspend(PM_SUSPEND_MEM).

    Additionally, it cleans up some debug code.

    Signed-off-by: Johannes Berg
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Johannes Berg
     
  • Sleep on the powerbook 3400 has been broken since the change that made
    powerbook_sleep_3400 call pmac_suspend_devices(), which disables
    interrupts. There are a couple of loops in powerbook_sleep_3400 that
    depend on interrupts being enabled, and in fact it has to have
    interrupts enabled at the point of going to sleep since it is an
    interrupt from the PMU that wakes it up.

    This fixes it by using pmu_wait_complete() instead of a spinloop, and
    by explicitly enabling interrupts before putting the CPU into sleep
    mode (which is OK since all interrupts except the PMU interrupt have
    been disabled at the interrupt controller by this stage).

    This changes the logic so that it keeps putting the CPU into sleep mode
    until the completion of the interrupt transaction from the PMU that
    signals the end of sleep. Also, we now call pmu_unlock() before sleep
    so that the via_pmu_interrupt() code can process the interrupt event
    from the PMU properly.

    Now that generic code saves and restores PCI state, it is no longer
    necessary to do that here. Thus pbook_pci_save/restore and related
    functions are no longer necessary, so this removes them.

    Lastly, this moves the ioremap of the memory controller to init code
    rather than doing it on every sleep/wakeup cycle.

    Signed-off-by: Paul Mackerras

    Paul Mackerras
     
  • This is fairly straightforward, and lets us get rid of x.completion
    as well.

    Signed-off-by: Paul Mackerras

    Paul Mackerras
     
  • This converts the therm_pm72.c driver to use the kthread API. I
    thought about making it use kthread_stop() instead of the `state'
    variable and the `ctrl_complete' completion, but that isn't simple and
    will require changing the way that `state' is used.

    Signed-off-by: Paul Mackerras

    Paul Mackerras
     
  • This converts adb.c to use the kthread API.

    It also changes adb_request so that if the ADBREQ_SYNC flag is
    specified, we now sleep waiting for the request to finish using an
    on-stack completion rather than spinning. To implement this, we now
    require that if the ADBREQ_SYNC flag is set, the `done' parameter must
    be NULL. All of the existing callers of adb_request that pass
    ADBREQ_SYNC appear to be in process context and have done == NULL.
    Doing this allows us to get rid of an awful hack in adb_request()
    where we used to test whether the request was coming from the adb
    probe task and use a completion if it was, and otherwise spin.

    This also gets rid of a static request block that was used if the req
    parameter to adb_request was NULL. None of the callers do that any
    more, so the static request block is no longer necessary.

    Signed-off-by: Paul Mackerras

    Paul Mackerras
     
  • We aren't supposed to use kernel_thread directly in drivers any more,
    and in fact using kthread_run is a bit simpler.

    Signed-off-by: Paul Mackerras

    Paul Mackerras
     
  • This kills off the remnants of the old sleep notifiers now that they
    are no longer used.

    Signed-off-by: Johannes Berg
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Johannes Berg
     
  • This replaces the pmu sleep notifier that adb had with suspend/resume
    hooks in a new platform driver/device.

    Signed-off-by: Johannes Berg
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Johannes Berg
     
  • We're currently getting a warning from not checking the result of
    sysfs_create_group, which is declared as __must_check.

    This change introduces appropriate error-handling for
    spu_add_sysdev_attr_group()

    Signed-off-by: Jeremy Kerr
    Signed-off-by: Arnd Bergmann

    Jeremy Kerr
     
  • Currently, we have a possibilty that the SLBs setup during context
    switch don't cover the entirety of the necessary lscsa and code
    regions, if these regions cross a segment boundary.

    This change checks the start and end of each region, and inserts a SLB
    entry for each, if unique. We also remove the assumption that the
    spu_save_code and spu_restore_code reside in the same segment, by using
    the specific code array for save and restore.

    Signed-off-by: Jeremy Kerr
    Signed-off-by: Arnd Bergmann

    Jeremy Kerr
     
  • Add a function spu_64k_pages_available(), so that we can abstract the
    explicity use of mmu_psize_defs() in lssca_alloc.c

    Signed-off-by: Jeremy Kerr
    Signed-off-by: Arnd Bergmann

    Jeremy Kerr
     
  • Now that we have a helper function to setup a SPU SLB, use it for
    __spu_trap_data_seq.

    Signed-off-by: Jeremy Kerr
    Signed-off-by: Arnd Bergmann

    Jeremy Kerr
     
  • Currently, the SPU context switch code (spufs/switch.c) sets up the
    SPU's SLBs directly, which requires some low-level mm stuff.

    This change moves the kernel SLB setup to spu_base.c, by exposing
    a function spu_setup_kernel_slbs() to do this setup. This allows us
    to remove the low-level mm code from switch.c, making it possible
    to later move switch.c to the spufs module.

    Also, add a struct spu_slb for the cases where we need to deal with
    SLB entries.

    Signed-off-by: Jeremy Kerr
    Signed-off-by: Arnd Bergmann

    Jeremy Kerr
     
  • This patch changes the way we check for the existence of
    vicinity property in spe device nodes.

    The new implementation does not depend on having an initialized
    cbe_spu_info[0].spus, and checks for presence of vicinity in all
    nodes, not only in the first one.

    Signed-off-by: Andre Detsch
    Signed-off-by: Jeremy Kerr
    Signed-off-by: Arnd Bergmann

    Andre Detsch
     
  • Export force_sig_info to allow signals to be sent from a modular spufs.

    Signed-off-by: Jeremy Kerr
    Signed-off-by: Arnd Bergmann

    Jeremy Kerr
     
  • Signed-off-by: Jon Loeliger
    Acked-by: Stephen Rothwell
    Signed-off-by: Arnd Bergmann

    Jon Loeliger
     
  • Two printk() calls were missing the terminating '\n'.

    Signed-off-by: Kou Ishizaki
    Signed-off-by: Arnd Bergmann

    Ishizaki Kou
     
  • Fix debug_bus_control and group_control PMU register values set up in
    set_pm_event(). Initialize variables before calling set_pm_event().
    Delete unused static array and code that initialized it.
    Rename constant to better reflect usage.

    Signed-off-by: Bob Nelson
    Signed-off-by: Arnd Bergmann

    Bob Nelson
     
  • The pm_interval register in the Cell PMU is read/write, but was implemented in
    the kernel as write-only. Previously, the written value was saved in a "shadow"
    copy so calls to cbe_read_pm() could return the value.

    Perfmon2 needs to be able to read the current values of pm_interval, so change
    cbe_read_pm() to read the actual register instead of the "shadow" copy. There
    is currently no code in the kernel that tries to read the pm_interval register
    with cbe_read_pm() (expecting to receive the "shadow" value), so this should
    not break any existing code.

    Signed-off-by: Kevin Corry
    Signed-off-by: Carl Love
    Signed-off-by: Arnd Bergmann

    Kevin Corry
     

14 Dec, 2007

4 commits