]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
serial: tegra: avoid reg access when clk disabled
authorAhung Cheng <ahcheng@nvidia.com>
Wed, 4 Sep 2019 04:42:57 +0000 (10:12 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Sep 2019 08:00:03 +0000 (10:00 +0200)
commit494f79bd2365703e4093efa0ecf4b139d83aba97
tree3ba58b78f0aada612bc1359dd4eaeba9b9b429cd
parent33ae787b74fc0e1dfe6bb998c7e4d1c2369a8776
serial: tegra: avoid reg access when clk disabled

This avoids two race conditions from the UART shutdown sequence both
leading to 'Machine check error in AXI2APB' and kernel oops.

One was that the clock was disabled before the DMA was terminated making
it possible for the DMA callbacks to be called after the clock was
disabled. These callbacks could write to the UART registers causing
timeout.

The second was that the clock was disabled before the UART was
completely flagged as closed. This is done after the shutdown is called
and a new write could be started after the clock was disabled.
tegra_uart_start_pio_tx could be called causing timeout.

Given that the baud rate is reset at the end of shutdown sequence, this
fix is to examine the baud rate to avoid register access from both race
conditions.

Besides, terminate the DMA before disabling the clock.

Signed-off-by: Ahung Cheng <ahcheng@nvidia.com>
Signed-off-by: Shardar Mohammed <smohammed@nvidia.com>
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Link: https://lore.kernel.org/r/1567572187-29820-3-git-send-email-kyarlagadda@nvidia.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial-tegra.c