All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Heider <a.heider@gmail.com>
To: Geoff Levand <geoff@infradead.org>
Cc: netdev@vger.kernel.org, cbe-oss-dev@lists.ozlabs.org,
	Andre Heider <a.heider@gmail.com>
Subject: [PATCH 2/3] ps3_gelic: Fix start_xmit kick error path
Date: Tue, 12 Jul 2011 22:13:25 +0200	[thread overview]
Message-ID: <1310501606-829-3-git-send-email-a.heider@gmail.com> (raw)
In-Reply-To: <1310501606-829-1-git-send-email-a.heider@gmail.com>

Revert to a proper state when gelic_card_kick_txdma() fails:
- Don't trigger BUG_ON when releasing the unsent tx descriptor
- Reset the tx chain head since the tail was not modified and
  hence not in sync
- Unlink the released descriptor bus address from its predecessor

Signed-off-by: Andre Heider <a.heider@gmail.com>
---
 drivers/net/ps3_gelic_net.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c
index 9652d10..94422fc 100644
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -897,12 +897,16 @@ int gelic_net_xmit(struct sk_buff *skb, struct net_device *netdev)
 	if (gelic_card_kick_txdma(card, descr)) {
 		/*
 		 * kick failed.
-		 * release descriptors which were just prepared
+		 * release descriptor which was just prepared
 		 */
 		netdev->stats.tx_dropped++;
+		/* don't trigger BUG_ON() in gelic_descr_release_tx */
+		descr->data_status = cpu_to_be32(GELIC_DESCR_TX_TAIL);
 		gelic_descr_release_tx(card, descr);
-		gelic_descr_release_tx(card, descr->next);
-		card->tx_chain.tail = descr->next->next;
+		/* reset head */
+		card->tx_chain.head = descr;
+		/* reset hw termination */
+		descr->prev->next_descr_addr = 0;
 		dev_info(ctodev(card), "%s: kick failure\n", __func__);
 	}
 
-- 
1.7.5.4


  parent reply	other threads:[~2011-07-12 20:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-12 20:13 [PATCH 0/3] ps3_gelic: Fix error paths when a tx dma fails Andre Heider
2011-07-12 20:13 ` [PATCH 1/3] ps3_gelic: Fix typos Andre Heider
2011-07-12 20:13 ` Andre Heider [this message]
2011-07-12 20:13 ` [PATCH 3/3] ps3_gelic: Don't kill the device on DMA failure Andre Heider
2011-07-13 22:31 ` [PATCH 0/3] ps3_gelic: Fix error paths when a tx dma fails Geoff Levand
2011-07-14  8:36   ` Andre Heider
2011-07-14 15:35     ` David Miller
2011-07-14 17:10       ` Geoff Levand
2011-07-14 17:12         ` 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=1310501606-829-3-git-send-email-a.heider@gmail.com \
    --to=a.heider@gmail.com \
    --cc=cbe-oss-dev@lists.ozlabs.org \
    --cc=geoff@infradead.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.