Commit 56921023 authored by Oded Gabbay's avatar Oded Gabbay

accel/habanalabs: remove sim code

There were a few places where simulator only code got into the upstream.
Remove those places that can confuse other developers.

Fixes: 2a0a839b ("habanalabs: extend fatal messages to contain PCI info")
Cc: Moti Haimovski <mhaimovski@habana.ai>
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
parent 5d658d0c
...@@ -2328,13 +2328,9 @@ int hl_device_init(struct hl_device *hdev) ...@@ -2328,13 +2328,9 @@ int hl_device_init(struct hl_device *hdev)
hdev->disabled = true; hdev->disabled = true;
if (expose_interfaces_on_err) if (expose_interfaces_on_err)
cdev_sysfs_debugfs_add(hdev); cdev_sysfs_debugfs_add(hdev);
if (hdev->pdev)
dev_err(&hdev->pdev->dev, dev_err(&hdev->pdev->dev,
"Failed to initialize hl%d. Device %s is NOT usable !\n", "Failed to initialize hl%d. Device %s is NOT usable !\n",
hdev->cdev_idx, dev_name(&(hdev)->pdev->dev)); hdev->cdev_idx, dev_name(&hdev->pdev->dev));
else
pr_err("Failed to initialize hl%d. Device %s is NOT usable !\n",
hdev->cdev_idx, dev_name(&(hdev)->pdev->dev));
return rc; return rc;
} }
......
...@@ -2558,12 +2558,7 @@ void hl_wreg(struct hl_device *hdev, u32 reg, u32 val); ...@@ -2558,12 +2558,7 @@ void hl_wreg(struct hl_device *hdev, u32 reg, u32 val);
ktime_t __timeout; \ ktime_t __timeout; \
u32 __elbi_read; \ u32 __elbi_read; \
int __rc = 0; \ int __rc = 0; \
if (hdev->pdev) \
__timeout = ktime_add_us(ktime_get(), timeout_us); \ __timeout = ktime_add_us(ktime_get(), timeout_us); \
else \
__timeout = ktime_add_us(ktime_get(),\
min((u64)(timeout_us * 10), \
(u64) HL_SIM_MAX_TIMEOUT_US)); \
might_sleep_if(sleep_us); \ might_sleep_if(sleep_us); \
for (;;) { \ for (;;) { \
if (elbi) { \ if (elbi) { \
...@@ -2615,13 +2610,7 @@ void hl_wreg(struct hl_device *hdev, u32 reg, u32 val); ...@@ -2615,13 +2610,7 @@ void hl_wreg(struct hl_device *hdev, u32 reg, u32 val);
u8 __arr_idx; \ u8 __arr_idx; \
int __rc = 0; \ int __rc = 0; \
\ \
if (hdev->pdev) \
__timeout = ktime_add_us(ktime_get(), timeout_us); \ __timeout = ktime_add_us(ktime_get(), timeout_us); \
else \
__timeout = ktime_add_us(ktime_get(),\
min(((u64)timeout_us * 10), \
(u64) HL_SIM_MAX_TIMEOUT_US)); \
\
might_sleep_if(sleep_us); \ might_sleep_if(sleep_us); \
if (arr_size >= 64) \ if (arr_size >= 64) \
__rc = -EINVAL; \ __rc = -EINVAL; \
...@@ -2679,12 +2668,8 @@ void hl_wreg(struct hl_device *hdev, u32 reg, u32 val); ...@@ -2679,12 +2668,8 @@ void hl_wreg(struct hl_device *hdev, u32 reg, u32 val);
mem_written_by_device) \ mem_written_by_device) \
({ \ ({ \
ktime_t __timeout; \ ktime_t __timeout; \
if (hdev->pdev) \ \
__timeout = ktime_add_us(ktime_get(), timeout_us); \ __timeout = ktime_add_us(ktime_get(), timeout_us); \
else \
__timeout = ktime_add_us(ktime_get(),\
min((u64)(timeout_us * 100), \
(u64) HL_SIM_MAX_TIMEOUT_US)); \
might_sleep_if(sleep_us); \ might_sleep_if(sleep_us); \
for (;;) { \ for (;;) { \
/* Verify we read updates done by other cores or by device */ \ /* Verify we read updates done by other cores or by device */ \
......
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