Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1153037pxb; Sun, 10 Oct 2021 22:38:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFML9L0+BWIN7qzeR9Mki1QnhcTdBtFpw2BqsmWk8IorIUgM2kPE0oihm8ORecd5wWoVkc X-Received: by 2002:a17:902:e743:b0:13f:18ba:c8a8 with SMTP id p3-20020a170902e74300b0013f18bac8a8mr15168118plf.72.1633930730146; Sun, 10 Oct 2021 22:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633930730; cv=none; d=google.com; s=arc-20160816; b=VOcRvgcS0Lc7ZWrnfnV6exiegzxw1O0WVm7cRpAxCnHl0n7HsUVarh4yf+rWnI/Gp7 aLU3Y45qsA5/JD2/3T1vB00Uf7Sx+kvl8NXgEjYfpe3J8GPMA2Mhx0JQ5j/ozCm3K1Xz OcMYKY710M6pISG9ozV0jRHnCCpkunL8Rc4M0SbX5LKZzS2KjOBwcTtbut+ijKhJ6Vkp kq30lxOScpR8A57JCBWF5IjPMqo+ZmYPEju2Zmp+H1xHqgNLYpYkccgTckDP8nTgcuRr rxEoiyVTlGUxPj14QCwLpxhTtcYvAeCXR6kU06tTegt2v1LZHOxXWQ1CUs5/bTIML+En zfrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=x6zJ1TMB99Xj1FgTf/EaXYFiMV4l4PhopS0sskGKUJg=; b=uxjb6/l+4xXpZLfUXxqXhpLb8w3Tik325MZ/QaDe6JwjMky/6ncW+SIsWFMAlV/OfL YyzAq//I0x54BoacX65EOCihFx5hceIkZDW84m7PEilI0dvQCG1owo0Gjz1uCYB/O3HY nnlYbaBMYt7PiHm7kdl7ye/BchI5XFRvtVCGhPBEYhPEN0zQ/lvi6+ovjQ3zRKg/HenA 8o4qbUvRGehWJNPAcnT2TPUN0epCWIcbb6D04YpdOiogduFkNKLzgRhOHMODI+KESCmC C67KPZS5FuateQQtyeQi/fzCigf0w7ZH5cXPnnkT5CjHfGuSCRGtj0V3fuBUaoblppTa OlOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kali.org header.s=google header.b=MMWmNas2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kali.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c140si9621885pfb.379.2021.10.10.22.38.37; Sun, 10 Oct 2021 22:38:49 -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; dkim=pass header.i=@kali.org header.s=google header.b=MMWmNas2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kali.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232419AbhJKEJC (ORCPT + 99 others); Mon, 11 Oct 2021 00:09:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232145AbhJKEJB (ORCPT ); Mon, 11 Oct 2021 00:09:01 -0400 Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A15CAC06161C for ; Sun, 10 Oct 2021 21:07:01 -0700 (PDT) Received: by mail-oi1-x22a.google.com with SMTP id o204so14760263oih.13 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=Sl5mo+ANHKvmjUvwDUAzEW/U7QCYyIHQW6RgarqiKuzzzlrMOtvrfb3xCVr0tZZ3zP 8e5u7sABuKqFXKbNBa8ijZo6WAL8QgvIR1WTEjEQW1eK8byikCr5g4hdFV5yHbiiS37y Hpb6GNFcVEtVhF5459YZzDWwBl59/XbKB0vMRr9M+LrdUzgkevWmKMLahYUINJNSuEHK cQu5/lNLtoTtWn2V4FOLk1dPtHl0rlT5brmIB/yiRc1+6bpq0f+cQj71jGBzvSrewa4s xvV3GqspPAYxBwyegkr4Ai7DJuEbZr53CcxHAcGiIjQO4SDQaCMO1gZrq+rh4h0mHliC YEwA== X-Gm-Message-State: AOAM530zmGTohFOOT+tWqxadnkD/DD0BY5SGO8p+sL5da/jL6nYIePI0 gjThf48P9NXldQUX2IwqiB9ZgA== 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: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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