lkml.org 
[lkml]   [2020]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] dma: zynqmp_dma: Initialize descriptor list after freeing during reset
From
Date
Hello Vinod,

On 02.05.2020 14:32, Vinod Koul wrote:
> Would it not be better to use list_del_init() where we delete it rather
> than do the init here?
>

It is not a problem of list element itself not being initialized.
The problem is that during fault conditions (zynqmp_dma_reset) all
elements are moved to free list. List head however is not reinitialized.

In normal flow elements are removed by list_del and resubmitted to
free list with zynqmp_dma_free_descriptor.

static void zynqmp_dma_chan_desc_cleanup(struct zynqmp_dma_chan *chan)
{
    ...
    list_for_each_entry_safe(desc, next, &chan->done_list, node) {
        ...
        list_del(&desc->node);
        ...
        zynqmp_dma_free_descriptor(chan, desc);
    }
}

The zynqmp_dma_free_descriptor does not delete elements from the
list by itself.
I am not he author of this driver so I fixed it by
doing non intrusive changes.

Anyways, I do not see how using list_del_init would fix the bug.

Regards, Rafal

\
 
 \ /
  Last update: 2020-05-02 15:09    [W:0.097 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site