From 485572902c62da909ca4a29ff4f11d904930beea Mon Sep 17 00:00:00 2001 From: Gauri Joshi Date: Fri, 4 Jun 2021 16:51:01 -0700 Subject: [PATCH] msm: mhi-dev: Send channel state broadcasts for QRTR channels Set the channel attribute for QRTR channels (MHI_CLIENT_IPCR_OUT and MHI_CLIENT_IPCR_IN) so that QRTR client gets the uevent broadcast when the channel state changes. Change the naming for the structure to mhi_chan_attr_table since kernel clients are also configured using the same structure. Change-Id: I40232a09c27d7410d772055448d0354fb0c359b1 Signed-off-by: Gauri Joshi --- drivers/platform/msm/mhi_dev/mhi_uci.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/platform/msm/mhi_dev/mhi_uci.c b/drivers/platform/msm/mhi_dev/mhi_uci.c index 2d04c2cbf5b0..d33ddfe5ea81 100644 --- a/drivers/platform/msm/mhi_dev/mhi_uci.c +++ b/drivers/platform/msm/mhi_dev/mhi_uci.c @@ -96,8 +96,11 @@ static void mhi_uci_generic_client_cb(struct mhi_dev_client_cb_data *cb_data); static void mhi_uci_at_ctrl_client_cb(struct mhi_dev_client_cb_data *cb_data); static void mhi_uci_at_ctrl_tre_cb(struct mhi_dev_client_cb_reason *reason); -/* UCI channel attributes table */ -static const struct chan_attr uci_chan_attr_table[] = { +/* MHI channel attributes table + * Skip node creation for IPCR channels but still allow uevent broadcast to + * QRTR client by setting the broadcast flag + */ +static const struct chan_attr mhi_chan_attr_table[] = { { MHI_CLIENT_LOOPBACK_OUT, TRB_MAX_DATA_SIZE, @@ -267,7 +270,7 @@ static const struct chan_attr uci_chan_attr_table[] = { NULL, NULL, false, - false, + true, true }, { @@ -1224,8 +1227,8 @@ static int mhi_state_uevent(struct device *dev, struct kobj_uevent_env *env) mhi_parse_state(buf, &nbytes, info); add_uevent_var(env, "MHI_STATE=%s", buf); - for (i = 0; i < ARRAY_SIZE(uci_chan_attr_table); i++) { - chan_attrib = &uci_chan_attr_table[i]; + for (i = 0; i < ARRAY_SIZE(mhi_chan_attr_table); i++) { + chan_attrib = &mhi_chan_attr_table[i]; if (chan_attrib->state_bcast) { uci_log(UCI_DBG_ERROR, "Calling notify for ch %d\n", chan_attrib->chan_id); @@ -1548,8 +1551,8 @@ void mhi_uci_chan_state_notify_all(struct mhi_dev *mhi, unsigned int i; const struct chan_attr *chan_attrib; - for (i = 0; i < ARRAY_SIZE(uci_chan_attr_table); i++) { - chan_attrib = &uci_chan_attr_table[i]; + for (i = 0; i < ARRAY_SIZE(mhi_chan_attr_table); i++) { + chan_attrib = &mhi_chan_attr_table[i]; if (chan_attrib->state_bcast) { uci_log(UCI_DBG_ERROR, "Calling notify for ch %d\n", chan_attrib->chan_id); @@ -2101,8 +2104,8 @@ static int uci_init_client_attributes(struct mhi_uci_ctxt_t *uci_ctxt) struct uci_client *client; const struct chan_attr *chan_attrib; - for (i = 0; i < ARRAY_SIZE(uci_chan_attr_table); i += 2) { - chan_attrib = &uci_chan_attr_table[i]; + for (i = 0; i < ARRAY_SIZE(mhi_chan_attr_table); i += 2) { + chan_attrib = &mhi_chan_attr_table[i]; index = CHAN_TO_CLIENT(chan_attrib->chan_id); client = &uci_ctxt->client_handles[index]; client->out_chan_attr = chan_attrib;