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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28F7FC433EF for ; Mon, 11 Oct 2021 10:03:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E9E0360F24 for ; Mon, 11 Oct 2021 10:03:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E9E0360F24 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=svB7u56aW4GiqaxCw6giFjUttJCLfCTFASfqq9X8vuc=; b=QVuuWiuREeLeAG ZVQTdD3KEQHqxVp1cliPASUwUcO6sRVB2RO4Ty8yu7Ug8oVxYhJUII8dceNy3nBsOIzJCRSFSSScS oElCTquYApYHOWy05JXa142YFRUYnfGo8M4pqQ4nh1/M+aT3WUhESOJyBqSD0/moTschPetbzHvbM 3r139bYNeGbcxC/wvunZUlHSDEnF8XLkueVFzySd5qZHOmKLcW1rJYvOWIrNFbkkpHMjNEYtCjSMB hb4HOsx7WraOjWLrjpeESCjNQeEP5tTlbOrQRvvA/sa10u86l44s/fb2rXRaT2UpaEYfoPC+ZzZ/G 76TSlmW5B7JtRXY7w0DQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZs7E-008irY-ES; Mon, 11 Oct 2021 10:01:05 +0000 Received: from mout.kundenserver.de ([212.227.126.134]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZs3V-008h7p-Gy for linux-arm-kernel@lists.infradead.org; Mon, 11 Oct 2021 09:57:16 +0000 Received: from mail-wr1-f46.google.com ([209.85.221.46]) by mrelayeu.kundenserver.de (mreue009 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MMXYN-1mI4Jt3wAB-00JdQs for ; Mon, 11 Oct 2021 11:57:10 +0200 Received: by mail-wr1-f46.google.com with SMTP id r18so54346735wrg.6 for ; Mon, 11 Oct 2021 02:57:10 -0700 (PDT) X-Gm-Message-State: AOAM5321hEa9o9fsK12c5Aro/ZtJEm8JcmT9qQLCMP8s8rzmR1D18lPY AAOS2Sn2ACg+PGl2tS3Fe4/Q+wNcHIV1b558G98= X-Google-Smtp-Source: ABdhPJxAE0aTicIaLYe2qnN2pp2cTh2YlBgwyXsBeIGZ6xRxR2Cgvhms/FkNW5VQT+nJ6ErHbjgjqQ/uoPWW1e+ZyE4= X-Received: by 2002:a05:600c:1548:: with SMTP id f8mr7487209wmg.35.1633946230518; Mon, 11 Oct 2021 02:57:10 -0700 (PDT) MIME-Version: 1.0 References: <20211010023350.978638-1-dmitry.baryshkov@linaro.org> In-Reply-To: From: Arnd Bergmann Date: Mon, 11 Oct 2021 11:56:54 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] iommu: fix ARM_SMMU vs QCOM_SCM compilation To: Dmitry Baryshkov Cc: Arnd Bergmann , Bjorn Andersson , Joerg Roedel , Will Deacon , Robin Murphy , Kalle Valo , Thierry Reding , Andy Gross , linux-arm-msm , "open list:IOMMU DRIVERS"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OO8izRxxlsraaWQNljeASNtUI6gqZ2IvnuuA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211011_025713_917764_0FA0E30B X-CRM114-Status: GOOD ( 25.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 11, 2021 at 11:10 AM Dmitry Baryshkov wrote: > > On Mon, 11 Oct 2021 at 09:09, Arnd Bergmann wrote: > > > > On Mon, Oct 11, 2021 at 6:11 AM Dmitry Baryshkov > > wrote: > > > On Sun, 10 Oct 2021 at 20:42, Arnd Bergmann wrote: > > > > > > The patch seems correct, but it becomes overcomplicated. What about: > > > - restoring QCOM_SCM stubs > > > > The stubs are what has led to the previous bugs in this area to often > > go unnoticed for too long, as illustrated by your suggestion > > > > > - making ARM_SMMU select QCOM_SCM if ARM_SMMU_QCOM > > > > I assume you meant "select QCOM_SCM if ARCH_QCOM", > > after we stop using ARM_SMMU_QCOM? > > > > > This would have almost the same result as with your patch, but without > > > extra ARM_SMMU_QCOM Kconfig symbol. > > > > The "almost" is the problem: consider the case of > > > > CONFIG_ARM=y > > CONFIG_COMPILE_TEST=y > > CONFIG_ARCH_QCOM=n > > CONFIG_ARM_SMMU=y > > CONFIG_DRM_MSM=m > > CONFIG_QCOM_SCM=m (selected by DRM_MSM) > > > > The stubs here lead to ARM_SMMU linking against the QCOM_SCM > > driver from built-in code, which fails because QCOM_SCM itself > > is a loadable module. > > I see. The idealist in me wishes to change my suggestion to > 'select QCOM_SCM if ARCH_QCOM || COMPILE_TEST' > but I have the subtle feeling that this also might fail somehow. I think that would actually work, but it has the nasty side-effect that simply flipping 'CONFIG_COMPILE_TEST' changes what the kernel does, rather than just hiding or unhiding additional options. > > We can move the "select QCOM_SCM" in the ARM_SMMU_QCOM > > symbol if we make that a tristate though, if you want to separate it > > a little more. > > This would complicate things a bit, as we would no longer be able to > use 'arm-smmu-$(CONFIG_ARM_SMMU_QCOM) +=' construct. I'm fairly sure we could still use that, Kbuild is smart enough to include both 'file-m +=' and 'file-y += ' in 'file.ko', see scripts/Makefile.lib: # If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object multi-obj-y := $(call multi-search, $(obj-y), .o, -objs -y) multi-obj-m := $(call multi-search, $(obj-m), .o, -objs -y -m) multi-obj-ym := $(multi-obj-y) $(multi-obj-m) # Replace multi-part objects by their individual parts, # including built-in.a from subdirectories real-obj-y := $(call real-search, $(obj-y), .o, -objs -y) real-obj-m := $(call real-search, $(obj-m), .o, -objs -y -m) What doesn't work is having a built-in driver in a directory that is guarded with a =m symbol, or including a =m object into a =y module. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel