Lines Matching +full:os +full:- +full:initiated

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2003-2020, Intel Corporation. All rights reserved.
68 * mei_cl_conn_status_to_errno - convert client connect response
79 case MEI_CL_CONN_NOT_FOUND: return -ENOTTY; in mei_cl_conn_status_to_errno()
80 case MEI_CL_CONN_ALREADY_STARTED: return -EBUSY; in mei_cl_conn_status_to_errno()
81 case MEI_CL_CONN_OUT_OF_RESOURCES: return -EBUSY; in mei_cl_conn_status_to_errno()
82 case MEI_CL_CONN_MESSAGE_SMALL: return -EINVAL; in mei_cl_conn_status_to_errno()
83 case MEI_CL_CONN_NOT_ALLOWED: return -EBUSY; in mei_cl_conn_status_to_errno()
84 default: return -EINVAL; in mei_cl_conn_status_to_errno()
89 * mei_hbm_write_message - wrapper for sending hbm messages.
99 return mei_write_message(dev, hdr, sizeof(*hdr), data, hdr->length); in mei_hbm_write_message()
103 * mei_hbm_idle - set hbm to idle state
109 dev->init_clients_timer = 0; in mei_hbm_idle()
110 dev->hbm_state = MEI_HBM_IDLE; in mei_hbm_idle()
114 * mei_hbm_reset - reset hbm counters and book keeping data structurs
126 * mei_hbm_hdr - construct hbm header
135 mei_hdr->length = length; in mei_hbm_hdr()
136 mei_hdr->msg_complete = 1; in mei_hbm_hdr()
140 * mei_hbm_cl_hdr - construct client hbm header
154 cmd->hbm_cmd = hbm_cmd; in mei_hbm_cl_hdr()
155 cmd->host_addr = mei_cl_host_addr(cl); in mei_hbm_cl_hdr()
156 cmd->me_addr = mei_cl_me_id(cl); in mei_hbm_cl_hdr()
160 * mei_hbm_cl_write - write simple hbm client message
182 * mei_hbm_cl_addr_equal - check if the client's and
193 return mei_cl_host_addr(cl) == cmd->host_addr && in mei_hbm_cl_addr_equal()
194 mei_cl_me_id(cl) == cmd->me_addr; in mei_hbm_cl_addr_equal()
198 * mei_hbm_cl_find_by_cmd - find recipient client
211 list_for_each_entry(cl, &dev->file_list, link) in mei_hbm_cl_find_by_cmd()
219 * mei_hbm_start_wait - wait for start response message.
229 if (dev->hbm_state > MEI_HBM_STARTING) in mei_hbm_start_wait()
232 mutex_unlock(&dev->device_lock); in mei_hbm_start_wait()
233 ret = wait_event_timeout(dev->wait_hbm_start, in mei_hbm_start_wait()
234 dev->hbm_state != MEI_HBM_STARTING, in mei_hbm_start_wait()
236 mutex_lock(&dev->device_lock); in mei_hbm_start_wait()
238 if (ret == 0 && (dev->hbm_state <= MEI_HBM_STARTING)) { in mei_hbm_start_wait()
239 dev->hbm_state = MEI_HBM_IDLE; in mei_hbm_start_wait()
240 dev_err(dev->dev, "waiting for mei start failed\n"); in mei_hbm_start_wait()
241 return -ETIME; in mei_hbm_start_wait()
247 * mei_hbm_start_req - sends start request message.
269 dev->hbm_state = MEI_HBM_IDLE; in mei_hbm_start_req()
272 dev_err(dev->dev, "version message write failed: ret = %d\n", in mei_hbm_start_req()
277 dev->hbm_state = MEI_HBM_STARTING; in mei_hbm_start_req()
278 dev->init_clients_timer = MEI_CLIENTS_INIT_TIMEOUT; in mei_hbm_start_req()
284 * mei_hbm_dma_setup_req() - setup DMA request
303 paddr = dev->dr_dscr[i].daddr; in mei_hbm_dma_setup_req()
306 req.dma_dscr[i].size = dev->dr_dscr[i].size; in mei_hbm_dma_setup_req()
313 dev_err(dev->dev, "dma setup request write failed: ret = %d.\n", in mei_hbm_dma_setup_req()
318 dev->hbm_state = MEI_HBM_DR_SETUP; in mei_hbm_dma_setup_req()
319 dev->init_clients_timer = MEI_CLIENTS_INIT_TIMEOUT; in mei_hbm_dma_setup_req()
325 * mei_hbm_capabilities_req - request capabilities
341 if (dev->hbm_f_vt_supported) in mei_hbm_capabilities_req()
346 dev_err(dev->dev, in mei_hbm_capabilities_req()
351 dev->hbm_state = MEI_HBM_CAP_SETUP; in mei_hbm_capabilities_req()
352 dev->init_clients_timer = MEI_CLIENTS_INIT_TIMEOUT; in mei_hbm_capabilities_req()
358 * mei_hbm_enum_clients_req - sends enumeration client request message.
375 req.flags |= dev->hbm_f_dc_supported ? MEI_HBM_ENUM_F_ALLOW_ADD : 0; in mei_hbm_enum_clients_req()
376 req.flags |= dev->hbm_f_ie_supported ? in mei_hbm_enum_clients_req()
381 dev_err(dev->dev, "enumeration request write failed: ret = %d.\n", in mei_hbm_enum_clients_req()
385 dev->hbm_state = MEI_HBM_ENUM_CLIENTS; in mei_hbm_enum_clients_req()
386 dev->init_clients_timer = MEI_CLIENTS_INIT_TIMEOUT; in mei_hbm_enum_clients_req()
392 * mei_hbm_me_cl_add - add new me client to the list
397 * Return: 0 on success and -ENOMEM on allocation failure
404 const uuid_le *uuid = &res->client_properties.protocol_name; in mei_hbm_me_cl_add()
410 return -ENOMEM; in mei_hbm_me_cl_add()
414 me_cl->props = res->client_properties; in mei_hbm_me_cl_add()
415 me_cl->client_id = res->me_addr; in mei_hbm_me_cl_add()
416 me_cl->tx_flow_ctrl_creds = 0; in mei_hbm_me_cl_add()
424 * mei_hbm_add_cl_resp - send response to fw on client add request
438 dev_dbg(dev->dev, "adding client response\n"); in mei_hbm_add_cl_resp()
449 dev_err(dev->dev, "add client response write failed: ret = %d\n", in mei_hbm_add_cl_resp()
455 * mei_hbm_fw_add_cl_req - request from the fw to add a client
475 if (dev->dev_state == MEI_DEV_ENABLED) in mei_hbm_fw_add_cl_req()
476 schedule_work(&dev->bus_rescan_work); in mei_hbm_fw_add_cl_req()
478 return mei_hbm_add_cl_resp(dev, req->me_addr, status); in mei_hbm_fw_add_cl_req()
482 * mei_hbm_cl_notify_req - send notification request
488 * Return: 0 on success and -EIO on write failure
505 dev_err(dev->dev, "notify request failed: ret = %d\n", ret); in mei_hbm_cl_notify_req()
511 * notify_res_to_fop - convert notification response to the proper
523 return mei_cl_notify_req2fop(rs->start); in notify_res_to_fop()
527 * mei_hbm_cl_notify_start_res - update the client state according
541 cl_dbg(dev, cl, "hbm: notify start response status=%d\n", rs->status); in mei_hbm_cl_notify_start_res()
543 if (rs->status == MEI_HBMS_SUCCESS || in mei_hbm_cl_notify_start_res()
544 rs->status == MEI_HBMS_ALREADY_STARTED) { in mei_hbm_cl_notify_start_res()
545 cl->notify_en = true; in mei_hbm_cl_notify_start_res()
546 cl->status = 0; in mei_hbm_cl_notify_start_res()
548 cl->status = -EINVAL; in mei_hbm_cl_notify_start_res()
553 * mei_hbm_cl_notify_stop_res - update the client state according
567 cl_dbg(dev, cl, "hbm: notify stop response status=%d\n", rs->status); in mei_hbm_cl_notify_stop_res()
569 if (rs->status == MEI_HBMS_SUCCESS || in mei_hbm_cl_notify_stop_res()
570 rs->status == MEI_HBMS_NOT_STARTED) { in mei_hbm_cl_notify_stop_res()
571 cl->notify_en = false; in mei_hbm_cl_notify_stop_res()
572 cl->status = 0; in mei_hbm_cl_notify_stop_res()
575 cl->status = -EINVAL; in mei_hbm_cl_notify_stop_res()
580 * mei_hbm_cl_notify - signal notification event
596 * mei_hbm_prop_req - request property for a single client
610 addr = find_next_bit(dev->me_clients_map, MEI_CLIENTS_MAX, start_idx); in mei_hbm_prop_req()
614 dev->hbm_state = MEI_HBM_STARTED; in mei_hbm_prop_req()
628 dev_err(dev->dev, "properties request write failed: ret = %d\n", in mei_hbm_prop_req()
633 dev->init_clients_timer = MEI_CLIENTS_INIT_TIMEOUT; in mei_hbm_prop_req()
640 * mei_hbm_pg - sends pg command
645 * Return: -EIO on write failure
646 * -EOPNOTSUPP if the operation is not supported by the protocol
654 if (!dev->hbm_f_pg_supported) in mei_hbm_pg()
655 return -EOPNOTSUPP; in mei_hbm_pg()
664 dev_err(dev->dev, "power gate command write failed.\n"); in mei_hbm_pg()
670 * mei_hbm_stop_req - send stop request message
674 * Return: -EIO on write failure
691 * mei_hbm_cl_flow_control_req - sends flow control request.
696 * Return: -EIO on write failure
708 * mei_hbm_add_single_tx_flow_ctrl_creds - adds single buffer credentials.
721 me_cl = mei_me_cl_by_id(dev, fctrl->me_addr); in mei_hbm_add_single_tx_flow_ctrl_creds()
723 dev_err(dev->dev, "no such me client %d\n", fctrl->me_addr); in mei_hbm_add_single_tx_flow_ctrl_creds()
724 return -ENOENT; in mei_hbm_add_single_tx_flow_ctrl_creds()
727 if (WARN_ON(me_cl->props.single_recv_buf == 0)) { in mei_hbm_add_single_tx_flow_ctrl_creds()
728 rets = -EINVAL; in mei_hbm_add_single_tx_flow_ctrl_creds()
732 me_cl->tx_flow_ctrl_creds++; in mei_hbm_add_single_tx_flow_ctrl_creds()
733 dev_dbg(dev->dev, "recv flow ctrl msg ME %d (single) creds = %d.\n", in mei_hbm_add_single_tx_flow_ctrl_creds()
734 fctrl->me_addr, me_cl->tx_flow_ctrl_creds); in mei_hbm_add_single_tx_flow_ctrl_creds()
743 * mei_hbm_cl_flow_control_res - flow control response from me
753 if (!fctrl->host_addr) { in mei_hbm_cl_tx_flow_ctrl_creds_res()
761 cl->tx_flow_ctrl_creds++; in mei_hbm_cl_tx_flow_ctrl_creds_res()
763 cl->tx_flow_ctrl_creds); in mei_hbm_cl_tx_flow_ctrl_creds_res()
769 * mei_hbm_cl_disconnect_req - sends disconnect message to fw.
774 * Return: -EIO on write failure
785 * mei_hbm_cl_disconnect_rsp - sends disconnect respose to the FW
790 * Return: -EIO on write failure
801 * mei_hbm_cl_disconnect_res - update the client state according
814 cl_dbg(dev, cl, "hbm: disconnect response status=%d\n", rs->status); in mei_hbm_cl_disconnect_res()
816 if (rs->status == MEI_CL_DISCONN_SUCCESS) in mei_hbm_cl_disconnect_res()
817 cl->state = MEI_FILE_DISCONNECT_REPLY; in mei_hbm_cl_disconnect_res()
818 cl->status = 0; in mei_hbm_cl_disconnect_res()
822 * mei_hbm_cl_connect_req - send connection request to specific me client
827 * Return: -EIO on write failure
838 * mei_hbm_cl_connect_res - update the client state according
852 mei_cl_conn_status_str(rs->status)); in mei_hbm_cl_connect_res()
854 if (rs->status == MEI_CL_CONN_SUCCESS) in mei_hbm_cl_connect_res()
855 cl->state = MEI_FILE_CONNECTED; in mei_hbm_cl_connect_res()
857 cl->state = MEI_FILE_DISCONNECT_REPLY; in mei_hbm_cl_connect_res()
858 if (rs->status == MEI_CL_CONN_NOT_FOUND) { in mei_hbm_cl_connect_res()
859 mei_me_cl_del(dev, cl->me_cl); in mei_hbm_cl_connect_res()
860 if (dev->dev_state == MEI_DEV_ENABLED) in mei_hbm_cl_connect_res()
861 schedule_work(&dev->bus_rescan_work); in mei_hbm_cl_connect_res()
864 cl->status = mei_cl_conn_status_to_errno(rs->status); in mei_hbm_cl_connect_res()
868 * mei_hbm_cl_res - process hbm response received on behalf
883 list_for_each_entry_safe(cb, next, &dev->ctrl_rd_list, list) { in mei_hbm_cl_res()
885 cl = cb->cl; in mei_hbm_cl_res()
887 if (cb->fop_type != fop_type) in mei_hbm_cl_res()
891 list_del_init(&cb->list); in mei_hbm_cl_res()
916 cl->timer_count = 0; in mei_hbm_cl_res()
917 wake_up(&cl->wait); in mei_hbm_cl_res()
922 * mei_hbm_fw_disconnect_req - disconnect request initiated by ME firmware
928 * Return: -ENOMEM on allocation failure
939 cl->state = MEI_FILE_DISCONNECTING; in mei_hbm_fw_disconnect_req()
940 cl->timer_count = 0; in mei_hbm_fw_disconnect_req()
945 return -ENOMEM; in mei_hbm_fw_disconnect_req()
951 * mei_hbm_pg_enter_res - PG enter response received
955 * Return: 0 on success, -EPROTO on state mismatch
960 dev->pg_event != MEI_PG_EVENT_WAIT) { in mei_hbm_pg_enter_res()
961 dev_err(dev->dev, "hbm: pg entry response: state mismatch [%s, %d]\n", in mei_hbm_pg_enter_res()
962 mei_pg_state_str(mei_pg_state(dev)), dev->pg_event); in mei_hbm_pg_enter_res()
963 return -EPROTO; in mei_hbm_pg_enter_res()
966 dev->pg_event = MEI_PG_EVENT_RECEIVED; in mei_hbm_pg_enter_res()
967 wake_up(&dev->wait_pg); in mei_hbm_pg_enter_res()
973 * mei_hbm_pg_resume - process with PG resume
979 pm_request_resume(dev->dev); in mei_hbm_pg_resume()
984 * mei_hbm_pg_exit_res - PG exit response received
988 * Return: 0 on success, -EPROTO on state mismatch
993 (dev->pg_event != MEI_PG_EVENT_WAIT && in mei_hbm_pg_exit_res()
994 dev->pg_event != MEI_PG_EVENT_IDLE)) { in mei_hbm_pg_exit_res()
995 dev_err(dev->dev, "hbm: pg exit response: state mismatch [%s, %d]\n", in mei_hbm_pg_exit_res()
996 mei_pg_state_str(mei_pg_state(dev)), dev->pg_event); in mei_hbm_pg_exit_res()
997 return -EPROTO; in mei_hbm_pg_exit_res()
1000 switch (dev->pg_event) { in mei_hbm_pg_exit_res()
1002 dev->pg_event = MEI_PG_EVENT_RECEIVED; in mei_hbm_pg_exit_res()
1003 wake_up(&dev->wait_pg); in mei_hbm_pg_exit_res()
1008 * this is HW initiated exit from PG. in mei_hbm_pg_exit_res()
1011 dev->pg_event = MEI_PG_EVENT_RECEIVED; in mei_hbm_pg_exit_res()
1016 dev->pg_event); in mei_hbm_pg_exit_res()
1017 return -EPROTO; in mei_hbm_pg_exit_res()
1024 * mei_hbm_config_features - check what hbm features and commands
1032 dev->hbm_f_pg_supported = 0; in mei_hbm_config_features()
1033 if (dev->version.major_version > HBM_MAJOR_VERSION_PGI) in mei_hbm_config_features()
1034 dev->hbm_f_pg_supported = 1; in mei_hbm_config_features()
1036 if (dev->version.major_version == HBM_MAJOR_VERSION_PGI && in mei_hbm_config_features()
1037 dev->version.minor_version >= HBM_MINOR_VERSION_PGI) in mei_hbm_config_features()
1038 dev->hbm_f_pg_supported = 1; in mei_hbm_config_features()
1040 dev->hbm_f_dc_supported = 0; in mei_hbm_config_features()
1041 if (dev->version.major_version >= HBM_MAJOR_VERSION_DC) in mei_hbm_config_features()
1042 dev->hbm_f_dc_supported = 1; in mei_hbm_config_features()
1044 dev->hbm_f_ie_supported = 0; in mei_hbm_config_features()
1045 if (dev->version.major_version >= HBM_MAJOR_VERSION_IE) in mei_hbm_config_features()
1046 dev->hbm_f_ie_supported = 1; in mei_hbm_config_features()
1049 dev->hbm_f_dot_supported = 0; in mei_hbm_config_features()
1050 if (dev->version.major_version >= HBM_MAJOR_VERSION_DOT) in mei_hbm_config_features()
1051 dev->hbm_f_dot_supported = 1; in mei_hbm_config_features()
1054 dev->hbm_f_ev_supported = 0; in mei_hbm_config_features()
1055 if (dev->version.major_version >= HBM_MAJOR_VERSION_EV) in mei_hbm_config_features()
1056 dev->hbm_f_ev_supported = 1; in mei_hbm_config_features()
1059 dev->hbm_f_fa_supported = 0; in mei_hbm_config_features()
1060 if (dev->version.major_version >= HBM_MAJOR_VERSION_FA) in mei_hbm_config_features()
1061 dev->hbm_f_fa_supported = 1; in mei_hbm_config_features()
1063 /* OS ver message Support */ in mei_hbm_config_features()
1064 dev->hbm_f_os_supported = 0; in mei_hbm_config_features()
1065 if (dev->version.major_version >= HBM_MAJOR_VERSION_OS) in mei_hbm_config_features()
1066 dev->hbm_f_os_supported = 1; in mei_hbm_config_features()
1069 dev->hbm_f_dr_supported = 0; in mei_hbm_config_features()
1070 if (dev->version.major_version > HBM_MAJOR_VERSION_DR || in mei_hbm_config_features()
1071 (dev->version.major_version == HBM_MAJOR_VERSION_DR && in mei_hbm_config_features()
1072 dev->version.minor_version >= HBM_MINOR_VERSION_DR)) in mei_hbm_config_features()
1073 dev->hbm_f_dr_supported = 1; in mei_hbm_config_features()
1076 dev->hbm_f_vt_supported = 0; in mei_hbm_config_features()
1077 if (dev->version.major_version > HBM_MAJOR_VERSION_VT || in mei_hbm_config_features()
1078 (dev->version.major_version == HBM_MAJOR_VERSION_VT && in mei_hbm_config_features()
1079 dev->version.minor_version >= HBM_MINOR_VERSION_VT)) in mei_hbm_config_features()
1080 dev->hbm_f_vt_supported = 1; in mei_hbm_config_features()
1083 dev->hbm_f_cap_supported = 0; in mei_hbm_config_features()
1084 if (dev->version.major_version > HBM_MAJOR_VERSION_CAP || in mei_hbm_config_features()
1085 (dev->version.major_version == HBM_MAJOR_VERSION_CAP && in mei_hbm_config_features()
1086 dev->version.minor_version >= HBM_MINOR_VERSION_CAP)) in mei_hbm_config_features()
1087 dev->hbm_f_cap_supported = 1; in mei_hbm_config_features()
1091 * mei_hbm_version_is_supported - checks whether the driver can
1099 return (dev->version.major_version < HBM_MAJOR_VERSION) || in mei_hbm_version_is_supported()
1100 (dev->version.major_version == HBM_MAJOR_VERSION && in mei_hbm_version_is_supported()
1101 dev->version.minor_version <= HBM_MINOR_VERSION); in mei_hbm_version_is_supported()
1105 * mei_hbm_dispatch - bottom half read routine after ISR to
1129 BUG_ON(hdr->length >= sizeof(dev->rd_msg_buf)); in mei_hbm_dispatch()
1130 mei_read_slots(dev, dev->rd_msg_buf, hdr->length); in mei_hbm_dispatch()
1131 mei_msg = (struct mei_bus_message *)dev->rd_msg_buf; in mei_hbm_dispatch()
1137 if (dev->hbm_state == MEI_HBM_IDLE) { in mei_hbm_dispatch()
1138 dev_dbg(dev->dev, "hbm: state is idle ignore spurious messages\n"); in mei_hbm_dispatch()
1142 switch (mei_msg->hbm_cmd) { in mei_hbm_dispatch()
1144 dev_dbg(dev->dev, "hbm: start: response message received.\n"); in mei_hbm_dispatch()
1146 dev->init_clients_timer = 0; in mei_hbm_dispatch()
1150 dev_dbg(dev->dev, "HBM VERSION: DRIVER=%02d:%02d DEVICE=%02d:%02d\n", in mei_hbm_dispatch()
1152 version_res->me_max_version.major_version, in mei_hbm_dispatch()
1153 version_res->me_max_version.minor_version); in mei_hbm_dispatch()
1155 if (version_res->host_version_supported) { in mei_hbm_dispatch()
1156 dev->version.major_version = HBM_MAJOR_VERSION; in mei_hbm_dispatch()
1157 dev->version.minor_version = HBM_MINOR_VERSION; in mei_hbm_dispatch()
1159 dev->version.major_version = in mei_hbm_dispatch()
1160 version_res->me_max_version.major_version; in mei_hbm_dispatch()
1161 dev->version.minor_version = in mei_hbm_dispatch()
1162 version_res->me_max_version.minor_version; in mei_hbm_dispatch()
1166 dev_warn(dev->dev, "hbm: start: version mismatch - stopping the driver.\n"); in mei_hbm_dispatch()
1168 dev->hbm_state = MEI_HBM_STOPPED; in mei_hbm_dispatch()
1170 dev_err(dev->dev, "hbm: start: failed to send stop request\n"); in mei_hbm_dispatch()
1171 return -EIO; in mei_hbm_dispatch()
1178 if (dev->dev_state != MEI_DEV_INIT_CLIENTS || in mei_hbm_dispatch()
1179 dev->hbm_state != MEI_HBM_STARTING) { in mei_hbm_dispatch()
1180 dev_err(dev->dev, "hbm: start: state mismatch, [%d, %d]\n", in mei_hbm_dispatch()
1181 dev->dev_state, dev->hbm_state); in mei_hbm_dispatch()
1182 return -EPROTO; in mei_hbm_dispatch()
1185 if (dev->hbm_f_cap_supported) { in mei_hbm_dispatch()
1187 return -EIO; in mei_hbm_dispatch()
1188 wake_up(&dev->wait_hbm_start); in mei_hbm_dispatch()
1192 if (dev->hbm_f_dr_supported) { in mei_hbm_dispatch()
1194 dev_info(dev->dev, "running w/o dma ring\n"); in mei_hbm_dispatch()
1197 return -EIO; in mei_hbm_dispatch()
1199 wake_up(&dev->wait_hbm_start); in mei_hbm_dispatch()
1204 dev->hbm_f_dr_supported = 0; in mei_hbm_dispatch()
1208 return -EIO; in mei_hbm_dispatch()
1210 wake_up(&dev->wait_hbm_start); in mei_hbm_dispatch()
1214 dev_dbg(dev->dev, "hbm: capabilities response: message received.\n"); in mei_hbm_dispatch()
1216 dev->init_clients_timer = 0; in mei_hbm_dispatch()
1218 if (dev->hbm_state != MEI_HBM_CAP_SETUP) { in mei_hbm_dispatch()
1219 dev_err(dev->dev, "hbm: capabilities response: state mismatch, [%d, %d]\n", in mei_hbm_dispatch()
1220 dev->dev_state, dev->hbm_state); in mei_hbm_dispatch()
1221 return -EPROTO; in mei_hbm_dispatch()
1225 if (!(capability_res->capability_granted[0] & HBM_CAP_VT)) in mei_hbm_dispatch()
1226 dev->hbm_f_vt_supported = 0; in mei_hbm_dispatch()
1228 if (dev->hbm_f_dr_supported) { in mei_hbm_dispatch()
1230 dev_info(dev->dev, "running w/o dma ring\n"); in mei_hbm_dispatch()
1233 return -EIO; in mei_hbm_dispatch()
1238 dev->hbm_f_dr_supported = 0; in mei_hbm_dispatch()
1242 return -EIO; in mei_hbm_dispatch()
1246 dev_dbg(dev->dev, "hbm: dma setup response: message received.\n"); in mei_hbm_dispatch()
1248 dev->init_clients_timer = 0; in mei_hbm_dispatch()
1250 if (dev->hbm_state != MEI_HBM_DR_SETUP) { in mei_hbm_dispatch()
1251 dev_err(dev->dev, "hbm: dma setup response: state mismatch, [%d, %d]\n", in mei_hbm_dispatch()
1252 dev->dev_state, dev->hbm_state); in mei_hbm_dispatch()
1253 return -EPROTO; in mei_hbm_dispatch()
1258 if (dma_setup_res->status) { in mei_hbm_dispatch()
1259 u8 status = dma_setup_res->status; in mei_hbm_dispatch()
1262 dev_dbg(dev->dev, "hbm: dma setup not allowed\n"); in mei_hbm_dispatch()
1264 dev_info(dev->dev, "hbm: dma setup response: failure = %d %s\n", in mei_hbm_dispatch()
1268 dev->hbm_f_dr_supported = 0; in mei_hbm_dispatch()
1273 return -EIO; in mei_hbm_dispatch()
1277 dev_dbg(dev->dev, "hbm: client connect response: message received.\n"); in mei_hbm_dispatch()
1282 dev_dbg(dev->dev, "hbm: client disconnect response: message received.\n"); in mei_hbm_dispatch()
1287 dev_dbg(dev->dev, "hbm: client flow control response: message received.\n"); in mei_hbm_dispatch()
1294 dev_dbg(dev->dev, "hbm: power gate isolation entry response received\n"); in mei_hbm_dispatch()
1301 dev_dbg(dev->dev, "hbm: power gate isolation exit request received\n"); in mei_hbm_dispatch()
1308 dev_dbg(dev->dev, "hbm: properties response: message received.\n"); in mei_hbm_dispatch()
1310 dev->init_clients_timer = 0; in mei_hbm_dispatch()
1312 if (dev->dev_state != MEI_DEV_INIT_CLIENTS || in mei_hbm_dispatch()
1313 dev->hbm_state != MEI_HBM_CLIENT_PROPERTIES) { in mei_hbm_dispatch()
1314 dev_err(dev->dev, "hbm: properties response: state mismatch, [%d, %d]\n", in mei_hbm_dispatch()
1315 dev->dev_state, dev->hbm_state); in mei_hbm_dispatch()
1316 return -EPROTO; in mei_hbm_dispatch()
1321 if (props_res->status == MEI_HBMS_CLIENT_NOT_FOUND) { in mei_hbm_dispatch()
1322 dev_dbg(dev->dev, "hbm: properties response: %d CLIENT_NOT_FOUND\n", in mei_hbm_dispatch()
1323 props_res->me_addr); in mei_hbm_dispatch()
1324 } else if (props_res->status) { in mei_hbm_dispatch()
1325 dev_err(dev->dev, "hbm: properties response: wrong status = %d %s\n", in mei_hbm_dispatch()
1326 props_res->status, in mei_hbm_dispatch()
1327 mei_hbm_status_str(props_res->status)); in mei_hbm_dispatch()
1328 return -EPROTO; in mei_hbm_dispatch()
1334 if (mei_hbm_prop_req(dev, props_res->me_addr + 1)) in mei_hbm_dispatch()
1335 return -EIO; in mei_hbm_dispatch()
1340 dev_dbg(dev->dev, "hbm: enumeration response: message received\n"); in mei_hbm_dispatch()
1342 dev->init_clients_timer = 0; in mei_hbm_dispatch()
1345 BUILD_BUG_ON(sizeof(dev->me_clients_map) in mei_hbm_dispatch()
1346 < sizeof(enum_res->valid_addresses)); in mei_hbm_dispatch()
1347 memcpy(dev->me_clients_map, enum_res->valid_addresses, in mei_hbm_dispatch()
1348 sizeof(enum_res->valid_addresses)); in mei_hbm_dispatch()
1350 if (dev->dev_state != MEI_DEV_INIT_CLIENTS || in mei_hbm_dispatch()
1351 dev->hbm_state != MEI_HBM_ENUM_CLIENTS) { in mei_hbm_dispatch()
1352 dev_err(dev->dev, "hbm: enumeration response: state mismatch, [%d, %d]\n", in mei_hbm_dispatch()
1353 dev->dev_state, dev->hbm_state); in mei_hbm_dispatch()
1354 return -EPROTO; in mei_hbm_dispatch()
1357 dev->hbm_state = MEI_HBM_CLIENT_PROPERTIES; in mei_hbm_dispatch()
1361 return -EIO; in mei_hbm_dispatch()
1366 dev_dbg(dev->dev, "hbm: stop response: message received\n"); in mei_hbm_dispatch()
1368 dev->init_clients_timer = 0; in mei_hbm_dispatch()
1370 if (dev->hbm_state != MEI_HBM_STOPPED) { in mei_hbm_dispatch()
1371 dev_err(dev->dev, "hbm: stop response: state mismatch, [%d, %d]\n", in mei_hbm_dispatch()
1372 dev->dev_state, dev->hbm_state); in mei_hbm_dispatch()
1373 return -EPROTO; in mei_hbm_dispatch()
1376 dev->dev_state = MEI_DEV_POWER_DOWN; in mei_hbm_dispatch()
1377 dev_info(dev->dev, "hbm: stop response: resetting.\n"); in mei_hbm_dispatch()
1379 return -EPROTO; in mei_hbm_dispatch()
1383 dev_dbg(dev->dev, "hbm: disconnect request: message received\n"); in mei_hbm_dispatch()
1390 dev_dbg(dev->dev, "hbm: stop request: message received\n"); in mei_hbm_dispatch()
1391 dev->hbm_state = MEI_HBM_STOPPED; in mei_hbm_dispatch()
1393 dev_err(dev->dev, "hbm: stop request: failed to send stop request\n"); in mei_hbm_dispatch()
1394 return -EIO; in mei_hbm_dispatch()
1399 dev_dbg(dev->dev, "hbm: add client request received\n"); in mei_hbm_dispatch()
1404 if (dev->hbm_state <= MEI_HBM_ENUM_CLIENTS || in mei_hbm_dispatch()
1405 dev->hbm_state >= MEI_HBM_STOPPED) { in mei_hbm_dispatch()
1406 dev_err(dev->dev, "hbm: add client: state mismatch, [%d, %d]\n", in mei_hbm_dispatch()
1407 dev->dev_state, dev->hbm_state); in mei_hbm_dispatch()
1408 return -EPROTO; in mei_hbm_dispatch()
1413 dev_err(dev->dev, "hbm: add client: failed to send response %d\n", in mei_hbm_dispatch()
1415 return -EIO; in mei_hbm_dispatch()
1417 dev_dbg(dev->dev, "hbm: add client request processed\n"); in mei_hbm_dispatch()
1421 dev_dbg(dev->dev, "hbm: notify response received\n"); in mei_hbm_dispatch()
1426 dev_dbg(dev->dev, "hbm: notification\n"); in mei_hbm_dispatch()
1431 WARN(1, "hbm: wrong command %d\n", mei_msg->hbm_cmd); in mei_hbm_dispatch()
1432 return -EPROTO; in mei_hbm_dispatch()