From: Oded Gabbay <oded.gabbay@amd.com>
To: "Christian König" <deathsimple@vodafone.de>,
dri-devel@lists.freedesktop.org,
"Alexander Deucher" <Alexander.Deucher@amd.com>
Cc: <linux-kernel@vger.kernel.org>, Huang Ying <ying.huang@intel.com>,
LKP ML <lkp@01.org>, <ak@linux.intel.com>,
<rusty@rustcorp.com.au>, <airlied@linux.ie>
Subject: Re: [PATCH v2] drm/radeon: Init amdkfd only if it was compiled
Date: Mon, 29 Dec 2014 14:49:47 +0200 [thread overview]
Message-ID: <54A14DEB.4090503@amd.com> (raw)
In-Reply-To: <54A14C0C.8090401@vodafone.de>
On 12/29/2014 02:41 PM, Christian König wrote:
> Am 29.12.2014 um 09:59 schrieb Oded Gabbay:
>> This patch changes the radeon_kfd_init(), which is used to initialize the
>> interface between radeon and amdkfd, so the interface will be initialized only
>> if amdkfd was build, either as module or inside the kernel image.
>>
>> In the modules case, the symbol_request() will be used (same as old code). In
>> the in-image compilation case, a direct call to kgd2kfd_init() will be done.
>> For other cases, radeon_kfd_init() will just return false.
>>
>> This patch is necessary because in case of the following specific
>> configuration: kernel 32-bit, no modules support, random kernel base and no
>> hibernation, the symbol_request() doesn't work as expected - it doesn't return
>> NULL if the symbol doesn't exists - which makes the kernel panic.
>>
>> Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
>
> Using symbol_request() in general doesn't seem to be such a good idea, because
> it breaks symbol versioning and as far as I can see is only very rarely used in
> drivers (AFAIK only V4L drivers).
>
> But for the moment I don't have another idea either except for always loading
> the module which on most hardware is completely unnecessary. Maybe we should
> consider restructuring the module load dependencies in the next kernel release.
>
> For now the patch is Reviewed-by: Christian König <christian.koenig@amd.com>
>
Thanks Christian.
I agree that this is somewhat a mess, that was created unfortunately at the very
beginning of kfd.
We will definitely fix this in 2015, as we also need to think how kfd will
integrate with both radeon and amdgpu if they are present on the same system.
The current method we use doesn't enable that situation.
Ideally, I would like to see total separation (between init of radeon and init
of amdkfd) and use of exported symbols instead of symbol_request. Couple that
with probe deferral and I think the end result will be much better than the
current design.
Oded
>> ---
>> drivers/gpu/drm/radeon/radeon_kfd.c | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/radeon/radeon_kfd.c
>> b/drivers/gpu/drm/radeon/radeon_kfd.c
>> index 242fd8b..d3e78b4 100644
>> --- a/drivers/gpu/drm/radeon/radeon_kfd.c
>> +++ b/drivers/gpu/drm/radeon/radeon_kfd.c
>> @@ -101,6 +101,7 @@ static const struct kgd2kfd_calls *kgd2kfd;
>> bool radeon_kfd_init(void)
>> {
>> +#if defined(CONFIG_HSA_AMD_MODULE)
>> bool (*kgd2kfd_init_p)(unsigned, const struct kfd2kgd_calls*,
>> const struct kgd2kfd_calls**);
>> @@ -117,6 +118,17 @@ bool radeon_kfd_init(void)
>> }
>> return true;
>> +#elif defined(CONFIG_HSA_AMD)
>> + if (!kgd2kfd_init(KFD_INTERFACE_VERSION, &kfd2kgd, &kgd2kfd)) {
>> + kgd2kfd = NULL;
>> +
>> + return false;
>> + }
>> +
>> + return true;
>> +#else
>> + return false;
>> +#endif
>> }
>> void radeon_kfd_fini(void)
>
prev parent reply other threads:[~2014-12-29 13:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-29 8:59 [PATCH v2] drm/radeon: Init amdkfd only if it was compiled Oded Gabbay
2014-12-29 12:41 ` Christian König
2014-12-29 12:49 ` Oded Gabbay [this message]
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=54A14DEB.4090503@amd.com \
--to=oded.gabbay@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=airlied@linux.ie \
--cc=ak@linux.intel.com \
--cc=deathsimple@vodafone.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@01.org \
--cc=rusty@rustcorp.com.au \
--cc=ying.huang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox