diff options
author | Kai Ye <yekai13@huawei.com> | 2021-06-09 12:09:05 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-06-09 18:53:29 +0200 |
commit | 762b296bcbbc7344752ebf3a25583cf38f8adbdc (patch) | |
tree | 537d22ef1b73e9e6b1855371c3d7fb57c4505cdd /drivers/misc/uacce | |
parent | eeprom: idt_89hpesx: use SPDX-License-Identifier (diff) | |
download | linux-762b296bcbbc7344752ebf3a25583cf38f8adbdc.tar.xz linux-762b296bcbbc7344752ebf3a25583cf38f8adbdc.zip |
uacce: add print information if not enable sva
Add print information necessary if user not enable sva.
Signed-off-by: Kai Ye <yekai13@huawei.com>
Link: https://lore.kernel.org/r/1623233345-8765-1-git-send-email-yekai13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/uacce')
-rw-r--r-- | drivers/misc/uacce/uacce.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c index bae18ef03dcb..488eeb2811ae 100644 --- a/drivers/misc/uacce/uacce.c +++ b/drivers/misc/uacce/uacce.c @@ -387,15 +387,22 @@ static void uacce_release(struct device *dev) static unsigned int uacce_enable_sva(struct device *parent, unsigned int flags) { + int ret; + if (!(flags & UACCE_DEV_SVA)) return flags; flags &= ~UACCE_DEV_SVA; - if (iommu_dev_enable_feature(parent, IOMMU_DEV_FEAT_IOPF)) + ret = iommu_dev_enable_feature(parent, IOMMU_DEV_FEAT_IOPF); + if (ret) { + dev_err(parent, "failed to enable IOPF feature! ret = %pe\n", ERR_PTR(ret)); return flags; + } - if (iommu_dev_enable_feature(parent, IOMMU_DEV_FEAT_SVA)) { + ret = iommu_dev_enable_feature(parent, IOMMU_DEV_FEAT_SVA); + if (ret) { + dev_err(parent, "failed to enable SVA feature! ret = %pe\n", ERR_PTR(ret)); iommu_dev_disable_feature(parent, IOMMU_DEV_FEAT_IOPF); return flags; } |