Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3452799pxu; Tue, 8 Dec 2020 12:26:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2wkNttH/4ux3KNYNCReXlV4HjJpEpApv7JhKPIn3HbMWsP2PRGZOq8qFvZ3g8Ee6fTpe/ X-Received: by 2002:a17:906:3e02:: with SMTP id k2mr25106602eji.92.1607459170810; Tue, 08 Dec 2020 12:26:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607459170; cv=none; d=google.com; s=arc-20160816; b=lerpAw22SVXQm1M0gfw+iV4amcvjp3ubiIpbcq8o9URsE6iM+HRImW/fufaiaaz6L7 aeGP/0JM4PgKARZz0kK+wWk2dqplXbh/q0T304AZTseMG2mygJ3ihRWMaYAv/W+uJFQD 5XPKiGXZ/1SEakzZjZFbUy7aBOwsnd2BRmvwLYS6TL66g5n5UHe3qHburVo3Zi98VNw2 lTI4pNpOnhzb2oWYZ5T/sNQxxsaQrFQkCk1jowpvLe8PRe54eK+CzZpJzOmUxlXWemSc bsILuW4ZEIGXXAqwjQQBUUSi0MY8dIdhW8mVxI0qbwIVbZnPWHWgDnCByt2csbtFNRt1 aKNw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=VSgzR5h6x0kcXseqQKFdJ3xwAtpHizl08WzvvfTRxuk=; b=Yfxsv5k4uv/7s0cObDQpqgqTl3t1JYgbw43g2+2XtUSOSbmysdbMSySoaDli1BkH9k b507ATqFo07mnSVJPu5fxxzr/2f73afdVlsKvuamh85nHLm8lRniiO6sMd0p7C56zAXm Y42XV2IXSPODmHnKDRfvkSQOQspU5/QC+US/GWmI3h6wDNus2hkLjsgmpY7/DkxfiefV JShRA2eMO0P+kGvh9tW1b6fznlQdNKRveTkCfW4fLI65zi6DZEi2cGOGkvR5iXGDD5WL qu1FsH6NUpmBVuqd/gexsi9BsduSRuqj9KsdmdjWX4W3vPxHPodkWUnGJGhZ0q+dp7Z6 Ii8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id op28si6034797ejb.30.2020.12.08.12.25.46; Tue, 08 Dec 2020 12:26:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730097AbgLHP3n (ORCPT + 99 others); Tue, 8 Dec 2020 10:29:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730070AbgLHP3n (ORCPT ); Tue, 8 Dec 2020 10:29:43 -0500 Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 499F3C0613D6 for ; Tue, 8 Dec 2020 07:29:02 -0800 (PST) Received: from ramsan.of.borg ([84.195.186.194]) by xavier.telenet-ops.be with bizsmtp id 1rUy2400Z4C55Sk01rUysS; Tue, 08 Dec 2020 16:28:59 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kmevC-0090Ge-MH; Tue, 08 Dec 2020 16:28:58 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1kmevC-0094TP-8O; Tue, 08 Dec 2020 16:28:58 +0100 From: Geert Uytterhoeven To: Greg Kroah-Hartman , Masahiro Yamada , Michal Marek , Jonathan Corbet , Arnd Bergmann Cc: linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Geert Uytterhoeven Subject: [PATCH 2/2] Documentation/kbuild: Document platform dependency practises Date: Tue, 8 Dec 2020 16:28:57 +0100 Message-Id: <20201208152857.2162093-3-geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201208152857.2162093-1-geert+renesas@glider.be> References: <20201208152857.2162093-1-geert+renesas@glider.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Document best practises for using architecture and platform dependencies. Signed-off-by: Geert Uytterhoeven --- Documentation/kbuild/kconfig-language.rst | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Documentation/kbuild/kconfig-language.rst b/Documentation/kbuild/kconfig-language.rst index 2b746332d8aa6bce..87e9bbe14a21ce83 100644 --- a/Documentation/kbuild/kconfig-language.rst +++ b/Documentation/kbuild/kconfig-language.rst @@ -564,6 +564,30 @@ common system, and detect bugs that way. Note that compile-tested code should avoid crashing when run on a system where the dependency is not met. +Architecture and platform dependencies +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Due to the presence of stubs, most drivers can now be compiled on most +architectures. However, this does not mean it makes sense to have all drivers +available everywhere, as the actual hardware may only exist on specific +architectures and platforms. This is especially true for on-SoC IP cores, +which may be limited to a specific vendor or SoC family. + +To prevent asking the user about drivers that cannot be used on the system(s) +the user is compiling a kernel for, and if it makes sense, config symbols +controlling the compilation of a driver should contain proper dependencies, +limiting the visibility of the symbol to (a superset of) the platform(s) the +driver can be used on. The dependency can be an architecture (e.g. ARM) or +platform (e.g. ARCH_OMAP4) dependency. This makes life simpler not only for +distro config owners, but also for every single developer or user who +configures a kernel. + +Such a dependency can be relaxed by combining it with the compile-testing rule +above, leading to: + + config FOO + bool "Support for foo hardware" + depends on ARCH_FOO_VENDOR || COMPILE_TEST + Kconfig recursive dependency limitations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- 2.25.1