]> Git Repo - u-boot.git/commitdiff
net: dwc: Fix cache alignment issues
authorMarek Vasut <[email protected]>
Sun, 14 Sep 2014 22:50:37 +0000 (00:50 +0200)
committerMarek Vasut <[email protected]>
Mon, 6 Oct 2014 15:36:40 +0000 (17:36 +0200)
Fix remaining cache alignment issues in the DWC Ethernet driver.
Please note that the cache handling in the driver is making the
code hideous and thus the next patch cleans that up. In order to
make this change reviewable though, the cleanup is split from it.

Signed-off-by: Marek Vasut <[email protected]>
Cc: Chin Liang See <[email protected]>
Cc: Dinh Nguyen <[email protected]>
Cc: Albert Aribaud <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Wolfgang Denk <[email protected]>
Cc: Pavel Machek <[email protected]>
Cc: Joe Hershberger <[email protected]>
Acked-by: Pavel Machek <[email protected]>
drivers/net/designware.c

index 7186e3b491ecabd6128720a6284a1ef42d4b93c0..aaf146d444d4e166e651988af8d18934e15dd4c4 100644 (file)
@@ -303,7 +303,8 @@ static int dw_eth_send(struct eth_device *dev, void *packet, int length)
 
        /* Flush data to be sent */
        flush_dcache_range((unsigned long)desc_p->dmamac_addr,
-                          (unsigned long)desc_p->dmamac_addr + length);
+                          (unsigned long)desc_p->dmamac_addr +
+                          roundup(length, ARCH_DMA_MINALIGN));
 
 #if defined(CONFIG_DW_ALTDESCRIPTOR)
        desc_p->txrx_status |= DESC_TXSTS_TXFIRST | DESC_TXSTS_TXLAST;
@@ -372,7 +373,8 @@ static int dw_eth_recv(struct eth_device *dev)
                /* Flush only status field - others weren't changed */
                flush_dcache_range((unsigned long)&desc_p->txrx_status,
                                   (unsigned long)&desc_p->txrx_status +
-                                  sizeof(desc_p->txrx_status));
+                                       roundup(sizeof(desc_p->txrx_status),
+                                               ARCH_DMA_MINALIGN));
 
                /* Test the wrap-around condition. */
                if (++desc_num >= CONFIG_RX_DESCR_NUM)
This page took 0.037244 seconds and 4 git commands to generate.