[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1622792769-28017-1-git-send-email-yekai13@huawei.com>
Date: Fri, 4 Jun 2021 15:46:09 +0800
From: Kai Ye <yekai13@...wei.com>
To: <gregkh@...uxfoundation.org>,
<linux-accelerators@...ts.ozlabs.org>,
<linux-kernel@...r.kernel.org>, <linuxarm@...wei.com>,
<zhangfei.gao@...aro.org>, <wangzhou1@...ilicon.com>,
<yekai13@...wei.com>
Subject: [PATCH] uacce: add print information if not enable sva
Add print information necessary if user not enable sva.
Signed-off-by: Kai Ye <yekai13@...wei.com>
---
drivers/misc/uacce/uacce.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c
index bae18ef0..fe38af8 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 = %d\n", 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 = %d\n", ret);
iommu_dev_disable_feature(parent, IOMMU_DEV_FEAT_IOPF);
return flags;
}
--
2.7.4
Powered by blists - more mailing lists