diff options
Diffstat (limited to 'drivers/mmc/core/debugfs.c')
-rw-r--r-- | drivers/mmc/core/debugfs.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c index 998797ed67a6..3923880118b6 100644 --- a/drivers/mmc/core/debugfs.c +++ b/drivers/mmc/core/debugfs.c | |||
@@ -7,11 +7,14 @@ | |||
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #include <linux/moduleparam.h> | ||
11 | #include <linux/export.h> | ||
10 | #include <linux/debugfs.h> | 12 | #include <linux/debugfs.h> |
11 | #include <linux/fs.h> | 13 | #include <linux/fs.h> |
12 | #include <linux/seq_file.h> | 14 | #include <linux/seq_file.h> |
13 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
14 | #include <linux/stat.h> | 16 | #include <linux/stat.h> |
17 | #include <linux/fault-inject.h> | ||
15 | 18 | ||
16 | #include <linux/mmc/card.h> | 19 | #include <linux/mmc/card.h> |
17 | #include <linux/mmc/host.h> | 20 | #include <linux/mmc/host.h> |
@@ -19,6 +22,14 @@ | |||
19 | #include "core.h" | 22 | #include "core.h" |
20 | #include "mmc_ops.h" | 23 | #include "mmc_ops.h" |
21 | 24 | ||
25 | #ifdef CONFIG_FAIL_MMC_REQUEST | ||
26 | |||
27 | static DECLARE_FAULT_ATTR(fail_default_attr); | ||
28 | static char *fail_request; | ||
29 | module_param(fail_request, charp, 0); | ||
30 | |||
31 | #endif /* CONFIG_FAIL_MMC_REQUEST */ | ||
32 | |||
22 | /* The debugfs functions are optimized away when CONFIG_DEBUG_FS isn't set. */ | 33 | /* The debugfs functions are optimized away when CONFIG_DEBUG_FS isn't set. */ |
23 | static int mmc_ios_show(struct seq_file *s, void *data) | 34 | static int mmc_ios_show(struct seq_file *s, void *data) |
24 | { | 35 | { |
@@ -113,6 +124,15 @@ static int mmc_ios_show(struct seq_file *s, void *data) | |||
113 | case MMC_TIMING_SD_HS: | 124 | case MMC_TIMING_SD_HS: |
114 | str = "sd high-speed"; | 125 | str = "sd high-speed"; |
115 | break; | 126 | break; |
127 | case MMC_TIMING_UHS_SDR50: | ||
128 | str = "sd uhs SDR50"; | ||
129 | break; | ||
130 | case MMC_TIMING_UHS_SDR104: | ||
131 | str = "sd uhs SDR104"; | ||
132 | break; | ||
133 | case MMC_TIMING_UHS_DDR50: | ||
134 | str = "sd uhs DDR50"; | ||
135 | break; | ||
116 | default: | 136 | default: |
117 | str = "invalid"; | 137 | str = "invalid"; |
118 | break; | 138 | break; |
@@ -188,6 +208,15 @@ void mmc_add_host_debugfs(struct mmc_host *host) | |||
188 | root, &host->clk_delay)) | 208 | root, &host->clk_delay)) |
189 | goto err_node; | 209 | goto err_node; |
190 | #endif | 210 | #endif |
211 | #ifdef CONFIG_FAIL_MMC_REQUEST | ||
212 | if (fail_request) | ||
213 | setup_fault_attr(&fail_default_attr, fail_request); | ||
214 | host->fail_mmc_request = fail_default_attr; | ||
215 | if (IS_ERR(fault_create_debugfs_attr("fail_mmc_request", | ||
216 | root, | ||
217 | &host->fail_mmc_request))) | ||
218 | goto err_node; | ||
219 | #endif | ||
191 | return; | 220 | return; |
192 | 221 | ||
193 | err_node: | 222 | err_node: |