diff options
author | David S. Miller <davem@davemloft.net> | 2017-01-24 15:27:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-24 15:27:59 -0500 |
commit | 294628c1fe660b5c4ba4127df05ff2aa8c09a08a (patch) | |
tree | 9097881a608091eefbbcc1793df9406f5231c399 | |
parent | 5b9f57516337b523f7466a53939aaaea7b78141b (diff) | |
parent | 185aceefd80f98dc5b9d73eb6cbb70739a5ce4ea (diff) |
Merge branch 'alx-mq-fixes'
Tobias Regnery says:
====================
alx: fix fallout from multi queue conversion
Here are 3 fixes for the multi queue conversion in v4.10.
The first patch fixes a wrong condition in an if statement.
Patches 2 and 3 fixes regressions in the corner case when requesting msi-x
interrupts fails and we fall back to msi or legacy interrupts.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/atheros/alx/main.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c index c8f525574d68..7dcc907a449d 100644 --- a/drivers/net/ethernet/atheros/alx/main.c +++ b/drivers/net/ethernet/atheros/alx/main.c | |||
@@ -685,8 +685,6 @@ static int alx_alloc_rings(struct alx_priv *alx) | |||
685 | return -ENOMEM; | 685 | return -ENOMEM; |
686 | } | 686 | } |
687 | 687 | ||
688 | alx_reinit_rings(alx); | ||
689 | |||
690 | return 0; | 688 | return 0; |
691 | } | 689 | } |
692 | 690 | ||
@@ -703,7 +701,7 @@ static void alx_free_rings(struct alx_priv *alx) | |||
703 | if (alx->qnapi[0] && alx->qnapi[0]->rxq) | 701 | if (alx->qnapi[0] && alx->qnapi[0]->rxq) |
704 | kfree(alx->qnapi[0]->rxq->bufs); | 702 | kfree(alx->qnapi[0]->rxq->bufs); |
705 | 703 | ||
706 | if (!alx->descmem.virt) | 704 | if (alx->descmem.virt) |
707 | dma_free_coherent(&alx->hw.pdev->dev, | 705 | dma_free_coherent(&alx->hw.pdev->dev, |
708 | alx->descmem.size, | 706 | alx->descmem.size, |
709 | alx->descmem.virt, | 707 | alx->descmem.virt, |
@@ -984,6 +982,7 @@ static int alx_realloc_resources(struct alx_priv *alx) | |||
984 | alx_free_rings(alx); | 982 | alx_free_rings(alx); |
985 | alx_free_napis(alx); | 983 | alx_free_napis(alx); |
986 | alx_disable_advanced_intr(alx); | 984 | alx_disable_advanced_intr(alx); |
985 | alx_init_intr(alx, false); | ||
987 | 986 | ||
988 | err = alx_alloc_napis(alx); | 987 | err = alx_alloc_napis(alx); |
989 | if (err) | 988 | if (err) |
@@ -1241,6 +1240,12 @@ static int __alx_open(struct alx_priv *alx, bool resume) | |||
1241 | if (err) | 1240 | if (err) |
1242 | goto out_free_rings; | 1241 | goto out_free_rings; |
1243 | 1242 | ||
1243 | /* must be called after alx_request_irq because the chip stops working | ||
1244 | * if we copy the dma addresses in alx_init_ring_ptrs twice when | ||
1245 | * requesting msi-x interrupts failed | ||
1246 | */ | ||
1247 | alx_reinit_rings(alx); | ||
1248 | |||
1244 | netif_set_real_num_tx_queues(alx->dev, alx->num_txq); | 1249 | netif_set_real_num_tx_queues(alx->dev, alx->num_txq); |
1245 | netif_set_real_num_rx_queues(alx->dev, alx->num_rxq); | 1250 | netif_set_real_num_rx_queues(alx->dev, alx->num_rxq); |
1246 | 1251 | ||