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 0EBC4C433F5 for ; Mon, 11 Oct 2021 04:13:21 +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 B6C0A60EBC for ; Mon, 11 Oct 2021 04:13:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B6C0A60EBC 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=sjT+7X6YtfahoE6dXhotCxlip2e5iQIVcRuaK6niO9U=; b=U7+LgCeWIHN0HF pFTn7fhs9t4ybuy0guS349JftKYYep4vNsR4Kjdz8pWUKOO2W37OEsOreICTHjhHwKD0PvXVEKLyL EmCQmL8sdNgno9bYfWVPBov7gOnKrEFPyJd3wPFnkj0r/8is0DzrFY1H+PVM0kqK/AFwzWYTGMkDB I1eb8HSjpKlh/f9f6O6rFQ/loacezhPzZYMnBdoHmcpucfFUtkvjgJ9qqCQTu+HGDxyWJ9ODX86D8 7xnXAwJxqfnnpq8N+S+6yl73L9s2gfHMHEFETkFjSLQ8ER2NFSfMy67phK/4oz0y+YcvCzUSSKqKk pXLYgGlSEHWvPOLZCqCQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZmer-007f1o-2U; Mon, 11 Oct 2021 04:11:25 +0000 Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZmen-007f1M-4L for linux-arm-kernel@lists.infradead.org; Mon, 11 Oct 2021 04:11:22 +0000 Received: by mail-qt1-x836.google.com with SMTP id w2so7059278qtn.0 for ; Sun, 10 Oct 2021 21:11:19 -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=yJkzv/qLRuMHpfFpS4P34KqTWJ3Vx+EAHqhp1ZZOPqI=; b=g7nfie8pkWJr8W9Kqw/m1Vzt+2qKlzvyuggXbDSXZwyI3x53OnoV+ClCoAT6bMqbo+ Fw9xw9Q+uutz8BMZkylGG9FSYeCVHjZlVmRe4dG9eAzOFyL8OtwLXuwyJMGujzhjOCqT 4xbpCjnVe8bTFEsxJpdMDp1oRQjQVP9rkw3UjLxf7y75Pt82JMC26UcvpJHuYPifUF7x hse5hvFMSgnTujr4TFfW8sleWouVyzHOPNRji5xM7EcFK0c+HMaln5X+EUOu8swmQQBm 0CzyD03a0bQfFRESp5UrOPO3KClKDCJz72DEewHOE/75UzuGCOABNP+DD+3sFpi+ZGi6 9RWA== 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=yJkzv/qLRuMHpfFpS4P34KqTWJ3Vx+EAHqhp1ZZOPqI=; b=SPL1u1oJf50z2IhvVRqekT0jMGlvunOlvbNqIABa2fuBNwXTcE/mug2fX2EIRBJOd3 o/AcST92Kt1z0dyqacrYw1aGP751u4QPwxTBikyPSHQTptdTc9YNNrOi/IMyCJJ/NaPK m+l4PiljGr/yP99e0GY81BDZVKnh+9WZrDmjcxbMKtNqQ3EFglHKVq1Gr9XZ+PkJoLEH vS2RV4pwMIyipPt9VhinfC2Mo53NY7OwD/tq3b60/gN1lvz2pTZuPTgJcKnVw6x/rVaq m02g90PlXqSD1GuGpQJ4JjcAHzZq7VaWHtMJxwKO8VhgPyDIYLz/6HTE4//MYUoXtkMV bnGQ== X-Gm-Message-State: AOAM531GrK2MjFKD1/yo/q9koqXJ+7WqFIUgqeBYiU5r7G6sz51osADe q4PaF/rVInNfQtJ+evoQbMw6yTE7Je9lxMsroCRJEg== X-Google-Smtp-Source: ABdhPJxRuJ9TkoBbKOvVwOudaBHMqMs50XuLzRSTTUx4oR/M2EB3whe37CwIsMGxez4j3kIQ4T8PvHWhehH7hl2PAYo= X-Received: by 2002:ac8:1011:: with SMTP id z17mr12653163qti.388.1633925479158; Sun, 10 Oct 2021 21:11:19 -0700 (PDT) MIME-Version: 1.0 References: <20211010023350.978638-1-dmitry.baryshkov@linaro.org> In-Reply-To: From: Dmitry Baryshkov Date: Mon, 11 Oct 2021 07:11:07 +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-20211010_211121_226953_07442251 X-CRM114-Status: GOOD ( 32.98 ) 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 Sun, 10 Oct 2021 at 20:42, Arnd Bergmann wrote: > > On Sun, Oct 10, 2021 at 6:17 AM Bjorn Andersson > wrote: > > > > On Sat 09 Oct 21:33 CDT 2021, Dmitry Baryshkov wrote: > > > > > After commit 424953cf3c66 ("qcom_scm: hide Kconfig symbol") arm-smmu got > > > qcom_smmu_impl_init() call guarded by IS_ENABLED(CONFIG_ARM_SMMU_QCOM). > > > However the CONFIG_ARM_SMMU_QCOM Kconfig entry does not exist, so the > > > qcom_smmu_impl_init() is never called. > > > > > > So, let's fix this by always calling qcom_smmu_impl_init(). It does not > > > touch the smmu passed unless the device is a non-Qualcomm one. Make > > > ARM_SMMU select QCOM_SCM for ARCH_QCOM. > > Sorry about this bug. I was sure I had it working, but I lost part of the commit > during a rebase, and my randconfig builds still succeeded without it, so I > sent a wrong version. > > > Arnd's intention was to not force QCOM_SCM to be built on non-Qualcomm > > devices. But as Daniel experienced, attempting to boot most Qualcomm > > boards without this results in a instant reboot. > > > > I think it's okay if we tinker with CONFIG_ARM_SMMU_QCOM for v5.16, but > > we're getting late in v5.15 so I would prefer if we make sure this works > > out of the box. > > Yes, makes sense. For reference, see below for how I would fix this properly, > this is what I had intended to have in the patch. Feel free to pick > either version > as the immediate bugfix. I'll give the below a little more randconfig testing > overnight though. The pasted version of the patch is probably > whitespace-damaged, > let me know if you would like me to send it as a proper patch. > > Arnd > > 8<----- > Subject: iommu: fix ARM_SMMU_QCOM compilation > > My previous bugfix ended up making things worse for the QCOM IOMMU > driver when it forgot to add the Kconfig symbol that is getting used to > control the compilation of the SMMU implementation specific code > for Qualcomm. > > Fixes: 424953cf3c66 ("qcom_scm: hide Kconfig symbol") > Reported-by: Daniel Lezcano > Reported-by: Dmitry Baryshkov > Signed-off-by: Arnd Bergmann > ---- > diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig > index c5c71b7ab7e8..2dfe744ddd97 100644 > --- a/drivers/iommu/Kconfig > +++ b/drivers/iommu/Kconfig > @@ -311,6 +311,7 @@ config ARM_SMMU > select IOMMU_API > select IOMMU_IO_PGTABLE_LPAE > select ARM_DMA_USE_IOMMU if ARM > + select QCOM_SCM if ARM_SMMU_QCOM > help > Support for implementations of the ARM System MMU architecture > versions 1 and 2. > @@ -355,6 +356,13 @@ config ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT > 'arm-smmu.disable_bypass' will continue to override this > config. > > +config ARM_SMMU_QCOM > + def_bool y > + depends on ARM_SMMU && ARCH_QCOM > + help > + When running on a Qualcomm platform that has the custom variant > + of the ARM SMMU, this needs to be built into the SMMU driver. > + > config ARM_SMMU_V3 > tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support" > depends on ARM64 The patch seems correct, but it becomes overcomplicated. What about: - restoring QCOM_SCM stubs - making ARM_SMMU select QCOM_SCM if ARM_SMMU_QCOM This would have almost the same result as with your patch, but without extra ARM_SMMU_QCOM Kconfig symbol. -- With best wishes Dmitry _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel