Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp711720imp; Wed, 20 Feb 2019 07:43:55 -0800 (PST) X-Google-Smtp-Source: AHgI3IYYQrzEYTtMCGp0OonOKgkt/Mc86OsduPWyAx5IFdWY3+HXfmDr80SKFX9ZeUlk1sw+Wsjx X-Received: by 2002:a17:902:70c5:: with SMTP id l5mr7628924plt.107.1550677435848; Wed, 20 Feb 2019 07:43:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550677435; cv=none; d=google.com; s=arc-20160816; b=etJRLXUTCTKmVsXFsSH4jzFR6BzFmymmFpPuQv0WmfwjWccV7/dceyv3HecjAj4ldl a6jxa3pDQcsBzoS6krjgfRgLSnFRye+A05nZihU5f/UQUzGi6tIjCVyY8G8RfqNXzLqM vGQcEO0CpDjvEjJ6+MLebCcjzCouui3WeDr5F3ycWIc07hvf/9i+GzuSdbH3DV9wfUx+ nmqIFtaTxauafePuE7R2dDtepcyW06mu88oRe5jucalvGbIFFfFgMQR/cnYgIgrG01AV K5qqwvXaoA3dqEqtLX1J5PLaJ0Zoq374kfQPTq4LY9BqtE0eFyHLQYprVY+ChxZBXsWT 50uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=W+2+gH/cnpXEdwKdhhv3BRnr86Wa/+NvrZf3p7Twjgw=; b=pXV2aaHCV8go5UlX5SSCuqwi8GxPGwdw9hyChxnYhYaydEfAyH5WoQtTX163jHYaVu qrvxKLb/peGI2bept9lnXvby6IinW4olhzQ1ClP2ufh2KQx8ker0I1k01MZHzmzFNxG9 d6DW/9pSoyfIdz/f06IBlRqQrOzzq9F97M2AooBqoV/JvRwWrlGqIE5/eExGuanSAmQy mBowDKdvDpNpBDqUapjCEo0l4lt10Xvdi60Ytpe9vQIpjFliVNDsvt9l745Sa3bXcTKu hL16ZwAtSnMhZOSZ0kIBb/q4/RzS+Kr6s84qk5WpwJOUAIvijbpLpDfxzM2CDQPI1yJi v1NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=WzFThoOI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si18737804pgc.365.2019.02.20.07.43.40; Wed, 20 Feb 2019 07:43:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=WzFThoOI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727106AbfBTPmv (ORCPT + 99 others); Wed, 20 Feb 2019 10:42:51 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:42242 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726790AbfBTPmv (ORCPT ); Wed, 20 Feb 2019 10:42:51 -0500 Received: from pendragon.ideasonboard.com (dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C29E62D1; Wed, 20 Feb 2019 16:42:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1550677368; bh=YhxvAFkolvLn268p1eu9ujULBb6L7/qCzXE6g6jrB4A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WzFThoOIH7QsN7rMzA5yA0xwV8lWzyPIE9DBOXdiT9UxkZy1apdIBzLqkgbir6iwO /wb3lTfhqjMpSXmN0wAma8XlNX0PuUrd9yJnUXuA5kMKiVc9oRS6YImAP08OScw1DF PSRbelzoyqEWtqxl05kOsdFA+x16DoHvbM3CIhyY= Date: Wed, 20 Feb 2019 17:42:44 +0200 From: Laurent Pinchart To: Geert Uytterhoeven Cc: Joerg Roedel , Magnus Damm , Laurent Pinchart , iommu@lists.linux-foundation.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/7] iommu/ipmmu-vmsa: Move num_utlbs to SoC-specific features Message-ID: <20190220154244.GJ3516@pendragon.ideasonboard.com> References: <20190220150531.2462-1-geert+renesas@glider.be> <20190220150531.2462-6-geert+renesas@glider.be> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190220150531.2462-6-geert+renesas@glider.be> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, Thank you for the patch. On Wed, Feb 20, 2019 at 04:05:29PM +0100, Geert Uytterhoeven wrote: > The maximum number of micro-TLBs per IPMMU instance is not fixed, but > depends on the SoC type. Hence move it from struct ipmmu_vmsa_device to > struct ipmmu_features, and set up the correct value for both R-Car Gen2 > and Gen3 SoCs. > > Note that currently no code uses this value. > > Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart > --- > drivers/iommu/ipmmu-vmsa.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c > index 4e3134a9a52f8d87..0a21e734466eb1bd 100644 > --- a/drivers/iommu/ipmmu-vmsa.c > +++ b/drivers/iommu/ipmmu-vmsa.c > @@ -42,6 +42,7 @@ struct ipmmu_features { > bool use_ns_alias_offset; > bool has_cache_leaf_nodes; > unsigned int number_of_contexts; > + unsigned int num_utlbs; > bool setup_imbuscr; > bool twobit_imttbcr_sl0; > bool reserved_context; > @@ -53,7 +54,6 @@ struct ipmmu_vmsa_device { > struct iommu_device iommu; > struct ipmmu_vmsa_device *root; > const struct ipmmu_features *features; > - unsigned int num_utlbs; > unsigned int num_ctx; > spinlock_t lock; /* Protects ctx and domains[] */ > DECLARE_BITMAP(ctx, IPMMU_CTX_MAX); > @@ -972,6 +972,7 @@ static const struct ipmmu_features ipmmu_features_default = { > .use_ns_alias_offset = true, > .has_cache_leaf_nodes = false, > .number_of_contexts = 1, /* software only tested with one context */ > + .num_utlbs = 32, > .setup_imbuscr = true, > .twobit_imttbcr_sl0 = false, > .reserved_context = false, > @@ -981,6 +982,7 @@ static const struct ipmmu_features ipmmu_features_rcar_gen3 = { > .use_ns_alias_offset = false, > .has_cache_leaf_nodes = true, > .number_of_contexts = 8, > + .num_utlbs = 48, > .setup_imbuscr = false, > .twobit_imttbcr_sl0 = true, > .reserved_context = true, > @@ -1033,7 +1035,6 @@ static int ipmmu_probe(struct platform_device *pdev) > } > > mmu->dev = &pdev->dev; > - mmu->num_utlbs = 48; > spin_lock_init(&mmu->lock); > bitmap_zero(mmu->ctx, IPMMU_CTX_MAX); > mmu->features = of_device_get_match_data(&pdev->dev); -- Regards, Laurent Pinchart