All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: "Luis R. Rodriguez" <mcgrof@kernel.org>
Cc: "Oded Gabbay" <oded.gabbay@gmail.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>,
	iommu@lists.linux-foundation.org
Subject: Re: [RFT v2] iommu/amd: use subsys_initcall() on amdv2 iommu
Date: Mon, 25 Apr 2016 12:23:51 +0200	[thread overview]
Message-ID: <20160425102351.GC17926@8bytes.org> (raw)
In-Reply-To: <20160418120350.GE1990@wotan.suse.de>

On Mon, Apr 18, 2016 at 02:03:50PM +0200, Luis R. Rodriguez wrote:
> You said that with my patch you saw AMD IOMMUv2 kick off first,
> that was intentional as I thought that's what you needed. Can
> someone please describe the requirements?
> 
> Also what does drm use that you say has a conflict already? What
> drm code are we talking about exactly ?

The required order is:

	1. AMD IOMMUv1 (in-kernel only, initialized at boot time after PCI)
	2. AMD IOMMUv2 (in-kernel or as module, provides demand paging
			and uses v1 interfaces to talk to the IOMMU)
	3. AMD-KFD     (Implements compute offloading to the GPU and
			uses AMD IOMMUv2 functionality, also provides a
			symbol for the radeon driver)
	4. DRM with    (Checks if the symbol provided by AMD-KFD is
	   Radeon	available at init time and does the KFD
			initialization from there, because the GPU needs
			to be up first)

So AMD IOMMUv2 does not initialize (but it does load to have the symbols
available for drivers that optionally use its functionality) without the
AMD IOMMUv1 driver, as it can't access the IOMMU hardware then.

AMD-KFD does not load without AMD IOMMUv2 being loaded, as it depends on
its symbols. AMD-KFD on the other hand needs to be loaded before the
radeon driver (but this it not enforced by symbols), because otherwise
the radeon driver will not initialize the AMD-KFD driver.

When AMD-KFD is loaded and you load radeon then, you get the KFD
functionality in the kernel. Then you can move on to the fun getting the
userspace running and actually execute anything on the GPU. But thats
another story.

I know what you think, and I agree: It's a big mess :)

Regards,

	Joerg

WARNING: multiple messages have this Message-ID (diff)
From: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
To: "Luis R. Rodriguez" <mcgrof-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	"Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>,
	"Linux-Kernel@Vger. Kernel. Org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [RFT v2] iommu/amd: use subsys_initcall() on amdv2 iommu
Date: Mon, 25 Apr 2016 12:23:51 +0200	[thread overview]
Message-ID: <20160425102351.GC17926@8bytes.org> (raw)
In-Reply-To: <20160418120350.GE1990-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>

On Mon, Apr 18, 2016 at 02:03:50PM +0200, Luis R. Rodriguez wrote:
> You said that with my patch you saw AMD IOMMUv2 kick off first,
> that was intentional as I thought that's what you needed. Can
> someone please describe the requirements?
> 
> Also what does drm use that you say has a conflict already? What
> drm code are we talking about exactly ?

The required order is:

	1. AMD IOMMUv1 (in-kernel only, initialized at boot time after PCI)
	2. AMD IOMMUv2 (in-kernel or as module, provides demand paging
			and uses v1 interfaces to talk to the IOMMU)
	3. AMD-KFD     (Implements compute offloading to the GPU and
			uses AMD IOMMUv2 functionality, also provides a
			symbol for the radeon driver)
	4. DRM with    (Checks if the symbol provided by AMD-KFD is
	   Radeon	available at init time and does the KFD
			initialization from there, because the GPU needs
			to be up first)

So AMD IOMMUv2 does not initialize (but it does load to have the symbols
available for drivers that optionally use its functionality) without the
AMD IOMMUv1 driver, as it can't access the IOMMU hardware then.

AMD-KFD does not load without AMD IOMMUv2 being loaded, as it depends on
its symbols. AMD-KFD on the other hand needs to be loaded before the
radeon driver (but this it not enforced by symbols), because otherwise
the radeon driver will not initialize the AMD-KFD driver.

When AMD-KFD is loaded and you load radeon then, you get the KFD
functionality in the kernel. Then you can move on to the fun getting the
userspace running and actually execute anything on the GPU. But thats
another story.

I know what you think, and I agree: It's a big mess :)

Regards,

	Joerg

  parent reply	other threads:[~2016-04-25 10:23 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 22:12 [RFT] iommu/amd: use subsys_initcall() on amdv2 iommu Luis R. Rodriguez
2016-03-16  7:02 ` Oded Gabbay
2016-03-16  7:02   ` Oded Gabbay
2016-03-16 10:14   ` Joerg Roedel
2016-03-16 10:14     ` Joerg Roedel
2016-03-16 10:16     ` Oded Gabbay
2016-03-16 16:17       ` Luis R. Rodriguez
2016-03-16 16:39         ` Joerg Roedel
2016-03-16 16:57           ` Luis R. Rodriguez
2016-03-16 17:17             ` Joerg Roedel
2016-03-16 17:17               ` Joerg Roedel
2016-03-29 17:41               ` [RFT v2] " Luis R. Rodriguez
2016-03-29 17:41                 ` Luis R. Rodriguez
2016-04-09  0:25                 ` Luis R. Rodriguez
2016-04-09  0:25                   ` Luis R. Rodriguez
2016-04-11 13:28                   ` Christian König
2016-04-11 13:28                     ` Christian König
2016-04-11 13:39                     ` Oded Gabbay
2016-04-11 13:39                       ` Oded Gabbay
2016-04-11 13:52                       ` Christian König
2016-04-11 13:52                         ` Christian König
2016-04-12 22:07                         ` Luis R. Rodriguez
2016-04-12 22:07                           ` Luis R. Rodriguez
2016-04-18  6:48                           ` Oded Gabbay
2016-04-18  6:48                             ` Oded Gabbay
     [not found]                             ` <CAFCwf12SJ-dTv6PC0_KfHbtC9951xb_4v8wu5uSjXO-V3TgdkA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-18  6:55                               ` Luis R. Rodriguez
2016-04-18  7:02                                 ` Oded Gabbay
2016-04-18  7:02                                   ` Oded Gabbay
2016-04-18 12:03                                   ` Luis R. Rodriguez
2016-04-18 12:03                                     ` Luis R. Rodriguez
2016-04-19  2:02                                     ` Wan Zongshun
2016-04-19  2:02                                       ` Wan Zongshun
2016-05-27  0:12                                       ` Luis R. Rodriguez
2016-05-27  0:12                                         ` Luis R. Rodriguez
2016-04-25 10:23                                     ` Joerg Roedel [this message]
2016-04-25 10:23                                       ` Joerg Roedel
2016-05-27  0:46                                       ` Luis R. Rodriguez
2016-05-27  1:18                                         ` [RFT v3] drm: use late_initcall() for amdkfd and radeon Luis R. Rodriguez
2016-05-29 14:49                                           ` Oded Gabbay
2016-05-29 14:49                                             ` Oded Gabbay
2016-05-31 17:15                                             ` Luis R. Rodriguez
2016-05-31 17:15                                               ` Luis R. Rodriguez
2016-05-31 17:33                                               ` Oded Gabbay
2016-05-31 17:33                                                 ` Oded Gabbay
2016-05-29 18:27                                           ` Daniel Vetter
2016-05-29 18:27                                             ` Daniel Vetter
2016-05-31 16:58                                             ` Luis R. Rodriguez
2016-05-31 19:04                                               ` Daniel Vetter
2016-05-31 19:04                                                 ` Daniel Vetter
2016-06-01 21:11                                                 ` Luis R. Rodriguez
2016-11-10 22:12                                                   ` Luis R. Rodriguez
2016-11-10 22:12                                                     ` Luis R. Rodriguez

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=20160425102351.GC17926@8bytes.org \
    --to=joro@8bytes.org \
    --cc=christian.koenig@amd.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=oded.gabbay@gmail.com \
    /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.