File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 92
92
/* Polling time to wait for fDeviceInit */
93
93
#define FDEVICEINIT_COMPL_TIMEOUT 1500 /* millisecs */
94
94
95
+ /* UFSHC 4.0 compliant HC support this mode, refer param_set_mcq_mode() */
96
+ static bool use_mcq_mode = true;
97
+
98
+ static int param_set_mcq_mode (const char * val , const struct kernel_param * kp )
99
+ {
100
+ int ret ;
101
+
102
+ ret = param_set_bool (val , kp );
103
+ if (ret )
104
+ return ret ;
105
+
106
+ return 0 ;
107
+ }
108
+
109
+ static const struct kernel_param_ops mcq_mode_ops = {
110
+ .set = param_set_mcq_mode ,
111
+ .get = param_get_bool ,
112
+ };
113
+
114
+ module_param_cb (use_mcq_mode , & mcq_mode_ops , & use_mcq_mode , 0644 );
115
+ MODULE_PARM_DESC (use_mcq_mode , "Control MCQ mode for controllers starting from UFSHCI 4.0. 1 - enable MCQ, 0 - disable MCQ. MCQ is enabled by default" );
116
+
95
117
#define ufshcd_toggle_vreg (_dev , _vreg , _on ) \
96
118
({ \
97
119
int _ret; \
@@ -2261,6 +2283,10 @@ static inline int ufshcd_hba_capabilities(struct ufs_hba *hba)
2261
2283
if (err )
2262
2284
dev_err (hba -> dev , "crypto setup failed\n" );
2263
2285
2286
+ hba -> mcq_sup = FIELD_GET (MASK_MCQ_SUPPORT , hba -> capabilities );
2287
+ if (!hba -> mcq_sup )
2288
+ return err ;
2289
+
2264
2290
hba -> mcq_capabilities = ufshcd_readl (hba , REG_MCQCAP );
2265
2291
hba -> ext_iid_sup = FIELD_GET (MASK_EXT_IID_SUPPORT ,
2266
2292
hba -> mcq_capabilities );
Original file line number Diff line number Diff line change @@ -843,6 +843,7 @@ struct ufs_hba_monitor {
843
843
* @complete_put: whether or not to call ufshcd_rpm_put() from inside
844
844
* ufshcd_resume_complete()
845
845
* @ext_iid_sup: is EXT_IID is supported by UFSHC
846
+ * @mcq_sup: is mcq supported by UFSHC
846
847
*/
847
848
struct ufs_hba {
848
849
void __iomem * mmio_base ;
@@ -995,6 +996,7 @@ struct ufs_hba {
995
996
u32 luns_avail ;
996
997
bool complete_put ;
997
998
bool ext_iid_sup ;
999
+ bool mcq_sup ;
998
1000
};
999
1001
1000
1002
#ifdef CONFIG_SCSI_UFS_VARIABLE_SG_ENTRY_SIZE
You can’t perform that action at this time.
0 commit comments