svn commit: r225862 -
user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416
Adrian Chadd
adrian at FreeBSD.org
Thu Sep 29 05:16:54 UTC 2011
Author: adrian
Date: Thu Sep 29 05:16:53 2011
New Revision: 225862
URL: http://svn.freebsd.org/changeset/base/225862
Log:
General RX interrupt mitigation fixes.
* From what I can tell, interrupt mitigation doesn't mitigate RXERR events,
only RXOK events. I'm waiting for confirmation from Atheros, but this is
what their driver does.
* Yes, RXOK is set in AR_ISR even if it is clear in AR_IMR. So make sure
HAL_INT_RX isn't set if interrupt mitigation is enabled.
* Add/remove comments in order to better document what is going on.
Modified:
user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c
Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Thu Sep 29 03:37:42 2011 (r225861)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Thu Sep 29 05:16:53 2011 (r225862)
@@ -132,17 +132,6 @@ ar5416GetPendingInterrupts(struct ath_ha
return AH_FALSE;
}
- /*
- * XXX TODO: see whether the hardware signals AR_ISR_RXOK
- * even if RX interrupt mitigation is enabled (but then
- * doesn't trigger an interrupt per RX packet) - which means
- * we'll be setting HAL_INT_RX even before the RX mitigation
- * timers have expired.
- *
- * XXX TODO: do the same for the TX interrupts and TX interrupt
- * mitigation.
- */
-
*masked = isr & HAL_INT_COMMON;
if (isr & (AR_ISR_RXMINTR | AR_ISR_RXINTM)) {
@@ -153,9 +142,21 @@ ar5416GetPendingInterrupts(struct ath_ha
}
/*
- * Don't signal this when doing interrupt mitigation
+ * When doing RX interrupt mitigation, the RXOK bit is set
+ * in AR_ISR even if the relevant bit in AR_IMR is clear.
+ * Since this interrupt may be due to another source, don't
+ * just automatically set HAL_INT_RX if it's set, otherwise
+ * we could prematurely service the RX queue.
+ *
+ * In some cases, the driver can even handle all the RX
+ * frames just before the mitigation interrupt fires.
+ * The subsequent RX processing trip will then end up
+ * processing 0 frames.
*/
-#ifndef AH_AR5416_INTERRUPT_MITIGATION
+#ifdef AH_AR5416_INTERRUPT_MITIGATION
+ if (isr & AR_ISR_RXERR)
+ *masked |= HAL_INT_RX;
+#else
if (isr & (AR_ISR_RXOK | AR_ISR_RXERR))
*masked |= HAL_INT_RX;
#endif
More information about the svn-src-user
mailing list