Linux IOMMU Development
 help / color / mirror / Atom feed
From: Oded Gabbay <oded.gabbay@amd.com>
To: David Airlie <airlied@linux.ie>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Dana Elifaz" <Dana.Elifaz@amd.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	"Alexander Deucher" <Alexander.Deucher@amd.com>,
	iommu@lists.linux-foundation.org,
	"Christian König" <christian.koenig@amd.com>
Subject: [PATCH 0/2] Change order of linkage in kernel makefiles for amdkfd
Date: Mon, 22 Dec 2014 13:07:13 +0200	[thread overview]
Message-ID: <1419246435-7050-1-git-send-email-oded.gabbay@amd.com> (raw)

This small patch-set, was created to solve the bug described at 
https://bugzilla.kernel.org/show_bug.cgi?id=89661 (Kernel panic when 
trying use amdkfd driver on Kaveri). It replaces the previous patch-set called 
[PATCH 0/3] Use workqueue for device init in amdkfd
(http://lists.freedesktop.org/archives/dri-devel/2014-December/074401.html)

That bug appears only when radeon, amdkfd and amd_iommu_v2 are compiled 
inside the kernel (not as modules). In that case, the correct loading 
order, as determined by the exported symbol used by each driver, is 
not enforced anymore and the kernel loads them based on who was linked 
first. That makes radeon load first, amdkfd second and amd_iommu_v2 
third.

Because the initialization of a device in amdkfd is initiated by radeon, 
and can only be completed if amdkfd and amd_iommu_v2 were loaded and 
initialized, then in the case mentioned above, this initalization fails 
and there is a kernel panic as some pointers are not initialized but 
used nontheless.

To solve this bug, this patch-set moves iommu/ before gpu/ in drivers/Makefile 
and also moves amdkfd/ before radeon/ in drivers/gpu/drm/Makefile.

The rationale is that in general, AMD GPU devices are dependent on AMD IOMMU 
controller functionality to allow the GPU to access a process's virtual memory 
address space, without the need for pinning the memory. That's why it makes 
sense to initialize the iommu/ subsystem ahead of the gpu/ subsystem.

	Oded

Oded Gabbay (2):
  drivers: Move iommu/ before gpu/ in Makefile
  drm: Put amdkfd before radeon in drm Makefile

 drivers/Makefile         | 6 ++++--
 drivers/gpu/drm/Makefile | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2014-12-22 11:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-22 11:07 Oded Gabbay [this message]
2014-12-22 11:07 ` [PATCH 1/2] drivers: Move iommu/ before gpu/ in Makefile Oded Gabbay
2014-12-23 12:09   ` Oded Gabbay
2014-12-26  0:18     ` Linus Torvalds
     [not found] ` <1419246435-7050-1-git-send-email-oded.gabbay-5C7GfCeVMHo@public.gmane.org>
2014-12-22 11:07   ` [PATCH 2/2] drm: Put amdkfd before radeon in drm Makefile Oded Gabbay
2014-12-22 11:56 ` [PATCH 0/2] Change order of linkage in kernel makefiles for amdkfd Christian König
2014-12-25 13:20 ` Thierry Reding
2014-12-26  9:19   ` Laurent Pinchart
2014-12-28 11:36     ` Oded Gabbay
2014-12-29  8:16       ` Laurent Pinchart
2014-12-29  9:34         ` Christian König
     [not found]           ` <54A12028.7020303-5C7GfCeVMHo@public.gmane.org>
2015-01-05 15:46             ` Thierry Reding
2015-01-08 14:15               ` Oded Gabbay
     [not found]                 ` <54AE910E.5060803-5C7GfCeVMHo@public.gmane.org>
2015-01-09  9:56                   ` Thierry Reding

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=1419246435-7050-1-git-send-email-oded.gabbay@amd.com \
    --to=oded.gabbay@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Dana.Elifaz@amd.com \
    --cc=airlied@linux.ie \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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