* [PATCH net 1/3] alx: fix wrong condition to free descriptor memory
2017-01-24 13:34 [PATCH net 0/3] alx: fix fallout from multi queue conversion Tobias Regnery
@ 2017-01-24 13:34 ` Tobias Regnery
2017-01-24 13:34 ` [PATCH net 2/3] alx: fix fallback to msi or legacy interrupts Tobias Regnery
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Tobias Regnery @ 2017-01-24 13:34 UTC (permalink / raw)
To: netdev, jcliburn, chris.snook; +Cc: davem, Tobias Regnery
The condition to free the descriptor memory is wrong, we want to free the
memory if it is set and not if it is unset. Invert the test to fix this
issue.
Fixes: b0999223f224b ("alx: add ability to allocate and free alx_napi structures")
Signed-off-by: Tobias Regnery <tobias.regnery@gmail.com>
---
drivers/net/ethernet/atheros/alx/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
index c8f525574d68..765306bd78c2 100644
--- a/drivers/net/ethernet/atheros/alx/main.c
+++ b/drivers/net/ethernet/atheros/alx/main.c
@@ -703,7 +703,7 @@ static void alx_free_rings(struct alx_priv *alx)
if (alx->qnapi[0] && alx->qnapi[0]->rxq)
kfree(alx->qnapi[0]->rxq->bufs);
- if (!alx->descmem.virt)
+ if (alx->descmem.virt)
dma_free_coherent(&alx->hw.pdev->dev,
alx->descmem.size,
alx->descmem.virt,
--
2.9.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH net 2/3] alx: fix fallback to msi or legacy interrupts
2017-01-24 13:34 [PATCH net 0/3] alx: fix fallout from multi queue conversion Tobias Regnery
2017-01-24 13:34 ` [PATCH net 1/3] alx: fix wrong condition to free descriptor memory Tobias Regnery
@ 2017-01-24 13:34 ` Tobias Regnery
2017-01-24 13:34 ` [PATCH net 3/3] alx: work around hardware bug in interrupt fallback path Tobias Regnery
2017-01-24 20:28 ` [PATCH net 0/3] alx: fix fallout from multi queue conversion David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Tobias Regnery @ 2017-01-24 13:34 UTC (permalink / raw)
To: netdev, jcliburn, chris.snook; +Cc: davem, Tobias Regnery
If requesting msi-x interrupts fails we should fall back to msi or
legacy interrupts. However alx_realloc_ressources don't call
alx_init_intr, so we fail to set the right number of tx queues.
This results in watchdog timeouts and a nonfunctional adapter.
Fixes: d768319cd427 ("alx: enable multiple tx queues")
Signed-off-by: Tobias Regnery <tobias.regnery@gmail.com>
---
drivers/net/ethernet/atheros/alx/main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
index 765306bd78c2..75cbd46e429d 100644
--- a/drivers/net/ethernet/atheros/alx/main.c
+++ b/drivers/net/ethernet/atheros/alx/main.c
@@ -984,6 +984,7 @@ static int alx_realloc_resources(struct alx_priv *alx)
alx_free_rings(alx);
alx_free_napis(alx);
alx_disable_advanced_intr(alx);
+ alx_init_intr(alx, false);
err = alx_alloc_napis(alx);
if (err)
--
2.9.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH net 3/3] alx: work around hardware bug in interrupt fallback path
2017-01-24 13:34 [PATCH net 0/3] alx: fix fallout from multi queue conversion Tobias Regnery
2017-01-24 13:34 ` [PATCH net 1/3] alx: fix wrong condition to free descriptor memory Tobias Regnery
2017-01-24 13:34 ` [PATCH net 2/3] alx: fix fallback to msi or legacy interrupts Tobias Regnery
@ 2017-01-24 13:34 ` Tobias Regnery
2017-01-24 20:28 ` [PATCH net 0/3] alx: fix fallout from multi queue conversion David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Tobias Regnery @ 2017-01-24 13:34 UTC (permalink / raw)
To: netdev, jcliburn, chris.snook; +Cc: davem, Tobias Regnery
If requesting msi-x interrupts fails in alx_request_irq we fall back to
a single tx queue and msi or legacy interrupts.
Currently the adapter stops working in this case and we get tx watchdog
timeouts. For reasons unknown the adapter gets confused when we load the
dma adresses to the chip in alx_init_ring_ptrs twice: the first time with
multiple queues and the second time in the fallback case with a single
queue.
To fix this move the the call to alx_reinit_rings (which calls
alx_init_ring_ptrs) after alx_request_irq. At this time it is clear how
much tx queues we have and which dma addresses we use.
Fixes: d768319cd427 ("alx: enable multiple tx queues")
Signed-off-by: Tobias Regnery <tobias.regnery@gmail.com>
---
drivers/net/ethernet/atheros/alx/main.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
index 75cbd46e429d..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)
return -ENOMEM;
}
- alx_reinit_rings(alx);
-
return 0;
}
@@ -1242,6 +1240,12 @@ static int __alx_open(struct alx_priv *alx, bool resume)
if (err)
goto out_free_rings;
+ /* must be called after alx_request_irq because the chip stops working
+ * if we copy the dma addresses in alx_init_ring_ptrs twice when
+ * requesting msi-x interrupts failed
+ */
+ alx_reinit_rings(alx);
+
netif_set_real_num_tx_queues(alx->dev, alx->num_txq);
netif_set_real_num_rx_queues(alx->dev, alx->num_rxq);
--
2.9.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH net 0/3] alx: fix fallout from multi queue conversion
2017-01-24 13:34 [PATCH net 0/3] alx: fix fallout from multi queue conversion Tobias Regnery
` (2 preceding siblings ...)
2017-01-24 13:34 ` [PATCH net 3/3] alx: work around hardware bug in interrupt fallback path Tobias Regnery
@ 2017-01-24 20:28 ` David Miller
3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2017-01-24 20:28 UTC (permalink / raw)
To: tobias.regnery; +Cc: netdev, jcliburn, chris.snook
From: Tobias Regnery <tobias.regnery@gmail.com>
Date: Tue, 24 Jan 2017 14:34:21 +0100
> 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.
Series applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread