Merge "mmc: core: Add sysfs entry to print ring buffer"
This commit is contained in:
commit
b24a83ae61
1 changed files with 25 additions and 0 deletions
|
@ -32,6 +32,26 @@ module_param(fail_request, charp, 0);
|
||||||
#endif /* CONFIG_FAIL_MMC_REQUEST */
|
#endif /* CONFIG_FAIL_MMC_REQUEST */
|
||||||
|
|
||||||
/* The debugfs functions are optimized away when CONFIG_DEBUG_FS isn't set. */
|
/* The debugfs functions are optimized away when CONFIG_DEBUG_FS isn't set. */
|
||||||
|
static int mmc_ring_buffer_show(struct seq_file *s, void *data)
|
||||||
|
{
|
||||||
|
struct mmc_host *mmc = s->private;
|
||||||
|
|
||||||
|
mmc_dump_trace_buffer(mmc, s);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int mmc_ring_buffer_open(struct inode *inode, struct file *file)
|
||||||
|
{
|
||||||
|
return single_open(file, mmc_ring_buffer_show, inode->i_private);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct file_operations mmc_ring_buffer_fops = {
|
||||||
|
.open = mmc_ring_buffer_open,
|
||||||
|
.read = seq_read,
|
||||||
|
.llseek = seq_lseek,
|
||||||
|
.release = single_release,
|
||||||
|
};
|
||||||
|
|
||||||
static int mmc_ios_show(struct seq_file *s, void *data)
|
static int mmc_ios_show(struct seq_file *s, void *data)
|
||||||
{
|
{
|
||||||
static const char *vdd_str[] = {
|
static const char *vdd_str[] = {
|
||||||
|
@ -368,6 +388,11 @@ void mmc_add_host_debugfs(struct mmc_host *host)
|
||||||
&host->cmdq_thist_enabled))
|
&host->cmdq_thist_enabled))
|
||||||
goto err_node;
|
goto err_node;
|
||||||
|
|
||||||
|
#ifdef CONFIG_MMC_RING_BUFFER
|
||||||
|
if (!debugfs_create_file("ring_buffer", S_IRUSR,
|
||||||
|
root, host, &mmc_ring_buffer_fops))
|
||||||
|
goto err_node;
|
||||||
|
#endif
|
||||||
#ifdef CONFIG_MMC_CLKGATE
|
#ifdef CONFIG_MMC_CLKGATE
|
||||||
if (!debugfs_create_u32("clk_delay", (S_IRUSR | S_IWUSR),
|
if (!debugfs_create_u32("clk_delay", (S_IRUSR | S_IWUSR),
|
||||||
root, &host->clk_delay))
|
root, &host->clk_delay))
|
||||||
|
|
Loading…
Add table
Reference in a new issue