Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1256136

Re: [PATCH] iommu/amd: Fix amd_iommu_detect() (does not fix any issues).

From Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH] iommu/amd: Fix amd_iommu_detect() (does not fix any issues).
Date 2015-10-26 17:10 +0100
Message-ID <qnSvn-1WC-3@gated-at.bofh.it> (permalink)
References <q3FAK-453-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Aug 31, 2015 at 06:13:03PM -0400, j.glisse@gmail.com wrote:
> From: Jérôme Glisse <jglisse@redhat.com>
> 
> Fix amd_iommu_detect() to return positive value on success, like
> intended, and not zero. This will not change anything in the end
> as AMD IOMMU disable swiotlb and properly associate itself with

Not sure how it disables SWIOTLB? The AMD Vi does not seem to
change 'swiotlb'. While 'gart_iommu_init' does. Did you mean
the AMD GART code?

> devices even if detect() doesn't return a positive value.

Returning positive will mean that the pci_iommu_alloc will stop
processing _all_ other IOMMUs.

While returning 0 will let it detect the other IOMMUs.

Granted on an AMD machine there can be two 'IOMMU's - the GART
and the AMD Vi. The detection is always to call gart_iommu_hole_init
first, then amd_iommu_detect.

I presume if there was one more type on AMD we would run into trouble.


> 
> Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
> Cc: Joerg Roedel <jroedel@suse.de>
> Cc: iommu@lists.linux-foundation.org
> ---
>  drivers/iommu/amd_iommu_init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
> index a24495e..360a451 100644
> --- a/drivers/iommu/amd_iommu_init.c
> +++ b/drivers/iommu/amd_iommu_init.c
> @@ -2198,7 +2198,7 @@ int __init amd_iommu_detect(void)
>  	iommu_detected = 1;
>  	x86_init.iommu.iommu_init = amd_iommu_init;
>  
> -	return 0;
> +	return 1;
>  }
>  
>  /****************************************************************************
> -- 
> 1.8.3.1
> 
> _______________________________________________
> iommu mailing list
> iommu@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH] iommu/amd: Fix amd_iommu_detect() (does not fix any  issues). Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> - 2015-10-26 17:10 +0100
  Re: [PATCH] iommu/amd: Fix amd_iommu_detect() (does not fix any  issues). Jerome Glisse <j.glisse@gmail.com> - 2015-10-27 01:50 +0100
    Re: [PATCH] iommu/amd: Fix amd_iommu_detect() (does not fix any  issues). Jerome Glisse <j.glisse@gmail.com> - 2015-10-27 02:00 +0100
      Re: [PATCH] iommu/amd: Fix amd_iommu_detect() (does not fix any  issues). Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> - 2015-10-27 15:20 +0100

csiph-web