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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 0E591C433FE for ; Fri, 4 Dec 2020 23:28:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B7A5722838 for ; Fri, 4 Dec 2020 23:28:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727413AbgLDX2j (ORCPT ); Fri, 4 Dec 2020 18:28:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726508AbgLDX2j (ORCPT ); Fri, 4 Dec 2020 18:28:39 -0500 Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3089C061A51 for ; Fri, 4 Dec 2020 15:27:13 -0800 (PST) Received: by mail-ot1-x343.google.com with SMTP id i6so818070otr.2 for ; Fri, 04 Dec 2020 15:27:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=zLc7/3okPvFxP0Z5cS+hPwJjhxGd6v5dEl0jnqjK1K0=; b=xQwJageZbIycG4kTT8ShqMD3nUbwD7r8wUnxsVIIr+DgCBye6qng9WoGeVERzlid29 k/ObBybIk//OMjj5X5o6YZ0k0F4YAbF832KqRuemDPxAcGvpXGz4INpWkjsvJ/5BU8zJ Qf7/ZZlvvJbUKw/nn1qkD3DgSqL7BZqwgj4xqzlmiG/PCX2A4z4QX3GYSWBzdNtfezVv hbrkMNgU0Ogaga1hWbEu58REJxvLrJ/YyXTVkcispMWDJKH07SatPkBvKuiG1UyvjT6f uRrkVoAcABjtKNGxhr6n3YqlTzMBrQLIw1cXMB8i991kgSJJhcPVqWsPcFOQd3eQ+uR4 TsIw== 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=zLc7/3okPvFxP0Z5cS+hPwJjhxGd6v5dEl0jnqjK1K0=; b=sxwRWBjm3sg2ZjOwcKJZaUpCcJRrbLpZ7SuUaTNvzdhuwAICo20EUgrx3h71vQs2d1 rLuzkaVPaf4LYq8u6/r3dKrUFrb3Vl1NhElFxfX2CCYmMYOeVhpHNXC9QSMiBR24Ix8V w3YmICKnYECg1w7YoH6n64PlRd3eGq5cnuocQ3xhnLTdf586PY9Dx57Y+H+uyDfVWT/5 HqXxsWNtSdJFKjbjxdsk129Hw5B5RWdWvdVtv8AyWawcGwNcw/VhvQPbWPIkiAm3q1Zt XaT0RPzNxcUOyiC61TaSEDQe5nzGf7cgmutiOER5i6NIBJc+EXLUoJF2hl7gwaoUa8qo n3Iw== X-Gm-Message-State: AOAM530nqMgrbQUlopHGqo1S0RHSPCNtUN5ErqctokYask+gpBa4RXV0 Mj+2oTBYmC9yvy/1nF2mpSYeTw== X-Google-Smtp-Source: ABdhPJx/5ojyUAiGu0IYqd4XJaPj3ZSo9l52l1eGs5DI9MrJXP8DByhPu8SeKg2BBP6DoIR4XpMftA== X-Received: by 2002:a9d:7401:: with SMTP id n1mr5323426otk.21.1607124433014; Fri, 04 Dec 2020 15:27:13 -0800 (PST) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id k1sm949788ood.4.2020.12.04.15.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 15:27:12 -0800 (PST) Date: Fri, 4 Dec 2020 17:27:10 -0600 From: Bjorn Andersson To: Arnd Bergmann Cc: Andy Gross , Georgi Djakov , Arnd Bergmann , Sibi Sankar , Evan Green , Jonathan Marek , Odelu Kukatla , Krzysztof Kozlowski , David Dai , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] interconnect: qcom: fix rpmh link failures Message-ID: References: <20201204165030.3747484-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201204165030.3747484-1-arnd@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 04 Dec 10:50 CST 2020, Arnd Bergmann wrote: > From: Arnd Bergmann > > When CONFIG_COMPILE_TEST is set, it is possible to build some > of the interconnect drivers into the kernel while their dependencies > are loadable modules, which is bad: > > arm-linux-gnueabi-ld: drivers/interconnect/qcom/bcm-voter.o: in function `qcom_icc_bcm_voter_commit': > (.text+0x1f8): undefined reference to `rpmh_invalidate' > arm-linux-gnueabi-ld: (.text+0x20c): undefined reference to `rpmh_write_batch' > arm-linux-gnueabi-ld: (.text+0x2b0): undefined reference to `rpmh_write_batch' > arm-linux-gnueabi-ld: (.text+0x2e8): undefined reference to `rpmh_write_batch' > arm-linux-gnueabi-ld: drivers/interconnect/qcom/icc-rpmh.o: in function `qcom_icc_bcm_init': > (.text+0x2ac): undefined reference to `cmd_db_read_addr' > arm-linux-gnueabi-ld: (.text+0x2c8): undefined reference to `cmd_db_read_aux_data' > > The exact dependencies are a bit complicated, so split them out into a > hidden Kconfig symbol that all drivers can in turn depend on to get it > right. > > Fixes: 976daac4a1c5 ("interconnect: qcom: Consolidate interconnect RPMh support") > Signed-off-by: Arnd Bergmann Your patch looks correct to me, so: Reviewed-by: Bjorn Andersson But we're going to have to sprinkle a handful of these throughout the tree and we're not a lot of people who "understand" what it does (and at least I keep getting them wrong...) Perhaps it would be more reasonable to maintain this long term if we drop the possibility of compile testing these drivers independently of rpmh and command db? (I.e. drop the function stubs and rely on RPMH/COMMAND_DB to enable building under COMPILE_TEST)? And just to make it clear, I think we should merge your patch to fix v5.11; then consider to simplify this past that. Regards, Bjorn > --- > drivers/interconnect/qcom/Kconfig | 23 +++++++++++++++-------- > 1 file changed, 15 insertions(+), 8 deletions(-) > > diff --git a/drivers/interconnect/qcom/Kconfig b/drivers/interconnect/qcom/Kconfig > index a8f93ba265f8..b3fb5b02bcf1 100644 > --- a/drivers/interconnect/qcom/Kconfig > +++ b/drivers/interconnect/qcom/Kconfig > @@ -42,13 +42,23 @@ config INTERCONNECT_QCOM_QCS404 > This is a driver for the Qualcomm Network-on-Chip on qcs404-based > platforms. > > +config INTERCONNECT_QCOM_RPMH_POSSIBLE > + tristate > + default INTERCONNECT_QCOM > + depends on QCOM_RPMH || (COMPILE_TEST && !QCOM_RPMH) > + depends on QCOM_COMMAND_DB || (COMPILE_TEST && !QCOM_COMMAND_DB) > + depends on OF || COMPILE_TEST > + help > + Compile-testing RPMH drivers is possible on other platforms, > + but in order to avoid link failures, drivers must not be built-in > + when QCOM_RPMH or QCOM_COMMAND_DB are loadable modules > + > config INTERCONNECT_QCOM_RPMH > tristate > > config INTERCONNECT_QCOM_SC7180 > tristate "Qualcomm SC7180 interconnect driver" > - depends on INTERCONNECT_QCOM > - depends on (QCOM_RPMH && QCOM_COMMAND_DB && OF) || COMPILE_TEST > + depends on INTERCONNECT_QCOM_RPMH_POSSIBLE > select INTERCONNECT_QCOM_RPMH > select INTERCONNECT_QCOM_BCM_VOTER > help > @@ -57,8 +67,7 @@ config INTERCONNECT_QCOM_SC7180 > > config INTERCONNECT_QCOM_SDM845 > tristate "Qualcomm SDM845 interconnect driver" > - depends on INTERCONNECT_QCOM > - depends on (QCOM_RPMH && QCOM_COMMAND_DB && OF) || COMPILE_TEST > + depends on INTERCONNECT_QCOM_RPMH_POSSIBLE > select INTERCONNECT_QCOM_RPMH > select INTERCONNECT_QCOM_BCM_VOTER > help > @@ -67,8 +76,7 @@ config INTERCONNECT_QCOM_SDM845 > > config INTERCONNECT_QCOM_SM8150 > tristate "Qualcomm SM8150 interconnect driver" > - depends on INTERCONNECT_QCOM > - depends on (QCOM_RPMH && QCOM_COMMAND_DB && OF) || COMPILE_TEST > + depends on INTERCONNECT_QCOM_RPMH_POSSIBLE > select INTERCONNECT_QCOM_RPMH > select INTERCONNECT_QCOM_BCM_VOTER > help > @@ -77,8 +85,7 @@ config INTERCONNECT_QCOM_SM8150 > > config INTERCONNECT_QCOM_SM8250 > tristate "Qualcomm SM8250 interconnect driver" > - depends on INTERCONNECT_QCOM > - depends on (QCOM_RPMH && QCOM_COMMAND_DB && OF) || COMPILE_TEST > + depends on INTERCONNECT_QCOM_RPMH_POSSIBLE > select INTERCONNECT_QCOM_RPMH > select INTERCONNECT_QCOM_BCM_VOTER > help > -- > 2.27.0 >