Skip to content

Commit beb4e1e

Browse files
ausyskingregkh
authored andcommitted
mei: restrict vtag support to hbm version 2.2
The vtag allows partitioning the mei messages into virtual groups/channels. Vtags are supported for firmwares with HBM version 2.2 and newer and only when a firmware confirms the support via capability handshake. This change only define vtag restrictions in order to make the series bisectable. Everything will be enabled when driver HBM version is set to 2.2. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Link: https://lore.kernel.org/r/20200818115147.2567012-3-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e5cab1f commit beb4e1e

4 files changed

Lines changed: 27 additions & 0 deletions

File tree

‎drivers/misc/mei/debugfs.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ static int mei_dbgfs_devstate_show(struct seq_file *m, void *unused)
103103
seq_printf(m, "\tFA: %01d\n", dev->hbm_f_fa_supported);
104104
seq_printf(m, "\tOS: %01d\n", dev->hbm_f_os_supported);
105105
seq_printf(m, "\tDR: %01d\n", dev->hbm_f_dr_supported);
106+
seq_printf(m, "\tVT: %01d\n", dev->hbm_f_vt_supported);
106107
seq_printf(m, "\tCAP: %01d\n", dev->hbm_f_cap_supported);
107108
}
108109

‎drivers/misc/mei/hbm.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ static int mei_hbm_capabilities_req(struct mei_device *dev)
342342

343343
memset(&req, 0, sizeof(req));
344344
req.hbm_cmd = MEI_HBM_CAPABILITIES_REQ_CMD;
345+
if (dev->hbm_f_vt_supported)
346+
req.capability_requested[0] = HBM_CAP_VT;
345347

346348
ret = mei_hbm_write_message(dev, &mei_hdr, &req);
347349
if (ret) {
@@ -1074,6 +1076,14 @@ static void mei_hbm_config_features(struct mei_device *dev)
10741076
dev->version.minor_version >= HBM_MINOR_VERSION_DR))
10751077
dev->hbm_f_dr_supported = 1;
10761078

1079+
/* VTag Support */
1080+
dev->hbm_f_vt_supported = 0;
1081+
if (dev->version.major_version > HBM_MAJOR_VERSION_VT ||
1082+
(dev->version.major_version == HBM_MAJOR_VERSION_VT &&
1083+
dev->version.minor_version >= HBM_MINOR_VERSION_VT))
1084+
dev->hbm_f_vt_supported = 1;
1085+
1086+
/* Capability message Support */
10771087
dev->hbm_f_cap_supported = 0;
10781088
if (dev->version.major_version > HBM_MAJOR_VERSION_CAP ||
10791089
(dev->version.major_version == HBM_MAJOR_VERSION_CAP &&
@@ -1112,6 +1122,7 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
11121122
struct hbm_host_enum_response *enum_res;
11131123
struct hbm_dma_setup_response *dma_setup_res;
11141124
struct hbm_add_client_request *add_cl_req;
1125+
struct hbm_capability_response *capability_res;
11151126
int ret;
11161127

11171128
struct mei_hbm_cl_cmd *cl_cmd;
@@ -1214,6 +1225,10 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
12141225
return -EPROTO;
12151226
}
12161227

1228+
capability_res = (struct hbm_capability_response *)mei_msg;
1229+
if (!(capability_res->capability_granted[0] & HBM_CAP_VT))
1230+
dev->hbm_f_vt_supported = 0;
1231+
12171232
if (dev->hbm_f_dr_supported) {
12181233
if (mei_dmam_ring_alloc(dev))
12191234
dev_info(dev->dev, "running w/o dma ring\n");

‎drivers/misc/mei/hw.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@
7676
#define HBM_MINOR_VERSION_DR 1
7777
#define HBM_MAJOR_VERSION_DR 2
7878

79+
/*
80+
* MEI version with vm tag support
81+
*/
82+
#define HBM_MINOR_VERSION_VT 2
83+
#define HBM_MAJOR_VERSION_VT 2
84+
7985
/*
8086
* MEI version with capabilities message support
8187
*/
@@ -542,6 +548,9 @@ struct hbm_dma_ring_ctrl {
542548
u32 reserved4;
543549
} __packed;
544550

551+
/* virtual tag supported */
552+
#define HBM_CAP_VT BIT(0)
553+
545554
/**
546555
* struct hbm_capability_request - capability request from host to fw
547556
*

‎drivers/misc/mei/mei_dev.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ struct mei_fw_version {
426426
* @hbm_f_ie_supported : hbm feature immediate reply to enum request
427427
* @hbm_f_os_supported : hbm feature support OS ver message
428428
* @hbm_f_dr_supported : hbm feature dma ring supported
429+
* @hbm_f_vt_supported : hbm feature vtag supported
429430
* @hbm_f_cap_supported : hbm feature capabilities message supported
430431
*
431432
* @fw_ver : FW versions
@@ -511,6 +512,7 @@ struct mei_device {
511512
unsigned int hbm_f_ie_supported:1;
512513
unsigned int hbm_f_os_supported:1;
513514
unsigned int hbm_f_dr_supported:1;
515+
unsigned int hbm_f_vt_supported:1;
514516
unsigned int hbm_f_cap_supported:1;
515517

516518
struct mei_fw_version fw_ver[MEI_MAX_FW_VER_BLOCKS];

0 commit comments

Comments
 (0)