diff options
author | Oded Gabbay <ogabbay@kernel.org> | 2020-12-10 00:07:58 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-19 20:27:24 +0300 |
commit | 68a9abf536ff3c54b80983780315d8426da43125 (patch) | |
tree | 8b07a15af5824fdff2371250d852dbe318e06402 /drivers/misc/habanalabs | |
parent | 8d0522d9688c787b33fa2dca17ee298829fafaba (diff) | |
download | linux-68a9abf536ff3c54b80983780315d8426da43125.tar.xz |
habanalabs/gaudi: retry loading TPC f/w on -EINTR
[ Upstream commit 98e8781f008372057bd5cb059ca6b507371e473d ]
If loading the firmware file for the TPC f/w was interrupted, try
to do it again, up to 5 times.
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs')
-rw-r--r-- | drivers/misc/habanalabs/gaudi/gaudi.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c index 36f0bb7154ab..ed1bd41262ec 100644 --- a/drivers/misc/habanalabs/gaudi/gaudi.c +++ b/drivers/misc/habanalabs/gaudi/gaudi.c @@ -754,11 +754,17 @@ static int gaudi_init_tpc_mem(struct hl_device *hdev) size_t fw_size; void *cpu_addr; dma_addr_t dma_handle; - int rc; + int rc, count = 5; +again: rc = request_firmware(&fw, GAUDI_TPC_FW_FILE, hdev->dev); + if (rc == -EINTR && count-- > 0) { + msleep(50); + goto again; + } + if (rc) { - dev_err(hdev->dev, "Firmware file %s is not found!\n", + dev_err(hdev->dev, "Failed to load firmware file %s\n", GAUDI_TPC_FW_FILE); goto out; } |