From a459b560e58be327689e9bd8c0a6be9a4f163366 Mon Sep 17 00:00:00 2001 From: Lorenzo Bianconi Date: Thu, 11 Jun 2026 23:55:51 +0200 Subject: [PATCH] net: airoha: use int instead of atomic_t for qdma users counter QDMA users counter is always accessed holding RTNL lock so we do not require atomic_t for it. Signed-off-by: Lorenzo Bianconi Reviewed-by: Simon Horman Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/airoha/airoha_eth.c | 4 ++-- drivers/net/ethernet/airoha/airoha_eth.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c index 01083e90d7e2..1d1911a4759c 100644 --- a/drivers/net/ethernet/airoha/airoha_eth.c +++ b/drivers/net/ethernet/airoha/airoha_eth.c @@ -1840,7 +1840,7 @@ static int airoha_dev_open(struct net_device *netdev) airoha_qdma_set(qdma, REG_QDMA_GLOBAL_CFG, GLOBAL_CFG_TX_DMA_EN_MASK | GLOBAL_CFG_RX_DMA_EN_MASK); - atomic_inc(&qdma->users); + qdma->users++; if (!airoha_is_lan_gdm_dev(dev) && airoha_ppe_is_enabled(qdma->eth, 1)) @@ -1894,7 +1894,7 @@ static int airoha_dev_stop(struct net_device *netdev) REG_GDM_FWD_CFG(port->id), FE_PSE_PORT_DROP); - if (atomic_dec_and_test(&qdma->users)) { + if (!--qdma->users) { airoha_qdma_clear(qdma, REG_QDMA_GLOBAL_CFG, GLOBAL_CFG_TX_DMA_EN_MASK | GLOBAL_CFG_RX_DMA_EN_MASK); diff --git a/drivers/net/ethernet/airoha/airoha_eth.h b/drivers/net/ethernet/airoha/airoha_eth.h index 46b1c31939de..41d2e7a1f9fb 100644 --- a/drivers/net/ethernet/airoha/airoha_eth.h +++ b/drivers/net/ethernet/airoha/airoha_eth.h @@ -524,7 +524,7 @@ struct airoha_qdma { struct airoha_eth *eth; void __iomem *regs; - atomic_t users; + int users; struct airoha_irq_bank irq_banks[AIROHA_MAX_NUM_IRQ_BANKS];