Commit 6966d9e1 authored by Oded Gabbay's avatar Oded Gabbay

habanalabs: show unsupported message for GAUDI

If a GAUDI device is present in the system, display an error message that
it is not supported by the current kernel.
Reviewed-by: default avatarOmer Shpigelman <oshpigelman@habana.ai>
Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
parent 4f0e6ab7
...@@ -424,10 +424,12 @@ struct hl_eq { ...@@ -424,10 +424,12 @@ struct hl_eq {
* enum hl_asic_type - supported ASIC types. * enum hl_asic_type - supported ASIC types.
* @ASIC_INVALID: Invalid ASIC type. * @ASIC_INVALID: Invalid ASIC type.
* @ASIC_GOYA: Goya device. * @ASIC_GOYA: Goya device.
* @ASIC_GAUDI: Gaudi device.
*/ */
enum hl_asic_type { enum hl_asic_type {
ASIC_INVALID, ASIC_INVALID,
ASIC_GOYA ASIC_GOYA,
ASIC_GAUDI
}; };
struct hl_cs_parser; struct hl_cs_parser;
......
...@@ -40,12 +40,13 @@ MODULE_PARM_DESC(reset_on_lockup, ...@@ -40,12 +40,13 @@ MODULE_PARM_DESC(reset_on_lockup,
#define PCI_VENDOR_ID_HABANALABS 0x1da3 #define PCI_VENDOR_ID_HABANALABS 0x1da3
#define PCI_IDS_GOYA 0x0001 #define PCI_IDS_GOYA 0x0001
#define PCI_IDS_GAUDI 0x1000
static const struct pci_device_id ids[] = { static const struct pci_device_id ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_HABANALABS, PCI_IDS_GOYA), }, { PCI_DEVICE(PCI_VENDOR_ID_HABANALABS, PCI_IDS_GOYA), },
{ PCI_DEVICE(PCI_VENDOR_ID_HABANALABS, PCI_IDS_GAUDI), },
{ 0, } { 0, }
}; };
MODULE_DEVICE_TABLE(pci, ids);
/* /*
* get_asic_type - translate device id to asic type * get_asic_type - translate device id to asic type
...@@ -63,6 +64,9 @@ static enum hl_asic_type get_asic_type(u16 device) ...@@ -63,6 +64,9 @@ static enum hl_asic_type get_asic_type(u16 device)
case PCI_IDS_GOYA: case PCI_IDS_GOYA:
asic_type = ASIC_GOYA; asic_type = ASIC_GOYA;
break; break;
case PCI_IDS_GAUDI:
asic_type = ASIC_GAUDI;
break;
default: default:
asic_type = ASIC_INVALID; asic_type = ASIC_INVALID;
break; break;
...@@ -263,6 +267,11 @@ int create_hdev(struct hl_device **dev, struct pci_dev *pdev, ...@@ -263,6 +267,11 @@ int create_hdev(struct hl_device **dev, struct pci_dev *pdev,
dev_err(&pdev->dev, "Unsupported ASIC\n"); dev_err(&pdev->dev, "Unsupported ASIC\n");
rc = -ENODEV; rc = -ENODEV;
goto free_hdev; 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 { } else {
hdev->asic_type = asic_type; hdev->asic_type = asic_type;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment