21 Mar, 2012

1 commit


13 Mar, 2012

6 commits

  • Provide a common function to initialize a channels cookie values.

    Signed-off-by: Russell King
    Tested-by: Linus Walleij
    Reviewed-by: Linus Walleij
    Acked-by: Jassi Brar
    [imx-sdma.c & mxs-dma.c]
    Tested-by: Shawn Guo
    Signed-off-by: Vinod Koul

    Russell King - ARM Linux
     
  • Now that we have the completed cookie in the dma_chan structure, we
    can consolidate the tx_status functions by providing a function to set
    the txstate structure and returning the DMA status. We also provide
    a separate helper to set the residue for cookies which are still in
    progress.

    Signed-off-by: Russell King
    Tested-by: Linus Walleij
    Reviewed-by: Linus Walleij
    Acked-by: Jassi Brar
    [imx-sdma.c & mxs-dma.c]
    Tested-by: Shawn Guo
    Signed-off-by: Vinod Koul

    Russell King - ARM Linux
     
  • Provide a common function to do the cookie mechanics for completing
    a DMA descriptor.

    Signed-off-by: Russell King
    Tested-by: Linus Walleij
    Reviewed-by: Linus Walleij
    Acked-by: Jassi Brar
    [imx-sdma.c & mxs-dma.c]
    Tested-by: Shawn Guo
    Signed-off-by: Vinod Koul

    Russell King - ARM Linux
     
  • Everyone deals with assigning DMA cookies in the same way (it's part of
    the API so they should be), so lets consolidate the common code into a
    helper function to avoid this duplication.

    Signed-off-by: Russell King
    Tested-by: Linus Walleij
    Reviewed-by: Linus Walleij
    Acked-by: Jassi Brar
    [imx-sdma.c & mxs-dma.c]
    Tested-by: Shawn Guo
    Signed-off-by: Vinod Koul

    Russell King - ARM Linux
     
  • Add a local private header file to contain definitions and declarations
    which should only be used by DMA engine drivers.

    We also fix linux/dmaengine.h to use LINUX_DMAENGINE_H to guard against
    multiple inclusion.

    Signed-off-by: Russell King
    Tested-by: Linus Walleij
    Reviewed-by: Linus Walleij
    Acked-by: Jassi Brar
    [imx-sdma.c & mxs-dma.c]
    Tested-by: Shawn Guo
    Signed-off-by: Vinod Koul

    Russell King - ARM Linux
     
  • Every DMA engine implementation declares a last completed dma cookie
    in their private dma channel structures. This is pointless, and
    forces driver specific code. Move this out into the common dma_chan
    structure.

    Signed-off-by: Russell King
    Tested-by: Linus Walleij
    Reviewed-by: Linus Walleij
    Acked-by: Jassi Brar
    [imx-sdma.c & mxs-dma.c]
    Tested-by: Shawn Guo
    Signed-off-by: Vinod Koul

    Russell King - ARM Linux
     

05 Dec, 2011

2 commits

  • If dma_terminate_all() is called before the ep93xx_dma_tasklet() gets to run,
    it tries to access an empty ->active list which results following OOPS:

    Internal error: Oops - undefined instruction: 0 [#1]
    CPU: 0 Not tainted (3.2.0-rc1EP-1+ #1008)
    PC is at 0xc184c868
    LR is at ep93xx_dma_tasklet+0xec/0x164
    pc : [] lr : [] psr: 00000013
    sp : c02b7e70 ip : ffffffff fp : c02b7ea4
    r10: 00000100 r9 : 80000013 r8 : c02b7e50
    r7 : c02b7e70 r6 : c02b7ea4 r5 : 000000a4 r4 : c02b7e70
    r3 : c02b751d r2 : 8ae34598 r1 : c184c6e0 r0 : c02b7ea4
    Flags: nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
    Control: c000717f Table: c0004000 DAC: 00000017
    Process swapper (pid: 0, stack limit = 0xc02b6270)
    Stack: (0xc02b7e70 to 0xc02b8000)
    7e60: c02b7ea4 c02b7e70 c0008b64 c02bd5c4
    7e80: c02d60e0 00000000 00000000 c02bd44c c02d60e0 00000100 c02b7ec4 c02b7ea8
    7ea0: c001c49c c012b44c 00000018 00000001 c02d60e0 c02b6000 c02b7f04 c02b7ec8
    7ec0: c001cbc0 c001c3e4 c02b7eec c02b7ed8 00000006 0000000a c02bf674 c02c458c
    7ee0: 00000011 00000000 c02b7f7c c0004000 41129200 c02b0c80 c02b7f14 c02b7f08
    7f00: c001cdd0 c001cb38 c02b7f34 c02b7f18 c000983c c001cd98 c0009a60 60000013
    7f20: fefb0001 c02b7f7c c02b7f44 c02b7f38 c0008190 c0009810 c02b7f9c c02b7f48
    7f40: c0008b64 c0008190 c02c2bf8 00000002 c02b7f90 60000013 c02b6000 c02d1504
    7f60: c02baa88 c02baa80 c0004000 41129200 c02b0c80 c02b7f9c c02b7fa0 c02b7f90
    7f80: c0009a54 c0009a60 60000013 ffffffff c02b7fbc c02b7fa0 c000a03c c0009a40
    7fa0: c02b80b0 c02b19dc c02b19d8 c02baa80 c02b7fcc c02b7fc0 c02384e4 c0009fd4
    7fc0: c02b7ff4 c02b7fd0 c029d924 c0238494 c029d49c 00000000 00000000 c02b19dc
    7fe0: c0007175 c02b803c 00000000 c02b7ff8 c000803c c029d700 00000000 00000000
    Backtrace:
    [] (ep93xx_dma_tasklet+0x0/0x164) from [] (tasklet_action+0xc8/0xdc)
    [] (tasklet_action+0x0/0xdc) from [] (__do_softirq+0x98/0x154)
    r7:c02b6000 r6:c02d60e0 r5:00000001 r4:00000018
    [] (__do_softirq+0x0/0x154) from [] (irq_exit+0x48/0x50)
    [] (irq_exit+0x0/0x50) from [] (handle_IRQ+0x3c/0x8c)
    [] (handle_IRQ+0x0/0x8c) from [] (asm_do_IRQ+0x10/0x14)
    r7:c02b7f7c r6:fefb0001 r5:60000013 r4:c0009a60
    [] (asm_do_IRQ+0x0/0x14) from [] (__irq_svc+0x24/0xc0)
    Exception stack(0xc02b7f48 to 0xc02b7f90)
    7f40: c02c2bf8 00000002 c02b7f90 60000013 c02b6000 c02d1504
    7f60: c02baa88 c02baa80 c0004000 41129200 c02b0c80 c02b7f9c c02b7fa0 c02b7f90
    7f80: c0009a54 c0009a60 60000013 ffffffff
    [] (default_idle+0x0/0x34) from [] (cpu_idle+0x78/0xb0)
    [] (cpu_idle+0x0/0xb0) from [] (rest_init+0x60/0x78)
    r7:c02baa80 r6:c02b19d8 r5:c02b19dc r4:c02b80b0
    [] (rest_init+0x0/0x78) from [] (start_kernel+0x234/0x278)
    [] (start_kernel+0x0/0x278) from [] (0xc000803c)
    r5:c02b803c r4:c0007175
    Code: 42555300 54535953 643d4d45 65766972 (53007372)

    To make the code a bit more robust against things like these, we modify
    ep93xx_dma_get_active() to return NULL in case of empty ->active list and make
    sure that callers handle this correctly.

    Reported-by: Rafal Prylowski
    Signed-off-by: Mika Westerberg
    Acked-by: H Hartley Sweeten
    Signed-off-by: Vinod Koul

    Mika Westerberg
     
  • Setting the flags in case of IDE didn't have any effect since the control
    register is overwritten few lines below. So move these to be after the control
    register is initialized.

    Signed-off-by: Rafal Prylowski
    Signed-off-by: Mika Westerberg
    Acked-by: H Hartley Sweeten
    Signed-off-by: Vinod Koul

    Rafal Prylowski
     

27 Oct, 2011

1 commit

  • fixup usage of dma direction by introducing dma_transfer_direction,
    this patch moves dma/drivers/* to use new enum

    Cc: Jassi Brar
    Cc: Russell King
    Cc: Viresh Kumar
    Cc: Linus Walleij
    Cc: Nicolas Ferre
    Cc: Mika Westerberg
    Cc: H Hartley Sweeten
    Cc: Li Yang
    Cc: Zhang Wei
    Cc: Sascha Hauer
    Cc: Guennadi Liakhovetski
    Cc: Shawn Guo
    Cc: Yong Wang
    Cc: Tomoya MORINAGA
    Cc: Boojin Kim
    Cc: Barry Song
    Acked-by: Mika Westerberg
    Acked-by: Linus Walleij
    Acked-by: Viresh Kumar
    Acked-by: Nicolas Ferre
    Signed-off-by: Vinod Koul

    Vinod Koul
     

16 Oct, 2011

1 commit


16 Jun, 2011

1 commit


06 Jun, 2011

1 commit

  • The ep93xx DMA controller has 10 independent memory to peripheral (M2P)
    channels, and 2 dedicated memory to memory (M2M) channels. M2M channels can
    also be used by SPI and IDE to perform DMA transfers to/from their memory
    mapped FIFOs.

    This driver supports both M2P and M2M channels with DMA_SLAVE, DMA_CYCLIC and
    DMA_MEMCPY (M2M only) capabilities.

    Signed-off-by: Mika Westerberg
    Signed-off-by: Ryan Mallon
    Acked-by: H Hartley Sweeten
    Acked-by: Vinod Koul
    Cc: Dan Williams
    Signed-off-by: Vinod Koul

    Mika Westerberg