qcacmn: skip monitor reap timer if irq is enabled

For CFR test, monitor reap timer will start, meanwhile
irq for monitor status ring is also enabled, these two will
conflict and access mon_pdev->rx_status_q in the same time,
skb double free issue is reported.

If irq for monitor status ring has been enabled, skip to start
monitor reap timer which is unnecessary.

Change-Id: Ic015d370cb80604d7e4c261054ad529b64edca25
CRs-Fixed: 3614097
This commit is contained in:
Jinwei Chen
2023-09-13 04:06:34 -07:00
committed by Rahul Choudhary
parent 52662b6274
commit 65fdbbce9a
2 changed files with 41 additions and 2 deletions

View File

@@ -604,6 +604,25 @@ static void dp_mon_reap_timer_deinit(struct dp_soc *soc)
} }
} }
/**
* dp_mon_is_irq_enabled() - check if DP monitor status srng irq enabled
* @soc: point to soc
*
* Return: true if irq enabled, false if not.
*/
static bool
dp_mon_is_irq_enabled(struct dp_soc *soc)
{
void *mon_status_srng;
mon_status_srng = soc->rxdma_mon_status_ring[0].hal_srng;
if (!mon_status_srng)
return false;
return hal_srng_batch_threshold_irq_enabled(mon_status_srng);
}
/** /**
* dp_mon_reap_timer_start() - start reap timer of monitor status ring * dp_mon_reap_timer_start() - start reap timer of monitor status ring
* @soc: point to soc * @soc: point to soc
@@ -621,7 +640,8 @@ dp_mon_reap_timer_start(struct dp_soc *soc, enum cdp_mon_reap_source source)
struct dp_mon_soc *mon_soc = soc->monitor_soc; struct dp_mon_soc *mon_soc = soc->monitor_soc;
bool do_start; bool do_start;
if (!mon_soc->reap_timer_init) /* if monitor status ring irq enabled, no need to start timer */
if (!mon_soc->reap_timer_init || dp_mon_is_irq_enabled(soc))
return false; return false;
qdf_spin_lock_bh(&mon_soc->reap_timer_lock); qdf_spin_lock_bh(&mon_soc->reap_timer_lock);
@@ -656,7 +676,7 @@ dp_mon_reap_timer_stop(struct dp_soc *soc, enum cdp_mon_reap_source source)
struct dp_mon_soc *mon_soc = soc->monitor_soc; struct dp_mon_soc *mon_soc = soc->monitor_soc;
bool do_stop; bool do_stop;
if (!mon_soc->reap_timer_init) if (!mon_soc->reap_timer_init || dp_mon_is_irq_enabled(soc))
return false; return false;
qdf_spin_lock_bh(&mon_soc->reap_timer_lock); qdf_spin_lock_bh(&mon_soc->reap_timer_lock);

View File

@@ -3507,6 +3507,25 @@ uint16_t hal_srng_dst_get_hpidx(hal_ring_handle_t hal_ring_hdl)
return hp / srng->entry_size; return hp / srng->entry_size;
} }
/**
* hal_srng_batch_threshold_irq_enabled() - check if srng batch count
* threshold irq enabled
* @hal_ring_hdl: srng handle
*
* Return: true if enabled, false if not.
*/
static inline
bool hal_srng_batch_threshold_irq_enabled(hal_ring_handle_t hal_ring_hdl)
{
struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl;
if (srng->intr_batch_cntr_thres_entries &&
srng->flags & HAL_SRNG_MSI_INTR)
return true;
else
return false;
}
#ifdef FEATURE_DIRECT_LINK #ifdef FEATURE_DIRECT_LINK
/** /**
* hal_srng_set_msi_irq_config() - Set the MSI irq configuration for srng * hal_srng_set_msi_irq_config() - Set the MSI irq configuration for srng