Commit 0efdff96 authored by Tomasz Moń's avatar Tomasz Moń Committed by Carles Cufi
Browse files

nrf_usbd_common: Remove early DMA process handling



Early DMA process handling actually decreases performance in real world
scenarios because real world scenarios tend to be CPU bound. Moreover
the actual optimization is questionable because DMA semaphore can only
be released after the respective endpoint end event is handled. Remove
early DMA processing altogether and only check pending DMA at the end of
interrupt handler.

Signed-off-by: default avatarTomasz Moń <tomasz.mon@nordicsemi.no>
parent a0a80f62
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -18,15 +18,6 @@
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(nrf_usbd_common, CONFIG_NRF_USBD_COMMON_LOG_LEVEL);

#ifndef NRF_USBD_COMMON_EARLY_DMA_PROCESS
/* Try to process DMA request when endpoint transmission has been detected
 * and just after last EasyDMA has been processed.
 * It speeds up the transmission a little (about 10% measured)
 * with a cost of more CPU power used.
 */
#define NRF_USBD_COMMON_EARLY_DMA_PROCESS 1
#endif

#ifndef NRF_USBD_COMMON_STARTED_EV_ENABLE
#define NRF_USBD_COMMON_STARTED_EV_ENABLE 0
#endif
@@ -988,11 +979,6 @@ static inline void nrf_usbd_epout_dma_handler(nrf_usbd_common_ep_t ep)
	} else {
		/* Nothing to do */
	}

#if NRF_USBD_COMMON_EARLY_DMA_PROCESS
	/* Speed up */
	usbd_dmareq_process();
#endif
}

/**
@@ -1247,10 +1233,6 @@ static void ev_epdata_handler(void)

		(void)(usbd_ep_data_handler(ep, bitpos));
	}
	if (NRF_USBD_COMMON_EARLY_DMA_PROCESS) {
		/* Speed up */
		usbd_dmareq_process();
	}
}

/**