08 Oct, 2020

1 commit

  • Driver doesn't use keyword enum for enum owl_dmadesc_offsets resulting
    in warning:

    drivers/dma/owl-dma.c:139: warning: cannot understand function prototype:
    'enum owl_dmadesc_offsets '

    So add the keyword to fix it and also add documentation for missing
    OWL_DMADESC_SIZE

    Signed-off-by: Vinod Koul
    Link: https://lore.kernel.org/r/20201007083113.567559-6-vkoul@kernel.org
    Signed-off-by: Vinod Koul

    Vinod Koul
     

27 Jul, 2020

2 commits

  • DMA controller present on S700 SoC is compatible with the one on S900
    (as most of registers are same), but it has different DMA descriptor
    structure where registers "fcnt" and "ctrlb" uses different encoding.

    For instance, on S900 "fcnt" starts at offset 0x0c and uses upper 12
    bits whereas on S700, it starts at offset 0x1c and uses lower 12 bits.

    This commit adds support for DMA controller present on S700.

    Signed-off-by: Amit Singh Tomar
    Link: https://lore.kernel.org/r/1595180527-11320-4-git-send-email-amittomer25@gmail.com
    Signed-off-by: Vinod Koul

    Amit Singh Tomar
     
  • At the moment, Driver uses bit fields to describe registers of the DMA
    descriptor structure that makes it less portable and maintainable, and
    Andre suugested(and even sketched important bits for it) to make use of
    array to describe this DMA descriptors instead. It gives the flexibility
    while extending support for other platform such as Actions S700.

    This commit removes the "owl_dma_lli_hw" (that includes bit-fields) and
    uses array to describe DMA descriptor.

    Suggested-by: Andre Przywara
    Signed-off-by: Amit Singh Tomar
    Reviewed-by: Manivannan Sadhasivam
    Link: https://lore.kernel.org/r/1595180527-11320-3-git-send-email-amittomer25@gmail.com
    Signed-off-by: Vinod Koul

    Amit Singh Tomar
     

04 May, 2020

1 commit

  • When the kernel is built with lockdep support and the owl-dma driver is
    used, the following message is shown:

    [ 2.496939] INFO: trying to register non-static key.
    [ 2.501889] the code is fine but needs lockdep annotation.
    [ 2.507357] turning off the locking correctness validator.
    [ 2.512834] CPU: 0 PID: 12 Comm: kworker/0:1 Not tainted 5.6.3+ #15
    [ 2.519084] Hardware name: Generic DT based system
    [ 2.523878] Workqueue: events_freezable mmc_rescan
    [ 2.528681] [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
    [ 2.536420] [] (show_stack) from [] (dump_stack+0xb4/0xe0)
    [ 2.543645] [] (dump_stack) from [] (register_lock_class+0x6f0/0x718)
    [ 2.551816] [] (register_lock_class) from [] (__lock_acquire+0x78/0x25f0)
    [ 2.560330] [] (__lock_acquire) from [] (lock_acquire+0xd8/0x1f4)
    [ 2.568159] [] (lock_acquire) from [] (_raw_spin_lock_irqsave+0x3c/0x50)
    [ 2.576589] [] (_raw_spin_lock_irqsave) from [] (owl_dma_issue_pending+0xbc/0x120)
    [ 2.585884] [] (owl_dma_issue_pending) from [] (owl_mmc_request+0x1b0/0x390)
    [ 2.594655] [] (owl_mmc_request) from [] (mmc_start_request+0x94/0xbc)
    [ 2.602906] [] (mmc_start_request) from [] (mmc_wait_for_req+0x64/0xd0)
    [ 2.611245] [] (mmc_wait_for_req) from [] (mmc_app_send_scr+0x10c/0x144)
    [ 2.619669] [] (mmc_app_send_scr) from [] (mmc_sd_setup_card+0x4c/0x318)
    [ 2.628092] [] (mmc_sd_setup_card) from [] (mmc_sd_init_card+0x104/0x430)
    [ 2.636601] [] (mmc_sd_init_card) from [] (mmc_attach_sd+0xcc/0x16c)
    [ 2.644678] [] (mmc_attach_sd) from [] (mmc_rescan+0x3ac/0x40c)
    [ 2.652332] [] (mmc_rescan) from [] (process_one_work+0x2d8/0x780)
    [ 2.660239] [] (process_one_work) from [] (worker_thread+0x44/0x598)
    [ 2.668323] [] (worker_thread) from [] (kthread+0x148/0x150)
    [ 2.675708] [] (kthread) from [] (ret_from_fork+0x14/0x20)
    [ 2.682912] Exception stack(0xee8fdfb0 to 0xee8fdff8)
    [ 2.687954] dfa0: 00000000 00000000 00000000 00000000
    [ 2.696118] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [ 2.704277] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000

    The obvious fix would be to use 'spin_lock_init()' on 'pchan->lock'
    before attempting to call 'spin_lock_irqsave()' in 'owl_dma_get_pchan()'.

    However, according to Manivannan Sadhasivam, 'pchan->lock' was supposed
    to only protect 'pchan->vchan' while 'od->lock' does a similar job in
    'owl_dma_terminate_pchan()'.

    Therefore, this patch substitutes 'pchan->lock' with 'od->lock' and
    removes the 'lock' attribute in 'owl_dma_pchan' struct.

    Fixes: 47e20577c24d ("dmaengine: Add Actions Semi Owl family S900 DMA driver")
    Signed-off-by: Cristian Ciocaltea
    Reviewed-by: Manivannan Sadhasivam
    Acked-by: Andreas Färber
    Link: https://lore.kernel.org/r/c6e6cdaca252b5364bd294093673951036488cf0.1588439073.git.cristian.ciocaltea@gmail.com
    Signed-off-by: Vinod Koul

    Cristian Ciocaltea
     

26 Dec, 2019

1 commit

  • Originally freeing descriptors was split into a locked and an unlocked
    part. The locked part in vchan_get_all_descriptors() collected all
    descriptors on a separate list_head. This was done to allow iterating
    over that new list in vchan_dma_desc_free_list() without a lock held.

    This became broken in 13bb26ae8850 ("dmaengine: virt-dma: don't always
    free descriptor upon completion"). With this commit
    vchan_dma_desc_free_list() no longer exclusively operates on the
    separate list, but starts to put descriptors which can be reused back on
    &vc->desc_allocated. This list operation should have been locked, but
    wasn't.
    In the mean time drivers started to call vchan_dma_desc_free_list() with
    their lock held so that we now have the situation that
    vchan_dma_desc_free_list() is called locked from some drivers and
    unlocked from others.
    To clean this up we have to do two things:

    1. Add missing locking in vchan_dma_desc_free_list()
    2. Make sure drivers call vchan_dma_desc_free_list() unlocked

    This needs to be done atomically, so in this patch the locking is added
    and all drivers are fixed.

    Signed-off-by: Sascha Hauer
    Reviewed-by: Peter Ujfalusi
    Tested-by: Peter Ujfalusi
    Reviewed-by: Green Wan
    Tested-by: Green Wan
    Link: https://lore.kernel.org/r/20191216105328.15198-3-s.hauer@pengutronix.de
    Signed-off-by: Vinod Koul

    Sascha Hauer
     

14 Oct, 2019

1 commit


16 Oct, 2018

1 commit

  • Following warnings are generated when compiled with W=1,

    drivers/dma/owl-dma.c:170: warning: Function parameter or member 'cyclic'
    not described in 'owl_dma_txd'
    drivers/dma/owl-dma.c:198: warning: Function parameter or member 'cfg' not
    described in 'owl_dma_vchan'
    drivers/dma/owl-dma.c:198: warning: Function parameter or member 'drq' not
    described in 'owl_dma_vchan'
    drivers/dma/owl-dma.c:225: warning: Function parameter or member 'irq' not
    described in 'owl_dma'

    Fix this by adding comments for relevant struct members to appear in
    kernel-doc.

    Fixes: d64e1b3f5cce ("dmaengine: owl: Add Slave and Cyclic mode support for
    Actions Semi Owl S900 SoC")

    Reported-by: Vinod Koul
    Signed-off-by: Manivannan Sadhasivam
    Reviewed-by: Andreas Färber
    Signed-off-by: Vinod Koul

    Manivannan Sadhasivam
     

05 Oct, 2018

1 commit


09 Aug, 2018

1 commit