Commit 27f476ea authored by Alexander Usyskin's avatar Alexander Usyskin Committed by Greg Kroah-Hartman

mei: hbm: send immediate reply flag in enum request

Signal the FW that it can send an HBM enumeration answer immediately,
without waiting for FW initialization completion, meaning before
all the FW clients are ready and registered.

Organize enumeration response options to enum as a byproduct.
Signed-off-by: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a816a00e
...@@ -172,6 +172,8 @@ static ssize_t mei_dbgfs_read_devstate(struct file *fp, char __user *ubuf, ...@@ -172,6 +172,8 @@ static ssize_t mei_dbgfs_read_devstate(struct file *fp, char __user *ubuf,
dev->hbm_f_pg_supported); dev->hbm_f_pg_supported);
pos += scnprintf(buf + pos, bufsz - pos, "\tDC: %01d\n", pos += scnprintf(buf + pos, bufsz - pos, "\tDC: %01d\n",
dev->hbm_f_dc_supported); dev->hbm_f_dc_supported);
pos += scnprintf(buf + pos, bufsz - pos, "\tIE: %01d\n",
dev->hbm_f_ie_supported);
pos += scnprintf(buf + pos, bufsz - pos, "\tDOT: %01d\n", pos += scnprintf(buf + pos, bufsz - pos, "\tDOT: %01d\n",
dev->hbm_f_dot_supported); dev->hbm_f_dot_supported);
pos += scnprintf(buf + pos, bufsz - pos, "\tEV: %01d\n", pos += scnprintf(buf + pos, bufsz - pos, "\tEV: %01d\n",
......
...@@ -301,7 +301,10 @@ static int mei_hbm_enum_clients_req(struct mei_device *dev) ...@@ -301,7 +301,10 @@ static int mei_hbm_enum_clients_req(struct mei_device *dev)
enum_req = (struct hbm_host_enum_request *)dev->wr_msg.data; enum_req = (struct hbm_host_enum_request *)dev->wr_msg.data;
memset(enum_req, 0, len); memset(enum_req, 0, len);
enum_req->hbm_cmd = HOST_ENUM_REQ_CMD; enum_req->hbm_cmd = HOST_ENUM_REQ_CMD;
enum_req->allow_add = dev->hbm_f_dc_supported; enum_req->flags |= dev->hbm_f_dc_supported ?
MEI_HBM_ENUM_F_ALLOW_ADD : 0;
enum_req->flags |= dev->hbm_f_ie_supported ?
MEI_HBM_ENUM_F_IMMEDIATE_ENUM : 0;
ret = mei_write_message(dev, mei_hdr, dev->wr_msg.data); ret = mei_write_message(dev, mei_hdr, dev->wr_msg.data);
if (ret) { if (ret) {
...@@ -978,6 +981,9 @@ static void mei_hbm_config_features(struct mei_device *dev) ...@@ -978,6 +981,9 @@ static void mei_hbm_config_features(struct mei_device *dev)
if (dev->version.major_version >= HBM_MAJOR_VERSION_DC) if (dev->version.major_version >= HBM_MAJOR_VERSION_DC)
dev->hbm_f_dc_supported = 1; dev->hbm_f_dc_supported = 1;
if (dev->version.major_version >= HBM_MAJOR_VERSION_IE)
dev->hbm_f_ie_supported = 1;
/* disconnect on connect timeout instead of link reset */ /* disconnect on connect timeout instead of link reset */
if (dev->version.major_version >= HBM_MAJOR_VERSION_DOT) if (dev->version.major_version >= HBM_MAJOR_VERSION_DOT)
dev->hbm_f_dot_supported = 1; dev->hbm_f_dot_supported = 1;
......
...@@ -52,6 +52,12 @@ ...@@ -52,6 +52,12 @@
#define HBM_MINOR_VERSION_DC 0 #define HBM_MINOR_VERSION_DC 0
#define HBM_MAJOR_VERSION_DC 2 #define HBM_MAJOR_VERSION_DC 2
/*
* MEI version with immediate reply to enum request support
*/
#define HBM_MINOR_VERSION_IE 0
#define HBM_MAJOR_VERSION_IE 2
/* /*
* MEI version with disconnect on connection timeout support * MEI version with disconnect on connection timeout support
*/ */
...@@ -246,15 +252,26 @@ struct hbm_me_stop_request { ...@@ -246,15 +252,26 @@ struct hbm_me_stop_request {
} __packed; } __packed;
/** /**
* struct hbm_host_enum_request - enumeration request from host to fw * enum hbm_host_enum_flags - enumeration request flags (HBM version >= 2.0)
* *
* @hbm_cmd: bus message command header * @MEI_HBM_ENUM_F_ALLOW_ADD: allow dynamic clients add
* @allow_add: allow dynamic clients add HBM version >= 2.0 * @MEI_HBM_ENUM_F_IMMEDIATE_ENUM: allow FW to send answer immediately
*/
enum hbm_host_enum_flags {
MEI_HBM_ENUM_F_ALLOW_ADD = BIT(0),
MEI_HBM_ENUM_F_IMMEDIATE_ENUM = BIT(1),
};
/**
* struct hbm_host_enum_request - enumeration request from host to fw
*
* @hbm_cmd : bus message command header
* @flags : request flags
* @reserved: reserved * @reserved: reserved
*/ */
struct hbm_host_enum_request { struct hbm_host_enum_request {
u8 hbm_cmd; u8 hbm_cmd;
u8 allow_add; u8 flags;
u8 reserved[2]; u8 reserved[2];
} __packed; } __packed;
......
...@@ -390,6 +390,7 @@ const char *mei_pg_state_str(enum mei_pg_state state); ...@@ -390,6 +390,7 @@ const char *mei_pg_state_str(enum mei_pg_state state);
* @hbm_f_dot_supported : hbm feature disconnect on timeout * @hbm_f_dot_supported : hbm feature disconnect on timeout
* @hbm_f_ev_supported : hbm feature event notification * @hbm_f_ev_supported : hbm feature event notification
* @hbm_f_fa_supported : hbm feature fixed address client * @hbm_f_fa_supported : hbm feature fixed address client
* @hbm_f_ie_supported : hbm feature immediate reply to enum request
* *
* @me_clients_rwsem: rw lock over me_clients list * @me_clients_rwsem: rw lock over me_clients list
* @me_clients : list of FW clients * @me_clients : list of FW clients
...@@ -480,6 +481,7 @@ struct mei_device { ...@@ -480,6 +481,7 @@ struct mei_device {
unsigned int hbm_f_dot_supported:1; unsigned int hbm_f_dot_supported:1;
unsigned int hbm_f_ev_supported:1; unsigned int hbm_f_ev_supported:1;
unsigned int hbm_f_fa_supported:1; unsigned int hbm_f_fa_supported:1;
unsigned int hbm_f_ie_supported:1;
struct rw_semaphore me_clients_rwsem; struct rw_semaphore me_clients_rwsem;
struct list_head me_clients; struct list_head me_clients;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment