accel/ivpu: Fix DevTLB errors on suspend/resume and recovery
authorJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Wed, 7 Feb 2024 10:24:46 +0000 (11:24 +0100)
committerJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Mon, 12 Feb 2024 08:00:44 +0000 (09:00 +0100)
commit28083ff18d3f65ecd64857f4495623135dd1f132
treed8d459310d8416fa9eee71999b24f120d4a4fa96
parent5f8408aca66772d3aa9b4831577b2ac5ec41bcd9
accel/ivpu: Fix DevTLB errors on suspend/resume and recovery

Issue IP reset before shutdown in order to
complete all upstream requests to the SOC.
Without this DevTLB is complaining about
incomplete transactions and NPU cannot resume from
suspend.
This problem is only happening on recent IFWI
releases.

IP reset in rare corner cases can mess up PCI
configuration, so save it before the reset.
After this happens it is also impossible to
issue PLL requests and D0->D3->D0 cycle is needed
to recover the NPU. Add WP 0 request on power up,
so the PUNIT is always notified about NPU reset.

Use D0/D3 cycle for recovery as it can recover
from failed IP reset and FLR cannot.

Fixes: 3f7c0634926d ("accel/ivpu/37xx: Fix hangs related to MMIO reset")
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240207102446.3126981-1-jacek.lawrynowicz@linux.intel.com
drivers/accel/ivpu/ivpu_hw_37xx.c
drivers/accel/ivpu/ivpu_pm.c