From: Andy Fleming <afleming@freescale.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH] gianfar: Wait for both RX and TX to stop
Date: Sun, 18 Apr 2010 18:13:21 -0500 [thread overview]
Message-ID: <1271632401-2472-1-git-send-email-afleming@freescale.com> (raw)
When gracefully stopping the controller, the driver was continuing if
*either* RX or TX had stopped. We need to wait for both, or the
controller could get into an invalid state.
Signed-off-by: Andy Fleming <afleming@freescale.com>
---
drivers/net/gianfar.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 032073d..6038397 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1571,8 +1571,9 @@ static void gfar_halt_nodisable(struct net_device *dev)
tempval |= (DMACTRL_GRS | DMACTRL_GTS);
gfar_write(®s->dmactrl, tempval);
- while (!(gfar_read(®s->ievent) &
- (IEVENT_GRSC | IEVENT_GTSC)))
+ while ((gfar_read(®s->ievent) &
+ (IEVENT_GRSC | IEVENT_GTSC)) !=
+ (IEVENT_GRSC | IEVENT_GTSC))
cpu_relax();
}
}
--
1.6.5.2.g6ff9a
next reply other threads:[~2010-04-18 23:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-18 23:13 Andy Fleming [this message]
2010-04-19 21:08 ` [PATCH] gianfar: Wait for both RX and TX to stop Timur Tabi
2010-04-20 4:43 ` Kumar Gala
2010-04-20 15:01 ` Timur Tabi
2010-04-20 15:59 ` Timur Tabi
2010-04-21 1:06 ` David Miller
2010-04-21 4:22 ` Kumar Gala
2010-04-21 5:36 ` David Miller
2010-04-21 12:17 ` Kumar Gala
2010-04-21 14:33 ` Timur Tabi
2010-04-21 19:13 ` Kumar Gala
2010-04-21 21:33 ` David Miller
2010-04-20 4:44 ` Kumar Gala
2010-04-20 8:18 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1271632401-2472-1-git-send-email-afleming@freescale.com \
--to=afleming@freescale.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).