lkml.org 
[lkml]   [2020]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Handle init_iova_flush_queue failure in dma-iommu path
On Thu, Sep 10, 2020 at 01:25:38PM +0100, Tom Murphy wrote:
> init_iova_flush_queue can fail if we run out of memory. Fall back to noflush
> queue if it fails.
>
> Signed-off-by: Tom Murphy <murphyt7@tcd.ie>
> ---
> drivers/iommu/dma-iommu.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
> index 4959f5df21bd..5f69126f3e91 100644
> --- a/drivers/iommu/dma-iommu.c
> +++ b/drivers/iommu/dma-iommu.c
> @@ -343,8 +343,11 @@ static int iommu_dma_init_domain(struct iommu_domain *domain, dma_addr_t base,
>
> if (!cookie->fq_domain && !iommu_domain_get_attr(domain,
> DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE, &attr) && attr) {
> - cookie->fq_domain = domain;
> - init_iova_flush_queue(iovad, iommu_dma_flush_iotlb_all, NULL);
> + if (init_iova_flush_queue(iovad, iommu_dma_flush_iotlb_all,
> + NULL))
> + pr_warn("iova flush queue initialization failed\n");
> + else
> + cookie->fq_domain = domain;
> }
>
> if (!dev)

Looks good to me, but Robin should also have a look.

\
 
 \ /
  Last update: 2020-09-18 10:56    [W:0.036 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site