Re: [U-Boot] [PATCH 2/3] net/designware: invalidate entire descriptor in dw_eth_send

2014-04-28 Thread Ian Campbell
On Mon, 2014-04-28 at 12:05 +, Alexey Brodkin wrote: > And in this situation IMHO the only safe solution could be in proper > design of data layout. In other words we need to keep independent data > blocks aligned to cache line. > > And as you may see from "designware.h" buffer descriptor str

Re: [U-Boot] [PATCH 2/3] net/designware: invalidate entire descriptor in dw_eth_send

2014-04-28 Thread Alexey Brodkin
Dear Ian, On Sun, 2014-04-27 at 19:47 +0100, Ian Campbell wrote: > This is the driver for one particular ARM cache controller and not the > one used for the SoC. In any case it does "proper" start/end handling > only for cache flush operations, not cache invalidate. > > Cache invalidate is a pot

Re: [U-Boot] [PATCH 2/3] net/designware: invalidate entire descriptor in dw_eth_send

2014-04-27 Thread Ian Campbell
CCing the ARM custodian. Albert, what do you think of Alexey's comments below? Actually, having read it properly myself I think Alexey is confusing cache flushing with cache invalidation, I've left the CC in place though in case you have any thoughts on the matter. On Fri, 2014-04-25 at 08:48 +000

Re: [U-Boot] [PATCH 2/3] net/designware: invalidate entire descriptor in dw_eth_send

2014-04-25 Thread Alexey Brodkin
Hi Ian, On Thu, 2014-04-24 at 20:14 +0100, Ian Campbell wrote: > On Thu, 2014-04-24 at 17:41 +, Alexey Brodkin wrote: > > > 1. Don't invalidate "sizeof(struct dmamacdescr)" but only > > "roundup(sizeof(desc_p->txrx_status), ARCH_DMA_MINALIGN))". > > OK. (Although given the realities of the r

Re: [U-Boot] [PATCH 2/3] net/designware: invalidate entire descriptor in dw_eth_send

2014-04-24 Thread Stefan Monnier
> 1. Don't invalidate "sizeof(struct dmamacdescr)" but only > "roundup(sizeof(desc_p->txrx_status), ARCH_DMA_MINALIGN))". I'm not sure I like this: if ARCH_DMA_MINALIGN is "too large" and ends up invalidating more than the struct, it could be an error, so it's safer to ask it to invalidate the str

Re: [U-Boot] [PATCH 2/3] net/designware: invalidate entire descriptor in dw_eth_send

2014-04-24 Thread Ian Campbell
On Thu, 2014-04-24 at 17:41 +, Alexey Brodkin wrote: > 1. Don't invalidate "sizeof(struct dmamacdescr)" but only > "roundup(sizeof(desc_p->txrx_status), ARCH_DMA_MINALIGN))". OK. (Although given the realities of the real world values of ARCH_DMA_MINALIGN on every arch and the sizes of the str

Re: [U-Boot] [PATCH 2/3] net/designware: invalidate entire descriptor in dw_eth_send

2014-04-24 Thread Alexey Brodkin
Dear Ian, On Sat, 2014-04-19 at 14:52 +0100, Ian Campbell wrote: > - /* Invalidate only "status" field for the following check */ > - invalidate_dcache_range((unsigned long)&desc_p->txrx_status, > - (unsigned long)&desc_p->txrx_status + > -

[U-Boot] [PATCH 2/3] net/designware: invalidate entire descriptor in dw_eth_send

2014-04-19 Thread Ian Campbell
Some platforms cannot invalidate the cache at four byte intervals, so invalidate the entire descriptor. Signed-off-by: Ian Campbell --- drivers/net/designware.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/designware.c b/drivers/net/designware.c ind