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

Commit 93da75e9 authored by Sayali Lokhande's avatar Sayali Lokhande Committed by Gerrit - the friendly Code Review server
Browse files

scsi: ufs: Add new debugfs entry to crash on ufs error



This change adds new debugfs entry to support crashing
system on UFS error. By default, it will be set to N.
To enable selective crash on ufs error:
echo Y > /sys/kernel/debug/<ufshc node>/crash_on_err

Change-Id: Ie52ef5f4fd5c9028c39b01d3fad6142a362ebabf
Signed-off-by: default avatarSayali Lokhande <sayalil@codeaurora.org>
parent 4c314540
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1767,6 +1767,12 @@ void ufsdbg_add_debugfs(struct ufs_hba *hba)
		goto err;
	}

	if (!debugfs_create_bool("crash_on_err",
		0600, hba->debugfs_files.debugfs_root,
		&hba->crash_on_err))
		goto err;


	ufsdbg_setup_fault_injection(hba);

	ufshcd_vops_add_debugfs(hba, hba->debugfs_files.debugfs_root);
+5 −0
Original line number Diff line number Diff line
@@ -5130,6 +5130,8 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd)
		ufshcd_print_pwr_info(hba);
		ufshcd_print_host_regs(hba);
		ufshcd_print_cmd_log(hba);
		if (hba->crash_on_err)
			BUG_ON(1);
	}

	ufshcd_save_tstamp_of_last_dme_cmd(hba);
@@ -7702,6 +7704,9 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
		ufshcd_print_host_state(hba);
		ufshcd_print_pwr_info(hba);
		ufshcd_print_trs(hba, 1 << tag, true);
		/* crash the system upon setting this debugfs. */
		if (hba->crash_on_err)
			BUG_ON(1);
	} else {
		ufshcd_print_trs(hba, 1 << tag, false);
	}
+1 −0
Original line number Diff line number Diff line
@@ -813,6 +813,7 @@ struct ufs_hba {
	void *priv;
	unsigned int irq;
	bool is_irq_enabled;
	bool crash_on_err;

	u32 dev_ref_clk_gating_wait;
	u32 dev_ref_clk_freq;