Skip to content

Commit

Permalink
remove workcount
Browse files Browse the repository at this point in the history
  • Loading branch information
jbsky committed Sep 9, 2024
1 parent 56bc44a commit 1808ac2
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 34 deletions.
2 changes: 0 additions & 2 deletions debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,6 @@ static ssize_t mwl_debugfs_info_read(struct file *file, char __user *ubuf,
len += scnprintf(p + len, size - len,
"use_short_preamble: %s\n", priv->use_short_preamble ? "enable" : "disable");
len += mwl_hif_get_info(priv->hw, p + len, size - len);
len += scnprintf(p + len, size - len,
"work_count: %d\n", atomic_read(&pcie_priv->work_count));
ret = simple_read_from_buffer(ubuf, count, ppos, p, len);
free_page(page);

Expand Down
4 changes: 1 addition & 3 deletions hif/pcie/8864/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,7 @@ int pcie_8864_poll_napi(struct napi_struct *napi, int budget)
end_poll:
if (work_done < budget) {
napi_complete(napi);
atomic_dec(&pcie_priv->work_count);
if (atomic_read(&pcie_priv->work_count) == 0)
priv->hif.ops->irq_enable(hw);
priv->hif.ops->irq_enable(hw);
}
return work_done;
}
4 changes: 1 addition & 3 deletions hif/pcie/8864/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,9 +607,7 @@ void pcie_8864_tx_done_task(unsigned long data)
struct pcie_priv* pcie_priv = priv->hif.priv;

pcie_non_pfu_tx_done(priv);
atomic_dec(&pcie_priv->work_count);
if (atomic_read(&pcie_priv->work_count) == 0)
priv->hif.ops->irq_enable(hw);
priv->hif.ops->irq_enable(hw);
}

void pcie_8864_tx_done(unsigned long data)
Expand Down
4 changes: 1 addition & 3 deletions hif/pcie/8997/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,7 @@ int pcie_8997_poll_napi(struct napi_struct *napi, int budget)
end_poll:
if (work_done < budget) {
napi_complete(napi);
atomic_dec(&pcie_priv->work_count);
if (atomic_read(&pcie_priv->work_count) == 0)
priv->hif.ops->irq_enable(hw);
priv->hif.ops->irq_enable(hw);
}
return work_done;
}
4 changes: 1 addition & 3 deletions hif/pcie/8997/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,7 @@ void pcie_8997_tx_done_task(unsigned long data)
struct pcie_priv* pcie_priv = priv->hif.priv;

pcie_pfu_tx_done(priv);
atomic_dec(&pcie_priv->work_count);
if (atomic_read(&pcie_priv->work_count) == 0)
priv->hif.ops->irq_enable(hw);
priv->hif.ops->irq_enable(hw);
}

void pcie_8997_tx_xmit(struct ieee80211_hw *hw,
Expand Down
1 change: 0 additions & 1 deletion hif/pcie/dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,6 @@ struct pcie_priv {
struct net_device napi_dev;
struct napi_struct napi;
struct tasklet_struct rx_task;
atomic_t work_count;
unsigned int tx_head_room;
int txq_limit;
int txq_wake_threshold;
Expand Down
23 changes: 4 additions & 19 deletions hif/pcie/pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@ static void pcie_enable_data_tasks(struct ieee80211_hw *hw)
struct mwl_priv *priv = hw->priv;
struct pcie_priv *pcie_priv = priv->hif.priv;

atomic_set(&pcie_priv->work_count, 0);
tasklet_enable(&pcie_priv->tx_task);
tasklet_enable(&pcie_priv->tx_done_task);
napi_enable(&pcie_priv->napi);
Expand Down Expand Up @@ -511,9 +510,6 @@ static irqreturn_t pcie_isr_8864(struct ieee80211_hw *hw)
struct pcie_priv *pcie_priv = priv->hif.priv;
u32 int_status;

if (atomic_read(&pcie_priv->work_count))
return IRQ_HANDLED;

int_status = readl(pcie_priv->iobase1 + MACREG_REG_A2H_INTERRUPT_CAUSE);

if (int_status == 0x00000000)
Expand All @@ -528,12 +524,12 @@ static irqreturn_t pcie_isr_8864(struct ieee80211_hw *hw)
priv->hif.ops->irq_disable(hw);

if (int_status & MACREG_A2HRIC_BIT_TX_DONE) {
atomic_inc(&pcie_priv->work_count);
priv->hif.ops->irq_disable(hw);
tasklet_schedule(&pcie_priv->tx_done_task);
}

if (int_status & MACREG_A2HRIC_BIT_RX_RDY) {
atomic_inc(&pcie_priv->work_count);
priv->hif.ops->irq_disable(hw);
napi_schedule(&pcie_priv->napi);
}

Expand All @@ -547,9 +543,6 @@ static irqreturn_t pcie_isr_8864(struct ieee80211_hw *hw)

if (int_status & MACREG_A2HRIC_BIT_TX_WATCHDOG)
ieee80211_queue_work(hw, &priv->watchdog_ba_handle);

if (atomic_read(&pcie_priv->work_count) == 0)
priv->hif.ops->irq_enable(hw);
}

return IRQ_HANDLED;
Expand All @@ -561,9 +554,6 @@ static irqreturn_t pcie_isr_8997(struct ieee80211_hw *hw)
struct pcie_priv *pcie_priv = priv->hif.priv;
u32 int_status;

if (atomic_read(&pcie_priv->work_count))
return IRQ_HANDLED;

int_status = readl(pcie_priv->iobase1 + MACREG_REG_A2H_INTERRUPT_CAUSE);

if (int_status == 0x00000000)
Expand All @@ -575,15 +565,13 @@ static irqreturn_t pcie_isr_8997(struct ieee80211_hw *hw)
writel(~int_status,
pcie_priv->iobase1 + MACREG_REG_A2H_INTERRUPT_CAUSE);

priv->hif.ops->irq_disable(hw);

if (int_status & MACREG_A2HRIC_BIT_TX_DONE) {
atomic_inc(&pcie_priv->work_count);
priv->hif.ops->irq_disable(hw);
tasklet_schedule(&pcie_priv->tx_done_task);
}

if (int_status & MACREG_A2HRIC_BIT_RX_RDY) {
atomic_inc(&pcie_priv->work_count);
priv->hif.ops->irq_disable(hw);
napi_schedule(&pcie_priv->napi);
}

Expand All @@ -597,9 +585,6 @@ static irqreturn_t pcie_isr_8997(struct ieee80211_hw *hw)

if (int_status & MACREG_A2HRIC_BA_WATCHDOG)
ieee80211_queue_work(hw, &priv->watchdog_ba_handle);

if (atomic_read(&pcie_priv->work_count) == 0)
priv->hif.ops->irq_enable(hw);
}

return IRQ_HANDLED;
Expand Down

0 comments on commit 1808ac2

Please sign in to comment.