Skip to contentSkip to conversation

iommu/arm-smmu: fix incorrect use of S2CR_TYPE_SHIFT

PATCH In review Kefeng Wang 2 participants 5 messages Apr 18, 2014 – Apr 22, 2014 4 messages not in the archive IOMMU

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/arm-smmu: fix incorrect use of S2CR_TYPE_SHIFT

There is already S2CR_TYPE_TRANS in S2CR_TYPE_TRANS macro, so drop the second shift.

---
 drivers/iommu/arm-smmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/iommu/arm-smmu.c +1 -1
index 8b89e33..96755ec 100644
@@ -1167,7 +1167,7 @@ static int arm_smmu_domain_add_master(struct arm_smmu_domain *smmu_domain,
 	for (i = 0; i < master->num_streamids; ++i) {
 		u32 idx, s2cr;
 		idx = master->smrs ? master->smrs[i].idx : master->streamids[i];
-		s2cr = (S2CR_TYPE_TRANS << S2CR_TYPE_SHIFT) |
+		s2cr = S2CR_TYPE_TRANS |
 		       (smmu_domain->root_cfg.cbndx << S2CR_CBNDX_SHIFT);
 		writel_relaxed(s2cr, gr0_base + ARM_SMMU_GR0_S2CR(idx));
 	}
Signature · 1 line
1.7.1

A message that is not in the archive (sent off-list or not yet received): 1397786874-11372-1-git-send-email-wangkefeng.wang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org

#2 lore raw
Quoted 2 lines · Kefeng Wang

There is already S2CR_TYPE_TRANS in S2CR_TYPE_TRANS macro, so drop the second shift.

Typo issue, please use following patch.

Quoted 22 lines
---
 drivers/iommu/arm-smmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/iommu/arm-smmu.c +1 -1
index 8b89e33..96755ec 100644
@@ -1167,7 +1167,7 @@ static int arm_smmu_domain_add_master(struct arm_smmu_domain *smmu_domain,
 	for (i = 0; i < master->num_streamids; ++i) {
 		u32 idx, s2cr;
 		idx = master->smrs ? master->smrs[i].idx : master->streamids[i];
-		s2cr = (S2CR_TYPE_TRANS << S2CR_TYPE_SHIFT) |
+		s2cr = S2CR_TYPE_TRANS |
 		       (smmu_domain->root_cfg.cbndx << S2CR_CBNDX_SHIFT);
 		writel_relaxed(s2cr, gr0_base + ARM_SMMU_GR0_S2CR(idx));
 	}
Quoted 1 line

From bfcdbee6f5e71c561dfddf8751c4eabdca1e3a56 Mon Sep 17 00:00:00 2001

From: Kefeng Wang <[email protected]>
Date: Fri, 18 Apr 2014 10:20:48 +0800
Subject: [PATCH] iommu/arm-smmu: fix incorrect use of S2CR_TYPE_SHIFT

There is already S2CR_TYPE_SHIFT in S2CR_TYPE_TRANS macro, so drop the second shift.

---
 drivers/iommu/arm-smmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/iommu/arm-smmu.c +1 -1
index 8b89e33..96755ec 100644
@@ -1167,7 +1167,7 @@ static int arm_smmu_domain_add_master(struct arm_smmu_domain *smmu_domain,
 	for (i = 0; i < master->num_streamids; ++i) {
 		u32 idx, s2cr;
 		idx = master->smrs ? master->smrs[i].idx : master->streamids[i];
-		s2cr = (S2CR_TYPE_TRANS << S2CR_TYPE_SHIFT) |
+		s2cr = S2CR_TYPE_TRANS |
 		       (smmu_domain->root_cfg.cbndx << S2CR_CBNDX_SHIFT);
 		writel_relaxed(s2cr, gr0_base + ARM_SMMU_GR0_S2CR(idx));
 	}
Signature · 1 line
1.7.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 5 lines · Kefeng Wang
Quoted 2 lines · Kefeng Wang

There is already S2CR_TYPE_TRANS in S2CR_TYPE_TRANS macro, so drop the second shift.

Typo issue, please use following patch.

They look the same to me -- which one should I take?

Also, since S2CR_TYPE_TRANS is 0x0, this fix isn't critical, so I'll include it in my updates pull for 3.16.

Cheers,

Will

Quoted 52 lines
Quoted 11 lines
---
 drivers/iommu/arm-smmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/iommu/arm-smmu.c +0 -0
index 8b89e33..96755ec 100644

drivers/iommu/arm-smmu.c static int arm_smmu_domain_add_master(struct arm_smmu_domain *smmu_domain, · line 1173

Quoted 8 lines
drivers/iommu/arm-smmu.c +1 -1
@@ -1167,7 +1167,7 @@ static int arm_smmu_domain_add_master(struct arm_smmu_domain *smmu_domain,
 	for (i = 0; i < master->num_streamids; ++i) {
 		u32 idx, s2cr;
 		idx = master->smrs ? master->smrs[i].idx : master->streamids[i];
-		s2cr = (S2CR_TYPE_TRANS << S2CR_TYPE_SHIFT) |
+		s2cr = S2CR_TYPE_TRANS |
 		       (smmu_domain->root_cfg.cbndx << S2CR_CBNDX_SHIFT);
 		writel_relaxed(s2cr, gr0_base + ARM_SMMU_GR0_S2CR(idx));
 	}

From bfcdbee6f5e71c561dfddf8751c4eabdca1e3a56 Mon Sep 17 00:00:00 2001
From: Kefeng Wang <[email protected]>
Date: Fri, 18 Apr 2014 10:20:48 +0800
Subject: [PATCH] iommu/arm-smmu: fix incorrect use of S2CR_TYPE_SHIFT

There is already S2CR_TYPE_SHIFT in S2CR_TYPE_TRANS macro, so drop the second shift.

---
 drivers/iommu/arm-smmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/iommu/arm-smmu.c +1 -1
index 8b89e33..96755ec 100644
@@ -1167,7 +1167,7 @@ static int arm_smmu_domain_add_master(struct arm_smmu_domain *smmu_domain,
 	for (i = 0; i < master->num_streamids; ++i) {
 		u32 idx, s2cr;
 		idx = master->smrs ? master->smrs[i].idx : master->streamids[i];
-		s2cr = (S2CR_TYPE_TRANS << S2CR_TYPE_SHIFT) |
+		s2cr = S2CR_TYPE_TRANS |
 		       (smmu_domain->root_cfg.cbndx << S2CR_CBNDX_SHIFT);
 		writel_relaxed(s2cr, gr0_base + ARM_SMMU_GR0_S2CR(idx));
 	}
Signature · 1 line
1.7.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 3 lines · Will Deacon
Quoted 2 lines · Kefeng Wang
Quoted 1 line · Kefeng Wang

There is already S2CR_TYPE_TRANS in S2CR_TYPE_TRANS macro,

                     ^^^^^^^^^^^^^^^
Quoted 8 lines
Quoted 3 lines
Quoted 1 line

so drop the second shift.

Typo issue, please use following patch.

They look the same to me -- which one should I take?

Also, since S2CR_TYPE_TRANS is 0x0, this fix isn't critical, so I'll include it in my updates pull for 3.16.

OK, please use second one, thanks.

Kefeng

Quoted 60 lines

Cheers,

Will

Quoted 52 lines
Quoted 11 lines
---
 drivers/iommu/arm-smmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/iommu/arm-smmu.c +0 -0
index 8b89e33..96755ec 100644

drivers/iommu/arm-smmu.c static int arm_smmu_domain_add_master(struct arm_smmu_domain *smmu_domain, · line 1173

Quoted 8 lines
drivers/iommu/arm-smmu.c +1 -1
@@ -1167,7 +1167,7 @@ static int arm_smmu_domain_add_master(struct arm_smmu_domain *smmu_domain,
 	for (i = 0; i < master->num_streamids; ++i) {
 		u32 idx, s2cr;
 		idx = master->smrs ? master->smrs[i].idx : master->streamids[i];
-		s2cr = (S2CR_TYPE_TRANS << S2CR_TYPE_SHIFT) |
+		s2cr = S2CR_TYPE_TRANS |
 		       (smmu_domain->root_cfg.cbndx << S2CR_CBNDX_SHIFT);
 		writel_relaxed(s2cr, gr0_base + ARM_SMMU_GR0_S2CR(idx));
 	}

From bfcdbee6f5e71c561dfddf8751c4eabdca1e3a56 Mon Sep 17 00:00:00 2001
From: Kefeng Wang <[email protected]>
Date: Fri, 18 Apr 2014 10:20:48 +0800
Subject: [PATCH] iommu/arm-smmu: fix incorrect use of S2CR_TYPE_SHIFT

There is already S2CR_TYPE_SHIFT in S2CR_TYPE_TRANS macro, so drop the second shift.

---
 drivers/iommu/arm-smmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/iommu/arm-smmu.c +1 -1
index 8b89e33..96755ec 100644
@@ -1167,7 +1167,7 @@ static int arm_smmu_domain_add_master(struct arm_smmu_domain *smmu_domain,
 	for (i = 0; i < master->num_streamids; ++i) {
 		u32 idx, s2cr;
 		idx = master->smrs ? master->smrs[i].idx : master->streamids[i];
-		s2cr = (S2CR_TYPE_TRANS << S2CR_TYPE_SHIFT) |
+		s2cr = S2CR_TYPE_TRANS |
 		       (smmu_domain->root_cfg.cbndx << S2CR_CBNDX_SHIFT);
 		writel_relaxed(s2cr, gr0_base + ARM_SMMU_GR0_S2CR(idx));
 	}
Signature · 1 line
1.7.1

.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 7 lines · Kefeng Wang
Quoted 3 lines · Will Deacon
Quoted 2 lines · Kefeng Wang
Quoted 1 line · Kefeng Wang

There is already S2CR_TYPE_TRANS in S2CR_TYPE_TRANS macro,

                     ^^^^^^^^^^^^^^^
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

so drop the second shift.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Typo issue, please use following patch.

They look the same to me -- which one should I take?

Also, since S2CR_TYPE_TRANS is 0x0, this fix isn't critical, so I'll include it in my updates pull for 3.16.

OK, please use second one, thanks.

Ok, thanks.

Will