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 X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E7A8C433E2 for ; Tue, 1 Sep 2020 03:36:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D936B207D3 for ; Tue, 1 Sep 2020 03:36:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="t88wyukF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726105AbgIADg4 (ORCPT ); Mon, 31 Aug 2020 23:36:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725993AbgIADgz (ORCPT ); Mon, 31 Aug 2020 23:36:55 -0400 Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13660C0612FF for ; Mon, 31 Aug 2020 20:36:54 -0700 (PDT) Received: by mail-oi1-x241.google.com with SMTP id 3so2072876oih.0 for ; Mon, 31 Aug 2020 20:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3bbR697W940r4qzYtPEkaaefcfDcXbIb27x0eRbQn1Q=; b=t88wyukFrGBP19mHYjYTWsz3cjpW6QpEg7Ltbz+G5xqv1PsMrwfuqtT+tsBMRaFiAe 4gPWkDGMc/WT3t+OYUgDhDsySC1lQoBqPFXqCkKy/yNF7uKG0CBKbSLjEcYi8r99wzkD zJ1uKKejvBjXEpmdvoN6S1Kw1Lszf8WchWPjqE6kBvVrLaMFqaxCLB8jHPVd05sLjn5w Sn+IUjF1T8S8Vk2Gcxs12RcZw9Hv+7upag/QjiMCAT5OFVNyus4MjWThnyDI47KSEHer iinAg7zWc3pxEuBAlyWYMLY4fj4xuriYi3LKpZ+nfuCVl8br024gHoMVW+1TKqgidBXf 4pIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3bbR697W940r4qzYtPEkaaefcfDcXbIb27x0eRbQn1Q=; b=SB8aUbTjqU/YRQfV3ruxwZMTGK9EQVfjPG79usnX0GV3zOVYWBxuhS5KHZy8wCs7A8 F5wOAZIIR4L5IxaImO07bwD3SLMmX1vI67wGhmL/2r4ywUm43PHaZUjQ2dIVPAc5od6U A0QUsWN8weQHU4rAH7sBotfMw0LjNwrE8Mv2SEarxgIn+H4/HR8yHQErIWIUbagr1I5D pKqywqwLU/R4719c5zJBRSF7WlLzO4RmLev6y5Bj+JaQnMhkKHyWzFRcLdbq8PCIkP3Y xgsWV7/XgP3KQUNgbIA2B2IUWom5majvDJ/+JeLry0oObYVccrS7AQXM7x+BtjqU/WZi 28zg== X-Gm-Message-State: AOAM530jCFpq36cix+tLWXXpZfeJcgjc7wr1hBb9GPcow+eryq+TXIGq 5mCMknrW3RGPvOHBzJtTs/Fiow== X-Google-Smtp-Source: ABdhPJzjeGy+/ZDGjjXngyiAJQe6e3aEgxmZgSoz2VhDdCQaWZ2XBv1SUodwsR+dKUEuJnH+tsgDPw== X-Received: by 2002:aca:5413:: with SMTP id i19mr16131oib.105.1598931413164; Mon, 31 Aug 2020 20:36:53 -0700 (PDT) Received: from yoga ([2605:6000:e5cb:c100:8898:14ff:fe6d:34e]) by smtp.gmail.com with ESMTPSA id w136sm2050529oif.14.2020.08.31.20.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 20:36:52 -0700 (PDT) Date: Mon, 31 Aug 2020 22:36:35 -0500 From: Bjorn Andersson To: Rob Clark Cc: dri-devel@lists.freedesktop.org, iommu@lists.linux-foundation.org, linux-arm-msm@vger.kernel.org, Sai Prakash Ranjan , Will Deacon , freedreno@lists.freedesktop.org, Sibi Sankar , Vivek Gautam , Stephen Boyd , Robin Murphy , Joerg Roedel , linux-arm-kernel@lists.infradead.org, Jordan Crouse , Rob Clark , Jonathan Marek , Greg Kroah-Hartman , Thierry Reding , Krishna Reddy , open list Subject: Re: [PATCH 02/19] iommu/arm-smmu: Pass io-pgtable config to implementation specific function Message-ID: <20200901033635.GK3715@yoga> References: <20200810222657.1841322-1-jcrouse@codeaurora.org> <20200814024114.1177553-3-robdclark@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200814024114.1177553-3-robdclark@gmail.com> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Thu 13 Aug 21:40 CDT 2020, Rob Clark wrote: > From: Jordan Crouse > > Construct the io-pgtable config before calling the implementation specific > init_context function and pass it so the implementation specific function > can get a chance to change it before the io-pgtable is created. > > Signed-off-by: Jordan Crouse > Signed-off-by: Rob Clark Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > drivers/iommu/arm/arm-smmu/arm-smmu-impl.c | 3 ++- > drivers/iommu/arm/arm-smmu/arm-smmu.c | 11 ++++++----- > drivers/iommu/arm/arm-smmu/arm-smmu.h | 3 ++- > 3 files changed, 10 insertions(+), 7 deletions(-) > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c b/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c > index f4ff124a1967..a9861dcd0884 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c > @@ -68,7 +68,8 @@ static int cavium_cfg_probe(struct arm_smmu_device *smmu) > return 0; > } > > -static int cavium_init_context(struct arm_smmu_domain *smmu_domain) > +static int cavium_init_context(struct arm_smmu_domain *smmu_domain, > + struct io_pgtable_cfg *pgtbl_cfg) > { > struct cavium_smmu *cs = container_of(smmu_domain->smmu, > struct cavium_smmu, smmu); > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c > index 09c42af9f31e..37d8d49299b4 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c > @@ -795,11 +795,6 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain, > cfg->asid = cfg->cbndx; > > smmu_domain->smmu = smmu; > - if (smmu->impl && smmu->impl->init_context) { > - ret = smmu->impl->init_context(smmu_domain); > - if (ret) > - goto out_unlock; > - } > > pgtbl_cfg = (struct io_pgtable_cfg) { > .pgsize_bitmap = smmu->pgsize_bitmap, > @@ -810,6 +805,12 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain, > .iommu_dev = smmu->dev, > }; > > + if (smmu->impl && smmu->impl->init_context) { > + ret = smmu->impl->init_context(smmu_domain, &pgtbl_cfg); > + if (ret) > + goto out_clear_smmu; > + } > + > if (smmu_domain->non_strict) > pgtbl_cfg.quirks |= IO_PGTABLE_QUIRK_NON_STRICT; > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.h b/drivers/iommu/arm/arm-smmu/arm-smmu.h > index d890a4a968e8..83294516ac08 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu.h > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.h > @@ -386,7 +386,8 @@ struct arm_smmu_impl { > u64 val); > int (*cfg_probe)(struct arm_smmu_device *smmu); > int (*reset)(struct arm_smmu_device *smmu); > - int (*init_context)(struct arm_smmu_domain *smmu_domain); > + int (*init_context)(struct arm_smmu_domain *smmu_domain, > + struct io_pgtable_cfg *cfg); > void (*tlb_sync)(struct arm_smmu_device *smmu, int page, int sync, > int status); > int (*def_domain_type)(struct device *dev); > -- > 2.26.2 > 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 X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C74CC433E6 for ; Tue, 1 Sep 2020 03:36:57 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 085992083B for ; Tue, 1 Sep 2020 03:36:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="t88wyukF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 085992083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C245D863A3; Tue, 1 Sep 2020 03:36:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nxD-E2aZeISj; Tue, 1 Sep 2020 03:36:55 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id C4D4B8638F; Tue, 1 Sep 2020 03:36:55 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id AD015C088B; Tue, 1 Sep 2020 03:36:55 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id D3878C0052 for ; Tue, 1 Sep 2020 03:36:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C21D685DF6 for ; Tue, 1 Sep 2020 03:36:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id meUOiGaK2AG2 for ; Tue, 1 Sep 2020 03:36:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-oi1-f194.google.com (mail-oi1-f194.google.com [209.85.167.194]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 09F23844AA for ; Tue, 1 Sep 2020 03:36:54 +0000 (UTC) Received: by mail-oi1-f194.google.com with SMTP id x14so2314667oic.9 for ; Mon, 31 Aug 2020 20:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3bbR697W940r4qzYtPEkaaefcfDcXbIb27x0eRbQn1Q=; b=t88wyukFrGBP19mHYjYTWsz3cjpW6QpEg7Ltbz+G5xqv1PsMrwfuqtT+tsBMRaFiAe 4gPWkDGMc/WT3t+OYUgDhDsySC1lQoBqPFXqCkKy/yNF7uKG0CBKbSLjEcYi8r99wzkD zJ1uKKejvBjXEpmdvoN6S1Kw1Lszf8WchWPjqE6kBvVrLaMFqaxCLB8jHPVd05sLjn5w Sn+IUjF1T8S8Vk2Gcxs12RcZw9Hv+7upag/QjiMCAT5OFVNyus4MjWThnyDI47KSEHer iinAg7zWc3pxEuBAlyWYMLY4fj4xuriYi3LKpZ+nfuCVl8br024gHoMVW+1TKqgidBXf 4pIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3bbR697W940r4qzYtPEkaaefcfDcXbIb27x0eRbQn1Q=; b=ehI7ZHyJLA32/q7q+c/33+Aah28fDHnFsCG1SeyEa6c5SoFxayHkRKQR69iUJx7fYD VAsa8hNkY5AW+PrudB9KibdNSQvq9JCDzFuLTW3TvFaWRq//GLRpmHjeyZWUAvU3ZTOZ 1H+osGIc7+Zy+nlfI4h3SJRbV4Wq1/kuEv2PMDuvWTQ7XSFLrhYUn5/kiTQue4R7A5oS SyQD9/PDBdQuqNpbLfr2O5GuG0/fAcg9+P65lTQjqYZCH36YWZiee74UEJI9Selbt3jm MwxPV6cELOg2R4BWwBbmYn9tTeHzBbsuzqFSNDxmSX8Ra04OcqSYT8slUHFH47H9lZjl htpg== X-Gm-Message-State: AOAM532IPfrsEXijk88yZBXaclKQMrlO7BfyB0Sk15jjlHxWUWrMlN10 US8jEq+ygDOeE8l4VM2TCfrHBQ== X-Google-Smtp-Source: ABdhPJzjeGy+/ZDGjjXngyiAJQe6e3aEgxmZgSoz2VhDdCQaWZ2XBv1SUodwsR+dKUEuJnH+tsgDPw== X-Received: by 2002:aca:5413:: with SMTP id i19mr16131oib.105.1598931413164; Mon, 31 Aug 2020 20:36:53 -0700 (PDT) Received: from yoga ([2605:6000:e5cb:c100:8898:14ff:fe6d:34e]) by smtp.gmail.com with ESMTPSA id w136sm2050529oif.14.2020.08.31.20.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 20:36:52 -0700 (PDT) Date: Mon, 31 Aug 2020 22:36:35 -0500 From: Bjorn Andersson To: Rob Clark Subject: Re: [PATCH 02/19] iommu/arm-smmu: Pass io-pgtable config to implementation specific function Message-ID: <20200901033635.GK3715@yoga> References: <20200810222657.1841322-1-jcrouse@codeaurora.org> <20200814024114.1177553-3-robdclark@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200814024114.1177553-3-robdclark@gmail.com> Cc: Rob Clark , open list , Jonathan Marek , Will Deacon , linux-arm-msm@vger.kernel.org, Robin Murphy , dri-devel@lists.freedesktop.org, Stephen Boyd , iommu@lists.linux-foundation.org, Thierry Reding , Sibi Sankar , Vivek Gautam , Greg Kroah-Hartman , freedreno@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Thu 13 Aug 21:40 CDT 2020, Rob Clark wrote: > From: Jordan Crouse > > Construct the io-pgtable config before calling the implementation specific > init_context function and pass it so the implementation specific function > can get a chance to change it before the io-pgtable is created. > > Signed-off-by: Jordan Crouse > Signed-off-by: Rob Clark Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > drivers/iommu/arm/arm-smmu/arm-smmu-impl.c | 3 ++- > drivers/iommu/arm/arm-smmu/arm-smmu.c | 11 ++++++----- > drivers/iommu/arm/arm-smmu/arm-smmu.h | 3 ++- > 3 files changed, 10 insertions(+), 7 deletions(-) > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c b/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c > index f4ff124a1967..a9861dcd0884 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c > @@ -68,7 +68,8 @@ static int cavium_cfg_probe(struct arm_smmu_device *smmu) > return 0; > } > > -static int cavium_init_context(struct arm_smmu_domain *smmu_domain) > +static int cavium_init_context(struct arm_smmu_domain *smmu_domain, > + struct io_pgtable_cfg *pgtbl_cfg) > { > struct cavium_smmu *cs = container_of(smmu_domain->smmu, > struct cavium_smmu, smmu); > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c > index 09c42af9f31e..37d8d49299b4 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c > @@ -795,11 +795,6 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain, > cfg->asid = cfg->cbndx; > > smmu_domain->smmu = smmu; > - if (smmu->impl && smmu->impl->init_context) { > - ret = smmu->impl->init_context(smmu_domain); > - if (ret) > - goto out_unlock; > - } > > pgtbl_cfg = (struct io_pgtable_cfg) { > .pgsize_bitmap = smmu->pgsize_bitmap, > @@ -810,6 +805,12 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain, > .iommu_dev = smmu->dev, > }; > > + if (smmu->impl && smmu->impl->init_context) { > + ret = smmu->impl->init_context(smmu_domain, &pgtbl_cfg); > + if (ret) > + goto out_clear_smmu; > + } > + > if (smmu_domain->non_strict) > pgtbl_cfg.quirks |= IO_PGTABLE_QUIRK_NON_STRICT; > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.h b/drivers/iommu/arm/arm-smmu/arm-smmu.h > index d890a4a968e8..83294516ac08 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu.h > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.h > @@ -386,7 +386,8 @@ struct arm_smmu_impl { > u64 val); > int (*cfg_probe)(struct arm_smmu_device *smmu); > int (*reset)(struct arm_smmu_device *smmu); > - int (*init_context)(struct arm_smmu_domain *smmu_domain); > + int (*init_context)(struct arm_smmu_domain *smmu_domain, > + struct io_pgtable_cfg *cfg); > void (*tlb_sync)(struct arm_smmu_device *smmu, int page, int sync, > int status); > int (*def_domain_type)(struct device *dev); > -- > 2.26.2 > _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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 X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9990C433E6 for ; Tue, 1 Sep 2020 03:38:27 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 A4C94206FA for ; Tue, 1 Sep 2020 03:38:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="wgR3cIHO"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="t88wyukF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A4C94206FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0SmSq/NFUIluHgLAWGsl9ZA5/HGcT+ojVeJOhEGvs5U=; b=wgR3cIHOW/yK6YsP66NoIT38P W+Gi+24+Kn4fa2tlofRjmvNU0VHnxx65FnL3jn9+ZoDREN8Cv04/SXHR74k5QfSi+Jertn0a4S6Yx szpEJMQvf0g3h9Cwvzqmp82bvuwyoHAcQlq5yoDP7G8gAbBbSrlmgRvRxi+aZGQKqomdwMqoTgDeQ qoFa0FWrGEV/NdX3s7cjifgYCrSFKdBV/uUpmUfjRxDWRstbP6T6rHDU4iawLKZclDIxooUpyXoMr NKs1ydjYwuujDfmkwADHXsOcE7Jn2c3YbuYpa9ZE6ViKMIALWGANh141EBN3wrcZnYtwpY2/nq4N5 dPBVjIDuQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCx6P-0003Vj-NZ; Tue, 01 Sep 2020 03:36:57 +0000 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCx6M-0003VO-Vr for linux-arm-kernel@lists.infradead.org; Tue, 01 Sep 2020 03:36:56 +0000 Received: by mail-oi1-x244.google.com with SMTP id z195so2972601oia.6 for ; Mon, 31 Aug 2020 20:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3bbR697W940r4qzYtPEkaaefcfDcXbIb27x0eRbQn1Q=; b=t88wyukFrGBP19mHYjYTWsz3cjpW6QpEg7Ltbz+G5xqv1PsMrwfuqtT+tsBMRaFiAe 4gPWkDGMc/WT3t+OYUgDhDsySC1lQoBqPFXqCkKy/yNF7uKG0CBKbSLjEcYi8r99wzkD zJ1uKKejvBjXEpmdvoN6S1Kw1Lszf8WchWPjqE6kBvVrLaMFqaxCLB8jHPVd05sLjn5w Sn+IUjF1T8S8Vk2Gcxs12RcZw9Hv+7upag/QjiMCAT5OFVNyus4MjWThnyDI47KSEHer iinAg7zWc3pxEuBAlyWYMLY4fj4xuriYi3LKpZ+nfuCVl8br024gHoMVW+1TKqgidBXf 4pIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3bbR697W940r4qzYtPEkaaefcfDcXbIb27x0eRbQn1Q=; b=pgauFLBwdMME4jM1DfWHexIpXFS0TvhfK4wD5X36g71OVo1NNvfmKdaI7pi9b3Dp2s u46AJu2yMB2VYD7IolFlGWC2rJWPzH6/HRyxOmZqt2Qf5UN+Mg5STpzjgmi6RQlNaols MKPdFiWxkTmGXKr/ArXJ5xH90O4/5F7gIHnyuPmALl3NaZ7xISf57aTAE2brHmq3j9J7 8PsPwqfVovksoLXRa6XYEHKaZkzZRIg8Ol73StcB3mq/h5ugR63fxurqw9lqlRj23nJ7 KO9uuOA0Vxlueks/YJCULDsK51ILLVCC+A541eCNev1PfKKdMoWMe48C6JE0HL1V6l7A bXyg== X-Gm-Message-State: AOAM53380a1EaHXg94YlBK1hQzunxbIO1yoAgP4QXU7pM3V43L9svI1Z rtlr3AhDHr0LC1xC0RRUxuFNAg== X-Google-Smtp-Source: ABdhPJzjeGy+/ZDGjjXngyiAJQe6e3aEgxmZgSoz2VhDdCQaWZ2XBv1SUodwsR+dKUEuJnH+tsgDPw== X-Received: by 2002:aca:5413:: with SMTP id i19mr16131oib.105.1598931413164; Mon, 31 Aug 2020 20:36:53 -0700 (PDT) Received: from yoga ([2605:6000:e5cb:c100:8898:14ff:fe6d:34e]) by smtp.gmail.com with ESMTPSA id w136sm2050529oif.14.2020.08.31.20.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 20:36:52 -0700 (PDT) Date: Mon, 31 Aug 2020 22:36:35 -0500 From: Bjorn Andersson To: Rob Clark Subject: Re: [PATCH 02/19] iommu/arm-smmu: Pass io-pgtable config to implementation specific function Message-ID: <20200901033635.GK3715@yoga> References: <20200810222657.1841322-1-jcrouse@codeaurora.org> <20200814024114.1177553-3-robdclark@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200814024114.1177553-3-robdclark@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200831_233655_341479_ED21A296 X-CRM114-Status: GOOD ( 22.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , Sai Prakash Ranjan , Jordan Crouse , open list , Jonathan Marek , Will Deacon , linux-arm-msm@vger.kernel.org, Joerg Roedel , Robin Murphy , dri-devel@lists.freedesktop.org, Stephen Boyd , iommu@lists.linux-foundation.org, Thierry Reding , Sibi Sankar , Vivek Gautam , Greg Kroah-Hartman , freedreno@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu 13 Aug 21:40 CDT 2020, Rob Clark wrote: > From: Jordan Crouse > > Construct the io-pgtable config before calling the implementation specific > init_context function and pass it so the implementation specific function > can get a chance to change it before the io-pgtable is created. > > Signed-off-by: Jordan Crouse > Signed-off-by: Rob Clark Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > drivers/iommu/arm/arm-smmu/arm-smmu-impl.c | 3 ++- > drivers/iommu/arm/arm-smmu/arm-smmu.c | 11 ++++++----- > drivers/iommu/arm/arm-smmu/arm-smmu.h | 3 ++- > 3 files changed, 10 insertions(+), 7 deletions(-) > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c b/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c > index f4ff124a1967..a9861dcd0884 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c > @@ -68,7 +68,8 @@ static int cavium_cfg_probe(struct arm_smmu_device *smmu) > return 0; > } > > -static int cavium_init_context(struct arm_smmu_domain *smmu_domain) > +static int cavium_init_context(struct arm_smmu_domain *smmu_domain, > + struct io_pgtable_cfg *pgtbl_cfg) > { > struct cavium_smmu *cs = container_of(smmu_domain->smmu, > struct cavium_smmu, smmu); > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c > index 09c42af9f31e..37d8d49299b4 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c > @@ -795,11 +795,6 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain, > cfg->asid = cfg->cbndx; > > smmu_domain->smmu = smmu; > - if (smmu->impl && smmu->impl->init_context) { > - ret = smmu->impl->init_context(smmu_domain); > - if (ret) > - goto out_unlock; > - } > > pgtbl_cfg = (struct io_pgtable_cfg) { > .pgsize_bitmap = smmu->pgsize_bitmap, > @@ -810,6 +805,12 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain, > .iommu_dev = smmu->dev, > }; > > + if (smmu->impl && smmu->impl->init_context) { > + ret = smmu->impl->init_context(smmu_domain, &pgtbl_cfg); > + if (ret) > + goto out_clear_smmu; > + } > + > if (smmu_domain->non_strict) > pgtbl_cfg.quirks |= IO_PGTABLE_QUIRK_NON_STRICT; > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.h b/drivers/iommu/arm/arm-smmu/arm-smmu.h > index d890a4a968e8..83294516ac08 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu.h > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.h > @@ -386,7 +386,8 @@ struct arm_smmu_impl { > u64 val); > int (*cfg_probe)(struct arm_smmu_device *smmu); > int (*reset)(struct arm_smmu_device *smmu); > - int (*init_context)(struct arm_smmu_domain *smmu_domain); > + int (*init_context)(struct arm_smmu_domain *smmu_domain, > + struct io_pgtable_cfg *cfg); > void (*tlb_sync)(struct arm_smmu_device *smmu, int page, int sync, > int status); > int (*def_domain_type)(struct device *dev); > -- > 2.26.2 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEE0CC433E2 for ; Tue, 1 Sep 2020 07:32:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 A7180208DB for ; Tue, 1 Sep 2020 07:32:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="t88wyukF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7180208DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D6766E7E5; Tue, 1 Sep 2020 07:32:22 +0000 (UTC) Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1022A6E56D for ; Tue, 1 Sep 2020 03:36:54 +0000 (UTC) Received: by mail-oi1-x241.google.com with SMTP id u24so2962706oic.7 for ; Mon, 31 Aug 2020 20:36:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3bbR697W940r4qzYtPEkaaefcfDcXbIb27x0eRbQn1Q=; b=t88wyukFrGBP19mHYjYTWsz3cjpW6QpEg7Ltbz+G5xqv1PsMrwfuqtT+tsBMRaFiAe 4gPWkDGMc/WT3t+OYUgDhDsySC1lQoBqPFXqCkKy/yNF7uKG0CBKbSLjEcYi8r99wzkD zJ1uKKejvBjXEpmdvoN6S1Kw1Lszf8WchWPjqE6kBvVrLaMFqaxCLB8jHPVd05sLjn5w Sn+IUjF1T8S8Vk2Gcxs12RcZw9Hv+7upag/QjiMCAT5OFVNyus4MjWThnyDI47KSEHer iinAg7zWc3pxEuBAlyWYMLY4fj4xuriYi3LKpZ+nfuCVl8br024gHoMVW+1TKqgidBXf 4pIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3bbR697W940r4qzYtPEkaaefcfDcXbIb27x0eRbQn1Q=; b=RhL/qt9CpQeS5WTLR/SYIOGdTNLN9V/pHla4X1nU0drlf4IFvZTx498Em6Tby/50TJ 43uMoMSQc8dKjZFantfnE8nlapq9ju98Q6Lx50e+ZsUlj9mbx/QkGJ21gW1BSfR0xJOF Haru+NjHQSvxqnjTeXMc/tgVFH0zWnAtGLp3FlMYfZYg4r2RJabgGUGoeWcNonS4lMb8 ZGjYH4BDvmK12bALQOi1gxo+VnXV492Ivf1K33vmbtZZXaBRajyzvmv+zTbLDRcleGK8 7JeJ26iTa9OENtrmQ4Bhhdma/o1OAWV44mhlP0DmKBobzXL58Ai0t7bLHbv3b1rhBfea rCeA== X-Gm-Message-State: AOAM533EePG7khXVq0u2wjcfRrt9a3NDOFI0ex/EydTZfX5Fl3zGfk3s nRxjvmlUNdUpu1by0b2rHzVFIA== X-Google-Smtp-Source: ABdhPJzjeGy+/ZDGjjXngyiAJQe6e3aEgxmZgSoz2VhDdCQaWZ2XBv1SUodwsR+dKUEuJnH+tsgDPw== X-Received: by 2002:aca:5413:: with SMTP id i19mr16131oib.105.1598931413164; Mon, 31 Aug 2020 20:36:53 -0700 (PDT) Received: from yoga ([2605:6000:e5cb:c100:8898:14ff:fe6d:34e]) by smtp.gmail.com with ESMTPSA id w136sm2050529oif.14.2020.08.31.20.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 20:36:52 -0700 (PDT) Date: Mon, 31 Aug 2020 22:36:35 -0500 From: Bjorn Andersson To: Rob Clark Subject: Re: [PATCH 02/19] iommu/arm-smmu: Pass io-pgtable config to implementation specific function Message-ID: <20200901033635.GK3715@yoga> References: <20200810222657.1841322-1-jcrouse@codeaurora.org> <20200814024114.1177553-3-robdclark@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200814024114.1177553-3-robdclark@gmail.com> X-Mailman-Approved-At: Tue, 01 Sep 2020 07:31:54 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , Sai Prakash Ranjan , open list , Jonathan Marek , Will Deacon , linux-arm-msm@vger.kernel.org, Joerg Roedel , Robin Murphy , dri-devel@lists.freedesktop.org, Stephen Boyd , iommu@lists.linux-foundation.org, Thierry Reding , Krishna Reddy , Sibi Sankar , Vivek Gautam , Greg Kroah-Hartman , freedreno@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu 13 Aug 21:40 CDT 2020, Rob Clark wrote: > From: Jordan Crouse > > Construct the io-pgtable config before calling the implementation specific > init_context function and pass it so the implementation specific function > can get a chance to change it before the io-pgtable is created. > > Signed-off-by: Jordan Crouse > Signed-off-by: Rob Clark Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > drivers/iommu/arm/arm-smmu/arm-smmu-impl.c | 3 ++- > drivers/iommu/arm/arm-smmu/arm-smmu.c | 11 ++++++----- > drivers/iommu/arm/arm-smmu/arm-smmu.h | 3 ++- > 3 files changed, 10 insertions(+), 7 deletions(-) > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c b/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c > index f4ff124a1967..a9861dcd0884 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c > @@ -68,7 +68,8 @@ static int cavium_cfg_probe(struct arm_smmu_device *smmu) > return 0; > } > > -static int cavium_init_context(struct arm_smmu_domain *smmu_domain) > +static int cavium_init_context(struct arm_smmu_domain *smmu_domain, > + struct io_pgtable_cfg *pgtbl_cfg) > { > struct cavium_smmu *cs = container_of(smmu_domain->smmu, > struct cavium_smmu, smmu); > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c > index 09c42af9f31e..37d8d49299b4 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c > @@ -795,11 +795,6 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain, > cfg->asid = cfg->cbndx; > > smmu_domain->smmu = smmu; > - if (smmu->impl && smmu->impl->init_context) { > - ret = smmu->impl->init_context(smmu_domain); > - if (ret) > - goto out_unlock; > - } > > pgtbl_cfg = (struct io_pgtable_cfg) { > .pgsize_bitmap = smmu->pgsize_bitmap, > @@ -810,6 +805,12 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain, > .iommu_dev = smmu->dev, > }; > > + if (smmu->impl && smmu->impl->init_context) { > + ret = smmu->impl->init_context(smmu_domain, &pgtbl_cfg); > + if (ret) > + goto out_clear_smmu; > + } > + > if (smmu_domain->non_strict) > pgtbl_cfg.quirks |= IO_PGTABLE_QUIRK_NON_STRICT; > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.h b/drivers/iommu/arm/arm-smmu/arm-smmu.h > index d890a4a968e8..83294516ac08 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu.h > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.h > @@ -386,7 +386,8 @@ struct arm_smmu_impl { > u64 val); > int (*cfg_probe)(struct arm_smmu_device *smmu); > int (*reset)(struct arm_smmu_device *smmu); > - int (*init_context)(struct arm_smmu_domain *smmu_domain); > + int (*init_context)(struct arm_smmu_domain *smmu_domain, > + struct io_pgtable_cfg *cfg); > void (*tlb_sync)(struct arm_smmu_device *smmu, int page, int sync, > int status); > int (*def_domain_type)(struct device *dev); > -- > 2.26.2 > _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel