summaryrefslogtreecommitdiffstats
path: root/recipes-kernel
diff options
context:
space:
mode:
authorJoel A Fernandes <joelagnel@ti.com>2011-11-13 09:11:18 -0600
committerKoen Kooi <koen@dominion.thruhere.net>2011-11-13 16:19:46 +0100
commitc4310e7216767255abf300aa8286306483cfc1a6 (patch)
tree9b0f560818794d347b9d70efefb7d3cfdc6819ae /recipes-kernel
parent77208efef6f7ba30582400cb602168f7424417e8 (diff)
downloadmeta-ti-c4310e7216767255abf300aa8286306483cfc1a6.tar.gz
linux-ti33x-psp: Check if scheduling is required after DMA
After processing one DMA completion, checking if rescheduling is required instead of scheduling another completion request if the FIFO is non empty. This fixes high CPU load issue seen with g_mass_storage on a beaglebone and could potentially fix similar issues seen with other gadget drivers Signed-off-by: Joel A Fernandes <joelagnel@ti.com> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'recipes-kernel')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.1/0006-usb-musb-cppi41_dma-Check-if-scheduling-is-required-.patch42
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp_3.1.bb3
2 files changed, 44 insertions, 1 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.1/0006-usb-musb-cppi41_dma-Check-if-scheduling-is-required-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.1/0006-usb-musb-cppi41_dma-Check-if-scheduling-is-required-.patch
new file mode 100644
index 00000000..701c09d8
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.1/0006-usb-musb-cppi41_dma-Check-if-scheduling-is-required-.patch
@@ -0,0 +1,42 @@
1From b564457d26931a00f8c5645981a00c1eb78e9a90 Mon Sep 17 00:00:00 2001
2From: Joel A Fernandes <joelagnel@ti.com>
3Date: Sat, 12 Nov 2011 23:42:26 -0600
4Subject: [PATCH] usb::musb::cppi41_dma: Check if scheduling is required after DMA
5
6Even after TX DMA, data can still be in the FIFO and we would keep
7rescheduling the worker thread in a polling fashion taking up a lot
8of CPU if the controller was slow to respond. We check if rescheduling
9is required and sleep if so.
10
11This fixes high CPU load issue seen with g_mass_storage on a BeagleBone
12and could potentially fix similar issues seen with other gadget drivers.
13
14Signed-off-by: Joel A Fernandes <joelagnel@ti.com>
15---
16 drivers/usb/musb/cppi41_dma.c | 10 ++++++++++
17 1 files changed, 10 insertions(+), 0 deletions(-)
18
19diff --git a/drivers/usb/musb/cppi41_dma.c b/drivers/usb/musb/cppi41_dma.c
20index a24707c..e68c5d7 100644
21--- a/drivers/usb/musb/cppi41_dma.c
22+++ b/drivers/usb/musb/cppi41_dma.c
23@@ -1319,6 +1319,16 @@ void txdma_completion_work(struct work_struct *data)
24 struct musb *musb = cppi->musb;
25 unsigned long flags;
26
27+ /*
28+ * txdma worker thread can call schedule_work on itself and cause
29+ * itself to be scheduled immediately and because the data might still
30+ * be in FIFO if it hasn't been pushed out after DMA, it is possible for
31+ * the worker to consume lot of CPU when the controller is slow, so we
32+ * reschedule if necessary.
33+ */
34+ if (need_resched())
35+ cond_resched();
36+
37 spin_lock_irqsave(&musb->lock, flags);
38 cppi41_check_fifo_empty(cppi);
39 spin_unlock_irqrestore(&musb->lock, flags);
40--
411.7.4.1
42
diff --git a/recipes-kernel/linux/linux-ti33x-psp_3.1.bb b/recipes-kernel/linux/linux-ti33x-psp_3.1.bb
index c4cdfea9..37f59cad 100644
--- a/recipes-kernel/linux/linux-ti33x-psp_3.1.bb
+++ b/recipes-kernel/linux/linux-ti33x-psp_3.1.bb
@@ -11,7 +11,7 @@ MULTI_CONFIG_BASE_SUFFIX = ""
11 11
12BRANCH = "v3.1-staging" 12BRANCH = "v3.1-staging"
13SRCREV = "1d84d8853fa30cf3db2571a5aec572accca4e29d" 13SRCREV = "1d84d8853fa30cf3db2571a5aec572accca4e29d"
14MACHINE_KERNEL_PR_append = "q+gitr${SRCREV}" 14MACHINE_KERNEL_PR_append = "r+gitr${SRCREV}"
15 15
16COMPATIBLE_MACHINE = "(ti33x)" 16COMPATIBLE_MACHINE = "(ti33x)"
17 17
@@ -35,6 +35,7 @@ PATCHES_OVER_PSP = " \
35 file://0003-arm-omap-mcspi-correct-memory-range-when-requesting-.patch \ 35 file://0003-arm-omap-mcspi-correct-memory-range-when-requesting-.patch \
36 file://0004-arm-omap-mcspi-follow-proper-pm_runtime-enable-disab.patch \ 36 file://0004-arm-omap-mcspi-follow-proper-pm_runtime-enable-disab.patch \
37 file://0005-arm-omap-mcspi-follow-proper-probe-remove-steps.patch \ 37 file://0005-arm-omap-mcspi-follow-proper-probe-remove-steps.patch \
38 file://0006-usb-musb-cppi41_dma-Check-if-scheduling-is-required-.patch \
38 file://can/0001-can-d_can-Added-support-for-Bosch-D_CAN-controller.patch \ 39 file://can/0001-can-d_can-Added-support-for-Bosch-D_CAN-controller.patch \
39 file://can/0002-can-d_can-Added-platform-data-for-am33xx-device.patch \ 40 file://can/0002-can-d_can-Added-platform-data-for-am33xx-device.patch \
40 file://can/0003-can-d_can-DCAN-config-added-to-am335x_evm_defconfig.patch \ 41 file://can/0003-can-d_can-DCAN-config-added-to-am335x_evm_defconfig.patch \