Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp792748pxb; Sun, 10 Oct 2021 11:13:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx428j6ifdjrkZ/gO3mUP4r9ON8dr15muzM6IF3LC9uHzrIaERnanQNBO97QfmByWqNeDfX X-Received: by 2002:a63:33cb:: with SMTP id z194mr14861375pgz.380.1633889604685; Sun, 10 Oct 2021 11:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633889604; cv=none; d=google.com; s=arc-20160816; b=eaHInzeXlmEVfFNc7rCdrfdkasL2ewAEtkb76I9LMjFxLQxrkZ1FApoz2zjLHYWdQw /MuYNM2NvB65YU4M7DWILHBrJU8AGmcelT2zvf0KdlTbhiz0Yqm7NDEw8uZxO+DBFjoU KDsotCD8RXfm3+gH4uKQYRKveoZzRM0M39y3EgDpWHSMFPgnxrx+73oDiwZe6pg6gqsK 9CWAXkeUHM7UiPIvxzXE7ucK1jALNLfws8qePDsU34xq7waOPgHl5uJIz8a04VyfCQca 3SPfIvTPuY7WlbVI5lMvBBUW6p/x6bnl+xPMA2iqpBCuu1yKqKB26pPiplAJAFO15nlY 89OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=xennpDEnA2PXlfQSAf/oTr3cJoLkokDBY46hR9Tjz54=; b=PUQTgo9dyIbSgvDm9HV9PRh/lch3DFUI645Lc3cmx3eqXEpmUeeAsnJq0SyE2qXju1 bJ1tR2tTPSJD6QZyVPETNGl91DUYUQxQIEbgZFEscphtMI9BjxoGD9QtVmPjtSFDcs4+ UjzTme6VeEkUeKaYZ+0KZSocRoWNUmBQnpyFyM3eOGq1r0ykSrx+dZCBnY8vkO6MRuDy A5hVF5ZrciMQAgqa/x4dvP2+1tzg5pdWjKdVSkWDD0NrnUDs8NyhKRYJPux73Q3+13cg qTZPhszfcLe1+ZtrBRKf2izH55UmSxc7CiECktMsBnB+SJCaRiEZcEspUots4eyuOI28 Ioig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p15si7403376pgj.290.2021.10.10.11.12.57; Sun, 10 Oct 2021 11:13:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231749AbhJJRoS (ORCPT + 99 others); Sun, 10 Oct 2021 13:44:18 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:51211 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231134AbhJJRoS (ORCPT ); Sun, 10 Oct 2021 13:44:18 -0400 Received: from mail-wr1-f42.google.com ([209.85.221.42]) by mrelayeu.kundenserver.de (mreue108 [213.165.67.113]) with ESMTPSA (Nemesis) id 1N0G9p-1mw7Oo2dkd-00xIKV; Sun, 10 Oct 2021 19:42:17 +0200 Received: by mail-wr1-f42.google.com with SMTP id y3so14981417wrl.1; Sun, 10 Oct 2021 10:42:17 -0700 (PDT) X-Gm-Message-State: AOAM532svRuFPxZUNHvlD5UZfO4v7yFNlgwh5svx0fIeT/WBfrChfeE7 O6ug4P9JxHxSVZjQGe7YXdfZWRM2vlVQhgngLBo= 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 Kernel Mailing List , Linux ARM , Daniel Lezcano Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:jVG6/l1Sg3kgqLyDpuWv74nnT8ektUJ4DDBI9ZLM/lPylGA3rr0 HVQVjft4IguLUExdmpqPucvVzz7boSAVEkSJjguaSkLvdxS81umeCUEPrtaT9KlSvCt4DlM 86jCwVVc0u8HR5WNQ66W+xSnatPhFyGz7Abpqjt97ugYX++FM5Wz+S1qzE2QyBH0DEvfMJo iR+T/2Jr0OMJJV4oZr89A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:r4Iu1hR8NXU=:zjwDXYeJb7ylUVSVOiFk0B NFPr8MhoKc7A+8uXNcBwTD9tiFKs9uOeDL+bCLbaW3USNPBZS1uAJb34u65uVai+R3Yfswiaa pkzDrwe/XUMo5fnS3p/ev3V4MOLr+fzFwVh3HegQHuG9bwPjEPuCH2Wfl6Ahz7dVAfFnwUGW0 /+GCZUq18vf+hmHzlldxAXrAz4w9kb8ZOe5SiRGWQ3Bhp5ROXfkE3P7SomytvlR82iaqJF8uG wcKKzBMhGK5Zdgcr2ETWy0QJtO8yMBZzkCiD3uZwjimB7pqAXMBcfmTGksa/fJBxCdqBzNHTz Daap7mWe4+TVsxdKDlSIpITh7xcshkEGbuUBJIhIlzvjSQIm2QVeKruwxnxJZvkrhh2jv4hrU jRghjo/X9/cteVWdjNx5nq5L721hKoFRVfoKJjo+mpaNUfYI2ZOD2QMQxf6Uvokt7eovtuGTA kt6PFwY/a+6ZWUIolVdEwh3LaQXRWyXRvstxVY0upa39TEtsfPSTgG8YwmdwjwdYzFZt8+AEf ELfvPptbWlIxwcTg3k1ETlnn0TiO9BeVq9PBjkZUqaAscTpYn/XzpntRZyJ37Gu7XG75c2OZo qLag3vtEGDuQvTcEEFaiSIPoWBD1c6hnda8MdVeC7adBzk7Pu2PfzOZYrpHk39b0MlzQNRSwn zgs+T8w1BYK5tD0jJ2GF9h4+6GKnSPwV3Qn14rcEoQbFCzYazumRrn1Fq+8MQcoHxqAkl67Hy srHyK889ZVKmwoqksp6bleCA60RY/4qArm2gdg== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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