Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53544C636CC for ; Tue, 31 Jan 2023 09:20:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230510AbjAaJUR (ORCPT ); Tue, 31 Jan 2023 04:20:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229692AbjAaJUP (ORCPT ); Tue, 31 Jan 2023 04:20:15 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3ABC6CD for ; Tue, 31 Jan 2023 01:20:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675156814; x=1706692814; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=4JM1VnPDZosr3/MSF2FzrL7UH4abNkI0iF6A5UQGphM=; b=KLBmhLNcApntmahUMqAIE2SJOnix/l9zTQ7g2P4MVz+nwWSlkzaWqvi4 hGcwWV3nS+tjEAesb8+/Je+2Mh/6VdyuoW81kjbnSlEnZQ6QQ8ah6C04G B6XB6HoNJFRxyNK0Pq3D2FD/l20wXqcv0lGI4Jg9nUjAjxxHXW9cyZpSn DcZohYWsHRbKgG72y/TDVjgS5KpfgkSd/Eu6f1ur9vQqEgFku/HyWP7oc hRKq/ydxqwC0pdK+WXP5Jrzz0h8P0FdwUXmqf2bhWP92ZUnmVdczl2N1z Q1sFV6H3XSiqg6jRt3XKvQ9M8SK4ttuiQJm+SbECf9UghlYvw2OYFoU8O Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="392340234" X-IronPort-AV: E=Sophos;i="5.97,259,1669104000"; d="scan'208";a="392340234" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 01:20:13 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="993199875" X-IronPort-AV: E=Sophos;i="5.97,259,1669104000"; d="scan'208";a="993199875" Received: from jlawryno-mobl.ger.corp.intel.com (HELO [10.237.142.112]) ([10.237.142.112]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 01:20:10 -0800 Message-ID: <6b48eef6-2f9c-9673-fe3d-009d29dea641@linux.intel.com> Date: Tue, 31 Jan 2023 10:20:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] [v2] accel: fix CONFIG_DRM dependencies Content-Language: en-US To: Oded Gabbay , Arnd Bergmann Cc: Jeffrey Hugo , Arnd Bergmann , Daniel Vetter , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Melissa Wen , Thomas Zimmermann , Greg Kroah-Hartman , Dave Airlie References: <20230127221504.2522909-1-arnd@kernel.org> From: Jacek Lawrynowicz Organization: Intel Technology Poland sp. z o.o. - ul. Slowackiego 173, 80-298 Gdansk - KRS 101882 - NIP 957-07-52-316 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31.01.2023 09:53, Oded Gabbay wrote: > On Sat, Jan 28, 2023 at 12:15 AM Arnd Bergmann wrote: >> >> From: Arnd Bergmann >> >> 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 >> --- >> 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 Applied to drm-misc-next. Thanks.