Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 704876da authored by c_ppvk's avatar c_ppvk
Browse files

mmc: core: Add a new debugfs entry.



Added a new debugfs entry to support for crashing
the system upon an error.
The default value of this debugfs entry is 'N'.
This  need to set true('Y'), to crash upon an error.

Path to this debugfs entry to echo 'Y'/'N' is
/sys/kernel/debug/mmc0/crash_on_err for eMMC and
/sys/kernle/debug/mmc1/crash_on_err for SD card.

Change-Id: Ie7c79fb235b4882d73bb10193930418bd614ceaa
Signed-off-by: default avatarPradeep P V K <ppvk@codeaurora.org>
parent bb84735e
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -496,6 +496,11 @@ void mmc_add_host_debugfs(struct mmc_host *host)
		&host->cmdq_thist_enabled))
		&host->cmdq_thist_enabled))
		goto err_node;
		goto err_node;


	if (!debugfs_create_bool("crash_on_err",
		0600, root,
		&host->crash_on_err))
		goto err_node;

#ifdef CONFIG_MMC_RING_BUFFER
#ifdef CONFIG_MMC_RING_BUFFER
	if (!debugfs_create_file("ring_buffer", 0400,
	if (!debugfs_create_file("ring_buffer", 0400,
				root, host, &mmc_ring_buffer_fops))
				root, host, &mmc_ring_buffer_fops))
+3 −0
Original line number Original line Diff line number Diff line
@@ -157,6 +157,9 @@ void sdhci_dumpregs(struct sdhci_host *host)
		host->ops->dump_vendor_regs(host);
		host->ops->dump_vendor_regs(host);
	sdhci_dump_state(host);
	sdhci_dump_state(host);
	SDHCI_DUMP("============================================\n");
	SDHCI_DUMP("============================================\n");
	/* crash the system upon setting this debugfs. */
	if (host->mmc->crash_on_err)
		BUG_ON(1);
}
}
EXPORT_SYMBOL_GPL(sdhci_dumpregs);
EXPORT_SYMBOL_GPL(sdhci_dumpregs);


+1 −0
Original line number Original line Diff line number Diff line
@@ -710,6 +710,7 @@ struct mmc_host {
	atomic_t rpmb_req_pending;
	atomic_t rpmb_req_pending;
	struct mutex		rpmb_req_mutex;
	struct mutex		rpmb_req_mutex;
	unsigned long		private[0] ____cacheline_aligned;
	unsigned long		private[0] ____cacheline_aligned;
	bool crash_on_err;  /* crash the system on error */
};
};


struct device_node;
struct device_node;