All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Kai Ye <yekai13@huawei.com>
Cc: linux-accelerators@lists.ozlabs.org,
	linux-kernel@vger.kernel.org, linuxarm@huawei.com,
	zhangfei.gao@linaro.org, wangzhou1@hisilicon.com
Subject: Re: [PATCH] uacce: add print information if not enable sva
Date: Fri, 4 Jun 2021 09:51:29 +0200	[thread overview]
Message-ID: <YLnbgcJmQZChx1WV@kroah.com> (raw)
In-Reply-To: <1622792769-28017-1-git-send-email-yekai13@huawei.com>

On Fri, Jun 04, 2021 at 03:46:09PM +0800, Kai Ye wrote:
> Add print information necessary if user not enable sva.
> 
> Signed-off-by: Kai Ye <yekai13@huawei.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);

Why is this needed?  Has this ever happened in real life such that the
log message is now required?



>  		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);

Same here, does this happen in real systems?

thanks,

greg k-h

  reply	other threads:[~2021-06-04  7:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04  7:46 [PATCH] uacce: add print information if not enable sva Kai Ye
2021-06-04  7:51 ` Greg KH [this message]
2021-06-08  1:39   ` yekai(A)
2021-06-09  9:52     ` Greg KH
2021-06-04  7:57 ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YLnbgcJmQZChx1WV@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-accelerators@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=wangzhou1@hisilicon.com \
    --cc=yekai13@huawei.com \
    --cc=zhangfei.gao@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.