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 07174C433F5 for ; Mon, 11 Oct 2021 04:09:32 +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 C3C0760F23 for ; Mon, 11 Oct 2021 04:09:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C3C0760F23 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kali.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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l7DecRWo5Suxs5sg6aoWdF4HPrU1Q/UwwNd8pBlho3U=; b=QlasbubSNXiYJ7 8YgO5OH8llkpw6O24nOixCQIz+TkmOPxYY3EAsATtSgghHRb0sY1/1UEJ3ZhNTadcXFWVuPCMocNY enuf5th7ocE+69GEeKKCwJpo9jOHSk8zJ7/GjzEwf4gtXLqfAl434md+2SD2MSAXV6aEPFceybQ23 lxmV06C4I9horembCnuRDTfXBu7i7ySP3TRN0ANEsp/049kpOxZB9NfLbgQ3ZIXc02qWC3EDaS6MJ ziFw6rqq4ETAG1A46aCsJvtJu8Z79oe50fw+Mkd/pLQvPdxCGKe5CQTK1dNiIJ2kXuSMBeDaLr0+z 5QAxxbXzykNfOP6oTpIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZmai-007ehu-Qg; Mon, 11 Oct 2021 04:07:09 +0000 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZmae-007eh0-Sq for linux-arm-kernel@lists.infradead.org; Mon, 11 Oct 2021 04:07:06 +0000 Received: by mail-oi1-x22b.google.com with SMTP id o4so22914389oia.10 for ; Sun, 10 Oct 2021 21:07:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kali.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=x6zJ1TMB99Xj1FgTf/EaXYFiMV4l4PhopS0sskGKUJg=; b=MMWmNas2Kk06bSpFDsluQBhy85L5MC4CSaXQzLEp1VM6YfCxptom3EfbZ9CNodgEHn XYrtNOSNSOtPQLbFOnP/MC5RUYm2+SaZbjkFaJB9RfsA0itlYKmCOz0E4iHn9+hxBZqt M30hT9DrRYaeKfFnX9Z8cOnrK0nIaVPla5p7coiLuri1CBQ4Xy1ngm11PzoMRqCQQ6oz QQpKxfsNulQhqPNOqzGv/zyyqeBjZP8Ld0L5zp83z8k3kMRBq76ZGJiH7sie2TcTRBzU QC61z0hPyd/c95TXvqf82Fl8DZ2/VlTRIbvaW2h9aUDX+2zAbKOx3dVMV5z9zKCJrBot yI8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=x6zJ1TMB99Xj1FgTf/EaXYFiMV4l4PhopS0sskGKUJg=; b=Ete1V+R78DJ2q1docT4yf9NZ/z6x/RbbUjqVnfS4LMUI3ZUbeXvJnIdmFNrWVQM35r l+jEgfvyqvSXMA1k4xWAvaFr1UFbNNmaasyUd9nALDv6nAIrQEGS8ku2+XogB33MG8SF ePCNr6GK65iy7eusGqIxbF7LsQprPhD4pX8IE/dhuPNHkE9VStDL/TZuaXn4jng5D54A m3DFwlpFLc7l5ANJHuXOoaqoCOafvph4ehAMA1eiG8NlK3a8MQQ8AMA66KB3ALW6146A avPatO6qIEMmYjVcxmnFFR53jYm2jVl0OlrIDe7fDXoBXteGuqy9k3tr501K1TsGo58r JxOQ== X-Gm-Message-State: AOAM531olwTgaoucVfHy/GgUPNa4oTN5PekZFKi3NwA/2QS7JnYQCxCp mSbeN5PhmWjte2BF5VhsnZxZgA== X-Google-Smtp-Source: ABdhPJyNBhey2POmoHGytDsM+sjqpo3nS+HnjONu7HSk/QnQNoIRcds2yh6VSQNMRwLWpByqHsAFIw== X-Received: by 2002:aca:5b44:: with SMTP id p65mr15644888oib.158.1633925221021; Sun, 10 Oct 2021 21:07:01 -0700 (PDT) Received: from [192.168.11.48] (cpe-173-173-107-246.satx.res.rr.com. [173.173.107.246]) by smtp.gmail.com with ESMTPSA id bi1sm1506166oib.34.2021.10.10.21.06.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Oct 2021 21:07:00 -0700 (PDT) Message-ID: Date: Sun, 10 Oct 2021 23:06:59 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: [PATCH] iommu: fix ARM_SMMU vs QCOM_SCM compilation Content-Language: en-US To: Arnd Bergmann , Bjorn Andersson Cc: Dmitry Baryshkov , 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 References: <20211010023350.978638-1-dmitry.baryshkov@linaro.org> From: Steev Klimaszewski In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211010_210705_130081_BBB08836 X-CRM114-Status: GOOD ( 31.22 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 10/10/21 12:42 PM, 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 FWIW, I tested this patch on the Lenovo Yoga C630 with Dmitry's patch backed out, and this does the right thing as well. So if we go this route instead of the other patch, Tested-By: Steev Klimaszewski _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel