Skip to content

Commit

Permalink
habanalabs: enable gaudi code in driver
Browse files Browse the repository at this point in the history
Enable the GAUDI ASIC code in the pci probe callback of the driver so the
driver will handle GAUDI ASICs.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
  • Loading branch information
Oded Gabbay committed May 19, 2020
1 parent 79fc7a9 commit af57cb8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions drivers/misc/habanalabs/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ static int device_early_init(struct hl_device *hdev)
goya_set_asic_funcs(hdev);
strlcpy(hdev->asic_name, "GOYA", sizeof(hdev->asic_name));
break;
case ASIC_GAUDI:
gaudi_set_asic_funcs(hdev);
sprintf(hdev->asic_name, "GAUDI");
break;
default:
dev_err(hdev->dev, "Unrecognized ASIC type %d\n",
hdev->asic_type);
Expand Down
5 changes: 0 additions & 5 deletions drivers/misc/habanalabs/habanalabs_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,6 @@ int create_hdev(struct hl_device **dev, struct pci_dev *pdev,
dev_err(&pdev->dev, "Unsupported ASIC\n");
rc = -ENODEV;
goto free_hdev;
} else if (hdev->asic_type == ASIC_GAUDI) {
dev_err(&pdev->dev,
"GAUDI is not supported by the current kernel\n");
rc = -ENODEV;
goto free_hdev;
}
} else {
hdev->asic_type = asic_type;
Expand Down
3 changes: 3 additions & 0 deletions drivers/misc/habanalabs/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ static ssize_t device_type_show(struct device *dev,
case ASIC_GOYA:
str = "GOYA";
break;
case ASIC_GAUDI:
str = "GAUDI";
break;
default:
dev_err(hdev->dev, "Unrecognized ASIC type %d\n",
hdev->asic_type);
Expand Down

0 comments on commit af57cb8

Please sign in to comment.