mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
vhost-vdpa: print warning when vhost_vdpa_alloc_domain fails
Add a print explaining why vhost_vdpa_alloc_domain failed if the device is not IOMMU cache coherent capable. Without this print, we have no hint why the operation failed. For example: $ virsh start <domain> error: Failed to start domain <domain> error: Unable to open '/dev/vhost-vdpa-<idx>' for vdpa device: Unknown error 524 Suggested-by: Eugenio Perez Martin <eperezma@redhat.com> Signed-off-by: Alvaro Karsz <alvaro.karsz@solid-run.com> Message-Id: <20230202084212.1328530-1-alvaro.karsz@solid-run.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Eugenio Pérez Martin <eperezma@redhat.com>
This commit is contained in:
parent
08707b5c33
commit
6830a6aba9
1 changed files with 4 additions and 1 deletions
|
@ -1151,8 +1151,11 @@ static int vhost_vdpa_alloc_domain(struct vhost_vdpa *v)
|
||||||
if (!bus)
|
if (!bus)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
if (!device_iommu_capable(dma_dev, IOMMU_CAP_CACHE_COHERENCY))
|
if (!device_iommu_capable(dma_dev, IOMMU_CAP_CACHE_COHERENCY)) {
|
||||||
|
dev_warn_once(&v->dev,
|
||||||
|
"Failed to allocate domain, device is not IOMMU cache coherent capable\n");
|
||||||
return -ENOTSUPP;
|
return -ENOTSUPP;
|
||||||
|
}
|
||||||
|
|
||||||
v->domain = iommu_domain_alloc(bus);
|
v->domain = iommu_domain_alloc(bus);
|
||||||
if (!v->domain)
|
if (!v->domain)
|
||||||
|
|
Loading…
Reference in a new issue