Re: [U-Boot] [PATCH v3 03/10] sunxi: Remove mmc DMA support

2014-07-26 Thread Hans de Goede

Hi,

On 07/23/2014 07:35 PM, Siarhei Siamashka wrote:

On Mon,  9 Jun 2014 11:36:55 +0200
Hans de Goede hdego...@redhat.com wrote:


The DMA code in sunxi_mmc.c is broken. mmc_trans_data_by_dma() allocates the
dma descriptors on the stack, and then exits while the dma transfer is in
progress, so the dma engine is reading stack memory which at that point may
be re-used. So far we've gotten away with this by luck, but recent u-boot
changes have shifted the stack start address by 16 bytes, which combined
with dma alignment now exposes this problem.

Since we end up just busy waiting for the dma engine anyway, this commit
fixes things by simply removing the dma code, resulting in smaller bug-free
code.

Signed-off-by: Hans de Goede hdego...@redhat.com
Acked-by: Ian Campbell i...@hellion.org.uk


Acked-by: Siarhei Siamashka siarhei.siamas...@gmail.com


Thanks for the review. Note Ian has already submitted a pull-request
for these patches, so your ack won't make it upstream.


Was it a good idea to keep v2014.07 release relying on luck without
this patch?


Considering that things just work there, and the timing of when I found
this out, yes.

Regards,

Hans


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 03/10] sunxi: Remove mmc DMA support

2014-07-23 Thread Siarhei Siamashka
On Mon,  9 Jun 2014 11:36:55 +0200
Hans de Goede hdego...@redhat.com wrote:

 The DMA code in sunxi_mmc.c is broken. mmc_trans_data_by_dma() allocates the
 dma descriptors on the stack, and then exits while the dma transfer is in
 progress, so the dma engine is reading stack memory which at that point may
 be re-used. So far we've gotten away with this by luck, but recent u-boot
 changes have shifted the stack start address by 16 bytes, which combined
 with dma alignment now exposes this problem.
 
 Since we end up just busy waiting for the dma engine anyway, this commit
 fixes things by simply removing the dma code, resulting in smaller bug-free
 code.
 
 Signed-off-by: Hans de Goede hdego...@redhat.com
 Acked-by: Ian Campbell i...@hellion.org.uk

Acked-by: Siarhei Siamashka siarhei.siamas...@gmail.com

Was it a good idea to keep v2014.07 release relying on luck without
this patch?

-- 
Best regards,
Siarhei Siamashka
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot