Skip to content

Commit 98e8781

Browse files
committed
habanalabs/gaudi: retry loading TPC f/w on -EINTR
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>
1 parent 377182a commit 98e8781

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • drivers/misc/habanalabs/gaudi

drivers/misc/habanalabs/gaudi/gaudi.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,11 +838,17 @@ static int gaudi_init_tpc_mem(struct hl_device *hdev)
838838
size_t fw_size;
839839
void *cpu_addr;
840840
dma_addr_t dma_handle;
841-
int rc;
841+
int rc, count = 5;
842842

843+
again:
843844
rc = request_firmware(&fw, GAUDI_TPC_FW_FILE, hdev->dev);
845+
if (rc == -EINTR && count-- > 0) {
846+
msleep(50);
847+
goto again;
848+
}
849+
844850
if (rc) {
845-
dev_err(hdev->dev, "Firmware file %s is not found!\n",
851+
dev_err(hdev->dev, "Failed to load firmware file %s\n",
846852
GAUDI_TPC_FW_FILE);
847853
goto out;
848854
}

0 commit comments

Comments
 (0)