Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp309477pxb; Sat, 9 Oct 2021 21:39:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNG5kczDhw+quzRn0xzIceMfoJC7NA9+QuTMXHSEWsZ2bseBHztQRwDGiw7hcCB6QXpgCi X-Received: by 2002:a05:6a00:16c6:b029:32d:e190:9dd0 with SMTP id l6-20020a056a0016c6b029032de1909dd0mr18696115pfc.70.1633840766327; Sat, 09 Oct 2021 21:39:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633840766; cv=none; d=google.com; s=arc-20160816; b=Vf9ocir4gZdZctS760EcfeMcrFnVXgUEQGunnQgNnFTjZdkiprpt8Ul8vHq9XHuKw6 C1yy1uVu45rqZzSKdCvZxemZfHEWlNmMp9bv0s/7+BotxQ4yoyIai9m6f9v6IL7VHTzs fGTtq1qfdKuuvRx7NWi8V/l7Y6xk5NNLZYcloTfAPQ/Ia+ECSSMbXYaSlq2TjmoXR832 mCcjluluZsdB06f0xCIoOqGxBrMRAfSQfYqMsi4ozMp0ct9jdtczrqSgiMzABtvTl2+w 4E26OhRoB/6LQsxnn4QUBegMLpAzpNfS25Hoq/FhYpZZeJ6nvoiZwhn9ao/ZW7wq3ade 5UxA== 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=oS3/7Iu8XaPwbDFyRTMleM8YCizK9D6llJsSxGhaoZk=; b=cuVPYXOOmk7N9/If2WivdUDv/OrU9cU7jlYfvs1Vdcz2183P9BFV01cj7HG4wnk2c7 zA8fRFvDm8WvtffAuzi7Q9zK3TYBTOwBgPlyF4vI2fHPQh0gkTYpJ2b+drvey044phCY wNMpSZ7hanH9wgFDpHQOsUqLzpMItGT2BDIPqs0cxbTes6SdPEmTRrbQfFHP62dViAAA wlxhYhPITA8A6DTkGctMzs2EW1yrMTgvd6FWIihnGgleaQAMm3L23byWD3hFKEmNS1U0 HTUWph9HIh0vYaPXRBV48e7CqZKULMUl/KWcIi6Pl+U9MzBN4I/6sl2J43beGC35TR+q XMDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kali.org header.s=google header.b=SEDuDwvx; 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 s4si5412043plq.25.2021.10.09.21.39.02; Sat, 09 Oct 2021 21:39:26 -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=SEDuDwvx; 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 S229645AbhJJEgL (ORCPT + 99 others); Sun, 10 Oct 2021 00:36:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbhJJEgL (ORCPT ); Sun, 10 Oct 2021 00:36:11 -0400 Received: from mail-oo1-xc34.google.com (mail-oo1-xc34.google.com [IPv6:2607:f8b0:4864:20::c34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1581CC061762 for ; Sat, 9 Oct 2021 21:34:13 -0700 (PDT) Received: by mail-oo1-xc34.google.com with SMTP id r4-20020a4aa2c4000000b002b6f374cac9so26782ool.6 for ; Sat, 09 Oct 2021 21:34:13 -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=oS3/7Iu8XaPwbDFyRTMleM8YCizK9D6llJsSxGhaoZk=; b=SEDuDwvxsH2QVF7SHxwlWidbjjslBC9HcB3wX9ErK+x+/nEFa2IyjzOhtAu1kLxXet buQvB5yR3jH4Q+FPja2FK8Vux56XYLiMAQyXzqeUjb0PKQmCpimI+LPw4KDEmycjRKop lkK/5Zv3g7COM7QSep84giDmz4EviwuZcExXjSdXPK9xDCT4LzulXS3XavDIAhklXGDG +BGXHHzpl2hNhnxOnyHV/0Tk95v4FJ/K1PBY0/ClBvjBMhYJp3yiqvrMXjQMX8k+RVvO z6InxZihbD8YYZ+EoHjwvjh4Y/J+n61Veqk129gbKC6lCs5BRQa9QSInnB4HWyjyY2Bg RGRA== 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=oS3/7Iu8XaPwbDFyRTMleM8YCizK9D6llJsSxGhaoZk=; b=7a7tDxUvZdWYJ73F8T8Ivk2qA1tzbXFuisaKdzH582V2wqjw70ZKYfrUl2jxVSZvGd LZrF4bNdsSFoYeX+A54P7VaC61fwnMFDaNbzVgJ0F0i0UrSJyRdnVVc9bPr4ABjNwzK6 ItZKfC5qXMhVpSB2vpErv9XCNVCQDGJiAqCddyIwWzcDpSF655IyY1efAt9qyDMwJyCI DMpYIt1X8iuowEtAQDlgOhN57Cjppf2JS4xul51pdO5U0l5XR9OA2QLoSZgi/DDuPOZu FAFkuvhP8oNVa/xUfWz5O6DkTktwlA51Tgqq6zAxwS3T2jktIlQY0txXAiJCzmSNlAzZ DX0g== X-Gm-Message-State: AOAM533rRi1sAbbOnq8GNh9ITiuNpKoo7MRZ02il7D4x4DzDFLdE3d45 StL1JGLyX4vQ7c+IxPcGKvsl+Q== X-Received: by 2002:a4a:b64b:: with SMTP id f11mr14083092ooo.18.1633840452285; Sat, 09 Oct 2021 21:34:12 -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 n7sm899946oij.46.2021.10.09.21.34.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 Oct 2021 21:34:11 -0700 (PDT) Message-ID: Date: Sat, 9 Oct 2021 23:34:10 -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: Dmitry Baryshkov , Joerg Roedel , Will Deacon , Robin Murphy , Kalle Valo , Arnd Bergmann , Thierry Reding Cc: Bjorn Andersson , 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 References: <20211010023350.978638-1-dmitry.baryshkov@linaro.org> From: Steev Klimaszewski In-Reply-To: <20211010023350.978638-1-dmitry.baryshkov@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/9/21 9:33 PM, 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. > > 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; Without this applied, my Lenovo Yoga C630 just boot loops with 424953cf3c66 applied when it gets to the smmu.  This fixes it. Tested-By: Steev Klimaszewski