diff options
author | Aishwarya Pant <aishpant@gmail.com> | 2017-03-01 18:06:30 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-07 07:37:01 +0100 |
commit | 105d3b970b74d422b3af312f6f8edc7208cc8702 (patch) | |
tree | ec1183d64ba3608731a50731e98ef84510716de3 | |
parent | 541e68e0c3d0be9a940632edc5181788fff11d88 (diff) |
staging: dgnc: replace usleep_range with udelay
udelay is impelmented using a busy-wait loop and consumes CPU cycles
while usleep_range is implemented using interrupts.cls_flush_uart_write()
is called after a channel lock is acquired i.e. an atomic context.
Hence delay in this method should use udelay instead of usleep_range.
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/dgnc/dgnc_cls.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index 28a3e1676f07..3112c25282a7 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -609,7 +609,9 @@ static void cls_flush_uart_write(struct channel_t *ch) writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_XMIT), &ch->ch_cls_uart->isr_fcr); - usleep_range(10, 20); + + /* Must use *delay family functions in atomic context */ + udelay(10); ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM); } |