mei: hbm: send immediate reply flag in enum request
authorAlexander Usyskin <alexander.usyskin@intel.com>
Sun, 7 Feb 2016 21:35:42 +0000 (23:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Feb 2016 22:47:20 +0000 (14:47 -0800)
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>
drivers/misc/mei/debugfs.c
drivers/misc/mei/hbm.c
drivers/misc/mei/hw.h
drivers/misc/mei/mei_dev.h

index 8ad4063..c6c051b 100644 (file)
@@ -172,6 +172,8 @@ static ssize_t mei_dbgfs_read_devstate(struct file *fp, char __user *ubuf,
                                 dev->hbm_f_pg_supported);
                pos += scnprintf(buf + pos, bufsz - pos, "\tDC: %01d\n",
                                 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",
                                 dev->hbm_f_dot_supported);
                pos += scnprintf(buf + pos, bufsz - pos, "\tEV: %01d\n",
index 0c9310a..d2798d5 100644 (file)
@@ -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;
        memset(enum_req, 0, len);
        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);
        if (ret) {
@@ -978,6 +981,9 @@ static void mei_hbm_config_features(struct mei_device *dev)
        if (dev->version.major_version >= HBM_MAJOR_VERSION_DC)
                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 */
        if (dev->version.major_version >= HBM_MAJOR_VERSION_DOT)
                dev->hbm_f_dot_supported = 1;
index 459ad59..9daf3f9 100644 (file)
 #define HBM_MINOR_VERSION_DC               0
 #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
  */
@@ -246,15 +252,26 @@ struct hbm_me_stop_request {
 } __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
- * @allow_add: allow dynamic clients add HBM version >= 2.0
+ * @MEI_HBM_ENUM_F_ALLOW_ADD: allow dynamic clients add
+ * @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
  */
 struct hbm_host_enum_request {
        u8 hbm_cmd;
-       u8 allow_add;
+       u8 flags;
        u8 reserved[2];
 } __packed;
 
index c31adb8..2b9160e 100644 (file)
@@ -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_ev_supported  : hbm feature event notification
  * @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  : list of FW clients
@@ -480,6 +481,7 @@ struct mei_device {
        unsigned int hbm_f_dot_supported:1;
        unsigned int hbm_f_ev_supported:1;
        unsigned int hbm_f_fa_supported:1;
+       unsigned int hbm_f_ie_supported:1;
 
        struct rw_semaphore me_clients_rwsem;
        struct list_head me_clients;