return ret;
}
+/**
+ * ti_sci_is_response_ack() - Generic ACK/NACK message checkup
+ * @r: pointer to response buffer
+ *
+ * Return: true if the response was an ACK, else returns false.
+ */
+static bool ti_sci_is_response_ack(void *r)
+{
+ struct ti_sci_msg_hdr *hdr = r;
+
+ return hdr->flags & TI_SCI_FLAG_RESP_GENERIC_ACK ? true : false;
+}
+
/**
* ti_sci_do_xfer() - Do one transfer
* @info: Pointer to SCI entity information
}
/* Get response if requested */
- if (xfer->rx_len)
+ if (xfer->rx_len) {
ret = ti_sci_get_response(info, xfer, &info->chan_rx);
+ if (!ti_sci_is_response_ack(xfer->tx_message.buf)) {
+ dev_err(info->dev, "Message not acknowledged");
+ ret = -ENODEV;
+ }
+ }
return ret;
}
return 0;
}
-/**
- * ti_sci_is_response_ack() - Generic ACK/NACK message checkup
- * @r: pointer to response buffer
- *
- * Return: true if the response was an ACK, else returns false.
- */
-static bool ti_sci_is_response_ack(void *r)
-{
- struct ti_sci_msg_hdr *hdr = r;
-
- return hdr->flags & TI_SCI_FLAG_RESP_GENERIC_ACK ? true : false;
-}
-
/**
* cmd_set_board_config_using_msg() - Common command to send board configuration
* message
if (ret)
return ret;
- resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
-
- if (!ti_sci_is_response_ack(resp))
- return -ENODEV;
-
return ret;
}
if (ret)
return ret;
- resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
-
- if (!ti_sci_is_response_ack(resp))
- return -ENODEV;
-
if (state == MSG_DEVICE_SW_STATE_AUTO_OFF)
ti_sci_delete_exclusive_dev(info, id);
else if (flags & MSG_FLAG_DEVICE_EXCLUSIVE)
return ret;
resp = (struct ti_sci_msg_resp_get_device_state *)xfer->tx_message.buf;
- if (!ti_sci_is_response_ack(resp))
- return -ENODEV;
if (clcnt)
*clcnt = resp->context_loss_count;
if (ret)
return ret;
- resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
-
- if (!ti_sci_is_response_ack(resp))
- return -ENODEV;
-
return ret;
}
if (ret)
return ret;
- resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
-
- if (!ti_sci_is_response_ack(resp))
- return -ENODEV;
-
return ret;
}
resp = (struct ti_sci_msg_resp_get_clock_state *)xfer->tx_message.buf;
- if (!ti_sci_is_response_ack(resp))
- return -ENODEV;
-
if (programmed_state)
*programmed_state = resp->programmed_state;
if (current_state)
if (ret)
return ret;
- resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
-
- if (!ti_sci_is_response_ack(resp))
- return -ENODEV;
-
return ret;
}
if (ret)
return ret;
- resp = (struct ti_sci_msg_resp_get_clock_parent *)xfer->tx_message.buf;
-
- if (!ti_sci_is_response_ack(resp))
- ret = -ENODEV;
- else
- *parent_id = resp->parent_id;
+ *parent_id = resp->parent_id;
return ret;
}
resp = (struct ti_sci_msg_resp_get_clock_num_parents *)
xfer->tx_message.buf;
- if (!ti_sci_is_response_ack(resp))
- ret = -ENODEV;
- else
- *num_parents = resp->num_parents;
+ *num_parents = resp->num_parents;
return ret;
}
resp = (struct ti_sci_msg_resp_query_clock_freq *)xfer->tx_message.buf;
- if (!ti_sci_is_response_ack(resp))
- ret = -ENODEV;
- else
- *match_freq = resp->freq_hz;
+ *match_freq = resp->freq_hz;
return ret;
}
if (ret)
return ret;
- resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
-
- if (!ti_sci_is_response_ack(resp))
- return -ENODEV;
-
return ret;
}
resp = (struct ti_sci_msg_resp_get_clock_freq *)xfer->tx_message.buf;
- if (!ti_sci_is_response_ack(resp))
- ret = -ENODEV;
- else
- *freq = resp->freq_hz;
+ *freq = resp->freq_hz;
return ret;
}
if (ret)
return ret;
- resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
-
- if (!ti_sci_is_response_ack(resp))
- return -ENODEV;
-
return ret;
}
goto fail;
resp = (struct ti_sci_msg_resp_get_resource_range *)xfer->tx_message.buf;
- if (!ti_sci_is_response_ack(resp)) {
- ret = -ENODEV;
- } else if (!resp->range_start && !resp->range_num) {
+ if (!resp->range_start && !resp->range_num) {
ret = -ENODEV;
} else {
*range_start = resp->range_start;
resp = (struct ti_sci_msg_resp_query_msmc *)xfer->tx_message.buf;
- if (!ti_sci_is_response_ack(resp))
- return -ENODEV;
-
*msmc_start = ((u64)resp->msmc_start_high << TISCI_ADDR_HIGH_SHIFT) |
resp->msmc_start_low;
*msmc_end = ((u64)resp->msmc_end_high << TISCI_ADDR_HIGH_SHIFT) |
if (ret)
return ret;
- resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
-
- if (!ti_sci_is_response_ack(resp))
- ret = -ENODEV;
-
return ret;
}
if (ret)
return ret;
- resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
-
- if (!ti_sci_is_response_ack(resp))
- ret = -ENODEV;
-
return ret;
}
if (ret)
return ret;
- resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
-
- if (!ti_sci_is_response_ack(resp))
- ret = -ENODEV;
-
return ret;
}
if (ret)
return ret;
- resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
-
- if (!ti_sci_is_response_ack(resp))
- ret = -ENODEV;
-
return ret;
}
if (ret)
return ret;
- resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
-
- if (!ti_sci_is_response_ack(resp))
- ret = -ENODEV;
-
return ret;
}
resp = (struct ti_sci_msg_resp_proc_auth_boot_image *)xfer->tx_message.buf;
- if (!ti_sci_is_response_ack(resp))
- return -ENODEV;
-
*image_addr = (resp->image_addr_low & TISCI_ADDR_LOW_MASK) |
(((u64)resp->image_addr_high <<
TISCI_ADDR_HIGH_SHIFT) & TISCI_ADDR_HIGH_MASK);
resp = (struct ti_sci_msg_resp_get_proc_boot_status *)
xfer->tx_message.buf;
- if (!ti_sci_is_response_ack(resp))
- return -ENODEV;
*bv = (resp->bootvector_low & TISCI_ADDR_LOW_MASK) |
(((u64)resp->bootvector_high <<
TISCI_ADDR_HIGH_SHIFT) & TISCI_ADDR_HIGH_MASK);
if (ret)
goto fail;
- resp = (struct ti_sci_msg_rm_ring_cfg_resp *)xfer->tx_message.buf;
-
- ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV;
-
fail:
dev_dbg(info->dev, "RM_RA:config ring %u ret:%d\n", index, ret);
return ret;
if (ret)
goto fail;
- resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
- ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV;
-
fail:
dev_dbg(info->dev, "RM_PSIL: nav: %u link pair %u->%u ret:%u\n",
nav_id, src_thread, dst_thread, ret);
if (ret)
goto fail;
- resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
- ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV;
-
fail:
dev_dbg(info->dev, "RM_PSIL: link unpair %u->%u ret:%u\n",
src_thread, dst_thread, ret);
if (ret)
goto fail;
- resp =
- (struct ti_sci_msg_rm_udmap_tx_ch_cfg_resp *)xfer->tx_message.buf;
- ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL;
-
fail:
dev_dbg(info->dev, "TX_CH_CFG: chn %u ret:%u\n", params->index, ret);
return ret;
if (ret)
goto fail;
- resp =
- (struct ti_sci_msg_rm_udmap_rx_ch_cfg_resp *)xfer->tx_message.buf;
- ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL;
-
fail:
dev_dbg(info->dev, "RX_CH_CFG: chn %u ret:%d\n", params->index, ret);
return ret;
if (ret)
goto fail;
- resp =
- (struct ti_sci_msg_rm_udmap_flow_cfg_resp *)xfer->tx_message.buf;
- ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL;
-
fail:
dev_dbg(info->dev, "RX_FL_CFG: %u ret:%d\n", params->flow_index, ret);
return ret;
if (ret)
return ret;
- resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
-
- if (!ti_sci_is_response_ack(resp))
- return -ENODEV;
-
return 0;
}
resp = (struct ti_sci_msg_fwl_get_firewall_region_resp *)xfer->tx_message.buf;
- if (!ti_sci_is_response_ack(resp))
- return -ENODEV;
-
region->fwl_id = resp->fwl_id;
region->region = resp->region;
region->n_permission_regs = resp->n_permission_regs;
resp = (struct ti_sci_msg_fwl_change_owner_info_resp *)xfer->tx_message.buf;
- if (!ti_sci_is_response_ack(resp))
- return -ENODEV;
-
owner->fwl_id = resp->fwl_id;
owner->region = resp->region;
owner->owner_index = resp->owner_index;