From: Robert Jarzmik <firstname.lastname@example.org> To: Sascha Hauer <email@example.com> Cc: firstname.lastname@example.org, Peter Ujfalusi <email@example.com>, Vinod Koul <firstname.lastname@example.org>, email@example.com Subject: Re: vchan helper broken wrt locking Date: Wed, 04 Dec 2019 09:45:57 +0100 Message-ID: <firstname.lastname@example.org> (raw) In-Reply-To: <email@example.com> (Sascha Hauer's message of "Tue, 3 Dec 2019 12:50:50 +0100") Sascha Hauer <firstname.lastname@example.org> 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. Cheers. -- Robert PS: And yes, there are occurrences of list manipulations in virt-dma that should be protected by vc.lock as you pointed out.
next prev parent 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: 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 \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.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
dmaengine Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/dmaengine/0 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/ https://lore.kernel.org/dmaengine \ firstname.lastname@example.org public-inbox-index dmaengine Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.kernel.vger.dmaengine AGPL code for this site: git clone https://public-inbox.org/public-inbox.git