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 3385CC433F5 for ; Tue, 12 Oct 2021 03:37:37 +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 0417960E97 for ; Tue, 12 Oct 2021 03:37:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0417960E97 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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=VK09z0skukPnjlXsZm0CITUOVT4vvx8N8IfRgdru1FI=; b=NXcVcqRlmZiiUG bWVhMw4GrUE9ABsE6Fit7I2bUa2GVfhv7I9yFH4uZYQI4A5LLMMNpdmhX8R/baA2QijS2CwKNzWrA p27V8OuTYgd4k3SpzKKzfMzFFHPIykUDU+1iHgkIrBEWScGhTpZozRb8dvj1FGUyrrLtay7GZNh1U wAmqAdX1Q+z/WpeEveScP9J58m9mrNrPcU0fvtEYRO/ChMY6IcL0rvHps9+MxuOOFOVKeAKkESKEk w4nMWboF68T5FjjdQMAPjtS44GJjpmkWrV42MBWfV5x/n3lwvPCHOqb8K5qGug9dEhfpUqU9KR3Ta w4Ny24uJFUENRrri7a9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ma8ZL-00BLWI-Gs; Tue, 12 Oct 2021 03:35:11 +0000 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ma8ZH-00BLVj-I8 for linux-arm-kernel@lists.infradead.org; Tue, 12 Oct 2021 03:35:09 +0000 Received: by mail-qv1-xf32.google.com with SMTP id g14so1351416qvb.0 for ; Mon, 11 Oct 2021 20:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EmhQGrBHhBqco3/fKYTerqn3hrMIea7RZ3yw7yTntJk=; b=FC1XDkTlI9I/tEz1ohiUY519cWZieN3uOODYV1C8Mv3OPjdtuFF+dqXcKq77X5dTbL FITyfzUfZejn0lwoVQeHM4AB2z4b5c5tInY0RTkagZbfu5nYFlWPBc5Zx/zpJMx3zM5T 4v/o6h1PcKie+43TKXDMoBuLDUJX7aItxVIUwGjHMLdz2mtn+hb6QeNbKqm4fEoCBz6p 8K8yqovQoXvFiY2FMTkwqAP8uFXwjIjE+AiWX1ww9oZJJ99LE+Hy8oYKAZ8Sy+kQYNFs MzLN+AGWmAWrziF0nCvPLEkzSA9KcMArO6SdzuV4FN6wl/LXMiF3A/sm2Jz+cRzHwFSu mokg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EmhQGrBHhBqco3/fKYTerqn3hrMIea7RZ3yw7yTntJk=; b=bf9wWLcZTc38+fXiqpf5KSWQ3XCeZ+581zcy09iQvbOutxzgoqmNp6wxzfIlK2X/fz +hfzx+sBSG4eDzCPdyov/eFL+UT4A33lvqoGdzgQSXnL36PpYDuQcxttbvHSh5mOUmAf 9HjntClYThftJrRkZRsy9HyLuLfA1anC7VUOBuOd6TRCqKqjCvbsHzyLGlg17Ti6ybg+ CVfDyAdNBj0Yu3HKhO8ugschiR9R4/z46XnBbiN5RbrMnCnAvnf+RXoflL7VHuXTApvQ 99Dq3ncgrmoiyu52+yNcCs0Dh7U9GmtXYIsQsu7nnxFq0abKpOa0pMRIbjMLQC5a18q/ TGiQ== X-Gm-Message-State: AOAM530vNXh5VT+ppQzs8RROyJBqrpesK/P9/6UUjFLYbZhuqZsJ5h2M kA2MAFkYK1Cbxw1J4k3LV4BxS5T6Qv0vKULOzLJhEA== X-Google-Smtp-Source: ABdhPJwYk1vV8P7NVAAIhul2dADSwoQQewMWHAp5qbboSqFlQZFU1gNvtKnlICCH4yrsmE2uME429X0JuBEM+OhICKQ= X-Received: by 2002:a05:6214:70f:: with SMTP id b15mr27855384qvz.16.1634009706228; Mon, 11 Oct 2021 20:35:06 -0700 (PDT) MIME-Version: 1.0 References: <20211010023350.978638-1-dmitry.baryshkov@linaro.org> In-Reply-To: From: Dmitry Baryshkov Date: Tue, 12 Oct 2021 06:34:54 +0300 Message-ID: Subject: Re: [PATCH] iommu: fix ARM_SMMU vs QCOM_SCM compilation To: Arnd Bergmann Cc: Bjorn Andersson , Joerg Roedel , Will Deacon , Robin Murphy , Kalle Valo , Thierry Reding , Andy Gross , linux-arm-msm , "open list:IOMMU DRIVERS" , Linux Kernel Mailing List , Linux ARM , Daniel Lezcano X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211011_203507_652346_EFDE758B X-CRM114-Status: GOOD ( 28.92 ) 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, 11 Oct 2021 at 12:57, Arnd Bergmann wrote: > > 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) Ah, I thought Kbuild would accept only foo-y, please excuse me. > > 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 -- With best wishes Dmitry _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel