linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu/fsl_pamu: use physical cpu index to find the matched cpu nodes
@ 2013-11-14 19:30 Haiying Wang
  2013-11-14 22:10 ` Scott Wood
  0 siblings, 1 reply; 7+ messages in thread
From: Haiying Wang @ 2013-11-14 19:30 UTC (permalink / raw)
  To: joro, iommu, linuxppc-dev; +Cc: Varun Sethi

In the case we miss to bring up some cpus, we need to make sure we can
find the correct cpu nodes in the device tree based on the given logical
cpu index from the caller.

Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
---
 drivers/iommu/fsl_pamu.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index cba0498..a9ab57b 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -539,6 +539,7 @@ u32 get_stash_id(u32 stash_dest_hint, u32 vcpu)
 	u32 cache_level;
 	int len, found = 0;
 	int i;
+	u32 cpuid = get_hard_smp_processor_id(vcpu);
 
 	/* Fastpath, exit early if L3/CPC cache is target for stashing */
 	if (stash_dest_hint == PAMU_ATTR_CACHE_L3) {
@@ -559,7 +560,7 @@ u32 get_stash_id(u32 stash_dest_hint, u32 vcpu)
 	for_each_node_by_type(node, "cpu") {
 		prop = of_get_property(node, "reg", &len);
 		for (i = 0; i < len / sizeof(u32); i++) {
-			if (be32_to_cpup(&prop[i]) == vcpu) {
+			if (be32_to_cpup(&prop[i]) == cpuid) {
 				found = 1;
 				goto found_cpu_node;
 			}
-- 
1.7.3.1.50.g1e633

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-11-19  3:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-14 19:30 [PATCH] iommu/fsl_pamu: use physical cpu index to find the matched cpu nodes Haiying Wang
2013-11-14 22:10 ` Scott Wood
2013-11-15  3:16   ` Varun Sethi
2013-11-18 19:37     ` Scott Wood
2013-11-19  2:42       ` Varun Sethi
2013-11-19  3:04         ` Scott Wood
2013-11-19  3:09           ` Varun Sethi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).