Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1360006
| Path | csiph.com!news.freedyn.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Magnus Damm <magnus.damm@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 07/10] iommu/ipmmu-vmsa: Write IMCTR twice |
| Date | Thu, 17 Mar 2016 17:30:03 +0100 |
| Message-ID | <rdIYb-1i1-35@gated-at.bofh.it> (permalink) |
| References | <rdIY9-1i1-5@gated-at.bofh.it> |
| X-Original-To | iommu@lists.linux-foundation.org |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=DjgYfgb72nnyrUnIu1LMbref/qG7Kqo6UBA0j6qj4NY=; b=VE6IiC1kHLRgs9QIdjJCpS26eQkPqclw6aDsk22OAgiIYUdhHiadDbbq8Nv02fxX22 Swpgqtgqkg52wG7KwSemAR31a1GaIpBx/HdT2zSoSCFVlLSOEsxZdCS5njWQEqPQDC0C KwFOMlVn0ztOVrclM7OyfZlT8tWHStHe82K1nhw15esQwi9+kmwmAVK5moFEpwlYwKH+ Lq6r2bAIwMBYbHN+blC2esmqKWF55Azcxy1wyUpj4cW+4sDlZsbkQLwVSAXDw181vREG efgiG+BotEZrhZtgvT0eKl8KCYsPXr7Z6VaAuvP4LDSveyx8i1t2zujPBFiU3vGkzTbI T1NA== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:date:message-id:in-reply-to :references:subject; bh=DjgYfgb72nnyrUnIu1LMbref/qG7Kqo6UBA0j6qj4NY=; b=PXfZo/J7xOVYcl5ESGkh+PqiqapHYDy7MJ/CP7IuaA37iVNuYTzY84HKfHZrchI2Sk DAWk6oZ96yjNn1C2LVYw7N/sZl9Y4wFLHABI04VT/h4CL2ja0HHCtT3Ldh9OK274lX6m zoloU6ib6u+5WmT/kk3ToZ8/W8ES3HHQGxehvwJ3CtHN2qIj8/1vwk7YiWX/VhIAff9B /pP8IrxcwTS5FJ+BYEPMpnpM8fKlD2otNwW3zC3N2872CYYohQCccCUpgT1EbWeU70Mq cAevTB5yB69394hAh/rpJnwERwpFgl/SdxVABgUZa08ahRBbNwQWHsaJojBT6Lff/QIF aZyQ== |
| X-Gm-Message-State | AD7BkJKahO4hXWgNO0gSQPOURowJjOEbCMIsL09Vm4FFmWwKkcJIC1teSES/H0mnmadh7w== |
| X-Received | by 10.98.42.150 with SMTP id q144mr16336764pfq.73.1458232011419; Thu, 17 Mar 2016 09:26:51 -0700 (PDT) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 57 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | laurent.pinchart+renesas@ideasonboard.com, geert+renesas@glider.be, joro@8bytes.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, horms+renesas@verge.net.au, Magnus Damm <magnus.damm@gmail.com> |
| X-Original-Date | Fri, 18 Mar 2016 01:30:14 +0900 |
| X-Original-Message-ID | <20160317163014.24104.93912.sendpatchset@little-apple> |
| X-Original-References | <20160317162909.24104.31682.sendpatchset@little-apple> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1360006 |
Show key headers only | View raw
From: Magnus Damm <damm+renesas@opensource.se>
Write IMCTR both in the root device and the leaf node.
Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---
drivers/iommu/ipmmu-vmsa.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
--- 0021/drivers/iommu/ipmmu-vmsa.c
+++ work/drivers/iommu/ipmmu-vmsa.c 2016-03-18 00:31:24.250513000 +0900
@@ -256,6 +256,16 @@ static void ipmmu_ctx_write(struct ipmmu
ipmmu_write(domain->root, domain->context_id * IM_CTX_SIZE + reg, data);
}
+static void ipmmu_ctx_write2(struct ipmmu_vmsa_domain *domain, unsigned int reg,
+ u32 data)
+{
+ if (domain->mmu != domain->root)
+ ipmmu_write(domain->mmu,
+ domain->context_id * IM_CTX_SIZE + reg, data);
+
+ ipmmu_write(domain->root, domain->context_id * IM_CTX_SIZE + reg, data);
+}
+
/* -----------------------------------------------------------------------------
* TLB and microTLB Management
*/
@@ -282,7 +292,7 @@ static void ipmmu_tlb_invalidate(struct
reg = ipmmu_ctx_read(domain, IMCTR);
reg |= IMCTR_FLUSH;
- ipmmu_ctx_write(domain, IMCTR, reg);
+ ipmmu_ctx_write2(domain, IMCTR, reg);
ipmmu_tlb_sync(domain);
}
@@ -422,7 +432,8 @@ static int ipmmu_domain_init_context(str
* software management as we have no use for it. Flush the TLB as
* required when modifying the context registers.
*/
- ipmmu_ctx_write(domain, IMCTR, IMCTR_INTEN | IMCTR_FLUSH | IMCTR_MMUEN);
+ ipmmu_ctx_write2(domain, IMCTR,
+ IMCTR_INTEN | IMCTR_FLUSH | IMCTR_MMUEN);
return 0;
}
@@ -437,7 +448,7 @@ static void ipmmu_domain_destroy_context
*
* TODO: Is TLB flush really needed ?
*/
- ipmmu_ctx_write(domain, IMCTR, IMCTR_FLUSH);
+ ipmmu_ctx_write2(domain, IMCTR, IMCTR_FLUSH);
ipmmu_tlb_sync(domain);
}
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/10] iommu/ipmmu-vmsa: Initial r8a7795 support Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 09/10] iommu/ipmmu-vmsa: Allow two bit SL0 Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 06/10] iommu/ipmmu-vmsa: Add optional root device feature Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 05/10] iommu/ipmmu-vmsa: Introduce features, break out alias Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 10/10] iommu/ipmmu-vmsa: Hook up r8a7795 DT matching code Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 07/10] iommu/ipmmu-vmsa: Write IMCTR twice Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 01/10] iommu/ipmmu-vmsa: Make use of IOMMU_OF_DECLARE() Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 03/10] iommu/ipmmu-vmsa: Teach xlate() to skip disabled iommus Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
Re: [PATCH 03/10] iommu/ipmmu-vmsa: Teach xlate() to skip disabled iommus Geert Uytterhoeven <geert@linux-m68k.org> - 2016-03-18 10:50 +0100
[PATCH 08/10] iommu/ipmmu-vmsa: Make IMBUSCTR setup optional Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 04/10] iommu/ipmmu-vmsa: IPMMU device is 64-bit bus master Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 02/10] iommu/ipmmu-vmsa: Enable multi context support Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
csiph-web