Skip to contentSkip to conversation

iommu: dart: DART_T8110_ERROR range should be 0 to 5

PATCH Superseded Eric Curtin 2 participants 3 messages Jan 30, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu: dart: DART_T8110_ERROR range should be 0 to 5

This was detected by smatch as one "else if" statement could never be reached. Confirmed bit order by comparing with python implementation [1].

drivers/iommu/apple-dart.c:991 apple_dart_t8110_irq()
warn: duplicate check 'error_code == ((((1))) << (3))'
(previous on line 989)

Fixes d8bcc870d99d ("iommu: dart: Add t8110 DART support")
---
 drivers/iommu/apple-dart.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iommu/apple-dart.c +3 -3
index efe877842f72..3adacf4094d7 100644
@@ -112,15 +112,15 @@
 
 #define DART_T8110_ERROR_MASK 0x104
 
-#define DART_T8110_ERROR_READ_FAULT BIT(4)
-#define DART_T8110_ERROR_WRITE_FAULT BIT(3)
+#define DART_T8110_ERROR_READ_FAULT BIT(5)
+#define DART_T8110_ERROR_WRITE_FAULT BIT(4)
 #define DART_T8110_ERROR_NO_PTE BIT(3)
 #define DART_T8110_ERROR_NO_PMD BIT(2)
 #define DART_T8110_ERROR_NO_PGD BIT(1)
 #define DART_T8110_ERROR_NO_TTBR BIT(0)
 
 #define DART_T8110_ERROR_ADDR_LO 0x170
-#define DART_T8110_ERROR_ADDR_HI 0x174
+#define DART_T8110_ERROR_ADDR_HI 0x175
 
 #define DART_T8110_PROTECT 0x200
 #define DART_T8110_UNPROTECT 0x204
Signature · 1 line
2.39.1
#1 lore raw

Hi,

Quoted 21 lines · Eric Curtin

This was detected by smatch as one "else if" statement could never be reached. Confirmed bit order by comparing with python implementation [1].

drivers/iommu/apple-dart.c:991 apple_dart_t8110_irq()
warn: duplicate check 'error_code == ((((1))) << (3))'
(previous on line 989)

Fixes d8bcc870d99d ("iommu: dart: Add t8110 DART support")
---
 drivers/iommu/apple-dart.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iommu/apple-dart.c +0 -0
index efe877842f72..3adacf4094d7 100644

drivers/iommu/apple-dart.c line 116

Quoted 7 lines
drivers/iommu/apple-dart.c +2 -2
@@ -112,15 +112,15 @@
 
 #define DART_T8110_ERROR_MASK 0x104
 
-#define DART_T8110_ERROR_READ_FAULT BIT(4)
-#define DART_T8110_ERROR_WRITE_FAULT BIT(3)
+#define DART_T8110_ERROR_READ_FAULT BIT(5)
+#define DART_T8110_ERROR_WRITE_FAULT BIT(4)

this looks good!

drivers/iommu/apple-dart.c line 123

Quoted 8 lines
drivers/iommu/apple-dart.c +1 -1
 #define DART_T8110_ERROR_NO_PTE BIT(3)
 #define DART_T8110_ERROR_NO_PMD BIT(2)
 #define DART_T8110_ERROR_NO_PGD BIT(1)
 #define DART_T8110_ERROR_NO_TTBR BIT(0)
 
 #define DART_T8110_ERROR_ADDR_LO 0x170
-#define DART_T8110_ERROR_ADDR_HI 0x174
+#define DART_T8110_ERROR_ADDR_HI 0x175

this doesn't. 0x174 already is the correct offset.

Thanks,

Sven

#2 lore raw
In reply to Eric Curtin

Hi,

Quoted 21 lines · Eric Curtin

This was detected by smatch as one "else if" statement could never be reached. Confirmed bit order by comparing with python implementation [1].

drivers/iommu/apple-dart.c:991 apple_dart_t8110_irq()
warn: duplicate check 'error_code == ((((1))) << (3))'
(previous on line 989)

Fixes d8bcc870d99d ("iommu: dart: Add t8110 DART support")
---
 drivers/iommu/apple-dart.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iommu/apple-dart.c +0 -0
index efe877842f72..3adacf4094d7 100644

drivers/iommu/apple-dart.c line 116

Quoted 7 lines
drivers/iommu/apple-dart.c +2 -2
@@ -112,15 +112,15 @@
 
 #define DART_T8110_ERROR_MASK 0x104
 
-#define DART_T8110_ERROR_READ_FAULT BIT(4)
-#define DART_T8110_ERROR_WRITE_FAULT BIT(3)
+#define DART_T8110_ERROR_READ_FAULT BIT(5)
+#define DART_T8110_ERROR_WRITE_FAULT BIT(4)

this looks good!

drivers/iommu/apple-dart.c line 123

Quoted 8 lines
drivers/iommu/apple-dart.c +1 -1
 #define DART_T8110_ERROR_NO_PTE BIT(3)
 #define DART_T8110_ERROR_NO_PMD BIT(2)
 #define DART_T8110_ERROR_NO_PGD BIT(1)
 #define DART_T8110_ERROR_NO_TTBR BIT(0)
 
 #define DART_T8110_ERROR_ADDR_LO 0x170
-#define DART_T8110_ERROR_ADDR_HI 0x174
+#define DART_T8110_ERROR_ADDR_HI 0x175

this doesn't. 0x174 already is the correct offset.

Thanks,

Sven

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel