From: Dolev Raviv <draviv@codeaurora.org>
To: James.Bottomley@HansenPartnership.com, hch@infradead.org
Cc: linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org,
santoshsy@gmail.com, Yaniv Gardi <ygardi@codeaurora.org>,
Dolev Raviv <draviv@codeaurora.org>
Subject: [PATCH 2/6] scsi: ufs: fix power info after link start-up
Date: Thu, 23 Oct 2014 13:25:13 +0300 [thread overview]
Message-ID: <1414059917-13831-3-git-send-email-draviv@codeaurora.org> (raw)
In-Reply-To: <1414059917-13831-1-git-send-email-draviv@codeaurora.org>
From: Yaniv Gardi <ygardi@codeaurora.org>
After link start-up power mode will always be PWM G1. This is not
reflected in the pwr_info struct which will keep the previous values.
Since ufshcd_change_power_mode() tries to avoid unnecessary power mode
change if the requested power mode and current power mode are same,
power mode change won't execute again after driver initialization.
This patch solves the problem by setting pwr_info to PWM G1 after link
start-up.
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 59b6544..77a4e38 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -2246,6 +2246,22 @@ static int ufshcd_uic_hibern8_exit(struct ufs_hba *hba)
return ret;
}
+ /**
+ * ufshcd_init_pwr_info - setting the POR (power on reset)
+ * values in hba power info
+ * @hba: per-adapter instance
+ */
+static void ufshcd_init_pwr_info(struct ufs_hba *hba)
+{
+ hba->pwr_info.gear_rx = UFS_PWM_G1;
+ hba->pwr_info.gear_tx = UFS_PWM_G1;
+ hba->pwr_info.lane_rx = 1;
+ hba->pwr_info.lane_tx = 1;
+ hba->pwr_info.pwr_rx = SLOWAUTO_MODE;
+ hba->pwr_info.pwr_tx = SLOWAUTO_MODE;
+ hba->pwr_info.hs_rate = 0;
+}
+
/**
* ufshcd_get_max_pwr_mode - reads the max power mode negotiated with device
* @hba: per-adapter instance
@@ -4118,6 +4134,8 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
if (ret)
goto out;
+ ufshcd_init_pwr_info(hba);
+
/* UniPro link is active now */
ufshcd_set_link_active(hba);
--
1.8.5.2
--
Qualcomm Israel, on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2014-10-23 10:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-23 10:25 [PATCH 0/6] various fixes for UFS-PM series Dolev Raviv
2014-10-23 10:25 ` [PATCH 1/6] scsi: ufs: fix reference counting of W-LUs Dolev Raviv
2014-10-23 10:25 ` Dolev Raviv [this message]
2014-10-23 10:25 ` [PATCH 3/6] scsi: ufs: fix static checker errors in ufshcd_system_suspend Dolev Raviv
2014-10-23 10:25 ` [PATCH 4/6] scsi: ufs: fix static checker warning in ufshcd_populate_vreg Dolev Raviv
2014-10-23 10:25 ` [PATCH 5/6] scsi: ufs: fix static checker warning in __ufshcd_setup_clocks Dolev Raviv
2014-10-23 10:25 ` [PATCH 6/6] scsi: ufs: fix static checker warning in ufshcd_parse_clock_info Dolev Raviv
2014-10-23 17:15 ` [PATCH 0/6] various fixes for UFS-PM series Christoph Hellwig
2014-10-24 7:53 ` Dolev Raviv
2014-10-24 9:22 ` Christoph Hellwig
2014-10-26 11:04 ` Dolev Raviv
2014-10-27 9:50 ` Christoph Hellwig
2014-11-20 11:19 ` Dolev Raviv
2014-11-20 11:42 ` merez
2014-11-20 16:48 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1414059917-13831-3-git-send-email-draviv@codeaurora.org \
--to=draviv@codeaurora.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=hch@infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=santoshsy@gmail.com \
--cc=ygardi@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox