RE: [PATCH v2] fix wrong usage of dmaengine_unmap_put in async_xxx

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

 



Hi Dan,

With https://patchwork.kernel.org/patch/3863711/ applied, the issue disappeared.

Thanks,
Xuelin Shi

-----Original Message-----
From: dan.j.williams@xxxxxxxxx [mailto:dan.j.williams@xxxxxxxxx] On Behalf Of Dan Williams
Sent: 2014年4月10日 12:02
To: Shi Xuelin-B29237
Cc: Koul, Vinod; dmaengine@xxxxxxxxxxxxxxx; linuxppc-dev
Subject: Re: [PATCH v2] fix wrong usage of dmaengine_unmap_put in async_xxx

On Thu, Mar 20, 2014 at 1:16 AM,  <xuelin.shi@xxxxxxxxxxxxx> wrote:
> From: Xuelin Shi <xuelin.shi@xxxxxxxxxxxxx>
>
> dmaengine_unmap_put does below two things:
> a) unmap pages for srcs and dests
> b) free unmap struct
>
> The unmap struct data is generated but only initialized while other 
> some dma contions are met, like dma alignment etc.
> If the unmap data is not initialized, call dmaengine_unmap_put will 
> unmap some random data in unmap->addr[...]

Actually, this should be fixed by your other patch:

https://patchwork.kernel.org/patch/3863711/

Because the to_cnt, from_cnt, are properly initialized to zero.  The only issue was that the unmap pool was not specified.

Can you verify that the problem still exists with that patch applied?
I'll mark it for -stable.

> Also call dmaengine_get_unmap_data immediatally after generating tx is 
> not correct. Maybe the tx has not been finished by DMA hardware yet 
> but the srcs and dests are dma unmapped.

I disagree.  It is correct because the unmap data is reference counted.  If the DMA hardware is still using the buffers then it must hold a reference on the unmap data.  The dmaengine_put_unmap_data() instances your are removing are the ones that drop the initial reference count set in dmaengine_get_unmap_data().

?韬{.n?????%??檩??w?{.n???Ё?撖)?骅w*jg????????G??⒏⒎?:+v????????????"??????




[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