[Cbe-oss-dev] new fixes in spufs git tree

Jeremy Kerr jk at ozlabs.org
Mon Apr 28 17:53:47 EST 2008


Hi all,

I've just pushed a bunch of fixes to the spufs tree on kernel.org:

  http://git.kernel.org/?p=linux/kernel/git/jk/spufs.git

The commit logs are appended to this mail.

I believe that these are all set for .26, but more testing is always
good. If you have the spare cycles, try out the current spufs tree,
and let me know how you go.

(would anyone be interested in build snapshots of the spufs tree?)

Cheers,


Jeremy

commit 5fab5a84949305c04ba9bfb971e4e22856f8f296
Author: Luke Browning <lukebr at linux.vnet.ibm.com>
Date:   Mon Apr 28 17:35:56 2008 +1000

    [POWERPC] spufs: handle faults while the context switch pending flag is set
    
    Currently, page fault handlers don't issue a mfc restart if the context
    switch pending flag is set, which can leave us with a hanging DMA after
    a context restore.
    
    This patch introduces fault pending flag that is set by the fault
    handler and read by the context switch code, so that the latter can add
    the restart bit at the right spot, after it has successfuly saved the
    state of the mfc control register.
    
    Signed-off-by: Luke Browning <lukebr at linux.vnet.ibm.com>
    Signed-off-by: Jeremy Kerr <jk at ozlabs.org>

commit 5f306fb3819e0d380d048081750e04f9ad6dcf07
Author: Luke Browning <lukebr at linux.vnet.ibm.com>
Date:   Sun Apr 27 18:41:55 2008 +0000

    [POWERPC] spufs: fix concurrent delivery of class 0 & 1 exceptions
    
    SPU class 0 & 1 exceptions may occur in parallel, so we may end up
    overwriting csa.dsisr.
    
    This change adds dedicated fields for each class to the spu and the spu
    context so that fault data is not overwritten.
    
    Signed-off-by: Luke Browning <lukebr at linux.vnet.ibm.com>
    Signed-off-by: Jeremy Kerr <jk at ozlabs.org>

commit 35940d866a0273eebdf0102b2896ace2905116ae
Author: Luke Browning <lukebr at linux.vnet.ibm.com>
Date:   Mon Apr 28 14:32:34 2008 +1000

    [POWERPC] spufs: try to route SPU interrupts to local node
    
    Currently, we re-route SPU interrupts to the current cpu, which may be
    on a remote node. In the case of time slicing, all spu interrupts will
    end up routed to the same cpu, where the spusched_tick occurs.
    
    This change routes mfc interrupts to the cpu where the controlling
    thread last ran, provided that cpu is on the same node as the spu
    (otherwise don't reroute interrupts).
    
    This should improve performance and provide a more predictable
    environment for processing spu exceptions. In the past we have seen
    concurrent delivery of spu exceptions to two cpus. This eliminates that
    concern.
    
    Signed-off-by: Luke Browning <lukebr at linux.vnet.ibm.com>
    Signed-off-by: Jeremy Kerr <jk at ozlabs.org>

commit bf39f29b4d41de88dfd757531e2a940dc8041b27
Author: Luke Browning <lukebr at linux.vnet.ibm.com>
Date:   Fri Apr 25 14:00:00 2008 +1000

    [POWERPC] spufs: set SPU_CONTEXT_SWITCH_PENDING before synchronising SPU irqs
    
    synchronize_irq() provides the serialization for
    SPU_CONTEXT_SWITCH_PENDING which is read with a simple load. This
    routine guarantees that the relevant interrupt handlers are not running,
    so that the next time they do run they will see the update
    memory value.
    
    This must be done correctly so that exception handling code does not
    restart the mfc in the middle of a context switch while we are trying
    to atomically stop it and save state.
    
    Signed-off-by: Luke Browning <lukebr at linux.vnet.ibm.com>
    Signed-off-by: Jeremy Kerr <jk at ozlabs.org>

commit 68f589785826928f592cca04cf149f5c26de66a0
Author: Jeremy Kerr <jk at ozlabs.org>
Date:   Wed Apr 23 16:02:10 2008 +1000

    [POWERPC] spufs: don't acquire state_mutex interruptible while performing 
callback
    
    There's currently no way to tell if spu_process_callback has
    returned with the state mutex held, as -EINTR may be returned
    by either the syscall or the spu_acquire fail case.
    
    Instead, just do a non-interruptible mutex_lock here.
    
    Signed-off-by: Jeremy Kerr <jk at ozlabs.org>

commit 881b38be13d5203f74b1bdbcff56c4ea0db3b451
Author: Jeremy Kerr <jk at ozlabs.org>
Date:   Wed Apr 23 14:24:27 2008 +1000

    [POWERPC] spufs: update master runcntl with context lock held
    
    Currently, we update the SPU master run control bit (ie,
    spu_enable_spu) in spufs_run_spu before we grab the context mutex. This
    can result in races with other processes accessing this context's
    resources.
    
    This change moves the spu_enable_spu to after we have acquired the
    context lock.
    
    Signed-off-by: Jeremy Kerr <jk at ozlabs.org>

commit 01dd0747711f9e2fc18a497ef30b8edd48c75fb1
Author: Jeremy Kerr <jk at ozlabs.org>
Date:   Thu Apr 24 18:15:40 2008 +1000

    [POWERPC] spufs: fix post-stopped update of MFC_CNTL register
    
    We currently have two issues with the MFC save code:
    
     * save_mfc_decr doesn't handle a transition of 1 -> 0 of the Ds bit
     * The Q bit may be stale in the CSA
    
    This change fixes the first issue by clearing the relevant bits from
    the MFC_CNTL value in the CSA before or-ing in the updated status.
    Also, we add the Q bit to the updated status.
    
    Signed-off-by: Jeremy Kerr <jk at ozlabs.org>

commit 08f81066ab6e0ddb7107c749c10d1ae7fc2f6905
Author: Jeremy Kerr <jk at ozlabs.org>
Date:   Wed Apr 9 15:24:22 2008 +1000

    [POWERPC] spufs: fix save of mfc_cntl register
    
    Currently, we can introduce invalid entries into the MFC queues:
    
    1) context starts a DMA
    
    2) context gets scheduled out during a DMA
      - kernel saves MFC queue to CSA
      - kernel saves 0x0 in csa->mfc_control_RW
    
    3) context gets scheduled in
      - csa->mfc_control[Q] ('queues empty') isn't set, so DMA queues are
        restored from the CSA
    
    4) context's DMA is completed
    
    5) context gets scheduled out again, no DMA occuring this time
      - kernel sees that MFC_CNTL[Q] ('queues empty') is set, so doesn't
        touch saved queue data in CSA
      - kernel saves 0x0 in csa->mfc_control_RW
    
    6) context gets scheduled in
      - csa->mfc_control[Q] ('queues empty') isn't set (we saved is as 0!),
        so DMA queues are restored from the CSA
    
    In this last restore, we've restored the queue status from step 2,
    which are now invalid.
    
    This change makes save_mfc_cntl() closer to the save/restore sequence,
    as specified in the CBE handbook.
    
    With changes from Luke Browning.
    
    Signed-off-by: Jeremy Kerr <jk at ozlabs.org>

commit 499c57c73d693308dedea41618770551c27128d9
Author: Jeremy Kerr <jk at ozlabs.org>
Date:   Mon Apr 7 17:42:36 2008 +1000

    [POWERPC] spufs: don't touch suspend bits when purging DMA queue
    
    When we issue a MFC purge request, we may inadvertantly clear the
    suspended status.
    
    This change adds the MFC_CNTL_SUSPEND_MASK when we issue a purge
    request, so that the suspend bit is masked out.
    
    Signed-off-by: Jeremy Kerr <jk at ozlabs.org>

commit 9ffec7d9238859c8682b1f2afa5f5b8ccf6b9aa6
Author: Jeremy Kerr <jk at ozlabs.org>
Date:   Fri Apr 4 17:55:28 2008 +1100

    [POWERPC] cell: Fix lost interrupts due to fasteoi handler
    
    We may currently lose interrupts during SPE context switch, as we alter
    the INT_Route register. Because the IIC uses a per-thread priority
    status, changing the interrupt routing to a different thread means that
    the IRQ is no longer masked by the priority status, so we end up with
    two fasteoi IRQ handlers executing for the one irq_desc. The fasteoi
    handler doesn't handle multiple IRQs, so drops the second one.
    
    Fix this by using our own flow handler. This is based on
    handle_edge_irq, but issues an eoi after IRQs are handled, and doesn't
    do any mask/unmasking.
    
    Still in development. Still to address:
    
      * Testing. Lots of testing.
    
      * We could probably move handle_iic_irq to more generic flow handler
        (handle_fasteoi_edge_irq?).
    
      * Still waiting on details about how the C3PO handles level-to-edge
        conversion when cascading IRQs from the mpic, in order to verify
        that this is the correct solution.
    
    Signed-off-by: Jeremy Kerr <jk at ozlabs.org>

commit 2a9f13c5f48a5c2b024d3c62bc671fc6552a08e5
Author: Kumar Gala <galak at kernel.crashing.org>
Date:   Fri Apr 25 11:03:03 2008 +1000

    [POWERPC] spufs: add .gitignore for spu_save_dump.h & spu_restore_dump.h
    
    Signed-off-by: Kumar Gala <galak at kernel.crashing.org>
    Signed-off-by: Jeremy Kerr <jk at ozlabs.org>



More information about the cbe-oss-dev mailing list