All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Frank Li <Frank.li@nxp.com>
Cc: Jie Hai <haijie1@huawei.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Samuel Holland <samuel.holland@sifive.com>,
	Li Zetao <lizetao1@huawei.com>, Guanhua Gao <guanhua.gao@nxp.com>,
	"open list:DMA GENERIC OFFLOAD ENGINE SUBSYSTEM"
	<dmaengine@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:FREESCALE eDMA DRIVER" <imx@lists.linux.dev>,
	"open list:SIFIVE DRIVERS" <linux-riscv@lists.infradead.org>
Subject: Re: [PATCH v2] dmaegine: virt-dma : Fix multi-user with vchan
Date: Thu, 20 Jun 2024 21:47:01 +0530	[thread overview]
Message-ID: <ZnRV_fE8QViZG66o@matsya> (raw)
In-Reply-To: <ZnQ/AyffdW+u9C8P@lizhi-Precision-Tower-5810>

On 20-06-24, 10:38, Frank Li wrote:
> On Thu, Jun 20, 2024 at 10:53:53AM +0800, Jie Hai wrote:
> > List desc_allocated was introduced for the case of a transfer
> > submitted multiple times. But elegating descriptors on the list
> > causes other problems.
> > 
> > For example, in the multi-thread scenario, which tasks are
> > continuously created and submitted by each thread. If one of
> > the threads calls dmaengine_terminate_all, for dirvers using
> > vchan_get_all_descriptors, all descriptors will be freed. If
> > there's another thread submitting a transfer A by
> > vchan_tx_submit, the following results may be generated:
> > 1. desc A is freeing -> visit wrong address of node prep/next.
> > 2. desc A is freed -> visit invalid address of A.
> > 
> > In the above case, calltrace is generated and the system is
> > suspended. This can be tested by dmatest.
> 
> What's test steps to reproduce this problem?

I think I have asked in past (dont recall if that was this or some other
one), hopefully will get to hear on this one..

PS: Good hygiene to trim replies

-- 
~Vinod

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org>
To: Frank Li <Frank.li@nxp.com>
Cc: Jie Hai <haijie1@huawei.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Samuel Holland <samuel.holland@sifive.com>,
	Li Zetao <lizetao1@huawei.com>, Guanhua Gao <guanhua.gao@nxp.com>,
	"open list:DMA GENERIC OFFLOAD ENGINE SUBSYSTEM"
	<dmaengine@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:FREESCALE eDMA DRIVER" <imx@lists.linux.dev>,
	"open list:SIFIVE DRIVERS" <linux-riscv@lists.infradead.org>
Subject: Re: [PATCH v2] dmaegine: virt-dma : Fix multi-user with vchan
Date: Thu, 20 Jun 2024 21:47:01 +0530	[thread overview]
Message-ID: <ZnRV_fE8QViZG66o@matsya> (raw)
In-Reply-To: <ZnQ/AyffdW+u9C8P@lizhi-Precision-Tower-5810>

On 20-06-24, 10:38, Frank Li wrote:
> On Thu, Jun 20, 2024 at 10:53:53AM +0800, Jie Hai wrote:
> > List desc_allocated was introduced for the case of a transfer
> > submitted multiple times. But elegating descriptors on the list
> > causes other problems.
> > 
> > For example, in the multi-thread scenario, which tasks are
> > continuously created and submitted by each thread. If one of
> > the threads calls dmaengine_terminate_all, for dirvers using
> > vchan_get_all_descriptors, all descriptors will be freed. If
> > there's another thread submitting a transfer A by
> > vchan_tx_submit, the following results may be generated:
> > 1. desc A is freeing -> visit wrong address of node prep/next.
> > 2. desc A is freed -> visit invalid address of A.
> > 
> > In the above case, calltrace is generated and the system is
> > suspended. This can be tested by dmatest.
> 
> What's test steps to reproduce this problem?

I think I have asked in past (dont recall if that was this or some other
one), hopefully will get to hear on this one..

PS: Good hygiene to trim replies

-- 
~Vinod

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2024-06-20 16:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-20 11:42 [PATCH] dmaengine: virt-dma : fix vchan error on multi-thread Jie Hai
2023-09-25  1:09 ` Jie Hai
2023-12-08  1:52 ` Jie Hai
2024-01-31  1:32 ` Jie Hai
2024-06-20  2:53 ` [PATCH v2] dmaegine: virt-dma : Fix multi-user with vchan Jie Hai
2024-06-20  2:53   ` Jie Hai
2024-06-20 14:38   ` Frank Li
2024-06-20 14:38     ` Frank Li
2024-06-20 16:17     ` Vinod Koul [this message]
2024-06-20 16:17       ` Vinod Koul
2024-06-29  2:00     ` Jie Hai
2024-06-29  2:00       ` Jie Hai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZnRV_fE8QViZG66o@matsya \
    --to=vkoul@kernel.org \
    --cc=Frank.li@nxp.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=guanhua.gao@nxp.com \
    --cc=haijie1@huawei.com \
    --cc=imx@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lizetao1@huawei.com \
    --cc=paul.walmsley@sifive.com \
    --cc=samuel.holland@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.