MIPS: qca956x: Fix gmac descriptor corruption issue

tftp transfer failed as gmac descriptor got corrupted.
GMAC descriptors gets addresses from malloc area that
were already used and made free by some other module.
There is a cache invalidate issue when tftp transfer
happens and gmac descriptors gets corrupted.
flush_cache is needed to avoid this.

Change-Id: I40ae7c771bcac3fade78de4454bfa3dafde4b70a
Signed-off-by: Prabhu Jayakumar <pjayak@codeaurora.org>
This commit is contained in:
Prabhu Jayakumar 2016-05-09 18:18:41 +05:30 committed by Gerrit - the friendly Code Review server
parent 8f7336f0a6
commit cb833dd465

View file

@ -538,10 +538,12 @@ static int ath_gmac_alloc_fifo(int ndesc, ath_gmac_desc_t ** fifo)
return -1;
}
/* Desc gets overwritten maliciously, this is temp WAR */
p = p+ 4096;
p = (uchar *) (((u32) p + CONFIG_SYS_CACHELINE_SIZE - 1) &
~(CONFIG_SYS_CACHELINE_SIZE - 1));
/* gmac descriptors got overwritten due to cache invalidation issue. So , flush_cache is needed here*/
flush_cache((u32)p, (sizeof(ath_gmac_desc_t) * ndesc));
p = UNCACHED_SDRAM(p);
for (i = 0; i < ndesc; i++)