dmaengine Archive on
 help / color / Atom feed
From: Robert Jarzmik <>
To: Sascha Hauer <>
Cc:, Peter Ujfalusi <>,
	Vinod Koul <>,
Subject: Re: vchan helper broken wrt locking
Date: Wed, 04 Dec 2019 09:45:57 +0100
Message-ID: <87wobcxyuy.fsf@belgarion.home> (raw)
In-Reply-To: <> (Sascha Hauer's message of "Tue, 3 Dec 2019 12:50:50 +0100")

Sascha Hauer <> writes:

> Hi All,

Hi Sascha,

The short story : from my understanding, vc->desc_free() shouldn't be called
with vd->lock held. The locking of callbacks called by virt-dma shouldn't be
handled by virt-dma, but be a part of the dma driver's architecture rather than
forced by virt-dma.

The long story :

This is what I remember and my understanding for the virt-dma :
 - virt_dma_chan->lock protects only :
   - all lists within virt_dma_chan
   - virt_dma_desc->node, which is on one of the above lists

As a consequence of this statement, this lock shouldn't be held for other parts
of the code, and therefore not while calling vc->desc_free().

I base the above statement on my "former" understanding, and that is a code I
dealt with years ago, so I might be a little rusty here and there.  The original
code Russell wrote states in virt-dma.h :
 - in structure "struct_dma_desc"
   The "protected by vc.lock" is just for the "node" field
 - in structure "struct virt_dma_chan"
   The "protected by vc.lock" is just above the 4 lists (originally 3, and the I
   added one more)

Now Peter might have more insight, as he has modified the code more recently
that I did.



PS: And yes, there are occurrences of list manipulations in virt-dma that should
be protected by vc.lock as you pointed out.

  reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03 11:50 Sascha Hauer
2019-12-04  8:45 ` Robert Jarzmik [this message]
2019-12-04 11:47 ` Peter Ujfalusi
2019-12-04 14:01   ` Vinod Koul
2019-12-04 15:51   ` Sascha Hauer

Reply instructions:

You may reply publically 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:

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

  git send-email \
    --in-reply-to=87wobcxyuy.fsf@belgarion.home \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

dmaengine Archive on

Archives are clonable:
	git clone --mirror dmaengine/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dmaengine dmaengine/ \
	public-inbox-index dmaengine

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone