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 F1CC3C433EF for ; Sun, 10 Oct 2021 04:19: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 AD76361076 for ; Sun, 10 Oct 2021 04:19:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AD76361076 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9n2yD32AZkO0z6DHhvZtOoce/4tB5YV8mHw6GM37LUg=; b=hrnM81/WC5/6Mt otT/EtyMpgW72/f2LpTXrrw7dN4lK1FkH89SJZ3KIo1R3CI1wrzCvvhzUOBzf9Z0v+/1mL0cnXUSF gJO9tc1FvrZYb4eF7+py7fIEltFXUjS9fT04ukPYAL7Gf9ZOqKjqenJtYFF5i9kc3kAOKMvmHqM6W ax9V2IGN8KjEuJS7tmoCaPazclmp8m3PrYTGHdtKrxmqcXz1h5UEF+jW2B+BSgxJySsHHNBiOoflt SsrKJBnOIzRTB9PeiNmEqlZFMUpGXiJgc2JTNWwflw8tD1AX2dHe/a8hfytA52RXDKaZ6Q1kBQVXN KEyScnzEM7bdf3GgA15A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZQGY-006LHa-A3; Sun, 10 Oct 2021 04:16:50 +0000 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZQGU-006LH1-Ee for linux-arm-kernel@lists.infradead.org; Sun, 10 Oct 2021 04:16:47 +0000 Received: by mail-oi1-x229.google.com with SMTP id a3so19508940oid.6 for ; Sat, 09 Oct 2021 21:16:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9dKksHyZGIoBAPrBU/GqwD12Fnz5BhKh8zQvkAEnzwI=; b=iCjZiCxoSer6nwXKtggrDTz0n8s8SkVXF46eVVf+dAXR7iAWmg2pOFnaz+uVwYkvcR 8r/6AvZwj+EfCRbp3HGARx5fYbAxihUt6E+Frj2tjhGXpfgMKKn5CZMd1RxmMpW9QdVt dXTbLisBUVmNM6Wdyhbgny2tJnO6R5EF4qqH5xTBbfvGCr6FIHoUwiISBgEWodBNl+Mb //n8m5+LA2xS9jwEkiXTxHsVZtLeeYM1OanjAvYd1xRdnlcA7HvDjCQH2IyTvcMCUCBt q3SDVuwNDLKDrfRJmpBg+F5Ety22YhHWZsbkgTfcKBe1FD8ZYqLbziAGwiT2warMuoMO 7L8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9dKksHyZGIoBAPrBU/GqwD12Fnz5BhKh8zQvkAEnzwI=; b=CM35Eieety89x6KSGJsai7UlAUySBl8ERfkf+WkEIx0z/ojL70spwlJOPjdTkzs0lp I7pkP0DB/cTZMzxz45Ph93ZY3PBWhjmRtx4YupxVSLJMuZqeBhtYoYtPsUHaiGV80AZD cunXxsIBCoXtlri76PVOcLGLB3X5IulHnaKMWKQHY5vuYJMZ5p1z4yXJuTSxSKTXX0fn wan6utNnUY7K0CP3tNgiYYgScRzBn285OBsTvk2eIEjWlmWOP8afkih81mzoRpr6fKR4 59YU2aTdZZ7iJ2NuDf4e8jboj+ReBkq84CzOyx9fIO4uS0A8sXBIENsbawgUtK8kq7DP jvSA== X-Gm-Message-State: AOAM530aEyw2rERgXTdePEt2bBw+2Hr3xdlmyESfahA9sBG9F++MaPWP JJBxPSHQzv/VkHnstv8/WDNaSw== X-Google-Smtp-Source: ABdhPJxnOE3APNnnhnQmDWVAu7V3BvKoUVtdoeSGZ4XRGgWVmuQ54HqxcfsBWYHkiC1jZ4YcsSvprA== X-Received: by 2002:a05:6808:1816:: with SMTP id bh22mr13248863oib.69.1633839401460; Sat, 09 Oct 2021 21:16:41 -0700 (PDT) Received: from yoga ([2600:1700:a0:3dc8:c84c:8eff:fe1e:256f]) by smtp.gmail.com with ESMTPSA id 38sm907603oti.13.2021.10.09.21.16.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Oct 2021 21:16:40 -0700 (PDT) Date: Sat, 9 Oct 2021 23:16:38 -0500 From: Bjorn Andersson To: Dmitry Baryshkov Cc: Joerg Roedel , Will Deacon , Robin Murphy , Kalle Valo , Arnd Bergmann , Thierry Reding , Andy Gross , linux-arm-msm@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Daniel Lezcano Subject: Re: [PATCH] iommu: fix ARM_SMMU vs QCOM_SCM compilation Message-ID: References: <20211010023350.978638-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211010023350.978638-1-dmitry.baryshkov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211009_211646_557091_7CEF3964 X-CRM114-Status: GOOD ( 24.10 ) 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 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. > 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. Reviewed-by: Bjorn Andersson Regards, Bjorn > Fixes: 424953cf3c66 ("qcom_scm: hide Kconfig symbol") > Cc: Arnd Bergmann > Reported-by: Daniel Lezcano > Signed-off-by: Dmitry Baryshkov > --- > drivers/iommu/Kconfig | 1 + > drivers/iommu/arm/arm-smmu/Makefile | 3 +-- > drivers/iommu/arm/arm-smmu/arm-smmu-impl.c | 9 +++++++-- > 3 files changed, 9 insertions(+), 4 deletions(-) > > diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig > index c5c71b7ab7e8..a4593e53fe7d 100644 > --- a/drivers/iommu/Kconfig > +++ b/drivers/iommu/Kconfig > @@ -309,6 +309,7 @@ config ARM_SMMU > tristate "ARM Ltd. System MMU (SMMU) Support" > depends on ARM64 || ARM || (COMPILE_TEST && !GENERIC_ATOMIC64) > select IOMMU_API > + select QCOM_SCM > select IOMMU_IO_PGTABLE_LPAE > select ARM_DMA_USE_IOMMU if ARM > help > diff --git a/drivers/iommu/arm/arm-smmu/Makefile b/drivers/iommu/arm/arm-smmu/Makefile > index b0cc01aa20c9..e240a7bcf310 100644 > --- a/drivers/iommu/arm/arm-smmu/Makefile > +++ b/drivers/iommu/arm/arm-smmu/Makefile > @@ -1,5 +1,4 @@ > # SPDX-License-Identifier: GPL-2.0 > obj-$(CONFIG_QCOM_IOMMU) += qcom_iommu.o > obj-$(CONFIG_ARM_SMMU) += arm_smmu.o > -arm_smmu-objs += arm-smmu.o arm-smmu-impl.o arm-smmu-nvidia.o > -arm_smmu-$(CONFIG_ARM_SMMU_QCOM) += arm-smmu-qcom.o > +arm_smmu-objs += arm-smmu.o arm-smmu-impl.o arm-smmu-nvidia.o arm-smmu-qcom.o > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c b/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c > index 2c25cce38060..8199185dd262 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c > @@ -215,8 +215,13 @@ struct arm_smmu_device *arm_smmu_impl_init(struct arm_smmu_device *smmu) > of_device_is_compatible(np, "nvidia,tegra186-smmu")) > return nvidia_smmu_impl_init(smmu); > > - if (IS_ENABLED(CONFIG_ARM_SMMU_QCOM)) > - smmu = qcom_smmu_impl_init(smmu); > + /* > + * qcom_smmu_impl_init() will not touch smmu if the device is not > + * a Qualcomm one. > + */ > + smmu = qcom_smmu_impl_init(smmu); > + if (IS_ERR(smmu)) > + return smmu; > > if (of_device_is_compatible(np, "marvell,ap806-smmu-500")) > smmu->impl = &mrvl_mmu500_impl; > -- > 2.30.2 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel