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

Commit bcc5c13c authored by Asutosh Das's avatar Asutosh Das
Browse files

scsi: ufs-qcom: Add sysfs for a debug state



This sysfs entry provides the state of the driver.
If it's in debug/perf state.
This can be used by user-space scripts to toggle various tracing.

Change-Id: If0e3d8e032f60c9134bdd5ce27fe37687e67770a
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
parent ae23001f
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -68,6 +68,17 @@ config SCSI_UFSHCD_QTI
	  However, do not compile this as a module if your root file system
	  (the one containing the directory /) is located on a UFS device.

config UFS_DBG
	bool "Universal Flash Storage Debug Mode"
	depends on (SCSI_UFSHCD || SCSI_UFSHCD_QTI)
	help
	This selects the debug mode for ufs vendor driver.
	  Enables tracing for QTI ufs driver.
	  This also enables ftrace for ufs core and SCSI.
	  Enabling this would have an adverse performance impact on disk IO.

	  If unsure, say N.

config SCSI_UFSHCD_PCI
	tristate "PCI bus based UFS Controller support"
	depends on SCSI_UFSHCD && PCI
+16 −0
Original line number Diff line number Diff line
@@ -3593,12 +3593,28 @@ static ssize_t err_count_show(struct device *dev,

static DEVICE_ATTR_RO(err_count);

static ssize_t dbg_state_show(struct device *dev,
			struct device_attribute *attr, char *buf)
{
	int dbg_en = 0;

#if defined(CONFIG_UFS_DBG)
	dbg_en = 1;
#endif

	return scnprintf(buf, PAGE_SIZE, "%d\n", dbg_en);
}


static DEVICE_ATTR_RO(dbg_state);

static struct attribute *ufs_qcom_sysfs_attrs[] = {
	&dev_attr_err_state.attr,
	&dev_attr_power_mode.attr,
	&dev_attr_bus_speed_mode.attr,
	&dev_attr_clk_status.attr,
	&dev_attr_err_count.attr,
	&dev_attr_dbg_state.attr,
	NULL
};