Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1535349

Re: [PATCH] tty: serial: fsl_lpuart: fix del_timer_sync() vs timer routine deadlock

From Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Newsgroups linux.kernel
Subject Re: [PATCH] tty: serial: fsl_lpuart: fix del_timer_sync() vs timer routine deadlock
Date 2016-12-03 10:00 +0100
Message-ID <sKekN-7mr-3@gated-at.bofh.it> (permalink)
References <sJTgl-2BN-21@gated-at.bofh.it> <sK0Bb-7kF-3@gated-at.bofh.it> <sK3z4-Gp-27@gated-at.bofh.it> <sKekN-7mr-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



03.12.2016 10:06, Bhuvanchandra DV пишет:
> On 12/03/2016 02:58 AM, Nikita Yushchenko wrote:
> 
>>>> Problem found via lockdep:
>>>>
>>>> - lpuart_set_termios() calls del_timer_sync(&sport->lpuart_timer) while
>>>>    holding sport->port.lock
>>>>
>>>> - sport->lpuart_timer routine is lpuart_timer_func() that calls
>>>>    lpuart_copy_rx_to_tty() that acquires same lock.
>>>>
>>>> To fix, move Rx DMA stopping out of lock, as it already is in other
>>>> places
>>>> in the same file.
>>>>
>>>> While at it, also make Rx DMA start/stop code to look the same is in
>>>> other places in the same file.
>>> Yeah I saw that too, never really came around to look closer into it.
>>>
>>> Thanks for looking into it.
>>>
>>> You removed the check whether there was an old configuration, I think
>>> the idea of that was that we only resize DMA if it was configured
>>> differently before...
>> Per my code reading, checking for sport->lpuart_dma_rx_use should be
>> enough, this flag will be set only if DMA was previously enabled,
> 
> The check is to make sure the reconfiguration of DMA is done only when
> the baudrate is altered.

Then, ok to use

if (old && sport->lpuart_dma_rx_use) {...}

in both places?

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] tty: serial: fsl_lpuart: fix del_timer_sync() vs timer routine deadlock Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2016-12-02 11:30 +0100
  Re: [PATCH] tty: serial: fsl_lpuart: fix del_timer_sync() vs timer  routine deadlock Stefan Agner <stefan@agner.ch> - 2016-12-02 19:20 +0100
    Re: [PATCH] tty: serial: fsl_lpuart: fix del_timer_sync() vs timer  routine deadlock Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2016-12-02 22:30 +0100
      Re: [PATCH] tty: serial: fsl_lpuart: fix del_timer_sync() vs timer  routine deadlock Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2016-12-03 10:00 +0100

csiph-web