From patchwork Mon Jul 6 00:40:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 240738 List-Id: U-Boot discussion From: andre.przywara at arm.com (Andre Przywara) Date: Mon, 6 Jul 2020 01:40:38 +0100 Subject: [PATCH 07/15] net: sun8i_emac: Reduce cache maintenance on TX descriptor init In-Reply-To: <20200706004046.20842-1-andre.przywara@arm.com> References: <20200706004046.20842-1-andre.przywara@arm.com> Message-ID: <20200706004046.20842-8-andre.przywara@arm.com> When we initialise the TX descriptors, there is no need yet to clean them all to memory, as they don't contain any data yet. Later we will touch and clean each descriptor anyway. However we tell the MAC about the beginning of the chain, so we have to clean at least the first descriptor, to make it clear that this is empty and there are no packets to transfer yet. Signed-off-by: Andre Przywara --- drivers/net/sun8i_emac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c index 44ec8f3a63..38c56bde70 100644 --- a/drivers/net/sun8i_emac.c +++ b/drivers/net/sun8i_emac.c @@ -431,10 +431,10 @@ static void tx_descs_init(struct emac_eth_dev *priv) /* Correcting the last pointer of the chain */ desc_p->next = (uintptr_t)&desc_table_p[0]; - /* Flush all Tx buffer descriptors */ + /* Flush the first TX buffer descriptor we will tell the MAC about. */ flush_dcache_range((uintptr_t)priv->tx_chain, (uintptr_t)priv->tx_chain + - sizeof(priv->tx_chain)); + sizeof(priv->tx_chain[0])); writel((uintptr_t)&desc_table_p[0], priv->mac_reg + EMAC_TX_DMA_DESC); priv->tx_currdescnum = 0;