3 * Intel Management Engine Interface (Intel MEI) Linux driver
4 * Copyright (c) 2003-2012, Intel Corporation.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 #include <linux/pci.h>
18 #include <linux/sched.h>
19 #include <linux/wait.h>
20 #include <linux/mei.h>
27 static const char *mei_cl_conn_status_str(enum mei_cl_connect_status status)
29 #define MEI_CL_CS(status) case MEI_CL_CONN_##status: return #status
33 MEI_CL_CS(ALREADY_STARTED);
34 MEI_CL_CS(OUT_OF_RESOURCES);
35 MEI_CL_CS(MESSAGE_SMALL);
36 default: return "unknown";
42 * mei_cl_conn_status_to_errno - convert client connect response
43 * status to error code
45 * @status: client connect response status
47 * returns corresponding error code
49 static int mei_cl_conn_status_to_errno(enum mei_cl_connect_status status)
52 case MEI_CL_CONN_SUCCESS: return 0;
53 case MEI_CL_CONN_NOT_FOUND: return -ENOTTY;
54 case MEI_CL_CONN_ALREADY_STARTED: return -EBUSY;
55 case MEI_CL_CONN_OUT_OF_RESOURCES: return -EBUSY;
56 case MEI_CL_CONN_MESSAGE_SMALL: return -EINVAL;
57 default: return -EINVAL;
62 * mei_hbm_me_cl_allocate - allocates storage for me clients
64 * @dev: the device structure
66 * returns 0 on success -ENOMEM on allocation failure
68 static int mei_hbm_me_cl_allocate(struct mei_device *dev)
70 struct mei_me_client *clients;
73 dev->me_clients_num = 0;
74 dev->me_client_presentation_num = 0;
75 dev->me_client_index = 0;
77 /* count how many ME clients we have */
78 for_each_set_bit(b, dev->me_clients_map, MEI_CLIENTS_MAX)
79 dev->me_clients_num++;
81 if (dev->me_clients_num == 0)
84 kfree(dev->me_clients);
85 dev->me_clients = NULL;
87 dev_dbg(&dev->pdev->dev, "memory allocation for ME clients size=%ld.\n",
88 dev->me_clients_num * sizeof(struct mei_me_client));
89 /* allocate storage for ME clients representation */
90 clients = kcalloc(dev->me_clients_num,
91 sizeof(struct mei_me_client), GFP_KERNEL);
93 dev_err(&dev->pdev->dev, "memory allocation for ME clients failed.\n");
96 dev->me_clients = clients;
101 * mei_hbm_cl_hdr - construct client hbm header
104 * @hbm_cmd: host bus message command
105 * @buf: buffer for cl header
106 * @len: buffer length
109 void mei_hbm_cl_hdr(struct mei_cl *cl, u8 hbm_cmd, void *buf, size_t len)
111 struct mei_hbm_cl_cmd *cmd = buf;
115 cmd->hbm_cmd = hbm_cmd;
116 cmd->host_addr = cl->host_client_id;
117 cmd->me_addr = cl->me_client_id;
121 * mei_hbm_cl_addr_equal - tells if they have the same address
124 * @buf: buffer with cl header
126 * returns true if addresses are the same
129 bool mei_hbm_cl_addr_equal(struct mei_cl *cl, void *buf)
131 struct mei_hbm_cl_cmd *cmd = buf;
132 return cl->host_client_id == cmd->host_addr &&
133 cl->me_client_id == cmd->me_addr;
138 * mei_hbm_idle - set hbm to idle state
140 * @dev: the device structure
142 void mei_hbm_idle(struct mei_device *dev)
144 dev->init_clients_timer = 0;
145 dev->hbm_state = MEI_HBM_IDLE;
148 int mei_hbm_start_wait(struct mei_device *dev)
151 if (dev->hbm_state > MEI_HBM_START)
154 mutex_unlock(&dev->device_lock);
155 ret = wait_event_interruptible_timeout(dev->wait_recvd_msg,
156 dev->hbm_state == MEI_HBM_IDLE ||
157 dev->hbm_state >= MEI_HBM_STARTED,
158 mei_secs_to_jiffies(MEI_HBM_TIMEOUT));
159 mutex_lock(&dev->device_lock);
161 if (ret <= 0 && (dev->hbm_state <= MEI_HBM_START)) {
162 dev->hbm_state = MEI_HBM_IDLE;
163 dev_err(&dev->pdev->dev, "waiting for mei start failed\n");
170 * mei_hbm_start_req - sends start request message.
172 * @dev: the device structure
174 * returns 0 on success and < 0 on failure
176 int mei_hbm_start_req(struct mei_device *dev)
178 struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr;
179 struct hbm_host_version_request *start_req;
180 const size_t len = sizeof(struct hbm_host_version_request);
183 mei_hbm_hdr(mei_hdr, len);
185 /* host start message */
186 start_req = (struct hbm_host_version_request *)dev->wr_msg.data;
187 memset(start_req, 0, len);
188 start_req->hbm_cmd = HOST_START_REQ_CMD;
189 start_req->host_version.major_version = HBM_MAJOR_VERSION;
190 start_req->host_version.minor_version = HBM_MINOR_VERSION;
192 dev->hbm_state = MEI_HBM_IDLE;
193 ret = mei_write_message(dev, mei_hdr, dev->wr_msg.data);
195 dev_err(&dev->pdev->dev, "version message write failed: ret = %d\n",
200 dev->hbm_state = MEI_HBM_START;
201 dev->init_clients_timer = MEI_CLIENTS_INIT_TIMEOUT;
206 * mei_hbm_enum_clients_req - sends enumeration client request message.
208 * @dev: the device structure
210 * returns 0 on success and < 0 on failure
212 static int mei_hbm_enum_clients_req(struct mei_device *dev)
214 struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr;
215 struct hbm_host_enum_request *enum_req;
216 const size_t len = sizeof(struct hbm_host_enum_request);
219 /* enumerate clients */
220 mei_hbm_hdr(mei_hdr, len);
222 enum_req = (struct hbm_host_enum_request *)dev->wr_msg.data;
223 memset(enum_req, 0, len);
224 enum_req->hbm_cmd = HOST_ENUM_REQ_CMD;
226 ret = mei_write_message(dev, mei_hdr, dev->wr_msg.data);
228 dev_err(&dev->pdev->dev, "enumeration request write failed: ret = %d.\n",
232 dev->hbm_state = MEI_HBM_ENUM_CLIENTS;
233 dev->init_clients_timer = MEI_CLIENTS_INIT_TIMEOUT;
238 * mei_hbm_prop_req - request property for a single client
240 * @dev: the device structure
242 * returns 0 on success and < 0 on failure
245 static int mei_hbm_prop_req(struct mei_device *dev)
248 struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr;
249 struct hbm_props_request *prop_req;
250 const size_t len = sizeof(struct hbm_props_request);
251 unsigned long next_client_index;
252 unsigned long client_num;
255 client_num = dev->me_client_presentation_num;
257 next_client_index = find_next_bit(dev->me_clients_map, MEI_CLIENTS_MAX,
258 dev->me_client_index);
260 /* We got all client properties */
261 if (next_client_index == MEI_CLIENTS_MAX) {
262 dev->hbm_state = MEI_HBM_STARTED;
263 schedule_work(&dev->init_work);
268 dev->me_clients[client_num].client_id = next_client_index;
269 dev->me_clients[client_num].mei_flow_ctrl_creds = 0;
271 mei_hbm_hdr(mei_hdr, len);
272 prop_req = (struct hbm_props_request *)dev->wr_msg.data;
274 memset(prop_req, 0, sizeof(struct hbm_props_request));
277 prop_req->hbm_cmd = HOST_CLIENT_PROPERTIES_REQ_CMD;
278 prop_req->address = next_client_index;
280 ret = mei_write_message(dev, mei_hdr, dev->wr_msg.data);
282 dev_err(&dev->pdev->dev, "properties request write failed: ret = %d\n",
287 dev->init_clients_timer = MEI_CLIENTS_INIT_TIMEOUT;
288 dev->me_client_index = next_client_index;
294 * mei_hbm_stop_req - send stop request message
299 * This function returns -EIO on write failure
301 static int mei_hbm_stop_req(struct mei_device *dev)
303 struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr;
304 struct hbm_host_stop_request *req =
305 (struct hbm_host_stop_request *)dev->wr_msg.data;
306 const size_t len = sizeof(struct hbm_host_stop_request);
308 mei_hbm_hdr(mei_hdr, len);
311 req->hbm_cmd = HOST_STOP_REQ_CMD;
312 req->reason = DRIVER_STOP_REQUEST;
314 return mei_write_message(dev, mei_hdr, dev->wr_msg.data);
318 * mei_hbm_cl_flow_control_req - sends flow control request.
320 * @dev: the device structure
323 * This function returns -EIO on write failure
325 int mei_hbm_cl_flow_control_req(struct mei_device *dev, struct mei_cl *cl)
327 struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr;
328 const size_t len = sizeof(struct hbm_flow_control);
330 mei_hbm_hdr(mei_hdr, len);
331 mei_hbm_cl_hdr(cl, MEI_FLOW_CONTROL_CMD, dev->wr_msg.data, len);
333 dev_dbg(&dev->pdev->dev, "sending flow control host client = %d, ME client = %d\n",
334 cl->host_client_id, cl->me_client_id);
336 return mei_write_message(dev, mei_hdr, dev->wr_msg.data);
340 * mei_hbm_add_single_flow_creds - adds single buffer credentials.
342 * @dev: the device structure
343 * @flow: flow control.
345 * return 0 on success, < 0 otherwise
347 static int mei_hbm_add_single_flow_creds(struct mei_device *dev,
348 struct hbm_flow_control *flow)
350 struct mei_me_client *me_cl;
353 id = mei_me_cl_by_id(dev, flow->me_addr);
355 dev_err(&dev->pdev->dev, "no such me client %d\n",
360 me_cl = &dev->me_clients[id];
361 if (me_cl->props.single_recv_buf) {
362 me_cl->mei_flow_ctrl_creds++;
363 dev_dbg(&dev->pdev->dev, "recv flow ctrl msg ME %d (single).\n",
365 dev_dbg(&dev->pdev->dev, "flow control credentials =%d.\n",
366 me_cl->mei_flow_ctrl_creds);
368 BUG(); /* error in flow control */
375 * mei_hbm_cl_flow_control_res - flow control response from me
377 * @dev: the device structure
378 * @flow_control: flow control response bus message
380 static void mei_hbm_cl_flow_control_res(struct mei_device *dev,
381 struct hbm_flow_control *flow_control)
385 if (!flow_control->host_addr) {
386 /* single receive buffer */
387 mei_hbm_add_single_flow_creds(dev, flow_control);
391 /* normal connection */
392 list_for_each_entry(cl, &dev->file_list, link) {
393 if (mei_hbm_cl_addr_equal(cl, flow_control)) {
394 cl->mei_flow_ctrl_creds++;
395 dev_dbg(&dev->pdev->dev, "flow ctrl msg for host %d ME %d.\n",
396 flow_control->host_addr, flow_control->me_addr);
397 dev_dbg(&dev->pdev->dev, "flow control credentials = %d.\n",
398 cl->mei_flow_ctrl_creds);
406 * mei_hbm_cl_disconnect_req - sends disconnect message to fw.
408 * @dev: the device structure
409 * @cl: a client to disconnect from
411 * This function returns -EIO on write failure
413 int mei_hbm_cl_disconnect_req(struct mei_device *dev, struct mei_cl *cl)
415 struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr;
416 const size_t len = sizeof(struct hbm_client_connect_request);
418 mei_hbm_hdr(mei_hdr, len);
419 mei_hbm_cl_hdr(cl, CLIENT_DISCONNECT_REQ_CMD, dev->wr_msg.data, len);
421 return mei_write_message(dev, mei_hdr, dev->wr_msg.data);
425 * mei_hbm_cl_disconnect_rsp - sends disconnect respose to the FW
427 * @dev: the device structure
428 * @cl: a client to disconnect from
430 * This function returns -EIO on write failure
432 int mei_hbm_cl_disconnect_rsp(struct mei_device *dev, struct mei_cl *cl)
434 struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr;
435 const size_t len = sizeof(struct hbm_client_connect_response);
437 mei_hbm_hdr(mei_hdr, len);
438 mei_hbm_cl_hdr(cl, CLIENT_DISCONNECT_RES_CMD, dev->wr_msg.data, len);
440 return mei_write_message(dev, mei_hdr, dev->wr_msg.data);
444 * mei_hbm_cl_disconnect_res - disconnect response from ME
446 * @dev: the device structure
447 * @rs: disconnect response bus message
449 static void mei_hbm_cl_disconnect_res(struct mei_device *dev,
450 struct hbm_client_connect_response *rs)
453 struct mei_cl_cb *cb, *next;
455 dev_dbg(&dev->pdev->dev, "hbm: disconnect response cl:host=%02d me=%02d status=%d\n",
456 rs->me_addr, rs->host_addr, rs->status);
458 list_for_each_entry_safe(cb, next, &dev->ctrl_rd_list.list, list) {
461 /* this should not happen */
467 if (mei_hbm_cl_addr_equal(cl, rs)) {
469 if (rs->status == MEI_CL_DISCONN_SUCCESS)
470 cl->state = MEI_FILE_DISCONNECTED;
480 * mei_hbm_cl_connect_req - send connection request to specific me client
482 * @dev: the device structure
483 * @cl: a client to connect to
485 * returns -EIO on write failure
487 int mei_hbm_cl_connect_req(struct mei_device *dev, struct mei_cl *cl)
489 struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr;
490 const size_t len = sizeof(struct hbm_client_connect_request);
492 mei_hbm_hdr(mei_hdr, len);
493 mei_hbm_cl_hdr(cl, CLIENT_CONNECT_REQ_CMD, dev->wr_msg.data, len);
495 return mei_write_message(dev, mei_hdr, dev->wr_msg.data);
499 * mei_hbm_cl_connect_res - connect response from the ME
501 * @dev: the device structure
502 * @rs: connect response bus message
504 static void mei_hbm_cl_connect_res(struct mei_device *dev,
505 struct hbm_client_connect_response *rs)
509 struct mei_cl_cb *cb, *next;
511 dev_dbg(&dev->pdev->dev, "hbm: connect response cl:host=%02d me=%02d status=%s\n",
512 rs->me_addr, rs->host_addr,
513 mei_cl_conn_status_str(rs->status));
517 list_for_each_entry_safe(cb, next, &dev->ctrl_rd_list.list, list) {
520 /* this should not happen */
522 list_del_init(&cb->list);
526 if (cb->fop_type != MEI_FOP_CONNECT)
529 if (mei_hbm_cl_addr_equal(cl, rs)) {
539 if (rs->status == MEI_CL_CONN_SUCCESS)
540 cl->state = MEI_FILE_CONNECTED;
542 cl->state = MEI_FILE_DISCONNECTED;
543 cl->status = mei_cl_conn_status_to_errno(rs->status);
548 * mei_hbm_fw_disconnect_req - disconnect request initiated by ME firmware
549 * host sends disconnect response
551 * @dev: the device structure.
552 * @disconnect_req: disconnect request bus message from the me
554 * returns -ENOMEM on allocation failure
556 static int mei_hbm_fw_disconnect_req(struct mei_device *dev,
557 struct hbm_client_connect_request *disconnect_req)
560 struct mei_cl_cb *cb;
562 list_for_each_entry(cl, &dev->file_list, link) {
563 if (mei_hbm_cl_addr_equal(cl, disconnect_req)) {
564 dev_dbg(&dev->pdev->dev, "disconnect request host client %d ME client %d.\n",
565 disconnect_req->host_addr,
566 disconnect_req->me_addr);
567 cl->state = MEI_FILE_DISCONNECTED;
570 cb = mei_io_cb_init(cl, NULL);
573 cb->fop_type = MEI_FOP_DISCONNECT_RSP;
574 cl_dbg(dev, cl, "add disconnect response as first\n");
575 list_add(&cb->list, &dev->ctrl_wr_list.list);
585 * mei_hbm_version_is_supported - checks whether the driver can
586 * support the hbm version of the device
588 * @dev: the device structure
589 * returns true if driver can support hbm version of the device
591 bool mei_hbm_version_is_supported(struct mei_device *dev)
593 return (dev->version.major_version < HBM_MAJOR_VERSION) ||
594 (dev->version.major_version == HBM_MAJOR_VERSION &&
595 dev->version.minor_version <= HBM_MINOR_VERSION);
599 * mei_hbm_dispatch - bottom half read routine after ISR to
600 * handle the read bus message cmd processing.
602 * @dev: the device structure
603 * @mei_hdr: header of bus message
605 * returns 0 on success and < 0 on failure
607 int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
609 struct mei_bus_message *mei_msg;
610 struct mei_me_client *me_client;
611 struct hbm_host_version_response *version_res;
612 struct hbm_client_connect_response *connect_res;
613 struct hbm_client_connect_response *disconnect_res;
614 struct hbm_client_connect_request *disconnect_req;
615 struct hbm_flow_control *flow_control;
616 struct hbm_props_response *props_res;
617 struct hbm_host_enum_response *enum_res;
619 /* read the message to our buffer */
620 BUG_ON(hdr->length >= sizeof(dev->rd_msg_buf));
621 mei_read_slots(dev, dev->rd_msg_buf, hdr->length);
622 mei_msg = (struct mei_bus_message *)dev->rd_msg_buf;
624 /* ignore spurious message and prevent reset nesting
625 * hbm is put to idle during system reset
627 if (dev->hbm_state == MEI_HBM_IDLE) {
628 dev_dbg(&dev->pdev->dev, "hbm: state is idle ignore spurious messages\n");
632 switch (mei_msg->hbm_cmd) {
633 case HOST_START_RES_CMD:
634 dev_dbg(&dev->pdev->dev, "hbm: start: response message received.\n");
636 dev->init_clients_timer = 0;
638 version_res = (struct hbm_host_version_response *)mei_msg;
640 dev_dbg(&dev->pdev->dev, "HBM VERSION: DRIVER=%02d:%02d DEVICE=%02d:%02d\n",
641 HBM_MAJOR_VERSION, HBM_MINOR_VERSION,
642 version_res->me_max_version.major_version,
643 version_res->me_max_version.minor_version);
645 if (version_res->host_version_supported) {
646 dev->version.major_version = HBM_MAJOR_VERSION;
647 dev->version.minor_version = HBM_MINOR_VERSION;
649 dev->version.major_version =
650 version_res->me_max_version.major_version;
651 dev->version.minor_version =
652 version_res->me_max_version.minor_version;
655 if (!mei_hbm_version_is_supported(dev)) {
656 dev_warn(&dev->pdev->dev, "hbm: start: version mismatch - stopping the driver.\n");
658 dev->hbm_state = MEI_HBM_STOPPED;
659 if (mei_hbm_stop_req(dev)) {
660 dev_err(&dev->pdev->dev, "hbm: start: failed to send stop request\n");
666 if (dev->dev_state != MEI_DEV_INIT_CLIENTS ||
667 dev->hbm_state != MEI_HBM_START) {
668 dev_err(&dev->pdev->dev, "hbm: start: state mismatch, [%d, %d]\n",
669 dev->dev_state, dev->hbm_state);
673 dev->hbm_state = MEI_HBM_STARTED;
675 if (mei_hbm_enum_clients_req(dev)) {
676 dev_err(&dev->pdev->dev, "hbm: start: failed to send enumeration request\n");
680 wake_up_interruptible(&dev->wait_recvd_msg);
683 case CLIENT_CONNECT_RES_CMD:
684 dev_dbg(&dev->pdev->dev, "hbm: client connect response: message received.\n");
686 connect_res = (struct hbm_client_connect_response *) mei_msg;
687 mei_hbm_cl_connect_res(dev, connect_res);
688 wake_up(&dev->wait_recvd_msg);
691 case CLIENT_DISCONNECT_RES_CMD:
692 dev_dbg(&dev->pdev->dev, "hbm: client disconnect response: message received.\n");
694 disconnect_res = (struct hbm_client_connect_response *) mei_msg;
695 mei_hbm_cl_disconnect_res(dev, disconnect_res);
696 wake_up(&dev->wait_recvd_msg);
699 case MEI_FLOW_CONTROL_CMD:
700 dev_dbg(&dev->pdev->dev, "hbm: client flow control response: message received.\n");
702 flow_control = (struct hbm_flow_control *) mei_msg;
703 mei_hbm_cl_flow_control_res(dev, flow_control);
706 case HOST_CLIENT_PROPERTIES_RES_CMD:
707 dev_dbg(&dev->pdev->dev, "hbm: properties response: message received.\n");
709 dev->init_clients_timer = 0;
711 if (dev->me_clients == NULL) {
712 dev_err(&dev->pdev->dev, "hbm: properties response: mei_clients not allocated\n");
716 props_res = (struct hbm_props_response *)mei_msg;
717 me_client = &dev->me_clients[dev->me_client_presentation_num];
719 if (props_res->status) {
720 dev_err(&dev->pdev->dev, "hbm: properties response: wrong status = %d\n",
725 if (me_client->client_id != props_res->address) {
726 dev_err(&dev->pdev->dev, "hbm: properties response: address mismatch %d ?= %d\n",
727 me_client->client_id, props_res->address);
731 if (dev->dev_state != MEI_DEV_INIT_CLIENTS ||
732 dev->hbm_state != MEI_HBM_CLIENT_PROPERTIES) {
733 dev_err(&dev->pdev->dev, "hbm: properties response: state mismatch, [%d, %d]\n",
734 dev->dev_state, dev->hbm_state);
738 me_client->props = props_res->client_properties;
739 dev->me_client_index++;
740 dev->me_client_presentation_num++;
742 /* request property for the next client */
743 if (mei_hbm_prop_req(dev))
748 case HOST_ENUM_RES_CMD:
749 dev_dbg(&dev->pdev->dev, "hbm: enumeration response: message received\n");
751 dev->init_clients_timer = 0;
753 enum_res = (struct hbm_host_enum_response *) mei_msg;
754 BUILD_BUG_ON(sizeof(dev->me_clients_map)
755 < sizeof(enum_res->valid_addresses));
756 memcpy(dev->me_clients_map, enum_res->valid_addresses,
757 sizeof(enum_res->valid_addresses));
759 if (dev->dev_state != MEI_DEV_INIT_CLIENTS ||
760 dev->hbm_state != MEI_HBM_ENUM_CLIENTS) {
761 dev_err(&dev->pdev->dev, "hbm: enumeration response: state mismatch, [%d, %d]\n",
762 dev->dev_state, dev->hbm_state);
766 if (mei_hbm_me_cl_allocate(dev)) {
767 dev_err(&dev->pdev->dev, "hbm: enumeration response: cannot allocate clients array\n");
771 dev->hbm_state = MEI_HBM_CLIENT_PROPERTIES;
773 /* first property request */
774 if (mei_hbm_prop_req(dev))
779 case HOST_STOP_RES_CMD:
780 dev_dbg(&dev->pdev->dev, "hbm: stop response: message received\n");
782 dev->init_clients_timer = 0;
784 if (dev->hbm_state != MEI_HBM_STOPPED) {
785 dev_err(&dev->pdev->dev, "hbm: stop response: state mismatch, [%d, %d]\n",
786 dev->dev_state, dev->hbm_state);
790 dev->dev_state = MEI_DEV_POWER_DOWN;
791 dev_info(&dev->pdev->dev, "hbm: stop response: resetting.\n");
792 /* force the reset */
796 case CLIENT_DISCONNECT_REQ_CMD:
797 dev_dbg(&dev->pdev->dev, "hbm: disconnect request: message received\n");
799 disconnect_req = (struct hbm_client_connect_request *)mei_msg;
800 mei_hbm_fw_disconnect_req(dev, disconnect_req);
803 case ME_STOP_REQ_CMD:
804 dev_dbg(&dev->pdev->dev, "hbm: stop request: message received\n");
805 dev->hbm_state = MEI_HBM_STOPPED;
806 if (mei_hbm_stop_req(dev)) {
807 dev_err(&dev->pdev->dev, "hbm: start: failed to send stop request\n");