From d1b226b7d403b29c1064318097d972ce804e96e7 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 14 Jun 2018 09:08:44 +0200 Subject: net: zynq_gem: Initialize val variable in zynq_gem_miiphy_read() phyread can timeout and val will contain random value. Initialize it to zero not to report random value in case of error. Signed-off-by: Michal Simek Acked-by: Joe Hershberger --- drivers/net/zynq_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index a817f2e5d6..d1138fe090 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -609,7 +609,7 @@ static int zynq_gem_miiphy_read(struct mii_dev *bus, int addr, { struct zynq_gem_priv *priv = bus->priv; int ret; - u16 val; + u16 val = 0; ret = phyread(priv, addr, reg, &val); debug("%s 0x%x, 0x%x, 0x%x, 0x%x\n", __func__, addr, reg, val, ret); -- cgit v1.2.1 From 0f8888b763fdc24e506b538ab521848e0566f9ca Mon Sep 17 00:00:00 2001 From: Rabeeh Khoury Date: Tue, 19 Jun 2018 21:36:50 +0300 Subject: net: mvneta: dcache flush TX descriptors at init This fixes sporadic timeout on initial packet Tx (usually ARP), with an error message like: timeout: packet not sent Reviewed-by: Stefan Roese Tested-by: Chris Packham Acked-by: Joe Hershberger Signed-off-by: Rabeeh Khoury Signed-off-by: Baruch Siach --- drivers/net/mvneta.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 45e5eda955..254dd04697 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -1702,6 +1702,7 @@ static int mvneta_probe(struct udevice *dev) /* Align buffer area for descs and rx_buffers to 1MiB */ bd_space = memalign(1 << MMU_SECTION_SHIFT, BD_SPACE); + flush_dcache_range((ulong)bd_space, (ulong)bd_space + BD_SPACE); mmu_set_region_dcache_behaviour((phys_addr_t)bd_space, BD_SPACE, DCACHE_OFF); buffer_loc.tx_descs = (struct mvneta_tx_desc *)bd_space; -- cgit v1.2.1 From 318b5d76b6661dcaf6934b0a925bbcfdf0469069 Mon Sep 17 00:00:00 2001 From: Rabeeh Khoury Date: Tue, 19 Jun 2018 21:36:51 +0300 Subject: net: mvneta: zero Tx descriptors on init Make the initialization sequence consistent with the Linux kernel driver. Reviewed-by: Stefan Roese Acked-by: Joe Hershberger Signed-off-by: Rabeeh Khoury Signed-off-by: Baruch Siach --- drivers/net/mvneta.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 254dd04697..ab697b9bc7 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -1708,6 +1708,7 @@ static int mvneta_probe(struct udevice *dev) buffer_loc.tx_descs = (struct mvneta_tx_desc *)bd_space; size = roundup(MVNETA_MAX_TXD * sizeof(struct mvneta_tx_desc), ARCH_DMA_MINALIGN); + memset(buffer_loc.tx_descs, 0, size); buffer_loc.rx_descs = (struct mvneta_rx_desc *) ((phys_addr_t)bd_space + size); size += roundup(MVNETA_MAX_RXD * sizeof(struct mvneta_rx_desc), -- cgit v1.2.1