From patchwork Fri Dec 4 16:50:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 337761 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp583249jai; Fri, 4 Dec 2020 08:51:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZeS+04X8zvk1BUYObRjCwD+yplxpDuukZsriNJ/6H7UWfyalgoQREJH9BjuG+aF+UYDBm X-Received: by 2002:a17:906:52c4:: with SMTP id w4mr8002150ejn.165.1607100677277; Fri, 04 Dec 2020 08:51:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607100677; cv=none; d=google.com; s=arc-20160816; b=PqVQudPH7lAxvdwkFporzA+vetpwoQNLQxvyDehQgfkN1Fi8gSFx5bzI4zfQeF3g4i 56YvZqSuJCpY1spH09yGDMyq+GpYTBdK2ggFwhlWwHWSTJjZ/kC4nhVFXBEemxT/jWWJ LK9AZ6Dapz1Y4Z4XbuIOi9tttaqQH4WT0wmOVXiuthm2QBLjAVo8cZjopZN/FKYhDWB2 GFkuC/xYchAf79BLB03/ItlUaGdfyOmQfCQhsTk4RKQ1f53oTp83xTScZX5pc8QebFDq QqjMge4o9bD9PfnWzroU/TsdkBB5YD2aW8lcAoLQkGet3A6chZGtdDAuA5w2DJ9Mb98p h4YQ== 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; bh=DirfNs/m7o5tp0+OCoYGCi9OG4WRpbeWGCEd9KqtcP0=; b=JvEZ5paUNqR/JPcByXsiLeWLDU234u8LK4RO4oIDSX6zs19Doq2xBHhKJX32uvNp2U DFYdpXJFplM2m0ArbLOipHoMNhJsm+Ai/zhYDt+78N0OFFLNIuS2ZVstPEPk70wGg9/8 hUPXEtmBg6KEjTKRjefamsHXMqkwpziJ81uMPEUYF4S9EW48wV4VwTWlDwilPSSw96Im DsrDoGDqP+GYOwOHpE3JAKwzBzDeH/SHnCKziIsN+j8VrkwDDpWGrM3LyMdPE8Vn/geC F8mICgix9fV5h+jB6JJLSv2QiAz1QydO9GuWdi5I2BoOU+QvP1NXI3t1fwO8OmdVA0dq RPww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z5si1923045ejj.600.2020.12.04.08.51.17; Fri, 04 Dec 2020 08:51:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 S1727935AbgLDQvQ (ORCPT + 8 others); Fri, 4 Dec 2020 11:51:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:58132 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727125AbgLDQvQ (ORCPT ); Fri, 4 Dec 2020 11:51:16 -0500 From: Arnd Bergmann Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: Andy Gross , Bjorn Andersson , Georgi Djakov Cc: 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: [PATCH] interconnect: qcom: fix rpmh link failures Date: Fri, 4 Dec 2020 17:50:03 +0100 Message-Id: <20201204165030.3747484-1-arnd@kernel.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 --- drivers/interconnect/qcom/Kconfig | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) -- 2.27.0 Reviewed-by: Bjorn Andersson 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