[PATCH 5.13 115/351] habanalabs: check if asic secured with asic type

From: Greg Kroah-Hartman
Date: Mon Jul 19 2021 - 13:26:23 EST


From: Ohad Sharabi <osharabi@xxxxxxxxx>

[ Upstream commit 190ec49710a9fe0d5e9e36fe1a2fa864c048484f ]

Fix issue in which the input to the function is_asic_secured was device
PCI_IDS number instead of the asic_type enumeration.

Signed-off-by: Ohad Sharabi <osharabi@xxxxxxxxx>
Reviewed-by: Oded Gabbay <ogabbay@xxxxxxxxxx>
Signed-off-by: Oded Gabbay <ogabbay@xxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/misc/habanalabs/common/habanalabs_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/habanalabs/common/habanalabs_drv.c b/drivers/misc/habanalabs/common/habanalabs_drv.c
index d15b912a347b..91bcaaed5cd6 100644
--- a/drivers/misc/habanalabs/common/habanalabs_drv.c
+++ b/drivers/misc/habanalabs/common/habanalabs_drv.c
@@ -309,7 +309,7 @@ int create_hdev(struct hl_device **dev, struct pci_dev *pdev,

if (pdev)
hdev->asic_prop.fw_security_disabled =
- !is_asic_secured(pdev->device);
+ !is_asic_secured(hdev->asic_type);
else
hdev->asic_prop.fw_security_disabled = true;

--
2.30.2