diff mbox

[PULL,V4,27/31] i.MX: reset TX/RX descriptors when FEC is disabled.

Message ID 1464850102-17829-28-git-send-email-jasowang@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jason Wang June 2, 2016, 6:48 a.m. UTC
From: Jean-Christophe Dubois <jcd@tribudubois.net>

According to the FEC chapter of i.MX25 reference manual

RX adn TX descriptors are reseted when the FEC device is disabled through ECR.

Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/imx_fec.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c
index 768181e..7369cfa 100644
--- a/hw/net/imx_fec.c
+++ b/hw/net/imx_fec.c
@@ -454,6 +454,8 @@  static void imx_fec_write(void *opaque, hwaddr addr,
         }
         if ((s->ecr & FEC_EN) == 0) {
             s->rx_enabled = 0;
+            s->rx_descriptor = s->erdsr;
+            s->tx_descriptor = s->etdsr;
         }
         break;
     case 0x040: /* MMFR */