All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ps3_gelic: Fix error paths when a tx dma fails
@ 2011-07-12 20:13 Andre Heider
  2011-07-12 20:13 ` [PATCH 1/3] ps3_gelic: Fix typos Andre Heider
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Andre Heider @ 2011-07-12 20:13 UTC (permalink / raw)
  To: Geoff Levand; +Cc: netdev, cbe-oss-dev, Andre Heider

This series fixes a few bugs for the error paths once a tx dma request
fails. Without these I either ran into BUG_ON, the device got killed,
or the kernel crashed.

Note about #2:
I'm not sure what "gelic_descr_release_tx(card, descr->next)"
was doing there, ->next was never touched. Did i miss something?

Andre Heider (3):
  ps3_gelic: Fix typos
  ps3_gelic: Fix start_xmit kick error path
  ps3_gelic: Don't kill the device on DMA failure

 drivers/net/ps3_gelic_net.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

-- 
1.7.5.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] ps3_gelic: Fix typos
  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 ` Andre Heider
  2011-07-12 20:13 ` [PATCH 2/3] ps3_gelic: Fix start_xmit kick error path Andre Heider
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Andre Heider @ 2011-07-12 20:13 UTC (permalink / raw)
  To: Geoff Levand; +Cc: netdev, cbe-oss-dev, Andre Heider

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

diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c
index 35e47c3..9652d10 100644
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -876,7 +876,7 @@ int gelic_net_xmit(struct sk_buff *skb, struct net_device *netdev)
 	result = gelic_descr_prepare_tx(card, descr, skb);
 	if (result) {
 		/*
-		 * DMA map failed.  As chanses are that failure
+		 * DMA map failed.  As chances are that failure
 		 * would continue, just release skb and return
 		 */
 		netdev->stats.tx_dropped++;
@@ -1041,7 +1041,7 @@ static int gelic_card_decode_one_descr(struct gelic_card *card)
 		goto refill;
 	}
 	/*
-	 * descriptoers any other than FRAME_END here should
+	 * descriptors any other than FRAME_END here should
 	 * be treated as error.
 	 */
 	if (status != GELIC_DESCR_DMA_FRAME_END) {
@@ -1200,7 +1200,7 @@ void gelic_net_poll_controller(struct net_device *netdev)
 #endif /* CONFIG_NET_POLL_CONTROLLER */
 
 /**
- * gelic_net_open - called upon ifonfig up
+ * gelic_net_open - called upon ifconfig up
  * @netdev: interface device structure
  *
  * returns 0 on success, <0 on failure
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] ps3_gelic: Fix start_xmit kick error path
  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
  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
  3 siblings, 0 replies; 9+ messages in thread
From: Andre Heider @ 2011-07-12 20:13 UTC (permalink / raw)
  To: Geoff Levand; +Cc: netdev, cbe-oss-dev, Andre Heider

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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] ps3_gelic: Don't kill the device on DMA failure
  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 ` [PATCH 2/3] ps3_gelic: Fix start_xmit kick error path Andre Heider
@ 2011-07-12 20:13 ` Andre Heider
  2011-07-13 22:31 ` [PATCH 0/3] ps3_gelic: Fix error paths when a tx dma fails Geoff Levand
  3 siblings, 0 replies; 9+ messages in thread
From: Andre Heider @ 2011-07-12 20:13 UTC (permalink / raw)
  To: Geoff Levand; +Cc: netdev, cbe-oss-dev, Andre Heider

Reset card->tx_dma_progress when lv1_net_start_tx_dma() fails or it
won't send anything afterwards anymore

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

diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c
index 94422fc..4acc17b 100644
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -838,9 +838,11 @@ static int gelic_card_kick_txdma(struct gelic_card *card,
 		card->tx_dma_progress = 1;
 		status = lv1_net_start_tx_dma(bus_id(card), dev_id(card),
 					      descr->bus_addr, 0);
-		if (status)
+		if (status) {
+			card->tx_dma_progress = 0;
 			dev_info(ctodev(card), "lv1_net_start_txdma failed," \
 				 "status=%d\n", status);
+		}
 	}
 	return status;
 }
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/3] ps3_gelic: Fix error paths when a tx dma fails
  2011-07-12 20:13 [PATCH 0/3] ps3_gelic: Fix error paths when a tx dma fails Andre Heider
                   ` (2 preceding siblings ...)
  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 ` Geoff Levand
  2011-07-14  8:36   ` Andre Heider
  3 siblings, 1 reply; 9+ messages in thread
From: Geoff Levand @ 2011-07-13 22:31 UTC (permalink / raw)
  To: Andre Heider; +Cc: netdev, cbe-oss-dev

Hi Andre,

On 07/12/2011 01:13 PM, Andre Heider wrote:
> This series fixes a few bugs for the error paths once a tx dma request
> fails. Without these I either ran into BUG_ON, the device got killed,
> or the kernel crashed.

Thanks for preparing the fixes.  I added them to my ps3-linux
tree and did some quick tests which didn't show any problems.
I'll try to do some more through testing with them sometime
soon.

-Geoff


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/3] ps3_gelic: Fix error paths when a tx dma fails
  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
  0 siblings, 1 reply; 9+ messages in thread
From: Andre Heider @ 2011-07-14  8:36 UTC (permalink / raw)
  To: Geoff Levand; +Cc: netdev, cbe-oss-dev

Hey Geoff,

On Thu, Jul 14, 2011 at 12:31 AM, Geoff Levand <geoff@infradead.org> wrote:
> Hi Andre,
>
> On 07/12/2011 01:13 PM, Andre Heider wrote:
>> This series fixes a few bugs for the error paths once a tx dma request
>> fails. Without these I either ran into BUG_ON, the device got killed,
>> or the kernel crashed.
>
> Thanks for preparing the fixes.  I added them to my ps3-linux
> tree and did some quick tests which didn't show any problems.
> I'll try to do some more through testing with them sometime
> soon.

nice, thanks :)

Regards,
Andre

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/3] ps3_gelic: Fix error paths when a tx dma fails
  2011-07-14  8:36   ` Andre Heider
@ 2011-07-14 15:35     ` David Miller
  2011-07-14 17:10       ` Geoff Levand
  0 siblings, 1 reply; 9+ messages in thread
From: David Miller @ 2011-07-14 15:35 UTC (permalink / raw)
  To: a.heider; +Cc: geoff, netdev, cbe-oss-dev

From: Andre Heider <a.heider@gmail.com>
Date: Thu, 14 Jul 2011 10:36:32 +0200

> Hey Geoff,
> 
> On Thu, Jul 14, 2011 at 12:31 AM, Geoff Levand <geoff@infradead.org> wrote:
>> Hi Andre,
>>
>> On 07/12/2011 01:13 PM, Andre Heider wrote:
>>> This series fixes a few bugs for the error paths once a tx dma request
>>> fails. Without these I either ran into BUG_ON, the device got killed,
>>> or the kernel crashed.
>>
>> Thanks for preparing the fixes.  I added them to my ps3-linux
>> tree and did some quick tests which didn't show any problems.
>> I'll try to do some more through testing with them sometime
>> soon.
> 
> nice, thanks :)

Should I toss these into net-next-2.6 now?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/3] ps3_gelic: Fix error paths when a tx dma fails
  2011-07-14 15:35     ` David Miller
@ 2011-07-14 17:10       ` Geoff Levand
  2011-07-14 17:12         ` David Miller
  0 siblings, 1 reply; 9+ messages in thread
From: Geoff Levand @ 2011-07-14 17:10 UTC (permalink / raw)
  To: David Miller; +Cc: a.heider, netdev, cbe-oss-dev

Hi Dave,

On 07/14/2011 08:35 AM, David Miller wrote:
> From: Andre Heider <a.heider@gmail.com>
> Date: Thu, 14 Jul 2011 10:36:32 +0200
>> 
>> On Thu, Jul 14, 2011 at 12:31 AM, Geoff Levand <geoff@infradead.org> wrote:
>>> Hi Andre,
>>>
>>> On 07/12/2011 01:13 PM, Andre Heider wrote:
>>>> This series fixes a few bugs for the error paths once a tx dma request
>>>> fails. Without these I either ran into BUG_ON, the device got killed,
>>>> or the kernel crashed.
>>>
>>> Thanks for preparing the fixes.  I added them to my ps3-linux
>>> tree and did some quick tests which didn't show any problems.
>>> I'll try to do some more through testing with them sometime
>>> soon.
> 
> Should I toss these into net-next-2.6 now?

It seems reasonable to add these in.  I also have a fix for an
RX interrupt hang that I'll send you.

Acked-by: Geoff Levand <geoff@infradead.org>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/3] ps3_gelic: Fix error paths when a tx dma fails
  2011-07-14 17:10       ` Geoff Levand
@ 2011-07-14 17:12         ` David Miller
  0 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2011-07-14 17:12 UTC (permalink / raw)
  To: geoff; +Cc: a.heider, netdev, cbe-oss-dev

From: Geoff Levand <geoff@infradead.org>
Date: Thu, 14 Jul 2011 10:10:07 -0700

> On 07/14/2011 08:35 AM, David Miller wrote:
>> Should I toss these into net-next-2.6 now?
> 
> It seems reasonable to add these in.  I also have a fix for an
> RX interrupt hang that I'll send you.
> 
> Acked-by: Geoff Levand <geoff@infradead.org>

Great, done.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-07-14 17:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 2/3] ps3_gelic: Fix start_xmit kick error path Andre Heider
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

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.