lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <008a54e3-3585-2f73-a4cb-198fd2fa725a@gmail.com>
Date:   Fri, 21 Feb 2020 22:10:26 +0300
From:   Dmitry Osipenko <digetx@...il.com>
To:     Jon Hunter <jonathanh@...dia.com>, Jiri Slaby <jslaby@...e.cz>,
        Laxman Dewangan <ldewangan@...dia.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Thierry Reding <thierry.reding@...il.com>
Cc:     linux-serial@...r.kernel.org, linux-tegra@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH for 5.6 v2] tty: serial: tegra: Handle RX transfer in PIO
 mode if DMA wasn't started

19.02.2020 17:38, Jon Hunter пишет:
> 
> On 19/02/2020 12:25, Dmitry Osipenko wrote:
>> 17.02.2020 10:37, Jiri Slaby пишет:
>>> On 09. 02. 20, 17:44, Dmitry Osipenko wrote:
>>>> It is possible to get an instant RX timeout or end-of-transfer interrupt
>>>> before RX DMA was started, if transaction is less than 16 bytes. Transfer
>>>> should be handled in PIO mode in this case because DMA can't handle it.
>>>> This patch brings back the original behaviour of the driver that was
>>>> changed by accident by a previous commit, it fixes occasional Bluetooth HW
>>>> initialization failures which I started to notice recently.
>>>>
>>>> Fixes: d5e3fadb7012 ("tty: serial: tegra: Activate RX DMA transfer by request")
>>>> Signed-off-by: Dmitry Osipenko <digetx@...il.com>
>>>> ---
>>>>
>>>> Changelog:
>>>>
>>>> v2: - Corrected commit's title by adding the accidentally missed "tegra: "
>>>>       to the prefix.
>>>>
>>>>  drivers/tty/serial/serial-tegra.c | 35 ++++++++++++++-----------------
>>>>  1 file changed, 16 insertions(+), 19 deletions(-)
>>>>
>>>> diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
>>>> index 33034b852a51..8de8bac9c6c7 100644
>>>> --- a/drivers/tty/serial/serial-tegra.c
>>>> +++ b/drivers/tty/serial/serial-tegra.c
>>>> @@ -692,11 +692,22 @@ static void tegra_uart_copy_rx_to_tty(struct tegra_uart_port *tup,
>>>>  				   count, DMA_TO_DEVICE);
>>>>  }
>>>>  
>>>> +static void do_handle_rx_pio(struct tegra_uart_port *tup)
>>>> +{
>>>> +	struct tty_struct *tty = tty_port_tty_get(&tup->uport.state->port);
>>>> +	struct tty_port *port = &tup->uport.state->port;
>>>> +
>>>> +	tegra_uart_handle_rx_pio(tup, port);
>>>> +	if (tty) {
>>>
>>> What's the tty good for here, actually?
>>>
>>>> +		tty_flip_buffer_push(port);
>>>> +		tty_kref_put(tty);
>>>> +	}
>>>> +}
>>
>> I'm not really a TTY expert..
>>
>> Jon, maybe you have any clue whether TTY could disappear while port is
>> opened?
> 
> Nothing specific that I am aware of. The function tty_kref_get() appears
> to check that the tty pointer is valid and so it would seem logical to
> check here as well. But happy to be corrected :-)

Okay, thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ