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

Commit 53f92829 authored by Sujit Reddy Thumma's avatar Sujit Reddy Thumma
Browse files

scsi: ufs: add quirk for broken power mode change



Power mode change after bootup might be broken on some of the
UFS devices. Add a quirk to bypass power mode change during bootup.

Change-Id: I04c5dfa3380f1cec8a6f431ec6661ea189b11134
Signed-off-by: default avatarSujit Reddy Thumma <sthumma@codeaurora.org>
parent 2772e97d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1806,6 +1806,9 @@ static int ufshcd_config_max_pwr_mode(struct ufs_hba *hba)
	u8 pwr[] = {FASTAUTO_MODE, FASTAUTO_MODE};
	int ret;

	if (hba->quirks & UFSHCD_QUIRK_BROKEN_PWR_MODE_CHANGE)
		return 0;

	/* Get the connected lane count */
	ufshcd_dme_get(hba, UIC_ARG_MIB(PA_CONNECTEDRXDATALANES), &lanes[RX]);
	ufshcd_dme_get(hba, UIC_ARG_MIB(PA_CONNECTEDTXDATALANES), &lanes[TX]);
+6 −0
Original line number Diff line number Diff line
@@ -307,6 +307,12 @@ struct ufs_hba {
	 * controller to have a single command at a time for the device */
	#define UFSHCD_QUIRK_BROKEN_DEVICE_Q_CMND        (1 << 4)

	/*
	 * Power mode switch is broken, the power mode will be default
	 * to PWM-G1 or the one set by bootloader.
	 */
	#define UFSHCD_QUIRK_BROKEN_PWR_MODE_CHANGE      (1 << 5)

	struct uic_command *active_uic_cmd;
	struct mutex uic_cmd_mutex;