Skip to content

Commit

Permalink
Make msm_serial_hs RT to improve bluetooth performance
Browse files Browse the repository at this point in the history
msm_serial_hs threads for RX and TX are responsible for passing key
bluetooth buffers, such as bluetooth audio, between the Bluetooth HW and
the upper layers of the stack.  These threads are therefore on the
critical path for bluetooth audio latency, and should be scheduled as
RT threads in order to ensure that they meet audio deadlines.

Bug 36106419

Test:  Play bluetooth audio, confirm msm_serial_hs_0 threads are
scheduled as RT threads via systrace
Change-Id: I078dbcbab189a03bdc5fdfde6ec8c41c79c11610
Signed-off-by: Philip Cuadra <philipcuadra@google.com>
  • Loading branch information
Philip Cuadra authored and mikeNG committed Dec 23, 2019
1 parent 6e95e89 commit 17e12f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/tty/serial/msm_serial_hs.c
Expand Up @@ -2831,6 +2831,7 @@ static int uartdm_init_port(struct uart_port *uport)
struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
struct msm_hs_tx *tx = &msm_uport->tx;
struct msm_hs_rx *rx = &msm_uport->rx;
struct sched_param param = { .sched_priority = 1 };

init_waitqueue_head(&rx->wait);
init_waitqueue_head(&tx->wait);
Expand All @@ -2845,6 +2846,8 @@ static int uartdm_init_port(struct uart_port *uport)
MSM_HS_ERR("%s(): error creating task", __func__);
goto exit_lh_init;
}
sched_setscheduler(rx->task, SCHED_FIFO, &param);

init_kthread_work(&rx->kwork, msm_serial_hs_rx_work);

init_kthread_worker(&tx->kworker);
Expand All @@ -2854,6 +2857,7 @@ static int uartdm_init_port(struct uart_port *uport)
MSM_HS_ERR("%s(): error creating task", __func__);
goto exit_lh_init;
}
sched_setscheduler(tx->task, SCHED_FIFO, &param);

init_kthread_work(&tx->kwork, msm_serial_hs_tx_work);

Expand Down

0 comments on commit 17e12f2

Please sign in to comment.