aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs/common/device.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-08-26 10:50:50 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-08-26 10:50:50 -0700
commit27563ab6ef75abc64b7da2c7a321b7edd89dfcf7 (patch)
tree55b9cabd699deb690b4a8ac3f43ea5b00b53c75a /drivers/misc/habanalabs/common/device.c
parent51c4518ab77c6d3e917675891a9a529daabfaef1 (diff)
parent9c97cecab0d49e40460d9b5230ab4bf036f59491 (diff)
downloadkernel_replicant_linux-27563ab6ef75abc64b7da2c7a321b7edd89dfcf7.tar.gz
kernel_replicant_linux-27563ab6ef75abc64b7da2c7a321b7edd89dfcf7.tar.bz2
kernel_replicant_linux-27563ab6ef75abc64b7da2c7a321b7edd89dfcf7.zip
Merge tag 'char-misc-5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver fixes from Greg KH: "Here are some small char and misc and other driver subsystem fixes for 5.9-rc3. The majority of these are tiny habanalabs driver fixes, but also in here are: - speakup build fixes now that it is out of staging and got exposed to more build systems all of a sudden - mei driver fix All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: habanalabs: correctly report inbound pci region cfg error habanalabs: check correct vmalloc return code habanalabs: validate FW file size habanalabs: fix incorrect check on failed workqueue create habanalabs: set max power according to card type habanalabs: proper handling of alloc size in coresight habanalabs: set clock gating according to mask habanalabs: verify user input in cs_ioctl_signal_wait habanalabs: Fix a loop in gaudi_extract_ecc_info() habanalabs: Fix memory corruption in debugfs habanalabs: validate packet id during CB parse habanalabs: Validate user address before mapping habanalabs: unmap PCI bars upon iATU failure mei: hdcp: fix mei_hdcp_verify_mprime() input parameter speakup: only build serialio when ISA is enabled speakup: Fix wait_for_xmitr for ttyio case
Diffstat (limited to 'drivers/misc/habanalabs/common/device.c')
-rw-r--r--drivers/misc/habanalabs/common/device.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c
index be16b75bdfdb..24b01cce0a38 100644
--- a/drivers/misc/habanalabs/common/device.c
+++ b/drivers/misc/habanalabs/common/device.c
@@ -288,7 +288,7 @@ static int device_early_init(struct hl_device *hdev)
for (i = 0 ; i < hdev->asic_prop.completion_queues_count ; i++) {
snprintf(workq_name, 32, "hl-free-jobs-%u", i);
hdev->cq_wq[i] = create_singlethread_workqueue(workq_name);
- if (hdev->cq_wq == NULL) {
+ if (hdev->cq_wq[i] == NULL) {
dev_err(hdev->dev, "Failed to allocate CQ workqueue\n");
rc = -ENOMEM;
goto free_cq_wq;
@@ -1069,7 +1069,7 @@ again:
goto out_err;
}
- hl_set_max_power(hdev, hdev->max_power);
+ hl_set_max_power(hdev);
} else {
rc = hdev->asic_funcs->soft_reset_late_init(hdev);
if (rc) {
@@ -1318,6 +1318,11 @@ int hl_device_init(struct hl_device *hdev, struct class *hclass)
goto out_disabled;
}
+ /* Need to call this again because the max power might change,
+ * depending on card type for certain ASICs
+ */
+ hl_set_max_power(hdev);
+
/*
* hl_hwmon_init() must be called after device_late_init(), because only
* there we get the information from the device about which