Virtualization Archive mirror
 help / color / mirror / Atom feed
From: Jean-Philippe Brucker <jean-philippe@linaro.org>
To: flyingpenghao@gmail.com
Cc: virtualization@lists.linux.dev, Peng Hao <flyingpeng@tencent.com>
Subject: Re: [PATCH]  viommu: return error code for unknown probe type
Date: Mon, 15 Apr 2024 12:46:56 +0100	[thread overview]
Message-ID: <20240415114656.GA387653@myrica> (raw)
In-Reply-To: <20240415081823.18847-1-flyingpeng@tencent.com>

Hello,

On Mon, Apr 15, 2024 at 04:18:23PM +0800, flyingpenghao@gmail.com wrote:
> From: Peng Hao <flyingpeng@tencent.com>
> 
> If the probe types processed by the loop are all unknown,
> no error will be returned.
> 
> Signed-off-by: Peng Hao <flyingpeng@tencent.com>
> ---
>  drivers/iommu/virtio-iommu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c
> index 04048f64a2c0..80352505b762 100644
> --- a/drivers/iommu/virtio-iommu.c
> +++ b/drivers/iommu/virtio-iommu.c
> @@ -555,6 +555,7 @@ static int viommu_probe_endpoint(struct viommu_dev *viommu, struct device *dev)
>  			break;
>  		default:
>  			dev_err(dev, "unknown viommu prop 0x%x\n", type);
> +			ret = -EINVAL;

The intent here is only to warn (and it should probably be replaced with
dev_warn()). I don't think unrecognized properties should cause the
endpoint probe to fail, they just indicate that the device supports newer
features.

The virtio-iommu specification states this in 5.13.6.7.1 Driver
Requirements: PROBE request: 
"If the driver doesn’t recognize the type of a property, it SHOULD ignore
 the property."

Ideally, new PROBE properties are introduced alongside a virtio feature
bit, and the device doesn't present them in the PROBE buffer if that
feature isn't negotiated during device initialization. However we don't
yet have an example of such extension. Did you encounter this problem on
existing systems?

Thanks,
Jean

>  		}
>  
>  		if (ret)
> -- 
> 2.31.1
> 

      reply	other threads:[~2024-04-15 11:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15  8:18 [PATCH] viommu: return error code for unknown probe type flyingpenghao
2024-04-15 11:46 ` Jean-Philippe Brucker [this message]

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=20240415114656.GA387653@myrica \
    --to=jean-philippe@linaro.org \
    --cc=flyingpeng@tencent.com \
    --cc=flyingpenghao@gmail.com \
    --cc=virtualization@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).