[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b99f455c-edd8-1a84-337a-fa0dc4ecb16a@nvidia.com>
Date: Tue, 14 Jan 2020 15:16:45 +0000
From: Jon Hunter <jonathanh@...dia.com>
To: Dmitry Osipenko <digetx@...il.com>,
Laxman Dewangan <ldewangan@...dia.com>,
Vinod Koul <vkoul@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
Thierry Reding <thierry.reding@...il.com>,
Michał Mirosław <mirq-linux@...e.qmqm.pl>
CC: <dmaengine@...r.kernel.org>, <linux-tegra@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 03/14] dmaengine: tegra-apb: Prevent race conditions on
channel's freeing
On 12/01/2020 17:29, Dmitry Osipenko wrote:
> It's incorrect to check the channel's "busy" state without taking a lock.
> That shouldn't cause any real troubles, nevertheless it's always better
> not to have any race conditions in the code.
>
> Signed-off-by: Dmitry Osipenko <digetx@...il.com>
> ---
> drivers/dma/tegra20-apb-dma.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
> index 664e9c5df3ba..24ad3a5a04e3 100644
> --- a/drivers/dma/tegra20-apb-dma.c
> +++ b/drivers/dma/tegra20-apb-dma.c
> @@ -1294,8 +1294,7 @@ static void tegra_dma_free_chan_resources(struct dma_chan *dc)
>
> dev_dbg(tdc2dev(tdc), "Freeing channel %d\n", tdc->id);
>
> - if (tdc->busy)
> - tegra_dma_terminate_all(dc);
> + tegra_dma_terminate_all(dc);
>
> spin_lock_irqsave(&tdc->lock, flags);
> list_splice_init(&tdc->pending_sg_req, &sg_req_list);
Acked-by: Jon Hunter <jonathanh@...dia.com>
Cheers
Jon
--
nvpublic
Powered by blists - more mailing lists