Skip to contentSkip to conversation

iommu: dart: Use readl instead of readl_relaxed for consistency

PATCH Applied Sven Peter 5 participants 5 messages Nov 26, 2023 – Nov 27, 2023

Subsystems (2)
lore
Share & tools
lore

Sven Peter

author
#0 lore raw

PATCH 1/1 iommu: dart: Use readl instead of readl_relaxed for consistency

While the readl_relaxed in apple_dart_suspend is correct the rest of the driver uses the non-relaxed variants everywhere and the single readl_relaxed is inconsistent and possibly confusing.

---
 drivers/iommu/apple-dart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/apple-dart.c +1 -1
index 59cf256bf40f..c7f047ce0a7a 100644
@@ -1272,7 +1272,7 @@ static __maybe_unused int apple_dart_suspend(struct device *dev)
 	unsigned int sid, idx;
 
 	for (sid = 0; sid < dart->num_streams; sid++) {
-		dart->save_tcr[sid] = readl_relaxed(dart->regs + DART_TCR(dart, sid));
+		dart->save_tcr[sid] = readl(dart->regs + DART_TCR(dart, sid));
 		for (idx = 0; idx < dart->hw->ttbr_count; idx++)
 			dart->save_ttbr[sid][idx] =
 				readl(dart->regs + DART_TTBR(dart, sid, idx));
Signature · 1 line
2.34.1
#1 lore raw

r-b

Quoted 25 lines · Sven Peter

While the readl_relaxed in apple_dart_suspend is correct the rest of the driver uses the non-relaxed variants everywhere and the single readl_relaxed is inconsistent and possibly confusing.

---
 drivers/iommu/apple-dart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/apple-dart.c +1 -1
index 59cf256bf40f..c7f047ce0a7a 100644
@@ -1272,7 +1272,7 @@ static __maybe_unused int apple_dart_suspend(struct device *dev)
 	unsigned int sid, idx;
 
 	for (sid = 0; sid < dart->num_streams; sid++) {
-		dart->save_tcr[sid] = readl_relaxed(dart->regs + DART_TCR(dart, sid));
+		dart->save_tcr[sid] = readl(dart->regs + DART_TCR(dart, sid));
 		for (idx = 0; idx < dart->hw->ttbr_count; idx++)
 			dart->save_ttbr[sid][idx] =
 				readl(dart->regs + DART_TTBR(dart, sid, idx));
Signature · 1 line
2.34.1
reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Sven Peter
Quoted 24 lines · Sven Peter

While the readl_relaxed in apple_dart_suspend is correct the rest of the driver uses the non-relaxed variants everywhere and the single readl_relaxed is inconsistent and possibly confusing.

---
 drivers/iommu/apple-dart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/apple-dart.c +1 -2
index 59cf256bf40f..c7f047ce0a7a 100644
@@ -1272,7 +1272,7 @@ static __maybe_unused int apple_dart_suspend(struct device *dev)
        unsigned int sid, idx;
 
        for (sid = 0; sid < dart->num_streams; sid++) {
-               dart->save_tcr[sid] = readl_relaxed(dart->regs + DART_TCR(dart, sid));
+               dart->save_tcr[sid] = readl(dart->regs + DART_TCR(dart, sid));
                for (idx = 0; idx < dart->hw->ttbr_count; idx++)
                        dart->save_ttbr[sid][idx] =
                                readl(dart->regs + DART_TTBR(dart, sid, idx));
--
Quoted 3 lines

2.34.1

Signature · 1 line
真実はいつも一つ!/ Always, there's only one truth!
Acked-by on v1 1/1
#3 lore raw
In reply to Sven Peter
Quoted 14 lines · Sven Peter

While the readl_relaxed in apple_dart_suspend is correct the rest of the driver uses the non-relaxed variants everywhere and the single readl_relaxed is inconsistent and possibly confusing.

---
 drivers/iommu/apple-dart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/apple-dart.c +0 -0
index 59cf256bf40f..c7f047ce0a7a 100644

drivers/iommu/apple-dart.c static __maybe_unused int apple_dart_suspend(struct device *dev) · line 1278

Quoted 8 lines
drivers/iommu/apple-dart.c +1 -1
@@ -1272,7 +1272,7 @@ static __maybe_unused int apple_dart_suspend(struct device *dev)
 	unsigned int sid, idx;
 
 	for (sid = 0; sid < dart->num_streams; sid++) {
-		dart->save_tcr[sid] = readl_relaxed(dart->regs + DART_TCR(dart, sid));
+		dart->save_tcr[sid] = readl(dart->regs + DART_TCR(dart, sid));
 		for (idx = 0; idx < dart->hw->ttbr_count; idx++)
 			dart->save_ttbr[sid][idx] =
 				readl(dart->regs + DART_TTBR(dart, sid, idx));

- Hector

maintainer Applied
#4 lore raw
In reply to Sven Peter
Quoted 8 lines · Sven Peter

While the readl_relaxed in apple_dart_suspend is correct the rest of the driver uses the non-relaxed variants everywhere and the single readl_relaxed is inconsistent and possibly confusing.

---
 drivers/iommu/apple-dart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

In the future, can you please use "iommu/apple-dart:" as the prefix for you patch subject-lines? That fits better into the overall convention in the iommu-tree, thanks.

Regards,

Joerg