Message ID | 20230127094200.2451839-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp746527wrn; Fri, 27 Jan 2023 01:53:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXsawCLVH7eTaF1FKNj1mzI7R4WXXLrGAPAK6yLj8PRi05gRUf7ZZXLAoWguZjLnjheJ1TyJ X-Received: by 2002:a05:6402:2486:b0:49e:30ac:97f2 with SMTP id q6-20020a056402248600b0049e30ac97f2mr46473438eda.8.1674813233702; Fri, 27 Jan 2023 01:53:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674813233; cv=none; d=google.com; s=arc-20160816; b=MJdRFITXt6+JQ9QSTxkgUE/GNLcMZ/qI/uphGh4kjnRwUuAU2HMBQ0bCq7P/rYIRFf 3YG19/NgiuDsnA2cf1DZdZ+hXNQe/Q/o3Pet6iWS3f7+yX02kTvAo/sU9D4MKhaM6Hf6 vtGXmzxpl5sV/8SRgwc1rTkrO4VL9NIMhdab75lz10ijswUO9Ti5+2JdXPLDyXo4ZSFP SeGPvVT6/mFOn1+YmkvkVEyqH0SS65fXpeTIMrcNG6A/yUiFNXzBOiKCKoo69gSw0nHH LM8AUK6yPZ7OPVZP2vypX/onJpewYHvyZTAF+sbaE9ppORM0Hle2LIBt/K8obpCZN+86 GirQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=NDoW+rwllE1Rd6k/D7LNIhOM9xw8HCyc1wzpU8fHPqY=; b=qzKGEioXLqu9T3/rvNhglI+yANE1K3TyTK9q11JXQ3KFnzpdex+Rub9IVTCJwqyCAi vJg4D419U6YVQDGlJiKel7rRuVNTtn80LRl0a7MEyM2dYX89+kCP+v3KwbqDZ+YUUtly 8Rao98tzbesqzOPYC2rDCc2WuCVSRkHMBipKxqVS62MUoTvAjP8ZVF34RtM3c92WzKCT lvRbCpZh71hvftB+UBxqJ5jSRjLq2zKilnq6WmSdKNdK/GNUPy0XSr45ktMo7ZS/91dX YWMN/KPPnRe2VNNBRFCkmKB0hVAxWdDT+8T0KiXsP5/Z9rSQjDiw+lkOv4aFtXNa6sIB WS8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g+xgl3oi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c14-20020aa7c74e000000b0049e02982675si4357165eds.457.2023.01.27.01.53.29; Fri, 27 Jan 2023 01:53:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g+xgl3oi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233185AbjA0JqJ (ORCPT <rfc822;lekhanya01809@gmail.com> + 99 others); Fri, 27 Jan 2023 04:46:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbjA0JqH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 27 Jan 2023 04:46:07 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D8B67643D for <linux-kernel@vger.kernel.org>; Fri, 27 Jan 2023 01:46:06 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 083E861A7E for <linux-kernel@vger.kernel.org>; Fri, 27 Jan 2023 09:46:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F3F1C433D2; Fri, 27 Jan 2023 09:46:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674812765; bh=Dwcoj9AI+37+jvMJo/iQdubzeCr/in3liy/NPqI0rWo=; h=From:To:Cc:Subject:Date:From; b=g+xgl3oiFAeN8yu2QTebkyKbrVCnzTuUOjptqhJBaFBH3shVauUMfHqr/QHC1dhi6 /TMMU5fb0cV/gE3qELqKSaRo+4CMTavZsUSuE0q2PcocqNKjx5v4vzWwWU50pedEDC tcJpuaDFspmuZz7WYLa7a6RaAoCyEY3zeMbSOwOPZkE9wQcfLKCptcvWPElO2ThLn7 LrLmMECz+1qASVPqWgt2F0x7if74xxnOXos8MMTcnQ9oetqDXKIaNjMcRvDQFwGXzm HTq+weDy4w9D6wIf8GueQuHkhbeRveumaGRlthcM4vx7O3P36tp4krkU9anyk1F/e3 u7KKAADzgu6Ag== From: Arnd Bergmann <arnd@kernel.org> To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, Etienne Carriere <etienne.carriere@linaro.org>, Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Arnd Bergmann <arnd@arndb.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, linux-kernel@vger.kernel.org Subject: [PATCH] nvmem: stm32: fix OPTEE dependency Date: Fri, 27 Jan 2023 10:41:26 +0100 Message-Id: <20230127094200.2451839-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756168961685850089?= X-GMAIL-MSGID: =?utf-8?q?1756168961685850089?= |
Series |
nvmem: stm32: fix OPTEE dependency
|
|
Commit Message
Arnd Bergmann
Jan. 27, 2023, 9:41 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de> The stm32 nvmem driver fails to link as built-in when OPTEE is a loadable module: aarch64-linux-ld: drivers/nvmem/stm32-bsec-optee-ta.o: in function `stm32_bsec: stm32-bsec-optee-ta.c:(.text+0xc8): undefined reference to `tee_client_open_session' aarch64-linux-ld: drivers/nvmem/stm32-bsec-optee-ta.o: in function `stm32_bsec: stm32-bsec-optee-ta.c:(.text+0x1fc): undefined reference to `tee_client_open_context' Change the CONFIG_NVMEM_STM32_ROMEM definition so it can only be built-in if OPTEE is either built-in or disabled, and make NVMEM_STM32_BSEC_OPTEE_TA a hidden symbol instead. Fixes: acdf68bdf2d4 ("nvmem: stm32: add OP-TEE support for STM32MP13x") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/nvmem/Kconfig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Comments
On 27/01/2023 09:41, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The stm32 nvmem driver fails to link as built-in when OPTEE > is a loadable module: > > aarch64-linux-ld: drivers/nvmem/stm32-bsec-optee-ta.o: in function `stm32_bsec: > stm32-bsec-optee-ta.c:(.text+0xc8): undefined reference to `tee_client_open_session' > aarch64-linux-ld: drivers/nvmem/stm32-bsec-optee-ta.o: in function `stm32_bsec: > stm32-bsec-optee-ta.c:(.text+0x1fc): undefined reference to `tee_client_open_context' > > Change the CONFIG_NVMEM_STM32_ROMEM definition so it can only > be built-in if OPTEE is either built-in or disabled, and > make NVMEM_STM32_BSEC_OPTEE_TA a hidden symbol instead. > > Fixes: acdf68bdf2d4 ("nvmem: stm32: add OP-TEE support for STM32MP13x") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- thanks Anrd, Applied thanks --srini > drivers/nvmem/Kconfig | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig > index ed8ef7460be2..ae2c5257ed97 100644 > --- a/drivers/nvmem/Kconfig > +++ b/drivers/nvmem/Kconfig > @@ -295,8 +295,7 @@ config NVMEM_SPRD_EFUSE > will be called nvmem-sprd-efuse. > > config NVMEM_STM32_BSEC_OPTEE_TA > - bool "STM32MP BSEC OP-TEE TA support for nvmem-stm32-romem driver" > - depends on OPTEE > + def_bool NVMEM_STM32_ROMEM && OPTEE > help > Say y here to enable the accesses to STM32MP SoC OTPs by the OP-TEE > trusted application STM32MP BSEC. > @@ -307,7 +306,7 @@ config NVMEM_STM32_BSEC_OPTEE_TA > config NVMEM_STM32_ROMEM > tristate "STMicroelectronics STM32 factory-programmed memory support" > depends on ARCH_STM32 || COMPILE_TEST > - imply NVMEM_STM32_BSEC_OPTEE_TA > + depends on OPTEE || !OPTEE > help > Say y here to enable read-only access for STMicroelectronics STM32 > factory-programmed memory area.
Hi On 1/27/23 10:41, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The stm32 nvmem driver fails to link as built-in when OPTEE > is a loadable module: > > aarch64-linux-ld: drivers/nvmem/stm32-bsec-optee-ta.o: in function `stm32_bsec: > stm32-bsec-optee-ta.c:(.text+0xc8): undefined reference to `tee_client_open_session' > aarch64-linux-ld: drivers/nvmem/stm32-bsec-optee-ta.o: in function `stm32_bsec: > stm32-bsec-optee-ta.c:(.text+0x1fc): undefined reference to `tee_client_open_context' > > Change the CONFIG_NVMEM_STM32_ROMEM definition so it can only > be built-in if OPTEE is either built-in or disabled, and > make NVMEM_STM32_BSEC_OPTEE_TA a hidden symbol instead. > > Fixes: acdf68bdf2d4 ("nvmem: stm32: add OP-TEE support for STM32MP13x") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > drivers/nvmem/Kconfig | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig > index ed8ef7460be2..ae2c5257ed97 100644 > --- a/drivers/nvmem/Kconfig > +++ b/drivers/nvmem/Kconfig > @@ -295,8 +295,7 @@ config NVMEM_SPRD_EFUSE > will be called nvmem-sprd-efuse. > > config NVMEM_STM32_BSEC_OPTEE_TA > - bool "STM32MP BSEC OP-TEE TA support for nvmem-stm32-romem driver" > - depends on OPTEE > + def_bool NVMEM_STM32_ROMEM && OPTEE > help > Say y here to enable the accesses to STM32MP SoC OTPs by the OP-TEE > trusted application STM32MP BSEC. > @@ -307,7 +306,7 @@ config NVMEM_STM32_BSEC_OPTEE_TA > config NVMEM_STM32_ROMEM > tristate "STMicroelectronics STM32 factory-programmed memory support" > depends on ARCH_STM32 || COMPILE_TEST > - imply NVMEM_STM32_BSEC_OPTEE_TA > + depends on OPTEE || !OPTEE > help > Say y here to enable read-only access for STMicroelectronics STM32 > factory-programmed memory area. Thanks for the fix, I test several case.... at least the logical configurations: OP-TEE=n and NVMEM_STM32_ROMEM=m OP-TEE=y and NVMEM_STM32_ROMEM=m OP-TEE=n and NVMEM_STM32_ROMEM=y OP-TEE=y and NVMEM_STM32_ROMEM=y but I miss this case OP-TEE=m and NVMEM_STM32_ROMEM=y Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Thanks Patrick
diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig index ed8ef7460be2..ae2c5257ed97 100644 --- a/drivers/nvmem/Kconfig +++ b/drivers/nvmem/Kconfig @@ -295,8 +295,7 @@ config NVMEM_SPRD_EFUSE will be called nvmem-sprd-efuse. config NVMEM_STM32_BSEC_OPTEE_TA - bool "STM32MP BSEC OP-TEE TA support for nvmem-stm32-romem driver" - depends on OPTEE + def_bool NVMEM_STM32_ROMEM && OPTEE help Say y here to enable the accesses to STM32MP SoC OTPs by the OP-TEE trusted application STM32MP BSEC. @@ -307,7 +306,7 @@ config NVMEM_STM32_BSEC_OPTEE_TA config NVMEM_STM32_ROMEM tristate "STMicroelectronics STM32 factory-programmed memory support" depends on ARCH_STM32 || COMPILE_TEST - imply NVMEM_STM32_BSEC_OPTEE_TA + depends on OPTEE || !OPTEE help Say y here to enable read-only access for STMicroelectronics STM32 factory-programmed memory area.