From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44950C47096 for ; Thu, 3 Jun 2021 21:19:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F24D3613FF for ; Thu, 3 Jun 2021 21:19:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F24D3613FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7BE616EE8A; Thu, 3 Jun 2021 21:19:57 +0000 (UTC) Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by gabe.freedesktop.org (Postfix) with ESMTPS id 83B806E5CD for ; Thu, 3 Jun 2021 21:19:55 +0000 (UTC) Received: by mail-pf1-x432.google.com with SMTP id k15so5878801pfp.6 for ; Thu, 03 Jun 2021 14:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=dARTyUZkFV2V3Q8vjvHyg7kS20ldU3oA95Zvf/0nmmU=; b=RlGC85OmMDvj9lLQelmvTphzRZUs6Q32p0QF5Bg/Q2LMe0D5/UBCSIT/e0xPeW669f wZykzI7Gzu/ws2t4xm7q6ufYUKBKRZNLT3vq29CWutNeOaq7WsAwIYnxLA4QacqjfaiA tRO+qG0wBC/biL0C5sEWiMiV65bjw7Ef7FY8g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=dARTyUZkFV2V3Q8vjvHyg7kS20ldU3oA95Zvf/0nmmU=; b=b68fBdZd5jSz0dPR+ME2vlQva8Mkhoks1cwCr2KxHuPlqJfN14UbTyqISUDL9zV/IX Ru6XtmZg9m3j33rSDaXymE63ZPmfduJOQtM8RuRlnFvk7+Kk7/WIHgyOw5p9An92nrNN zCyAfrhXAhlqYu5zvAlFgf2k/Ia9Q7tRjvZpwRdY9iqPFVbvJ9HgxhL0Xou3thgXTBxy iIOA3lyazVuEFOKarIUghXWnBDp6hzmkgZx4JgsMC4sl+MFAPeozWAGGwdPY9S8piwNl zGusLYjcYm0xzxPvOXTf/MubWAfz/LfvwG4qCbDK/O4nGc24xDLIyuM4qNzJMggF9Pzz KAXQ== X-Gm-Message-State: AOAM531+DcGi3xDSlAf/GULGxWXb7qzlZN9WyfernavLE9s3Wbh/EyHW NQXMtc/Az0YHtQ34Rx2h76062g== X-Google-Smtp-Source: ABdhPJwJXHGlpcsXLY0UNfMnVi/6rllTy6mVSbumQm6UnltHqjQajeBgs1+0pT0Sh7Rsg7Iw58a7fg== X-Received: by 2002:a63:5c5d:: with SMTP id n29mr1373666pgm.131.1622755194914; Thu, 03 Jun 2021 14:19:54 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a15sm22746pfc.29.2021.06.03.14.19.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 14:19:53 -0700 (PDT) Date: Thu, 3 Jun 2021 14:19:52 -0700 From: Kees Cook To: Daniel Vetter Subject: Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG Message-ID: <202106031357.BE2A09DA8F@keescook> References: <20210602215252.695994-1-keescook@chromium.org> <20210602215252.695994-4-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sai Prakash Ranjan , kernel test robot , Emma Anholt , Arnd Bergmann , David Airlie , Sam Ravnborg , Sharat Masetty , Linux Kernel Mailing List , dri-devel , Thomas Zimmermann , linux-arm-msm , Dave Airlie , freedreno , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Jun 03, 2021 at 09:19:42PM +0200, Daniel Vetter wrote: > On Thu, Jun 3, 2021 at 8:43 PM Rob Herring wrote: > > > > On Wed, Jun 2, 2021 at 4:53 PM Kees Cook wrote: > > > > > > Avoid randconfig build failures by requiring VEXPRESS_CONFIG: > > > > > > aarch64-linux-gnu-ld: drivers/gpu/drm/pl111/pl111_versatile.o: in function `pl111_vexpress_clcd_init': > > > pl111_versatile.c:(.text+0x220): undefined reference to `devm_regmap_init_vexpress_config' > > > > pl111_vexpress_clcd_init() starts with: > > > > if (!IS_ENABLED(CONFIG_VEXPRESS_CONFIG)) > > return -ENODEV; > > > > Isn't that supposed to be enough to avoid an undefined reference? Ah! I missed that when reading the code. I see the problem now. It's because of: CONFIG_VEXPRESS_CONFIG=m CONFIG_DRM_PL111=y I think the right fix is: diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig index 80f6748055e3..662fc38f92ba 100644 --- a/drivers/gpu/drm/pl111/Kconfig +++ b/drivers/gpu/drm/pl111/Kconfig @@ -3,6 +3,7 @@ config DRM_PL111 tristate "DRM Support for PL111 CLCD Controller" depends on DRM depends on ARM || ARM64 || COMPILE_TEST + depends on VEXPRESS_CONFIG=y || VEXPRESS_CONFIG=DRM depends on COMMON_CLK select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER I will go check the defconfigs Rob mentioned... > > Making the whole file depend on VEXPRESS_CONFIG is not right either. > > Not all platforms need it. > > It needs a compile-time status inline then for the functions we're > using in pl111. FYI, this is the config I was working from, which was throwing link errors: https://lore.kernel.org/lkml/202105300926.fX0MYySp-lkp@intel.com/ > -Daniel > > > > > > > > > Fixes: 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init") > > > Signed-off-by: Kees Cook > > > --- > > > drivers/gpu/drm/pl111/Kconfig | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig > > > index 80f6748055e3..c5210a5bef1b 100644 > > > --- a/drivers/gpu/drm/pl111/Kconfig > > > +++ b/drivers/gpu/drm/pl111/Kconfig > > > @@ -2,7 +2,7 @@ > > > config DRM_PL111 > > > tristate "DRM Support for PL111 CLCD Controller" > > > depends on DRM > > > - depends on ARM || ARM64 || COMPILE_TEST > > > + depends on VEXPRESS_CONFIG > > > depends on COMMON_CLK > > > select DRM_KMS_HELPER > > > select DRM_KMS_CMA_HELPER > > > -- > > > 2.25.1 > > > > > > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch -- Kees Cook