rtcpu: Halt RTCPU using HSP_BYE before reset

Calling tegra_camrtc_reboot() can cause a memory fabric timeout error by
asserting reset when the RTCPU is in the middle of a memory transaction.
As a solution (similar to tegra_camrtc_halt), before asserting the
hardware reset, signaling the RTCPU to suspend its operations using
CAMRTC_HSP_BYE and waiting for RTCPU to enter WFI.

Bug 5051748

Change-Id: Iba8e4e837ee0983ffe9629e7627e0056ce1c2341
Signed-off-by: Petri Niemela <pniemela@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3317142
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Tested-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sudhir Vyas <svyas@nvidia.com>
This commit is contained in:
Petri Niemela
2025-03-11 08:02:20 +00:00
committed by Jon Hunter
parent 601567ef37
commit 58478b0ab6

View File

@@ -952,6 +952,7 @@ fail:
int tegra_camrtc_reboot(struct device *dev) int tegra_camrtc_reboot(struct device *dev)
{ {
struct tegra_cam_rtcpu *rtcpu = dev_get_drvdata(dev); struct tegra_cam_rtcpu *rtcpu = dev_get_drvdata(dev);
int err = 0;
int ret; int ret;
if (pm_runtime_suspended(dev)) { if (pm_runtime_suspended(dev)) {
@@ -974,6 +975,20 @@ int tegra_camrtc_reboot(struct device *dev)
tegra_camrtc_set_online(dev, false); tegra_camrtc_set_online(dev, false);
/* Signal CAMRTC to suspend its operations.
* Incompleted memory operations by CAMRTC can cause a memory fabric
* error if the reset signal is asserted in middle of shared memory
* transaction.
*/
if (rtcpu->hsp)
err = camrtc_hsp_bye(rtcpu->hsp);
/* Wait for the core to enter WFI before asserting the reset.
* Don't bother if the core was unresponsive.
*/
if (err == 0)
tegra_camrtc_wait_for_idle(dev);
tegra_camrtc_assert_resets(dev); tegra_camrtc_assert_resets(dev);
rtcpu->powered = false; rtcpu->powered = false;