From: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
To: Oded Gabbay <ogabbay@kernel.org>, Arnd Bergmann <arnd@kernel.org>
Cc: Jeffrey Hugo <quic_jhugo@quicinc.com>,
Arnd Bergmann <arnd@arndb.de>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
Melissa Wen <mwen@igalia.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Dave Airlie <airlied@redhat.com>
Subject: Re: [PATCH] [v2] accel: fix CONFIG_DRM dependencies
Date: Tue, 31 Jan 2023 10:20:08 +0100 [thread overview]
Message-ID: <6b48eef6-2f9c-9673-fe3d-009d29dea641@linux.intel.com> (raw)
In-Reply-To: <CAFCwf10RRFUqYEATg7p-LmKSEkFtAhneufJTdezFA7i3HJaDDw@mail.gmail.com>
On 31.01.2023 09:53, Oded Gabbay wrote:
> On Sat, Jan 28, 2023 at 12:15 AM Arnd Bergmann <arnd@kernel.org> wrote:
>>
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> At the moment, accel drivers can be built-in even with CONFIG_DRM=m,
>> but this causes a link failure:
>>
>> x86_64-linux-ld: drivers/accel/ivpu/ivpu_drv.o: in function `ivpu_dev_init':
>> ivpu_drv.c:(.text+0x1535): undefined reference to `drmm_kmalloc'
>> x86_64-linux-ld: ivpu_drv.c:(.text+0x1562): undefined reference to `drmm_kmalloc'
>> x86_64-linux-ld: drivers/accel/ivpu/ivpu_drv.o: in function `ivpu_remove':
>> ivpu_drv.c:(.text+0x1faa): undefined reference to `drm_dev_unregister'
>> x86_64-linux-ld: drivers/accel/ivpu/ivpu_drv.o: in function `ivpu_probe':
>> ivpu_drv.c:(.text+0x1fef): undefined reference to `__devm_drm_dev_alloc'
>>
>> The problem is that DRM_ACCEL is a 'bool' symbol symbol, so driver that
>> only depend on DRM_ACCEL but not also on DRM do not see the restriction
>> to =m configs.
>>
>> To ensure that each accel driver has an implied dependency on CONFIG_DRM,
>> enclose the entire Kconfig file in an if/endif check.
>>
>> Fixes: 8bf4889762a8 ("drivers/accel: define kconfig and register a new major")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> ---
>> v2: rearrage the DRM dependency rather than requiring DRM to be built-in
>> ---
>> drivers/accel/Kconfig | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/accel/Kconfig b/drivers/accel/Kconfig
>> index 834863902e16..c437206aa3f1 100644
>> --- a/drivers/accel/Kconfig
>> +++ b/drivers/accel/Kconfig
>> @@ -6,9 +6,10 @@
>> # as, but not limited to, Machine-Learning and Deep-Learning acceleration
>> # devices
>> #
>> +if DRM
>> +
>> menuconfig DRM_ACCEL
>> bool "Compute Acceleration Framework"
>> - depends on DRM
>> help
>> Framework for device drivers of compute acceleration devices, such
>> as, but not limited to, Machine-Learning and Deep-Learning
>> @@ -25,3 +26,5 @@ menuconfig DRM_ACCEL
>>
>> source "drivers/accel/habanalabs/Kconfig"
>> source "drivers/accel/ivpu/Kconfig"
>> +
>> +endif
>> --
>> 2.39.0
>>
> This patch is:
> Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Applied to drm-misc-next.
Thanks.
next prev parent reply other threads:[~2023-01-31 9:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-27 22:14 [PATCH] [v2] accel: fix CONFIG_DRM dependencies Arnd Bergmann
2023-01-27 22:14 ` Arnd Bergmann
2023-01-30 9:41 ` Stanislaw Gruszka
2023-01-30 9:41 ` Stanislaw Gruszka
2023-01-30 15:42 ` Jeffrey Hugo
2023-01-30 15:42 ` Jeffrey Hugo
2023-01-31 8:53 ` Oded Gabbay
2023-01-31 8:53 ` Oded Gabbay
2023-01-31 9:20 ` Jacek Lawrynowicz [this message]
2023-02-01 10:36 ` Thomas Zimmermann
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=6b48eef6-2f9c-9673-fe3d-009d29dea641@linux.intel.com \
--to=jacek.lawrynowicz@linux.intel.com \
--cc=airlied@redhat.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mwen@igalia.com \
--cc=ogabbay@kernel.org \
--cc=quic_jhugo@quicinc.com \
--cc=tzimmermann@suse.de \
/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.