* [RESEND PATCH v3 0/2] permit vendor specific values of unipro timeouts
[not found] <CGME20210112025940epcas2p2f27c4f5e84f7f745a64027bdba536227@epcas2p2.samsung.com>
@ 2021-01-12 2:48 ` Kiwoong Kim
2021-01-12 2:48 ` [RESEND PATCH v3 1/2] ufs: add a quirk not to use default unipro timeout values Kiwoong Kim
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Kiwoong Kim @ 2021-01-12 2:48 UTC (permalink / raw)
To: linux-scsi, alim.akhtar, avri.altman, jejb, martin.petersen,
beanhuo, asutoshd, cang, bvanassche, grant.jung, sc.suh, hy50.seo,
sh425.lee, bhoon95.kim
Cc: Kiwoong Kim
v2 -> v3: remove change ids
v1 -> v2: change some comments and rename the quirk
Kiwoong Kim (2):
ufs: add a quirk not to use default unipro timeout values
ufs: ufs-exynos: apply vendor specifics for three timeouts
drivers/scsi/ufs/ufs-exynos.c | 8 +++++++-
drivers/scsi/ufs/ufshcd.c | 40 +++++++++++++++++++++-------------------
drivers/scsi/ufs/ufshcd.h | 6 ++++++
3 files changed, 34 insertions(+), 20 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RESEND PATCH v3 1/2] ufs: add a quirk not to use default unipro timeout values
2021-01-12 2:48 ` [RESEND PATCH v3 0/2] permit vendor specific values of unipro timeouts Kiwoong Kim
@ 2021-01-12 2:48 ` Kiwoong Kim
2021-01-12 2:48 ` [RESEND PATCH v3 2/2] ufs: ufs-exynos: apply vendor specifics for three timeouts Kiwoong Kim
2021-01-12 7:38 ` [RESEND PATCH v3 0/2] permit vendor specific values of unipro timeouts Avri Altman
2 siblings, 0 replies; 5+ messages in thread
From: Kiwoong Kim @ 2021-01-12 2:48 UTC (permalink / raw)
To: linux-scsi, alim.akhtar, avri.altman, jejb, martin.petersen,
beanhuo, asutoshd, cang, bvanassche, grant.jung, sc.suh, hy50.seo,
sh425.lee, bhoon95.kim
Cc: Kiwoong Kim
Unipro specification says attribute IDs of the following
thing are vendor-specific values, so some SoCs could have
no regions at the defined addresses
- DME_LocalFC0ProtectionTimeOutVal
- DME_LocalTC0ReplayTimeOutVal
- DME_LocalAFC0ReqTimeOutVal
The following things should be set considering the compatibility
between host and device, so those values must not be fixed and
you could use reset values or vendor specific values
- PA_PWRMODEUSERDATA0
- PA_PWRMODEUSERDATA1
- PA_PWRMODEUSERDATA2
- PA_PWRMODEUSERDATA3
- PA_PWRMODEUSERDATA4
- PA_PWRMODEUSERDATA5
Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com>
---
drivers/scsi/ufs/ufshcd.c | 40 +++++++++++++++++++++-------------------
drivers/scsi/ufs/ufshcd.h | 6 ++++++
2 files changed, 27 insertions(+), 19 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 92d433d..9d3a41d 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -4153,25 +4153,27 @@ static int ufshcd_change_power_mode(struct ufs_hba *hba,
ufshcd_dme_set(hba, UIC_ARG_MIB(PA_HSSERIES),
pwr_mode->hs_rate);
- ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA0),
- DL_FC0ProtectionTimeOutVal_Default);
- ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA1),
- DL_TC0ReplayTimeOutVal_Default);
- ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA2),
- DL_AFC0ReqTimeOutVal_Default);
- ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA3),
- DL_FC1ProtectionTimeOutVal_Default);
- ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA4),
- DL_TC1ReplayTimeOutVal_Default);
- ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA5),
- DL_AFC1ReqTimeOutVal_Default);
-
- ufshcd_dme_set(hba, UIC_ARG_MIB(DME_LocalFC0ProtectionTimeOutVal),
- DL_FC0ProtectionTimeOutVal_Default);
- ufshcd_dme_set(hba, UIC_ARG_MIB(DME_LocalTC0ReplayTimeOutVal),
- DL_TC0ReplayTimeOutVal_Default);
- ufshcd_dme_set(hba, UIC_ARG_MIB(DME_LocalAFC0ReqTimeOutVal),
- DL_AFC0ReqTimeOutVal_Default);
+ if (!(hba->quirks & UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING)) {
+ ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA0),
+ DL_FC0ProtectionTimeOutVal_Default);
+ ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA1),
+ DL_TC0ReplayTimeOutVal_Default);
+ ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA2),
+ DL_AFC0ReqTimeOutVal_Default);
+ ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA3),
+ DL_FC1ProtectionTimeOutVal_Default);
+ ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA4),
+ DL_TC1ReplayTimeOutVal_Default);
+ ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA5),
+ DL_AFC1ReqTimeOutVal_Default);
+
+ ufshcd_dme_set(hba, UIC_ARG_MIB(DME_LocalFC0ProtectionTimeOutVal),
+ DL_FC0ProtectionTimeOutVal_Default);
+ ufshcd_dme_set(hba, UIC_ARG_MIB(DME_LocalTC0ReplayTimeOutVal),
+ DL_TC0ReplayTimeOutVal_Default);
+ ufshcd_dme_set(hba, UIC_ARG_MIB(DME_LocalAFC0ReqTimeOutVal),
+ DL_AFC0ReqTimeOutVal_Default);
+ }
ret = ufshcd_uic_change_pwr_mode(hba, pwr_mode->pwr_rx << 4
| pwr_mode->pwr_tx);
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 61344c4..f36f73c8 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -549,6 +549,12 @@ enum ufshcd_quirks {
*/
UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL = 1 << 12,
+ /*
+ * This quirk needs to disable unipro timeout values
+ * before power mode change
+ */
+ UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING = 1 << 13,
+
};
enum ufshcd_caps {
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [RESEND PATCH v3 2/2] ufs: ufs-exynos: apply vendor specifics for three timeouts
2021-01-12 2:48 ` [RESEND PATCH v3 0/2] permit vendor specific values of unipro timeouts Kiwoong Kim
2021-01-12 2:48 ` [RESEND PATCH v3 1/2] ufs: add a quirk not to use default unipro timeout values Kiwoong Kim
@ 2021-01-12 2:48 ` Kiwoong Kim
2021-01-12 7:38 ` [RESEND PATCH v3 0/2] permit vendor specific values of unipro timeouts Avri Altman
2 siblings, 0 replies; 5+ messages in thread
From: Kiwoong Kim @ 2021-01-12 2:48 UTC (permalink / raw)
To: linux-scsi, alim.akhtar, avri.altman, jejb, martin.petersen,
beanhuo, asutoshd, cang, bvanassche, grant.jung, sc.suh, hy50.seo,
sh425.lee, bhoon95.kim
Cc: Kiwoong Kim
Set optimized values for those timeouts
- FC0_PROTECTION_TIMER
- TC0_REPLAY_TIMER
- AFC0_REQUEST_TIMER
Exynos doesn't yet use traffic class #1.
Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com>
---
drivers/scsi/ufs/ufs-exynos.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c
index a8770ff..5ca21d1 100644
--- a/drivers/scsi/ufs/ufs-exynos.c
+++ b/drivers/scsi/ufs/ufs-exynos.c
@@ -640,6 +640,11 @@ static int exynos_ufs_pre_pwr_mode(struct ufs_hba *hba,
}
}
+ /* setting for three timeout values for traffic class #0 */
+ ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA0), 8064);
+ ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA1), 28224);
+ ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA2), 20160);
+
return 0;
out:
return ret;
@@ -1236,7 +1241,8 @@ struct exynos_ufs_drv_data exynos_ufs_drvs = {
UFSHCI_QUIRK_BROKEN_HCE |
UFSHCI_QUIRK_SKIP_RESET_INTR_AGGR |
UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR |
- UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL,
+ UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL |
+ UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING,
.opts = EXYNOS_UFS_OPT_HAS_APB_CLK_CTRL |
EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL |
EXYNOS_UFS_OPT_BROKEN_RX_SEL_IDX |
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [RESEND PATCH v3 0/2] permit vendor specific values of unipro timeouts
2021-01-12 2:48 ` [RESEND PATCH v3 0/2] permit vendor specific values of unipro timeouts Kiwoong Kim
2021-01-12 2:48 ` [RESEND PATCH v3 1/2] ufs: add a quirk not to use default unipro timeout values Kiwoong Kim
2021-01-12 2:48 ` [RESEND PATCH v3 2/2] ufs: ufs-exynos: apply vendor specifics for three timeouts Kiwoong Kim
@ 2021-01-12 7:38 ` Avri Altman
2021-01-13 2:17 ` Kiwoong Kim
2 siblings, 1 reply; 5+ messages in thread
From: Avri Altman @ 2021-01-12 7:38 UTC (permalink / raw)
To: Kiwoong Kim, linux-scsi@vger.kernel.org, alim.akhtar@samsung.com,
jejb@linux.ibm.com, martin.petersen@oracle.com,
beanhuo@micron.com, asutoshd@codeaurora.org, cang@codeaurora.org,
bvanassche@acm.org, grant.jung@samsung.com, sc.suh@samsung.com,
hy50.seo@samsung.com, sh425.lee@samsung.com,
bhoon95.kim@samsung.com
This series already got accepted and picked by Martin.
Thanks,
Avri
>
> v2 -> v3: remove change ids
> v1 -> v2: change some comments and rename the quirk
>
> Kiwoong Kim (2):
> ufs: add a quirk not to use default unipro timeout values
> ufs: ufs-exynos: apply vendor specifics for three timeouts
>
> drivers/scsi/ufs/ufs-exynos.c | 8 +++++++-
> drivers/scsi/ufs/ufshcd.c | 40 +++++++++++++++++++++-------------------
> drivers/scsi/ufs/ufshcd.h | 6 ++++++
> 3 files changed, 34 insertions(+), 20 deletions(-)
>
> --
> 2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [RESEND PATCH v3 0/2] permit vendor specific values of unipro timeouts
2021-01-12 7:38 ` [RESEND PATCH v3 0/2] permit vendor specific values of unipro timeouts Avri Altman
@ 2021-01-13 2:17 ` Kiwoong Kim
0 siblings, 0 replies; 5+ messages in thread
From: Kiwoong Kim @ 2021-01-13 2:17 UTC (permalink / raw)
To: 'Avri Altman', linux-scsi
> This series already got accepted and picked by Martin. alim.akhtar@samsung.com
>
> Thanks,
> Avri
Hm. I tried to find it but failed.
Could you share where his comment is with me?
Thanks.
Kiwoong Kim
>
> >
> > v2 -> v3: remove change ids
> > v1 -> v2: change some comments and rename the quirk
> >
> > Kiwoong Kim (2):
> > ufs: add a quirk not to use default unipro timeout values
> > ufs: ufs-exynos: apply vendor specifics for three timeouts
> >
> > drivers/scsi/ufs/ufs-exynos.c | 8 +++++++-
> > drivers/scsi/ufs/ufshcd.c | 40 +++++++++++++++++++++----------------
> ---
> > drivers/scsi/ufs/ufshcd.h | 6 ++++++
> > 3 files changed, 34 insertions(+), 20 deletions(-)
> >
> > --
> > 2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-01-13 2:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20210112025940epcas2p2f27c4f5e84f7f745a64027bdba536227@epcas2p2.samsung.com>
2021-01-12 2:48 ` [RESEND PATCH v3 0/2] permit vendor specific values of unipro timeouts Kiwoong Kim
2021-01-12 2:48 ` [RESEND PATCH v3 1/2] ufs: add a quirk not to use default unipro timeout values Kiwoong Kim
2021-01-12 2:48 ` [RESEND PATCH v3 2/2] ufs: ufs-exynos: apply vendor specifics for three timeouts Kiwoong Kim
2021-01-12 7:38 ` [RESEND PATCH v3 0/2] permit vendor specific values of unipro timeouts Avri Altman
2021-01-13 2:17 ` Kiwoong Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox