From eeedc179fbe456da3ded366c2dffa60b5812b9f5 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Sun, 12 Dec 2021 01:42:14 -0800 Subject: [PATCH] Unconditionally deactivate rings --- modules/mqnic/mqnic_cq.c | 6 ++---- modules/mqnic/mqnic_eq.c | 6 ++---- modules/mqnic/mqnic_rx.c | 6 ++---- modules/mqnic/mqnic_tx.c | 6 ++---- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/modules/mqnic/mqnic_cq.c b/modules/mqnic/mqnic_cq.c index 21f66a43c..17b4d14bc 100644 --- a/modules/mqnic/mqnic_cq.c +++ b/modules/mqnic/mqnic_cq.c @@ -99,8 +99,7 @@ void mqnic_destroy_cq_ring(struct mqnic_cq_ring **ring_ptr) struct mqnic_cq_ring *ring = *ring_ptr; *ring_ptr = NULL; - if (ring->active) - mqnic_deactivate_cq_ring(ring); + mqnic_deactivate_cq_ring(ring); dma_free_coherent(ring->priv->dev, ring->buf_size, ring->buf, ring->buf_dma_addr); kfree(ring); @@ -108,8 +107,7 @@ void mqnic_destroy_cq_ring(struct mqnic_cq_ring **ring_ptr) int mqnic_activate_cq_ring(struct mqnic_cq_ring *ring, int eq_index) { - if (ring->active) - mqnic_deactivate_cq_ring(ring); + mqnic_deactivate_cq_ring(ring); ring->eq_index = eq_index; diff --git a/modules/mqnic/mqnic_eq.c b/modules/mqnic/mqnic_eq.c index 9b9446c75..d45e2c5b7 100644 --- a/modules/mqnic/mqnic_eq.c +++ b/modules/mqnic/mqnic_eq.c @@ -114,8 +114,7 @@ void mqnic_destroy_eq_ring(struct mqnic_eq_ring **ring_ptr) struct device *dev = ring->priv->dev; *ring_ptr = NULL; - if (ring->active) - mqnic_deactivate_eq_ring(ring); + mqnic_deactivate_eq_ring(ring); dma_free_coherent(dev, ring->buf_size, ring->buf, ring->buf_dma_addr); kfree(ring); @@ -125,8 +124,7 @@ int mqnic_activate_eq_ring(struct mqnic_eq_ring *ring, int int_index) { int ret = 0; - if (ring->active) - mqnic_deactivate_eq_ring(ring); + mqnic_deactivate_eq_ring(ring); if (int_index < 0 || int_index >= ring->priv->mdev->irq_count) return -EINVAL; diff --git a/modules/mqnic/mqnic_rx.c b/modules/mqnic/mqnic_rx.c index 8ec6dace8..a9547d44a 100644 --- a/modules/mqnic/mqnic_rx.c +++ b/modules/mqnic/mqnic_rx.c @@ -115,8 +115,7 @@ void mqnic_destroy_rx_ring(struct mqnic_ring **ring_ptr) struct mqnic_ring *ring = *ring_ptr; *ring_ptr = NULL; - if (ring->active) - mqnic_deactivate_rx_ring(ring); + mqnic_deactivate_rx_ring(ring); mqnic_free_rx_buf(ring); @@ -128,8 +127,7 @@ void mqnic_destroy_rx_ring(struct mqnic_ring **ring_ptr) int mqnic_activate_rx_ring(struct mqnic_ring *ring, int cpl_index) { - if (ring->active) - mqnic_deactivate_rx_ring(ring); + mqnic_deactivate_rx_ring(ring); // deactivate queue iowrite32(0, ring->hw_addr + MQNIC_QUEUE_ACTIVE_LOG_SIZE_REG); diff --git a/modules/mqnic/mqnic_tx.c b/modules/mqnic/mqnic_tx.c index 44fcb8a62..27fdeef55 100644 --- a/modules/mqnic/mqnic_tx.c +++ b/modules/mqnic/mqnic_tx.c @@ -117,8 +117,7 @@ void mqnic_destroy_tx_ring(struct mqnic_ring **ring_ptr) struct mqnic_ring *ring = *ring_ptr; *ring_ptr = NULL; - if (ring->active) - mqnic_deactivate_tx_ring(ring); + mqnic_deactivate_tx_ring(ring); mqnic_free_tx_buf(ring); @@ -130,8 +129,7 @@ void mqnic_destroy_tx_ring(struct mqnic_ring **ring_ptr) int mqnic_activate_tx_ring(struct mqnic_ring *ring, int cpl_index) { - if (ring->active) - mqnic_deactivate_tx_ring(ring); + mqnic_deactivate_tx_ring(ring); // deactivate queue iowrite32(0, ring->hw_addr + MQNIC_QUEUE_ACTIVE_LOG_SIZE_REG);