diff mbox

ath: fix DFS timestamp wraparound reset condition

Message ID 1443522589-14421-1-git-send-email-zefir.kurtisi@neratec.com (mailing list archive)
State Accepted
Delegated to: Kalle Valo
Headers show

Commit Message

Zefir Kurtisi Sept. 29, 2015, 10:29 a.m. UTC
The DFS pattern detector ought to reset the
detector lines when a pulse is added with
lower time stamp than the previous (which
indicates a TSF restart).

This did not work so far and is fixed with
this patch.

The modification does not change detection
performance within the driver, since it
only ensures early reset (which is later
performed by the PRI detectors anyway).
It is relevant for synthetic tests and
statistical evaluations, where millions
of pulse patterns are processed and an
early reset helps reducing load.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
---
 drivers/net/wireless/ath/dfs_pattern_detector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo Oct. 9, 2015, 8:47 a.m. UTC | #1
Zefir Kurtisi <zefir.kurtisi@neratec.com> writes:

> The DFS pattern detector ought to reset the
> detector lines when a pulse is added with
> lower time stamp than the previous (which
> indicates a TSF restart).
>
> This did not work so far and is fixed with
> this patch.
>
> The modification does not change detection
> performance within the driver, since it
> only ensures early reset (which is later
> performed by the PRI detectors anyway).
> It is relevant for synthetic tests and
> statistical evaluations, where millions
> of pulse patterns are processed and an
> early reset helps reducing load.
>
> Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/dfs_pattern_detector.c b/drivers/net/wireless/ath/dfs_pattern_detector.c
index 656ce42..b52c209 100644
--- a/drivers/net/wireless/ath/dfs_pattern_detector.c
+++ b/drivers/net/wireless/ath/dfs_pattern_detector.c
@@ -290,10 +290,10 @@  dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event)
 	if (cd == NULL)
 		return false;
 
-	dpd->last_pulse_ts = event->ts;
 	/* reset detector on time stamp wraparound, caused by TSF reset */
 	if (event->ts < dpd->last_pulse_ts)
 		dpd_reset(dpd);
+	dpd->last_pulse_ts = event->ts;
 
 	/* do type individual pattern matching */
 	for (i = 0; i < dpd->num_radar_types; i++) {