Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8979013rwr; Thu, 11 May 2023 08:28:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5dN+3SgmTmWpNjaAVvywdvzYW03NQvtYJe0dijeyl2n3J6m9szizu2eTm5aBmoQjriE4cj X-Received: by 2002:a17:90a:c908:b0:24e:b0f:8f57 with SMTP id v8-20020a17090ac90800b0024e0b0f8f57mr19583541pjt.48.1683818910786; Thu, 11 May 2023 08:28:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683818910; cv=none; d=google.com; s=arc-20160816; b=vpl5y8oVoHzv2C7FhSuFBCsQn66O0qY1BmoRGISwO6fdPLUtetXJril/93e+fyySO4 JBh1arAb5/hDasZBVmggBtOQp32vXr1W75ANA38NgBb1Dob17/ssC+m+3f4J8YfDaPyS hfaoJ05F3g/tWMOyWJyuE9BcIl9mSp4o1lSYlG03Sr3wbubB8dbWCuWKjpM2Dbuf6h7T ba/8DwxmZbsfyRTXy+8c/XPp5oadjY5y1bt611WvAqKnO0PraTI4zKXKNs4KJ0mMMAog bfnSfLZ36rZKkmzPQyyo1cNvTcabD+RLQ/gku+V6htA/cpSO4dXDLtsoX+eJh5Vmb92d XcBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=DKh9RanEco8HkFU0f9YQUCI4J1uPooBwGH0J45ObAN4=; b=OcqAd/0y75VpYO8Jax+MDCPajT4EtY63Hw5do5i63Gl+stbi91Y+4bzXchKYB4/ick tftoxOC/zRQ6djULgCGmIHustoLrEBtUd7kLQJveG9JaTOHZZJK9G3mE0OqP5vcvE9hF uGVMFVPTn8uomDiAraVKDnRCuhKYXXTMoQRW2HxlQ3g3e2xgviHHvZkR2cBSM3+ziyo8 TpCQOWRZzCFDSomJhSt2Zqfqr/1UjX2IGJkjVc0hUmYgzSa5p0qN4bAdY0c6iTaOZICy 5Dr9WivXf0vDYeatTG6hdccAOkXZ5yxp6+yKylWWFhzVS99zdJw5deMDV2ixE7dX7Cf+ lv6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=sfcr2gDm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t72-20020a63784b000000b005303363c731si6833065pgc.457.2023.05.11.08.28.16; Thu, 11 May 2023 08:28:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=sfcr2gDm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238433AbjEKO63 (ORCPT + 99 others); Thu, 11 May 2023 10:58:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237865AbjEKO6W (ORCPT ); Thu, 11 May 2023 10:58:22 -0400 Received: from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3E0DEC; Thu, 11 May 2023 07:58:03 -0700 (PDT) Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-54f8b7a4feeso1655779eaf.2; Thu, 11 May 2023 07:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683817083; x=1686409083; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DKh9RanEco8HkFU0f9YQUCI4J1uPooBwGH0J45ObAN4=; b=sfcr2gDmpA6MfW6T3fpKqQu/TnYVeZ0fxsPI86zsuUPnzmWasEialKeKTWXqS7u4D4 nXAmdFPbkhVAxyjP9VrIVNaQNudJ45aNUqOCRB1IGcVfzLaPYqZpk+FHaEBKvM4nIvJa BrPZct/zhxfL5d8xAhEPBCe8Pfoeiko4NS+WsyWv/hMoEfjeE9l5SUEVkELWJLepsLWO bNVm6P2m43HS86NR/CHCBAMuP+OUM4yG/cZymVNXUrdib1sLGRStWZXVcJ6goiUPJ0H5 WyjurJUrawTO+PfgOG+D+RJVm+oh27AwT+1gMmuyz1gnnZa2+3OFg+h2Xyq1OF/88BMz +fzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683817083; x=1686409083; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DKh9RanEco8HkFU0f9YQUCI4J1uPooBwGH0J45ObAN4=; b=MnyJt7HPbiD9BzwHv1za+DC9iTDhOAzhiFx1+1m9iVqVNFpRA/a9Wg5OyshQzbJmlF gwKVWkWTRSonurPBWVCtEOvGNoNjsh8aHpjd5ZBLEX8QEq1H+I2SDqgBSaHxKcJr5PZ0 5f9oOqonZ2WCRbya2sXhElBM74n2jsYinLJL8p1v9WIQl0fjA4gILiDnOZZ01xENSq4g OSaLOhup7mZ45n+HDdea+DyeDkkrRXMnU7/+WLzQuvXfE+D0EJ6R64YQN5afhsK01Hda hjWIa3bL0t99SimTEfvNtJf23CaM+Cr945ZtItQ0U0XCxmfyGvhpVsWgsutFBLIoQnTJ th/w== X-Gm-Message-State: AC+VfDymMooX4zBhC4r6WX8qSGMfZRFAYb+t5k9R6uSG98IS9Y3Ely87 DG3COhr4U4q4CCLgxvpIR+JGIuz9vouYnu/64AE= X-Received: by 2002:a4a:7606:0:b0:54f:54b3:cb9c with SMTP id t6-20020a4a7606000000b0054f54b3cb9cmr4931936ooc.1.1683817082839; Thu, 11 May 2023 07:58:02 -0700 (PDT) MIME-Version: 1.0 References: <20230509163712.376117-1-robdclark@gmail.com> In-Reply-To: From: Rob Clark Date: Thu, 11 May 2023 07:57:51 -0700 Message-ID: Subject: Re: [PATCH 1/2] iommu/arm-smmu-qcom: Fix missing adreno_smmu's To: Dmitry Baryshkov Cc: dri-devel@lists.freedesktop.org, iommu@lists.linux-foundation.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Rob Clark , Lepton Wu , Will Deacon , Robin Murphy , Joerg Roedel , Sai Prakash Ranjan , Konrad Dybcio , Bjorn Andersson , Elliot Berman , Marijn Suijten , Emma Anholt , "moderated list:ARM SMMU DRIVERS" , "open list:IOMMU SUBSYSTEM" , open list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 11, 2023 at 7:51=E2=80=AFAM Dmitry Baryshkov wrote: > > On Tue, 9 May 2023 at 19:37, Rob Clark wrote: > > > > From: Rob Clark > > > > When the special handling of qcom,adreno-smmu was moved into > > qcom_smmu_create(), it was overlooked that we didn't have all the > > required entries in qcom_smmu_impl_of_match. So we stopped getting > > adreno_smmu_priv on sc7180, breaking per-process pgtables. > > > > Fixes: 30b912a03d91 ("iommu/arm-smmu-qcom: Move the qcom,adreno-smmu ch= eck into qcom_smmu_create") > > Suggested-by: Lepton Wu > > Signed-off-by: Rob Clark > > --- > > drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu= /arm/arm-smmu/arm-smmu-qcom.c > > index d1b296b95c86..760d9c43dbd2 100644 > > --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > > @@ -496,20 +496,21 @@ static const struct qcom_smmu_match_data qcom_smm= u_500_impl0_data =3D { > > /* > > * Do not add any more qcom,SOC-smmu-500 entries to this list, unless = they need > > * special handling and can not be covered by the qcom,smmu-500 entry. > > */ > > static const struct of_device_id __maybe_unused qcom_smmu_impl_of_matc= h[] =3D { > > { .compatible =3D "qcom,msm8996-smmu-v2", .data =3D &msm8996_sm= mu_data }, > > { .compatible =3D "qcom,msm8998-smmu-v2", .data =3D &qcom_smmu_= v2_data }, > > { .compatible =3D "qcom,qcm2290-smmu-500", .data =3D &qcom_smmu= _500_impl0_data }, > > { .compatible =3D "qcom,qdu1000-smmu-500", .data =3D &qcom_smmu= _500_impl0_data }, > > { .compatible =3D "qcom,sc7180-smmu-500", .data =3D &qcom_smmu_= 500_impl0_data }, > > + { .compatible =3D "qcom,sc7180-smmu-v2", .data =3D &qcom_smmu_v= 2_data }, > > { .compatible =3D "qcom,sc7280-smmu-500", .data =3D &qcom_smmu_= 500_impl0_data }, > > { .compatible =3D "qcom,sc8180x-smmu-500", .data =3D &qcom_smmu= _500_impl0_data }, > > { .compatible =3D "qcom,sc8280xp-smmu-500", .data =3D &qcom_smm= u_500_impl0_data }, > > { .compatible =3D "qcom,sdm630-smmu-v2", .data =3D &qcom_smmu_v= 2_data }, > > { .compatible =3D "qcom,sdm845-smmu-v2", .data =3D &qcom_smmu_v= 2_data }, > > { .compatible =3D "qcom,sdm845-smmu-500", .data =3D &sdm845_smm= u_500_data }, > > { .compatible =3D "qcom,sm6115-smmu-500", .data =3D &qcom_smmu_= 500_impl0_data}, > > { .compatible =3D "qcom,sm6125-smmu-500", .data =3D &qcom_smmu_= 500_impl0_data }, > > { .compatible =3D "qcom,sm6350-smmu-v2", .data =3D &qcom_smmu_v= 2_data }, > > { .compatible =3D "qcom,sm6350-smmu-500", .data =3D &qcom_smmu_= 500_impl0_data }, > > @@ -540,12 +541,14 @@ struct arm_smmu_device *qcom_smmu_impl_init(struc= t arm_smmu_device *smmu) > > /* Match platform for ACPI boot */ > > if (acpi_match_platform_list(qcom_acpi_platlist) >=3D 0= ) > > return qcom_smmu_create(smmu, &qcom_smmu_500_im= pl0_data); > > } > > #endif > > > > match =3D of_match_node(qcom_smmu_impl_of_match, np); > > if (match) > > return qcom_smmu_create(smmu, match->data); > > > > + WARN_ON(of_device_is_compatible(np, "qcom,adreno-smmu")); > > Could you please add a comment here, noting the reason? Or maybe we > should change that to: > if (WARN_ON(...)) > return ERR_PTR(-EINVAL); I'll add a comment. Not having an iommu is even worse, so returning an error isn't a good idea. I just wanted to leave some breadcrumbs so people can see where the problem actually is if per-process pgtables break again. BR, -R > > > + > > return smmu; > > } > > -- > > 2.40.1 > > > > > -- > With best wishes > Dmitry