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] [thread-next>] [day] [month] [year] [list]
Message-ID: <5935afbd-ec39-21f8-1585-57a932261271@nvidia.com>
Date:   Tue, 18 Oct 2022 14:18:49 +0100
From:   Jon Hunter <jonathanh@...dia.com>
To:     Kartik <kkartik@...dia.com>, ldewangan@...dia.com,
        gregkh@...uxfoundation.org, jirislaby@...nel.org,
        thierry.reding@...il.com, swarren@...dia.com,
        akhilrajeev@...dia.com, linux-serial@...r.kernel.org,
        linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] serial: tegra: read DMA status before terminating


On 18/10/2022 07:25, Kartik wrote:
> To get the valid data, read DMA status before terminating the DMA. As
> dmaengine_terminate_all() deletes the DMA desc.
> 
> Fixes: e9ea096dd225 ("serial: tegra: add serial driver")
> 
> Signed-off-by: Akhil R <akhilrajeev@...dia.com>
> Signed-off-by: Kartik <kkartik@...dia.com>
> ---
>   drivers/tty/serial/serial-tegra.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
> index b7170cb9a544..2779b4491f02 100644
> --- a/drivers/tty/serial/serial-tegra.c
> +++ b/drivers/tty/serial/serial-tegra.c
> @@ -619,8 +619,8 @@ static void tegra_uart_stop_tx(struct uart_port *u)
>   	if (tup->tx_in_progress != TEGRA_UART_TX_DMA)
>   		return;
>   
> -	dmaengine_terminate_all(tup->tx_dma_chan);
>   	dmaengine_tx_status(tup->tx_dma_chan, tup->tx_cookie, &state);
> +	dmaengine_terminate_all(tup->tx_dma_chan);

The change looks fine to me, but on further review of other similar 
drivers I see that they pause first ...

  dmaengine_pause(tup->tx_dma_chan);
  dmaengine_tx_status(tup->tx_dma_chan, tup->tx_cookie, &state);
  dmaengine_terminate_all(tup->tx_dma_chan);

This makes sense so that when we calculate the amount of the data 
transferred we get the exact amount. Can we add a pause while we are at it?

Thanks!
Jon

-- 
nvpublic

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ