The 'irq_disabled' variable indicates the current state of the RX IRQ and is used by the RX NAPI handler to determine whether the IRQ should be enabled. Currently, 'irq_disabled' is set before actually disabling the IRQ by invoking disable_irq_nosync(). In an SMP environment, this leads to a race condition wherein the processor taking the interrupt sets 'irq_disabled' while another processor executing a previous instance of the RX NAPI handler sees 'irq_disabled' set and invokes enable_irq() before the RX IRQ is actually disabled by disable_irq_nosync(). This results in the following warning: Unbalanced enable for IRQ ... Fix this by disabling the RX IRQ using disable_irq_nosync() before setting 'irq_disabled'. Fixes: da70d184a8c3 ("net: ethernet: ti: am65-cpsw: Introduce multi queue Rx") Fixes: 47bfc4d128de ("net: ti: am65-cpsw-nuss: fix RX IRQ state after .ndo_stop()") Cc: Signed-off-by: Siddharth Vadapalli --- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index 5924db6be3fe..8785ab40f157 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -1570,8 +1570,8 @@ static irqreturn_t am65_cpsw_nuss_rx_irq(int irq, void *dev_id) { struct am65_cpsw_rx_flow *flow = dev_id; - flow->irq_disabled = true; disable_irq_nosync(irq); + flow->irq_disabled = true; napi_schedule(&flow->napi_rx); return IRQ_HANDLED; -- 2.51.1 The 'irq_disabled' variable indicates the current state of the TX IRQ and is used by the TX NAPI handler to determine whether the IRQ should be enabled. Currently, 'irq_disabled' is set before actually disabling the IRQ by invoking disable_irq_nosync(). In an SMP environment, this leads to a race condition wherein the processor taking the interrupt sets 'irq_disabled' while another processor executing a previous instance of the TX NAPI handler sees 'irq_disabled' set and invokes enable_irq() before the TX IRQ is actually disabled by disable_irq_nosync(). This results in the following warning: Unbalanced enable for IRQ ... Fix this by disabling the TX IRQ using disable_irq_nosync() before setting 'irq_disabled'. Fixes: 8756ef2eb078 ("net: ti: icssg-prueth: Add AF_XDP zero copy for TX") Cc: Signed-off-by: Siddharth Vadapalli --- drivers/net/ethernet/ti/icssg/icssg_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/icssg/icssg_common.c b/drivers/net/ethernet/ti/icssg/icssg_common.c index 0cf9dfe0fa36..24716c8d7f75 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_common.c +++ b/drivers/net/ethernet/ti/icssg/icssg_common.c @@ -348,8 +348,8 @@ static irqreturn_t prueth_tx_irq(int irq, void *dev_id) { struct prueth_tx_chn *tx_chn = dev_id; - tx_chn->irq_disabled = true; disable_irq_nosync(irq); + tx_chn->irq_disabled = true; napi_schedule(&tx_chn->napi_tx); return IRQ_HANDLED; -- 2.51.1 The 'irq_disabled' variable indicates the current state of the RX IRQ and is used by the RX NAPI handler to determine whether the IRQ should be enabled. Currently, 'irq_disabled' is set before actually disabling the IRQ by invoking disable_irq_nosync(). In an SMP environment, this leads to a race condition wherein the processor taking the interrupt sets 'irq_disabled' while another processor executing a previous instance of the RX NAPI handler sees 'irq_disabled' set and invokes enable_irq() before the RX IRQ is actually disabled by disable_irq_nosync(). This results in the following warning: Unbalanced enable for IRQ ... Fix this by disabling the RX IRQ using disable_irq_nosync() before setting 'irq_disabled'. Fixes: 7a64bb388df3 ("net: ti: icssg-prueth: Add AF_XDP zero copy for RX") Cc: Signed-off-by: Siddharth Vadapalli --- drivers/net/ethernet/ti/icssg/icssg_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/icssg/icssg_common.c b/drivers/net/ethernet/ti/icssg/icssg_common.c index 24716c8d7f75..a512a1317c59 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_common.c +++ b/drivers/net/ethernet/ti/icssg/icssg_common.c @@ -1385,8 +1385,8 @@ irqreturn_t prueth_rx_irq(int irq, void *dev_id) { struct prueth_emac *emac = dev_id; - emac->rx_chns.irq_disabled = true; disable_irq_nosync(irq); + emac->rx_chns.irq_disabled = true; napi_schedule(&emac->napi_rx); return IRQ_HANDLED; -- 2.51.1