Re: [PATCH v3 4/4] drivers: misc: Add Support for TMR Inject IP

From: Rao, Appana Durga Kedareswara
Date: Thu Sep 08 2022 - 03:07:28 EST


Hi Greg,

Thanks for the review.

On 08/09/22 11:32 am, Greg KH wrote:
On Thu, Sep 08, 2022 at 09:54:44AM +0530, Appana Durga Kedareswara rao wrote:
The Triple Modular Redundancy(TMR) provides functional fault injection by
changing selected MicroBlaze instructions, which provides the possibility
to verify that the TMR subsystem error detection and fault recovery logic
is working properly, provided sysfs entries which allow the user to inject
a fault.

Usage:
echo 1 > /sys/kernel/debug/xtmr_inject/inject_fault/inject_fault

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@xxxxxxx>
---
Changes for v3:
--> Updated the driver to use fault-injection api as suggested by Greg.
--> Updated the Kconfig to compile the driver as a module.
Changes for v2:
--> Fixed Month in the sysfs description.
--> Fixed line over 80 char in driver.
--> Replaced kstrtol with kstrtoul as suggested by Michal.
--> Added error check for xlnx,magic value.

MAINTAINERS | 6 +
drivers/misc/Kconfig | 10 ++
drivers/misc/Makefile | 1 +
drivers/misc/xilinx_tmr_inject.c | 181 +++++++++++++++++++++++++++++++
4 files changed, 198 insertions(+)
create mode 100644 drivers/misc/xilinx_tmr_inject.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 5fc5ec13985e..1207effa8e15 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13284,6 +13284,12 @@ F: Documentation/ABI/testing/sysfs-driver-xilinx-tmr-manager
F: Documentation/devicetree/bindings/misc/xlnx,tmr-manager.yaml
F: drivers/misc/xilinx_tmr_manager.c
+MICROBLAZE TMR INJECT
+M: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@xxxxxxx>
+S: Supported
+F: Documentation/devicetree/bindings/misc/xlnx,tmr-inject.yaml
+F: drivers/misc/xilinx_tmr_inject.c
+
MICROCHIP AT91 DMA DRIVERS
M: Ludovic Desroches <ludovic.desroches@xxxxxxxxxxxxx>
M: Tudor Ambarus <tudor.ambarus@xxxxxxxxxxxxx>
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 1508cc29b05a..7b1930a7f18a 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -506,6 +506,16 @@ config TMR_MANAGER
Say N here unless you know what you are doing.
+config TMR_INJECT
+ tristate "Select TMR Inject"
+ depends on TMR_MANAGER && FAULT_INJECTION

But if CONFIG_FAULT_INJECTION_DEBUG_FS is not enabled, does this driver
actually do anything? Why not just depend on that option?


Sure will fix and will post v4.

Regards,
Kedar.

thanks,

greg k-h