From patchwork Fri May 30 11:20:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hiroshi Doyu X-Patchwork-Id: 354083 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 075A91400D6 for ; Fri, 30 May 2014 21:20:51 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754565AbaE3LUr (ORCPT ); Fri, 30 May 2014 07:20:47 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:3683 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753504AbaE3LUp (ORCPT ); Fri, 30 May 2014 07:20:45 -0400 Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com id ; Fri, 30 May 2014 04:20:35 -0700 Received: from hqemhub01.nvidia.com ([172.20.12.94]) by hqnvupgp07.nvidia.com (PGP Universal service); Fri, 30 May 2014 04:13:32 -0700 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Fri, 30 May 2014 04:13:32 -0700 Received: from deemhub02.nvidia.com (10.21.69.138) by hqemhub01.nvidia.com (172.20.150.30) with Microsoft SMTP Server (TLS) id 8.3.342.0; Fri, 30 May 2014 04:20:45 -0700 Received: from oreo.nvidia.com (10.21.65.27) by deemhub02.nvidia.com (10.21.69.138) with Microsoft SMTP Server (TLS) id 8.3.342.0; Fri, 30 May 2014 13:20:42 +0200 From: Hiroshi Doyu To: Subject: [PATCHv8 11/21] iommu/tegra: smmu: Rename hwgrp -> swgroups Date: Fri, 30 May 2014 14:20:24 +0300 Message-ID: <1401448834-32659-12-git-send-email-hdoyu@nvidia.com> X-Mailer: git-send-email 2.0.0.rc1.15.g7e76a2f In-Reply-To: <1401448834-32659-1-git-send-email-hdoyu@nvidia.com> References: <1401448834-32659-1-git-send-email-hdoyu@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Use the correct term for SWGROUP related variables and macros. The term "swgroup" is the collection of "memory client". A "memory client" usually represents a HardWare Accelerator(HWA) like GPU. Sometimes a strut device can belong to multiple "swgroup" so that "swgroup's'" is used here. This "swgroups" is the term used in Tegra TRM. Rename along with TRM. Signed-off-by: Hiroshi Doyu --- drivers/iommu/tegra-smmu.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index caa531cb1c50..5cb0e2a2b267 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -179,12 +179,12 @@ enum { #define NUM_SMMU_REG_BANKS 3 -#define smmu_client_enable_hwgrp(c, m) smmu_client_set_hwgrp(c, m, 1) -#define smmu_client_disable_hwgrp(c) smmu_client_set_hwgrp(c, 0, 0) -#define __smmu_client_enable_hwgrp(c, m) __smmu_client_set_hwgrp(c, m, 1) -#define __smmu_client_disable_hwgrp(c) __smmu_client_set_hwgrp(c, 0, 0) +#define smmu_client_enable_swgroups(c, m) smmu_client_set_swgroups(c, m, 1) +#define smmu_client_disable_swgroups(c) smmu_client_set_swgroups(c, 0, 0) +#define __smmu_client_enable_swgroups(c, m) __smmu_client_set_swgroups(c, m, 1) +#define __smmu_client_disable_swgroups(c) __smmu_client_set_swgroups(c, 0, 0) -#define HWGRP_ASID_REG(x) ((x) * sizeof(u32) + SMMU_ASID_BASE) +#define SWGROUPS_ASID_REG(x) ((x) * sizeof(u32) + SMMU_ASID_BASE) /* * Per client for address space @@ -195,7 +195,7 @@ struct smmu_client { struct device *dev; struct list_head list; struct smmu_as *as; - unsigned long hwgrp[2]; + unsigned long swgroups[2]; }; /* @@ -377,7 +377,7 @@ static int register_smmu_client(struct smmu_device *smmu, client->dev = dev; client->of_node = dev->of_node; - memcpy(client->hwgrp, swgroups, sizeof(u64)); + memcpy(client->swgroups, swgroups, sizeof(u64)); return insert_smmu_client(smmu, client); } @@ -402,7 +402,7 @@ static int smmu_of_get_swgroups(struct device *dev, unsigned long *swgroups) return -ENODEV; } -static int __smmu_client_set_hwgrp(struct smmu_client *c, +static int __smmu_client_set_swgroups(struct smmu_client *c, unsigned long *map, int on) { int i; @@ -411,10 +411,10 @@ static int __smmu_client_set_hwgrp(struct smmu_client *c, struct smmu_device *smmu = as->smmu; if (!on) - map = c->hwgrp; + map = c->swgroups; for_each_set_bit(i, map, TEGRA_SWGROUP_MAX) { - offs = HWGRP_ASID_REG(i); + offs = SWGROUPS_ASID_REG(i); val = smmu_read(smmu, offs); if (on) { if (val) { @@ -424,7 +424,7 @@ static int __smmu_client_set_hwgrp(struct smmu_client *c, } val = mask; - memcpy(c->hwgrp, map, sizeof(u64)); + memcpy(c->swgroups, map, sizeof(u64)); } else { WARN_ON((val & mask) == mask); val &= ~mask; @@ -437,7 +437,7 @@ skip: return 0; } -static int smmu_client_set_hwgrp(struct smmu_client *c, +static int smmu_client_set_swgroups(struct smmu_client *c, unsigned long *map, int on) { int err; @@ -446,7 +446,7 @@ static int smmu_client_set_hwgrp(struct smmu_client *c, struct smmu_device *smmu = as->smmu; spin_lock_irqsave(&smmu->lock, flags); - err = __smmu_client_set_hwgrp(c, map, on); + err = __smmu_client_set_swgroups(c, map, on); spin_unlock_irqrestore(&smmu->lock, flags); return err; } @@ -486,7 +486,7 @@ static int smmu_setup_regs(struct smmu_device *smmu) smmu_write(smmu, val, SMMU_PTB_DATA); list_for_each_entry(c, &as->client, list) - __smmu_client_set_hwgrp(c, c->hwgrp, 1); + __smmu_client_set_swgroups(c, c->swgroups, 1); } smmu_write(smmu, smmu->translation_enable_0, SMMU_TRANSLATION_ENABLE_0); @@ -814,7 +814,7 @@ static int smmu_iommu_attach_dev(struct iommu_domain *domain, return -ENOMEM; client->as = as; - err = smmu_client_enable_hwgrp(client, client->hwgrp); + err = smmu_client_enable_swgroups(client, client->swgroups); if (err) return -EINVAL; @@ -834,7 +834,7 @@ static int smmu_iommu_attach_dev(struct iommu_domain *domain, * Reserve "page zero" for AVP vectors using a common dummy * page. */ - if (test_bit(TEGRA_SWGROUP_AVPC, client->hwgrp)) { + if (test_bit(TEGRA_SWGROUP_AVPC, client->swgroups)) { struct page *page; page = as->smmu->avp_vector_page; @@ -847,7 +847,7 @@ static int smmu_iommu_attach_dev(struct iommu_domain *domain, return 0; err_client: - smmu_client_disable_hwgrp(client); + smmu_client_disable_swgroups(client); spin_unlock(&as->client_lock); return err; } @@ -863,7 +863,7 @@ static void smmu_iommu_detach_dev(struct iommu_domain *domain, list_for_each_entry(c, &as->client, list) { if (c->dev == dev) { - smmu_client_disable_hwgrp(c); + smmu_client_disable_swgroups(c); list_del(&c->list); c->as = NULL; dev_dbg(smmu->dev,