habanalabs: disable CPU access on timeouts
authorOded Gabbay <oded.gabbay@gmail.com>
Thu, 28 Feb 2019 08:46:12 +0000 (10:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Feb 2019 12:04:59 +0000 (13:04 +0100)
commita28ce422a6d926c11d7e72a83ccaa4f9b06077ea
tree65f08f69e8eec0cf7d5272a87e2e612f975c04ec
parent27ca384cb7c44b8b16ea43f9aed930664140360e
habanalabs: disable CPU access on timeouts

This patch provides a workaround for a bug in the F/W where the response
time for a request from KMD may take more then 100ms. This could cause the
queue between KMD and the F/W to get out of sync.

The WA is to:
1. Increase the timeout of ALL requests to 1s.
2. In case a request isn't answered in time, mark the state as
"cpu_disabled" and prevent sending further requests from KMD to the F/W.
This will eventually lead to a heartbeat failure and hard reset of the
device.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/habanalabs/debugfs.c
drivers/misc/habanalabs/device.c
drivers/misc/habanalabs/goya/goya.c
drivers/misc/habanalabs/habanalabs.h
drivers/misc/habanalabs/hwmon.c
drivers/misc/habanalabs/sysfs.c