diff options
author | Divy Le Ray <divy@chelsio.com> | 2008-10-08 20:36:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-08 20:36:03 -0400 |
commit | 20d3fc11505a2706a33b4c9a932af036d836727f (patch) | |
tree | 8c72b6673ac62166225d30a409b09c2354f5286b /drivers/net/cxgb3/sge.c | |
parent | 45cec1bac0719c904bb5f4405c2937f7e715888c (diff) |
cxgb3: reset the adapter on fatal error
when a fatal error occurs, bring ports down, reset the chip,
and bring ports back up.
Factorize code used for both EEH and fatal error recovery.
Fix timer usage when bringing up/resetting sge queue sets.
Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb3/sge.c')
-rw-r--r-- | drivers/net/cxgb3/sge.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index 7346a8e26da1..87919419b707 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -351,7 +351,8 @@ static void free_rx_bufs(struct pci_dev *pdev, struct sge_fl *q) | |||
351 | pci_unmap_single(pdev, pci_unmap_addr(d, dma_addr), | 351 | pci_unmap_single(pdev, pci_unmap_addr(d, dma_addr), |
352 | q->buf_size, PCI_DMA_FROMDEVICE); | 352 | q->buf_size, PCI_DMA_FROMDEVICE); |
353 | if (q->use_pages) { | 353 | if (q->use_pages) { |
354 | put_page(d->pg_chunk.page); | 354 | if (d->pg_chunk.page) |
355 | put_page(d->pg_chunk.page); | ||
355 | d->pg_chunk.page = NULL; | 356 | d->pg_chunk.page = NULL; |
356 | } else { | 357 | } else { |
357 | kfree_skb(d->skb); | 358 | kfree_skb(d->skb); |
@@ -583,7 +584,7 @@ static void t3_reset_qset(struct sge_qset *q) | |||
583 | memset(q->fl, 0, sizeof(struct sge_fl) * SGE_RXQ_PER_SET); | 584 | memset(q->fl, 0, sizeof(struct sge_fl) * SGE_RXQ_PER_SET); |
584 | memset(q->txq, 0, sizeof(struct sge_txq) * SGE_TXQ_PER_SET); | 585 | memset(q->txq, 0, sizeof(struct sge_txq) * SGE_TXQ_PER_SET); |
585 | q->txq_stopped = 0; | 586 | q->txq_stopped = 0; |
586 | memset(&q->tx_reclaim_timer, 0, sizeof(q->tx_reclaim_timer)); | 587 | q->tx_reclaim_timer.function = NULL; /* for t3_stop_sge_timers() */ |
587 | kfree(q->lro_frag_tbl); | 588 | kfree(q->lro_frag_tbl); |
588 | q->lro_nfrags = q->lro_frag_len = 0; | 589 | q->lro_nfrags = q->lro_frag_len = 0; |
589 | } | 590 | } |
@@ -2840,9 +2841,7 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports, | |||
2840 | struct net_lro_mgr *lro_mgr = &q->lro_mgr; | 2841 | struct net_lro_mgr *lro_mgr = &q->lro_mgr; |
2841 | 2842 | ||
2842 | init_qset_cntxt(q, id); | 2843 | init_qset_cntxt(q, id); |
2843 | init_timer(&q->tx_reclaim_timer); | 2844 | setup_timer(&q->tx_reclaim_timer, sge_timer_cb, (unsigned long)q); |
2844 | q->tx_reclaim_timer.data = (unsigned long)q; | ||
2845 | q->tx_reclaim_timer.function = sge_timer_cb; | ||
2846 | 2845 | ||
2847 | q->fl[0].desc = alloc_ring(adapter->pdev, p->fl_size, | 2846 | q->fl[0].desc = alloc_ring(adapter->pdev, p->fl_size, |
2848 | sizeof(struct rx_desc), | 2847 | sizeof(struct rx_desc), |