habanalabs: improve a couple of error messages
This patch improves the error message that is shown when a new user tries to open a new FD while there is already an existing user that is working on the device. It also improves the error message in case of missing firmware file. Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>alistair/sunxi64-5.4-dsi
parent
60e8523e2e
commit
cfc2f35006
|
@ -29,13 +29,13 @@ int hl_fw_push_fw_to_device(struct hl_device *hdev, const char *fw_name,
|
||||||
|
|
||||||
rc = request_firmware(&fw, fw_name, hdev->dev);
|
rc = request_firmware(&fw, fw_name, hdev->dev);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
dev_err(hdev->dev, "Failed to request %s\n", fw_name);
|
dev_err(hdev->dev, "Firmware file %s is not found!\n", fw_name);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
fw_size = fw->size;
|
fw_size = fw->size;
|
||||||
if ((fw_size % 4) != 0) {
|
if ((fw_size % 4) != 0) {
|
||||||
dev_err(hdev->dev, "illegal %s firmware size %zu\n",
|
dev_err(hdev->dev, "Illegal %s firmware size %zu\n",
|
||||||
fw_name, fw_size);
|
fw_name, fw_size);
|
||||||
rc = -EINVAL;
|
rc = -EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -107,7 +107,7 @@ int hl_device_open(struct inode *inode, struct file *filp)
|
||||||
|
|
||||||
if (atomic_read(&hdev->fd_open_cnt)) {
|
if (atomic_read(&hdev->fd_open_cnt)) {
|
||||||
dev_info_ratelimited(hdev->dev,
|
dev_info_ratelimited(hdev->dev,
|
||||||
"Device %s is already attached to application\n",
|
"Can't open %s because another user is working on it\n",
|
||||||
dev_name(hdev->dev));
|
dev_name(hdev->dev));
|
||||||
mutex_unlock(&hdev->fd_open_cnt_lock);
|
mutex_unlock(&hdev->fd_open_cnt_lock);
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
Loading…
Reference in New Issue