aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Usyskin <alexander.usyskin@intel.com>2016-02-07 16:35:42 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-07 17:47:20 -0500
commit27f476ea98ed495839662db4e3a76357bbeb1bb3 (patch)
treea2d798f854cf1f8194ae4ab1763922251cdb9436
parenta816a00ece63d16ade7e9c0ca8b5a7e4c5ea2453 (diff)
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: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/misc/mei/debugfs.c2
-rw-r--r--drivers/misc/mei/hbm.c8
-rw-r--r--drivers/misc/mei/hw.h25
-rw-r--r--drivers/misc/mei/mei_dev.h2
4 files changed, 32 insertions, 5 deletions
diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c
index 8ad406315741..c6c051b52f55 100644
--- a/drivers/misc/mei/debugfs.c
+++ b/drivers/misc/mei/debugfs.c
@@ -172,6 +172,8 @@ static ssize_t mei_dbgfs_read_devstate(struct file *fp, char __user *ubuf,
172 dev->hbm_f_pg_supported); 172 dev->hbm_f_pg_supported);
173 pos += scnprintf(buf + pos, bufsz - pos, "\tDC: %01d\n", 173 pos += scnprintf(buf + pos, bufsz - pos, "\tDC: %01d\n",
174 dev->hbm_f_dc_supported); 174 dev->hbm_f_dc_supported);
175 pos += scnprintf(buf + pos, bufsz - pos, "\tIE: %01d\n",
176 dev->hbm_f_ie_supported);
175 pos += scnprintf(buf + pos, bufsz - pos, "\tDOT: %01d\n", 177 pos += scnprintf(buf + pos, bufsz - pos, "\tDOT: %01d\n",
176 dev->hbm_f_dot_supported); 178 dev->hbm_f_dot_supported);
177 pos += scnprintf(buf + pos, bufsz - pos, "\tEV: %01d\n", 179 pos += scnprintf(buf + pos, bufsz - pos, "\tEV: %01d\n",
diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c
index 0c9310ad6136..d2798d5b0a9d 100644
--- a/drivers/misc/mei/hbm.c
+++ b/drivers/misc/mei/hbm.c
@@ -301,7 +301,10 @@ static int mei_hbm_enum_clients_req(struct mei_device *dev)
301 enum_req = (struct hbm_host_enum_request *)dev->wr_msg.data; 301 enum_req = (struct hbm_host_enum_request *)dev->wr_msg.data;
302 memset(enum_req, 0, len); 302 memset(enum_req, 0, len);
303 enum_req->hbm_cmd = HOST_ENUM_REQ_CMD; 303 enum_req->hbm_cmd = HOST_ENUM_REQ_CMD;
304 enum_req->allow_add = dev->hbm_f_dc_supported; 304 enum_req->flags |= dev->hbm_f_dc_supported ?
305 MEI_HBM_ENUM_F_ALLOW_ADD : 0;
306 enum_req->flags |= dev->hbm_f_ie_supported ?
307 MEI_HBM_ENUM_F_IMMEDIATE_ENUM : 0;
305 308
306 ret = mei_write_message(dev, mei_hdr, dev->wr_msg.data); 309 ret = mei_write_message(dev, mei_hdr, dev->wr_msg.data);
307 if (ret) { 310 if (ret) {
@@ -978,6 +981,9 @@ static void mei_hbm_config_features(struct mei_device *dev)
978 if (dev->version.major_version >= HBM_MAJOR_VERSION_DC) 981 if (dev->version.major_version >= HBM_MAJOR_VERSION_DC)
979 dev->hbm_f_dc_supported = 1; 982 dev->hbm_f_dc_supported = 1;
980 983
984 if (dev->version.major_version >= HBM_MAJOR_VERSION_IE)
985 dev->hbm_f_ie_supported = 1;
986
981 /* disconnect on connect timeout instead of link reset */ 987 /* disconnect on connect timeout instead of link reset */
982 if (dev->version.major_version >= HBM_MAJOR_VERSION_DOT) 988 if (dev->version.major_version >= HBM_MAJOR_VERSION_DOT)
983 dev->hbm_f_dot_supported = 1; 989 dev->hbm_f_dot_supported = 1;
diff --git a/drivers/misc/mei/hw.h b/drivers/misc/mei/hw.h
index 459ad596df66..9daf3f9aed25 100644
--- a/drivers/misc/mei/hw.h
+++ b/drivers/misc/mei/hw.h
@@ -53,6 +53,12 @@
53#define HBM_MAJOR_VERSION_DC 2 53#define HBM_MAJOR_VERSION_DC 2
54 54
55/* 55/*
56 * MEI version with immediate reply to enum request support
57 */
58#define HBM_MINOR_VERSION_IE 0
59#define HBM_MAJOR_VERSION_IE 2
60
61/*
56 * MEI version with disconnect on connection timeout support 62 * MEI version with disconnect on connection timeout support
57 */ 63 */
58#define HBM_MINOR_VERSION_DOT 0 64#define HBM_MINOR_VERSION_DOT 0
@@ -246,15 +252,26 @@ struct hbm_me_stop_request {
246} __packed; 252} __packed;
247 253
248/** 254/**
249 * struct hbm_host_enum_request - enumeration request from host to fw 255 * enum hbm_host_enum_flags - enumeration request flags (HBM version >= 2.0)
250 * 256 *
251 * @hbm_cmd: bus message command header 257 * @MEI_HBM_ENUM_F_ALLOW_ADD: allow dynamic clients add
252 * @allow_add: allow dynamic clients add HBM version >= 2.0 258 * @MEI_HBM_ENUM_F_IMMEDIATE_ENUM: allow FW to send answer immediately
259 */
260enum hbm_host_enum_flags {
261 MEI_HBM_ENUM_F_ALLOW_ADD = BIT(0),
262 MEI_HBM_ENUM_F_IMMEDIATE_ENUM = BIT(1),
263};
264
265/**
266 * struct hbm_host_enum_request - enumeration request from host to fw
267 *
268 * @hbm_cmd : bus message command header
269 * @flags : request flags
253 * @reserved: reserved 270 * @reserved: reserved
254 */ 271 */
255struct hbm_host_enum_request { 272struct hbm_host_enum_request {
256 u8 hbm_cmd; 273 u8 hbm_cmd;
257 u8 allow_add; 274 u8 flags;
258 u8 reserved[2]; 275 u8 reserved[2];
259} __packed; 276} __packed;
260 277
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
index c31adb8a0cff..2b9160e506d7 100644
--- a/drivers/misc/mei/mei_dev.h
+++ b/drivers/misc/mei/mei_dev.h
@@ -390,6 +390,7 @@ const char *mei_pg_state_str(enum mei_pg_state state);
390 * @hbm_f_dot_supported : hbm feature disconnect on timeout 390 * @hbm_f_dot_supported : hbm feature disconnect on timeout
391 * @hbm_f_ev_supported : hbm feature event notification 391 * @hbm_f_ev_supported : hbm feature event notification
392 * @hbm_f_fa_supported : hbm feature fixed address client 392 * @hbm_f_fa_supported : hbm feature fixed address client
393 * @hbm_f_ie_supported : hbm feature immediate reply to enum request
393 * 394 *
394 * @me_clients_rwsem: rw lock over me_clients list 395 * @me_clients_rwsem: rw lock over me_clients list
395 * @me_clients : list of FW clients 396 * @me_clients : list of FW clients
@@ -480,6 +481,7 @@ struct mei_device {
480 unsigned int hbm_f_dot_supported:1; 481 unsigned int hbm_f_dot_supported:1;
481 unsigned int hbm_f_ev_supported:1; 482 unsigned int hbm_f_ev_supported:1;
482 unsigned int hbm_f_fa_supported:1; 483 unsigned int hbm_f_fa_supported:1;
484 unsigned int hbm_f_ie_supported:1;
483 485
484 struct rw_semaphore me_clients_rwsem; 486 struct rw_semaphore me_clients_rwsem;
485 struct list_head me_clients; 487 struct list_head me_clients;