diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2023-11-18 21:44:43 +0900 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2023-11-24 19:23:35 -0500 |
commit | 045da3077bc57e587d0ab4cfc8945b76af03d72d (patch) | |
tree | 46d9e9dbedf2bc031e5fce18706f18f4fc803706 /include/ufs | |
parent | edbc78a1b74c3d31dabaf3280bcee0356e744ca9 (diff) | |
download | linux-045da3077bc57e587d0ab4cfc8945b76af03d72d.tar.gz linux-045da3077bc57e587d0ab4cfc8945b76af03d72d.tar.bz2 linux-045da3077bc57e587d0ab4cfc8945b76af03d72d.zip |
scsi: ufs: core: Make fault injection dynamically configurable per HBA
The UFS driver has two driver-specific fault injection mechanisms
(trigger_eh and timeout). Each fault injection configuration can only be
specified by a module parameter and cannot be reconfigured without
reloading the driver. Also, each configuration is common to all HBAs.
This change adds the following subdirectories for each UFS HBA when
debugfs is enabled:
/sys/kernel/debug/ufshcd/<HBA>/timeout_inject
/sys/kernel/debug/ufshcd/<HBA>/trigger_eh_inject
Each fault injection attribute can be dynamically set per HBA by a
corresponding file in these directories.
This is tested with QEMU UFS devices.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Link: https://lore.kernel.org/r/20231118124443.1007116-1-akinobu.mita@gmail.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/ufs')
-rw-r--r-- | include/ufs/ufshcd.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index 7f0b2c5599cd..d862c8ddce03 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -16,6 +16,7 @@ #include <linux/blk-crypto-profile.h> #include <linux/blk-mq.h> #include <linux/devfreq.h> +#include <linux/fault-inject.h> #include <linux/msi.h> #include <linux/pm_runtime.h> #include <linux/dma-direction.h> @@ -1058,6 +1059,10 @@ struct ufs_hba { struct delayed_work debugfs_ee_work; u32 debugfs_ee_rate_limit_ms; #endif +#ifdef CONFIG_SCSI_UFS_FAULT_INJECTION + struct fault_attr trigger_eh_attr; + struct fault_attr timeout_attr; +#endif u32 luns_avail; unsigned int nr_hw_queues; unsigned int nr_queues[HCTX_MAX_TYPES]; |