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 EEC2FC433F5 for ; Sun, 10 Oct 2021 17:44:25 +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 9DB1460EE2 for ; Sun, 10 Oct 2021 17:44:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9DB1460EE2 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=AVq1FLyZSc4j7a5T9m579XZL/SzagDphPkP1XoOq5VA=; b=bjO9hYfktyTgGz z5m7nIdrUMLCVGn1FfvueDloYpCh8lKMicbFFfj9Euxb4Ex8E0e2PTqUcUwLzvXHRevYhk3Numwj0 3X9SV4xOi++RU6xiWznhOVQZB05NfNvz+yNUU79291ExkoDiD5REcLWillYxeDKCO+U5blddNFepq efhaoleKhLEwgA43fSpvaWO+xlqEiSKuQ/9UnX2ljTnD/Yp1nB8m3Kq5jnqZA0iFaAYpOrkg+SqqA P7NBXyMbK0DPnqdCs5jvnSIjXWxfhNrrWWqVZ6foD99D99mwj/wbTYa4fVgrq/eGvxgxt4mQ1PG5c vFmKiT2Pt4mF3dlpvRmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZcq9-007Dc5-SH; Sun, 10 Oct 2021 17:42:26 +0000 Received: from mout.kundenserver.de ([212.227.126.133]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZcq5-007Dav-LY for linux-arm-kernel@lists.infradead.org; Sun, 10 Oct 2021 17:42:23 +0000 Received: from mail-wr1-f47.google.com ([209.85.221.47]) by mrelayeu.kundenserver.de (mreue009 [213.165.67.97]) with ESMTPSA (Nemesis) id 1M7JvQ-1mhLXB2VNU-007k4w for ; Sun, 10 Oct 2021 19:42:17 +0200 Received: by mail-wr1-f47.google.com with SMTP id u18so48209526wrg.5 for ; Sun, 10 Oct 2021 10:42:17 -0700 (PDT) X-Gm-Message-State: AOAM530pMXaexc5nZhQdqLIsp4Pv6vsB7Gzpu5GnQ9cpZrOSjdTgm9mn x64hnr7tZANtBfIL95u6F6YBlhdxDh2DyF/pBWQ= X-Google-Smtp-Source: ABdhPJxAjKU8yfXgt2rjYVImjIKCImbIW4poCzzJGpBcz8kno/AlWQFANYktYRG2caQHUL2ye2HhyFkPp3obwvzre5s= X-Received: by 2002:a1c:4b08:: with SMTP id y8mr6006483wma.98.1633887737269; Sun, 10 Oct 2021 10:42:17 -0700 (PDT) MIME-Version: 1.0 References: <20211010023350.978638-1-dmitry.baryshkov@linaro.org> In-Reply-To: From: Arnd Bergmann Date: Sun, 10 Oct 2021 19:42:00 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] iommu: fix ARM_SMMU vs QCOM_SCM compilation To: Bjorn Andersson Cc: Dmitry Baryshkov , Joerg Roedel , Will Deacon , Robin Murphy , Kalle Valo , Arnd Bergmann , Thierry Reding , Andy Gross , linux-arm-msm , "open list:IOMMU DRIVERS" , Linux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Ka3nE8HGYaMtSltgXoEfmuKQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211010_104222_052800_4B34B1BE X-CRM114-Status: GOOD ( 24.83 ) 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, 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel