habanalabs: skip read fw errors if dynamic descriptor invalid
authorOhad Sharabi <osharabi@habana.ai>
Mon, 22 Nov 2021 10:23:51 +0000 (12:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:05:04 +0000 (11:05 +0100)
commit5895474d218265645a24ecaf4afe6413c39bdb82
treef080171763907e266187cad043558fbcfb369d49
parent8f23743e1978162c0925dc718e42fe56d3518614
habanalabs: skip read fw errors if dynamic descriptor invalid

[ Upstream commit 4fac990f604e6c10538026835a8a30f3c1b6fcf5 ]

Reporting FW errors involves reading of the error registers.

In case we have a corrupted FW descriptor we cannot do that since the
dynamic scratchpad is potentially corrupted as well and may cause kernel
crush when attempting access to a corrupted register offset.

Signed-off-by: Ohad Sharabi <osharabi@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/habanalabs/common/firmware_if.c
drivers/misc/habanalabs/common/habanalabs.h