All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 0/2] davinci emac dcache ops on buffers
@ 2016-08-15 17:22 Karl Beldan
  2016-08-15 17:23 ` [U-Boot] [PATCH v2 1/2] net: davinci_emac: Round up top tx buffer boundaries for dcache ops Karl Beldan
  2016-08-15 17:23 ` [U-Boot] [PATCH v2 2/2] net: davinci_emac: Invalidate only the received portion of a buffer Karl Beldan
  0 siblings, 2 replies; 11+ messages in thread
From: Karl Beldan @ 2016-08-15 17:22 UTC (permalink / raw)
  To: u-boot

Changes from v1:

 - Prefer dcache_op(base, base + ALIGN(len, PKTALIGN))
   to     dcache_op(base, round_up(base + len, ARCH_DMA_MINALIGN))
   as suggested by Tom and Joe.

 - In v2_1/2, explicitly align the top tx buffers only since the rx top
   ones are obviously already properly aligned.

Karl Beldan (2):
  net: davinci_emac: Round up top tx buffer boundaries for dcache ops
  net: davinci_emac: Invalidate only the received portion of a buffer

 drivers/net/davinci_emac.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

-- 
2.9.2

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v2 1/2] net: davinci_emac: Round up top tx buffer boundaries for dcache ops
  2016-08-15 17:22 [U-Boot] [PATCH v2 0/2] davinci emac dcache ops on buffers Karl Beldan
@ 2016-08-15 17:23 ` Karl Beldan
  2016-08-15 17:28   ` Joe Hershberger
                     ` (3 more replies)
  2016-08-15 17:23 ` [U-Boot] [PATCH v2 2/2] net: davinci_emac: Invalidate only the received portion of a buffer Karl Beldan
  1 sibling, 4 replies; 11+ messages in thread
From: Karl Beldan @ 2016-08-15 17:23 UTC (permalink / raw)
  To: u-boot

check_cache_range() warns that the top boundaries are not properly
aligned when flushing or invalidating the buffers and make these
operations fail.

This gets rid of the remaining warnings:
CACHE: Misaligned operation at range

Signed-off-by: Karl Beldan <karl.beldan+oss@gmail.com>
---
 drivers/net/davinci_emac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 947bfab..62b7a1d 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -632,7 +632,7 @@ static int davinci_eth_send_packet (struct eth_device *dev,
 				      EMAC_CPPI_EOP_BIT);
 
 	flush_dcache_range((unsigned long)packet,
-			(unsigned long)packet + length);
+			   (unsigned long)packet + ALIGN(length, PKTALIGN));
 
 	/* Send the packet */
 	writel(BD_TO_HW((unsigned long)emac_tx_desc), &adap_emac->TX0HDP);
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v2 2/2] net: davinci_emac: Invalidate only the received portion of a buffer
  2016-08-15 17:22 [U-Boot] [PATCH v2 0/2] davinci emac dcache ops on buffers Karl Beldan
  2016-08-15 17:23 ` [U-Boot] [PATCH v2 1/2] net: davinci_emac: Round up top tx buffer boundaries for dcache ops Karl Beldan
@ 2016-08-15 17:23 ` Karl Beldan
  2016-08-15 17:28   ` Joe Hershberger
                     ` (3 more replies)
  1 sibling, 4 replies; 11+ messages in thread
From: Karl Beldan @ 2016-08-15 17:23 UTC (permalink / raw)
  To: u-boot

ATM when receiving a packet the whole buffer is invalidated, this change
optimizes this behaviour.

Signed-off-by: Karl Beldan <karl.beldan+oss@gmail.com>
---
 drivers/net/davinci_emac.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 62b7a1d..f43130a 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -676,12 +676,12 @@ static int davinci_eth_rcv_packet (struct eth_device *dev)
 			printf ("WARN: emac_rcv_pkt: Error in packet\n");
 		} else {
 			unsigned long tmp = (unsigned long)rx_curr_desc->buffer;
+			unsigned short len =
+				rx_curr_desc->buff_off_len & 0xffff;
 
-			invalidate_dcache_range(tmp, tmp + EMAC_RXBUF_SIZE);
-			net_process_received_packet(
-				rx_curr_desc->buffer,
-				rx_curr_desc->buff_off_len & 0xffff);
-			ret = rx_curr_desc->buff_off_len & 0xffff;
+			invalidate_dcache_range(tmp, tmp + ALIGN(len, PKTALIGN));
+			net_process_received_packet(rx_curr_desc->buffer, len);
+			ret = len;
 		}
 
 		/* Ack received packet descriptor */
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v2 2/2] net: davinci_emac: Invalidate only the received portion of a buffer
  2016-08-15 17:23 ` [U-Boot] [PATCH v2 2/2] net: davinci_emac: Invalidate only the received portion of a buffer Karl Beldan
@ 2016-08-15 17:28   ` Joe Hershberger
  2016-08-16  1:09   ` Tom Rini
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Joe Hershberger @ 2016-08-15 17:28 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 15, 2016 at 12:23 PM, Karl Beldan <karl.beldan@gmail.com> wrote:
> ATM when receiving a packet the whole buffer is invalidated, this change
> optimizes this behaviour.
>
> Signed-off-by: Karl Beldan <karl.beldan+oss@gmail.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v2 1/2] net: davinci_emac: Round up top tx buffer boundaries for dcache ops
  2016-08-15 17:23 ` [U-Boot] [PATCH v2 1/2] net: davinci_emac: Round up top tx buffer boundaries for dcache ops Karl Beldan
@ 2016-08-15 17:28   ` Joe Hershberger
  2016-08-16  1:09   ` Tom Rini
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Joe Hershberger @ 2016-08-15 17:28 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 15, 2016 at 12:23 PM, Karl Beldan <karl.beldan@gmail.com> wrote:
> check_cache_range() warns that the top boundaries are not properly
> aligned when flushing or invalidating the buffers and make these
> operations fail.
>
> This gets rid of the remaining warnings:
> CACHE: Misaligned operation at range
>
> Signed-off-by: Karl Beldan <karl.beldan+oss@gmail.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v2 2/2] net: davinci_emac: Invalidate only the received portion of a buffer
  2016-08-15 17:23 ` [U-Boot] [PATCH v2 2/2] net: davinci_emac: Invalidate only the received portion of a buffer Karl Beldan
  2016-08-15 17:28   ` Joe Hershberger
@ 2016-08-16  1:09   ` Tom Rini
  2016-08-17  5:07   ` Mugunthan V N
  2016-08-23  2:28   ` [U-Boot] " Joe Hershberger
  3 siblings, 0 replies; 11+ messages in thread
From: Tom Rini @ 2016-08-16  1:09 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 15, 2016 at 05:23:01PM +0000, Karl Beldan wrote:

> ATM when receiving a packet the whole buffer is invalidated, this change
> optimizes this behaviour.
> 
> Signed-off-by: Karl Beldan <karl.beldan+oss@gmail.com>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160815/8807feb7/attachment.sig>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v2 1/2] net: davinci_emac: Round up top tx buffer boundaries for dcache ops
  2016-08-15 17:23 ` [U-Boot] [PATCH v2 1/2] net: davinci_emac: Round up top tx buffer boundaries for dcache ops Karl Beldan
  2016-08-15 17:28   ` Joe Hershberger
@ 2016-08-16  1:09   ` Tom Rini
  2016-08-17  5:06   ` Mugunthan V N
  2016-08-23  2:28   ` [U-Boot] " Joe Hershberger
  3 siblings, 0 replies; 11+ messages in thread
From: Tom Rini @ 2016-08-16  1:09 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 15, 2016 at 05:23:00PM +0000, Karl Beldan wrote:

> check_cache_range() warns that the top boundaries are not properly
> aligned when flushing or invalidating the buffers and make these
> operations fail.
> 
> This gets rid of the remaining warnings:
> CACHE: Misaligned operation at range
> 
> Signed-off-by: Karl Beldan <karl.beldan+oss@gmail.com>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160815/08a03255/attachment.sig>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v2 1/2] net: davinci_emac: Round up top tx buffer boundaries for dcache ops
  2016-08-15 17:23 ` [U-Boot] [PATCH v2 1/2] net: davinci_emac: Round up top tx buffer boundaries for dcache ops Karl Beldan
  2016-08-15 17:28   ` Joe Hershberger
  2016-08-16  1:09   ` Tom Rini
@ 2016-08-17  5:06   ` Mugunthan V N
  2016-08-23  2:28   ` [U-Boot] " Joe Hershberger
  3 siblings, 0 replies; 11+ messages in thread
From: Mugunthan V N @ 2016-08-17  5:06 UTC (permalink / raw)
  To: u-boot

On Monday 15 August 2016 10:53 PM, Karl Beldan wrote:
> check_cache_range() warns that the top boundaries are not properly
> aligned when flushing or invalidating the buffers and make these
> operations fail.
> 
> This gets rid of the remaining warnings:
> CACHE: Misaligned operation at range
> 
> Signed-off-by: Karl Beldan <karl.beldan+oss@gmail.com>

Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>

Regards
Mugunthan V N

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v2 2/2] net: davinci_emac: Invalidate only the received portion of a buffer
  2016-08-15 17:23 ` [U-Boot] [PATCH v2 2/2] net: davinci_emac: Invalidate only the received portion of a buffer Karl Beldan
  2016-08-15 17:28   ` Joe Hershberger
  2016-08-16  1:09   ` Tom Rini
@ 2016-08-17  5:07   ` Mugunthan V N
  2016-08-23  2:28   ` [U-Boot] " Joe Hershberger
  3 siblings, 0 replies; 11+ messages in thread
From: Mugunthan V N @ 2016-08-17  5:07 UTC (permalink / raw)
  To: u-boot

On Monday 15 August 2016 10:53 PM, Karl Beldan wrote:
> ATM when receiving a packet the whole buffer is invalidated, this change
> optimizes this behaviour.
> 
> Signed-off-by: Karl Beldan <karl.beldan+oss@gmail.com>

Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>

Regards
Mugunthan V N

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] net: davinci_emac: Round up top tx buffer boundaries for dcache ops
  2016-08-15 17:23 ` [U-Boot] [PATCH v2 1/2] net: davinci_emac: Round up top tx buffer boundaries for dcache ops Karl Beldan
                     ` (2 preceding siblings ...)
  2016-08-17  5:06   ` Mugunthan V N
@ 2016-08-23  2:28   ` Joe Hershberger
  3 siblings, 0 replies; 11+ messages in thread
From: Joe Hershberger @ 2016-08-23  2:28 UTC (permalink / raw)
  To: u-boot

Hi karl,

https://patchwork.ozlabs.org/patch/659357/ was applied to u-boot-net.git.

Thanks!
-Joe

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] net: davinci_emac: Invalidate only the received portion of a buffer
  2016-08-15 17:23 ` [U-Boot] [PATCH v2 2/2] net: davinci_emac: Invalidate only the received portion of a buffer Karl Beldan
                     ` (2 preceding siblings ...)
  2016-08-17  5:07   ` Mugunthan V N
@ 2016-08-23  2:28   ` Joe Hershberger
  3 siblings, 0 replies; 11+ messages in thread
From: Joe Hershberger @ 2016-08-23  2:28 UTC (permalink / raw)
  To: u-boot

Hi karl,

https://patchwork.ozlabs.org/patch/659358/ was applied to u-boot-net.git.

Thanks!
-Joe

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-08-23  2:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-15 17:22 [U-Boot] [PATCH v2 0/2] davinci emac dcache ops on buffers Karl Beldan
2016-08-15 17:23 ` [U-Boot] [PATCH v2 1/2] net: davinci_emac: Round up top tx buffer boundaries for dcache ops Karl Beldan
2016-08-15 17:28   ` Joe Hershberger
2016-08-16  1:09   ` Tom Rini
2016-08-17  5:06   ` Mugunthan V N
2016-08-23  2:28   ` [U-Boot] " Joe Hershberger
2016-08-15 17:23 ` [U-Boot] [PATCH v2 2/2] net: davinci_emac: Invalidate only the received portion of a buffer Karl Beldan
2016-08-15 17:28   ` Joe Hershberger
2016-08-16  1:09   ` Tom Rini
2016-08-17  5:07   ` Mugunthan V N
2016-08-23  2:28   ` [U-Boot] " Joe Hershberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.