Re: vchan helper broken wrt locking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> 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.



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux