]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mailbox: tegra-hsp: Clear mailbox before using message
authorPekka Pessi <ppessi@nvidia.com>
Mon, 2 Dec 2024 10:05:59 +0000 (15:35 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 12:49:51 +0000 (13:49 +0100)
commit3d725abdfdd9737f3abf46171423c6ed62c98f28
treec261b7b4b325a0b7116fb3f1c2dd20e1c6ca7414
parentf3d80f34f58445355fa27b9579a449fb186aa64e
mailbox: tegra-hsp: Clear mailbox before using message

commit 0b7f8328f988178b55ee11d772a6e1238c04d29d upstream.

The Tegra RCE (Camera) driver expects the mailbox to be empty before
processing the IVC messages. On RT kernel, the threads processing the
IVC messages (which are invoked after `mbox_chan_received_data()` is
called) may be on a different CPU or running with a higher priority
than the HSP interrupt handler thread. This can cause it to act on the
message before the mailbox gets cleared in the HSP interrupt handler
resulting in a loss of IVC notification.

Fix this by clearing the mailbox data register before calling
`mbox_chan_received_data()`.

Fixes: 8f585d14030d ("mailbox: tegra-hsp: Add tegra_hsp_sm_ops")
Fixes: 74c20dd0f892 ("mailbox: tegra-hsp: Add 128-bit shared mailbox support")
Cc: stable@vger.kernel.org
Signed-off-by: Pekka Pessi <ppessi@nvidia.com>
Signed-off-by: Kartik Rajput <kkartik@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mailbox/tegra-hsp.c