1 Subject: net/ps3_gelic: Fix RX DMA restart
3 Fix the condition where PS3 network RX hangs when no network
4 TX is occuring by calling gelic_card_enable_rxdmac() during
5 RX_DMA_CHAIN_END event processing.
7 The gelic hardware automatically clears its RX_DMA_EN flag when
8 it detects an RX_DMA_CHAIN_END event. In its processing of
9 RX_DMA_CHAIN_END the gelic driver is required to set RX_DMA_EN
10 (with a call to gelic_card_enable_rxdmac()) to restart RX DMA
11 transfers. The existing gelic driver code does not set
12 RX_DMA_EN directly in its processing of the RX_DMA_CHAIN_END
13 event, but uses a flag variable card->rx_dma_restart_required
14 to schedule the setting of RX_DMA_EN until next inside the
17 It seems this delayed setting of RX_DMA_EN causes the hang since
18 the next RX interrupt after the RX_DMA_CHAIN_END event where
19 RX_DMA_EN is scheduled to be set will not occur since RX_DMA_EN
20 was not set. In the case were network TX is occuring, RX_DMA_EN
21 is set in the next TX interrupt and RX processing continues.
23 Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
25 drivers/net/ps3_gelic_net.c | 21 ++++++++-------------
26 drivers/net/ps3_gelic_net.h | 1 -
27 2 files changed, 8 insertions(+), 14 deletions(-)
29 --- a/drivers/net/ps3_gelic_net.c
30 +++ b/drivers/net/ps3_gelic_net.c
31 @@ -970,10 +970,6 @@ static int gelic_card_decode_one_descr(s
34 status = gelic_descr_get_status(descr);
35 - /* is this descriptor terminated with next_descr == NULL? */
37 - be32_to_cpu(descr->dmac_cmd_status) &
38 - GELIC_DESCR_RX_DMA_CHAIN_END;
40 if (status == GELIC_DESCR_DMA_CARDOWNED)
42 @@ -1036,6 +1032,11 @@ static int gelic_card_decode_one_descr(s
43 /* ok, we've got a packet in descr */
44 gelic_net_pass_skb_up(descr, card, netdev);
47 + /* is the current descriptor terminated with next_descr == NULL? */
49 + be32_to_cpu(descr->dmac_cmd_status) &
50 + GELIC_DESCR_RX_DMA_CHAIN_END;
52 * So that always DMAC can see the end
53 * of the descriptor chain to avoid
54 @@ -1064,10 +1065,9 @@ refill:
55 * If dmac chain was met, DMAC stopped.
58 - if (dmac_chain_ended) {
59 - card->rx_dma_restart_required = 1;
60 - dev_dbg(ctodev(card), "reenable rx dma scheduled\n");
63 + if (dmac_chain_ended)
64 + gelic_card_enable_rxdmac(card);
68 @@ -1133,11 +1133,6 @@ static irqreturn_t gelic_card_interrupt(
70 status &= card->irq_mask;
72 - if (card->rx_dma_restart_required) {
73 - card->rx_dma_restart_required = 0;
74 - gelic_card_enable_rxdmac(card);
77 if (status & GELIC_CARD_RXINT) {
78 gelic_card_rx_irq_off(card);
79 napi_schedule(&card->napi);
80 --- a/drivers/net/ps3_gelic_net.h
81 +++ b/drivers/net/ps3_gelic_net.h
82 @@ -284,7 +284,6 @@ struct gelic_card {
84 struct gelic_descr_chain tx_chain;
85 struct gelic_descr_chain rx_chain;
86 - int rx_dma_restart_required;
89 * tx_lock guards tx descriptor list and