Skip to content

Commit

Permalink
Revert "net: ethernet: ti: am65-cpsw: Fix warning "Unbalanced enable …
Browse files Browse the repository at this point in the history
…IRQ""

We will fix this with another approach so reverting this.

This reverts commit 95b8042.

Signed-off-by: Roger Quadros <[email protected]>
Signed-off-by: Vignesh Raghavendra <[email protected]>
  • Loading branch information
rogerq authored and r-vignesh committed Dec 14, 2022
1 parent 17c9de7 commit 44937fe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
20 changes: 14 additions & 6 deletions drivers/net/ethernet/ti/am65-cpsw-nuss.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,10 @@ static int am65_cpsw_nuss_common_open(struct am65_cpsw_common *common,
}

napi_enable(&common->napi_rx);
if (common->rx_irq_disabled) {
common->rx_irq_disabled = false;
enable_irq(common->rx_chns.irq);
}

dev_dbg(common->dev, "cpsw_nuss started\n");
return 0;
Expand Down Expand Up @@ -880,12 +884,15 @@ static int am65_cpsw_nuss_rx_poll(struct napi_struct *napi_rx, int budget)
dev_dbg(common->dev, "%s num_rx:%d %d\n", __func__, num_rx, budget);

if (num_rx < budget && napi_complete_done(napi_rx, num_rx)) {
if (unlikely(common->rx_pace_timeout)) {
hrtimer_start(&common->rx_hrtimer,
ns_to_ktime(common->rx_pace_timeout),
HRTIMER_MODE_REL_PINNED);
} else {
enable_irq(common->rx_chns.irq);
if (common->rx_irq_disabled) {
common->rx_irq_disabled = false;
if (unlikely(common->rx_pace_timeout)) {
hrtimer_start(&common->rx_hrtimer,
ns_to_ktime(common->rx_pace_timeout),
HRTIMER_MODE_REL_PINNED);
} else {
enable_irq(common->rx_chns.irq);
}
}
}

Expand Down Expand Up @@ -1126,6 +1133,7 @@ static irqreturn_t am65_cpsw_nuss_rx_irq(int irq, void *dev_id)
{
struct am65_cpsw_common *common = dev_id;

common->rx_irq_disabled = true;
disable_irq_nosync(irq);
napi_schedule(&common->napi_rx);

Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/ti/am65-cpsw-nuss.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ struct am65_cpsw_common {

struct am65_cpsw_rx_chn rx_chns;
struct napi_struct napi_rx;
bool rx_irq_disabled;
struct hrtimer rx_hrtimer;
unsigned long rx_pace_timeout;

Expand Down

0 comments on commit 44937fe

Please sign in to comment.