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=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE autolearn=unavailable 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 4B093C47096 for ; Thu, 3 Jun 2021 21:30:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E3C561403 for ; Thu, 3 Jun 2021 21:30:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230225AbhFCVbx (ORCPT ); Thu, 3 Jun 2021 17:31:53 -0400 Received: from mail-pf1-f173.google.com ([209.85.210.173]:43734 "EHLO mail-pf1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230081AbhFCVbw (ORCPT ); Thu, 3 Jun 2021 17:31:52 -0400 Received: by mail-pf1-f173.google.com with SMTP id t28so5885364pfg.10 for ; Thu, 03 Jun 2021 14:30:08 -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=2Yeh/FjvoGmDvMVI3FhndKEAnDxbRTGa5PVumREo+/U=; b=CxbhIwPtH10NEUgChjJXFAa/Kma9UcNFh/9cCYSjXEjz+Z+xBYH79qxj2tLoiCcBxh VTKyd/9ozWk/aUphLEgt+/m2POjsNqpzx8S1J6xAdQ+By8aUx6MwBbH6+6TPDadxXfwG hGJGk1CkZzfssRK7krjAHRRCm2Ehd0Gncf8rY= 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=2Yeh/FjvoGmDvMVI3FhndKEAnDxbRTGa5PVumREo+/U=; b=ikBzEM2nDpvcoOuZFmrnwZA9XdxGPlXUwUOgvXFiuwo4mo3UjKRc7mzkVXICElztI+ ZPvtXruu75c44SvPBMJAS4RFLnaDJA4RDQb40YtaisUwrg3pHhVFOJSb9OzEkmrzSAtn qVxvz/YSsEnny9v9Ek2IM986uqrTYsEYfhO/qkK4mNSkZTx07d3sUrkmRwtkny7rMEen radqmOah8UkwhgXNA+s/Rnjk9iKr3kc5XQXDl06X3ThOE/pDzZ3SnX/sMrSIY5nhdQ/Y KfpogCvr5OAKGVtbNxvzfK0Fmg0Tlb5SYKmQjwrSKW7rKjLq2MRvDl0Df4npKINR/Okn rGOw== X-Gm-Message-State: AOAM533/XA11Qld4oMd2RpUb3gAfcAS87jvc2t2uLIOsPkcKpr2VP7rO k5pijJoHg5UYIR505y+C29KvWQ== X-Google-Smtp-Source: ABdhPJyAQKUVj6xeGTKI/EB0Y3dsmWB0IM9MSfak1uIoG3Yp+fIAM1Il/NoO3cJ2xnooyk2IosedYA== X-Received: by 2002:a63:be45:: with SMTP id g5mr1386784pgo.311.1622755747756; Thu, 03 Jun 2021 14:29:07 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id u73sm22479pfc.169.2021.06.03.14.29.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 14:29:07 -0700 (PDT) Date: Thu, 3 Jun 2021 14:29:05 -0700 From: Kees Cook To: Daniel Vetter Cc: Rob Herring , Dave Airlie , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Arnd Bergmann , kernel test robot , Sai Prakash Ranjan , Emma Anholt , Rob Clark , Sean Paul , Sharat Masetty , Linus Walleij , Sam Ravnborg , Linux Kernel Mailing List , dri-devel , linux-arm-msm , freedreno Subject: Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG Message-ID: <202106031422.FD9E3C5755@keescook> References: <20210602215252.695994-1-keescook@chromium.org> <20210602215252.695994-4-keescook@chromium.org> <202106031357.BE2A09DA8F@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202106031357.BE2A09DA8F@keescook> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Thu, Jun 03, 2021 at 02:19:52PM -0700, Kees Cook wrote: > 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 Oops, no, I had this backwairds: depends on !VEXPRESS_CONFIG || VEXPRESS_CONFIG=DRM _that_ lets me build with: # CONFIG_VEXPRESS_CONFIG is not set CONFIG_DRM_PL111=y CONFIG_VEXPRESS_CONFIG=y CONFIG_DRM_PL111=y CONFIG_VEXPRESS_CONFIG=m CONFIG_DRM_PL111=m CONFIG_VEXPRESS_CONFIG=y CONFIG_DRM_PL111=m and disallows: CONFIG_VEXPRESS_CONFIG=m CONFIG_DRM_PL111=y (this will force CONFIG_DRM_PL111=m) -Kees > 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 -- Kees Cook 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 5AA29C47096 for ; Thu, 3 Jun 2021 21:29:10 +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 23EA16120F for ; Thu, 3 Jun 2021 21:29:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23EA16120F 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 8CA276E5D4; Thu, 3 Jun 2021 21:29:09 +0000 (UTC) Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 343496E5D3 for ; Thu, 3 Jun 2021 21:29:08 +0000 (UTC) Received: by mail-pf1-x42f.google.com with SMTP id s14so5010727pfd.9 for ; Thu, 03 Jun 2021 14:29:08 -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=2Yeh/FjvoGmDvMVI3FhndKEAnDxbRTGa5PVumREo+/U=; b=CxbhIwPtH10NEUgChjJXFAa/Kma9UcNFh/9cCYSjXEjz+Z+xBYH79qxj2tLoiCcBxh VTKyd/9ozWk/aUphLEgt+/m2POjsNqpzx8S1J6xAdQ+By8aUx6MwBbH6+6TPDadxXfwG hGJGk1CkZzfssRK7krjAHRRCm2Ehd0Gncf8rY= 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=2Yeh/FjvoGmDvMVI3FhndKEAnDxbRTGa5PVumREo+/U=; b=cF/61aCUSpiLTOd8lz8eP2CUTR5Tpx6tDvBPv9WYAw3ZX4nJWEq1ZeS2O9vA4iEpDP clexWJDVfdTX++psw0nh9PsqkkT7qeCRIzEOaeRd38HRICAD/MGxfDnqee1+jdcambJc 9C29LKgySAdOcE12kYmy596KrMsFdxBWFgYvZQGEIWrNgr1ZrchGY3Wk0A5UGJKjB1f1 o6WEjOW3yB648NXDTF0JsZHKxvFg/Cwal35gNErmiNItgX32X84OitQ6CJ8tx3Gw3kut SxHxEzIK0cbNwhj2kFFOD+E8skARCOqzFw/hdZtfBFglqBg+mJnHR3CrAMkkSe9fOg/j g45Q== X-Gm-Message-State: AOAM532GIPpWUYX19e0VxdHk8GvR0YHbxL0INsTTx7htEeFFQoA3jqxP wzSZ1hnOPvBz5WBSuPmRtEvY5Q== X-Google-Smtp-Source: ABdhPJyAQKUVj6xeGTKI/EB0Y3dsmWB0IM9MSfak1uIoG3Yp+fIAM1Il/NoO3cJ2xnooyk2IosedYA== X-Received: by 2002:a63:be45:: with SMTP id g5mr1386784pgo.311.1622755747756; Thu, 03 Jun 2021 14:29:07 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id u73sm22479pfc.169.2021.06.03.14.29.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 14:29:07 -0700 (PDT) Date: Thu, 3 Jun 2021 14:29:05 -0700 From: Kees Cook To: Daniel Vetter Subject: Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG Message-ID: <202106031422.FD9E3C5755@keescook> References: <20210602215252.695994-1-keescook@chromium.org> <20210602215252.695994-4-keescook@chromium.org> <202106031357.BE2A09DA8F@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202106031357.BE2A09DA8F@keescook> 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 02:19:52PM -0700, Kees Cook wrote: > 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 Oops, no, I had this backwairds: depends on !VEXPRESS_CONFIG || VEXPRESS_CONFIG=DRM _that_ lets me build with: # CONFIG_VEXPRESS_CONFIG is not set CONFIG_DRM_PL111=y CONFIG_VEXPRESS_CONFIG=y CONFIG_DRM_PL111=y CONFIG_VEXPRESS_CONFIG=m CONFIG_DRM_PL111=m CONFIG_VEXPRESS_CONFIG=y CONFIG_DRM_PL111=m and disallows: CONFIG_VEXPRESS_CONFIG=m CONFIG_DRM_PL111=y (this will force CONFIG_DRM_PL111=m) -Kees > 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 -- Kees Cook