Skip to content

Commit c2bd9fc

Browse files
Tomas Winklergregkh
authored andcommitted
mei: restrict dma ring support to hbm version 2.1
Only a firmware with version 2.1 and above supports dma ring feature. Signed-off-by: Tomas Winkler <[email protected]> Signed-off-by: Alexander Usyskin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9d89ddf commit c2bd9fc

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

drivers/misc/mei/debugfs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ static ssize_t mei_dbgfs_read_devstate(struct file *fp, char __user *ubuf,
183183
dev->hbm_f_fa_supported);
184184
pos += scnprintf(buf + pos, bufsz - pos, "\tOS: %01d\n",
185185
dev->hbm_f_os_supported);
186+
pos += scnprintf(buf + pos, bufsz - pos, "\tDR: %01d\n",
187+
dev->hbm_f_dr_supported);
186188
}
187189

188190
pos += scnprintf(buf + pos, bufsz - pos, "pg: %s, %s\n",

drivers/misc/mei/hbm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,12 @@ static void mei_hbm_config_features(struct mei_device *dev)
10071007
/* OS ver message Support */
10081008
if (dev->version.major_version >= HBM_MAJOR_VERSION_OS)
10091009
dev->hbm_f_os_supported = 1;
1010+
1011+
/* DMA Ring Support */
1012+
if (dev->version.major_version > HBM_MAJOR_VERSION_DR ||
1013+
(dev->version.major_version == HBM_MAJOR_VERSION_DR &&
1014+
dev->version.minor_version >= HBM_MINOR_VERSION_DR))
1015+
dev->hbm_f_dr_supported = 1;
10101016
}
10111017

10121018
/**

drivers/misc/mei/hw.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@
8080
#define HBM_MINOR_VERSION_OS 0
8181
#define HBM_MAJOR_VERSION_OS 2
8282

83+
/*
84+
* MEI version with dma ring support
85+
*/
86+
#define HBM_MINOR_VERSION_DR 1
87+
#define HBM_MAJOR_VERSION_DR 2
88+
8389
/* Host bus message command opcode */
8490
#define MEI_HBM_CMD_OP_MSK 0x7f
8591
/* Host bus message command RESPONSE */

drivers/misc/mei/mei_dev.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ struct mei_fw_version {
418418
* @hbm_f_fa_supported : hbm feature fixed address client
419419
* @hbm_f_ie_supported : hbm feature immediate reply to enum request
420420
* @hbm_f_os_supported : hbm feature support OS ver message
421+
* @hbm_f_dr_supported : hbm feature dma ring supported
421422
*
422423
* @fw_ver : FW versions
423424
*
@@ -495,6 +496,7 @@ struct mei_device {
495496
unsigned int hbm_f_fa_supported:1;
496497
unsigned int hbm_f_ie_supported:1;
497498
unsigned int hbm_f_os_supported:1;
499+
unsigned int hbm_f_dr_supported:1;
498500

499501
struct mei_fw_version fw_ver[MEI_MAX_FW_VER_BLOCKS];
500502

0 commit comments

Comments
 (0)