Commit da85175a authored by Jyothi Kumar Seerapu's avatar Jyothi Kumar Seerapu
Browse files

msm: mhi_dev: Change MHI logs for Channel and Ring Ids



Currently the MHI logs are not unique for channel and ring ids.
Post this change, all channel ids can be found with ch_id:xx and
all ring ids can be found with ring_id:yy in MHI logs, thus making
the debugging process easier.

Change-Id: I6352911814795792f796b2062da6465da7af89ff
Signed-off-by: default avatarJyothi Kumar Seerapu <quic_jseerapu@quicinc.com>
parent 0db056af
This diff is collapsed.
......@@ -121,7 +121,7 @@ static int mhi_dev_net_init_ch_attributes(struct mhi_dev_net_ctxt *mhi_ctxt)
chan_attrib->dir = MHI_DIR_OUT;
chan_attrib->chan_id = channel;
chan_attrib->max_packet_size = TRB_MAX_DATA_SIZE;
mhi_dev_net_log(MHI_INFO, "Write chan attributes dir %d chan_id %d\n",
mhi_dev_net_log(MHI_INFO, "Write ch attributes dir %d ch_id:%d\n",
chan_attrib->dir, chan_attrib->chan_id);
channel = MHI_CLIENT_IP_SW_4_IN;
......@@ -129,7 +129,7 @@ static int mhi_dev_net_init_ch_attributes(struct mhi_dev_net_ctxt *mhi_ctxt)
chan_attrib->dir = MHI_DIR_IN;
chan_attrib->chan_id = channel;
chan_attrib->max_packet_size = TRB_MAX_DATA_SIZE;
mhi_dev_net_log(MHI_INFO, "Read chan attributes dir %d chan_id %d\n",
mhi_dev_net_log(MHI_INFO, "Read ch attributes dir %d ch_id %d\n",
chan_attrib->dir, chan_attrib->chan_id);
return 0;
}
......@@ -299,7 +299,7 @@ static ssize_t mhi_dev_net_client_read(struct mhi_dev_net_client *mhi_handle)
if (bytes_avail < 0) {
mhi_dev_net_log(MHI_ERROR,
"Failed to read chan %d bytes_avail = %d\n",
"Failed to read ch_id:%d bytes_avail = %d\n",
chan, bytes_avail);
spin_lock_irqsave(&mhi_handle->rd_lock, flags);
kfree_skb(skb);
......@@ -513,18 +513,18 @@ static int mhi_dev_net_open_chan_create_netif(struct mhi_dev_net_client *client)
struct list_head *cp, *q;
struct mhi_req *mreq;
mhi_dev_net_log(MHI_DBG, "opening OUT %d IN %d channels\n",
mhi_dev_net_log(MHI_DBG, "opening OUT ch_id:%d IN ch_id:%d channels\n",
client->out_chan,
client->in_chan);
mhi_dev_net_log(MHI_DBG,
"Initializing inbound chan %d.\n",
"Initializing inbound ch_id:%d.\n",
client->in_chan);
rc = mhi_dev_open_channel(client->out_chan, &client->out_handle,
mhi_net_ctxt.net_event_notifier);
if (rc < 0) {
mhi_dev_net_log(MHI_ERROR,
"Failed to open chan %d, ret 0x%x\n",
"Failed to open ch_id:%d, ret 0x%x\n",
client->out_chan, rc);
goto handle_not_rdy_err;
} else
......@@ -534,13 +534,13 @@ static int mhi_dev_net_open_chan_create_netif(struct mhi_dev_net_client *client)
mhi_net_ctxt.net_event_notifier);
if (rc < 0) {
mhi_dev_net_log(MHI_ERROR,
"Failed to open chan %d, ret 0x%x\n",
"Failed to open ch_id:%d, ret 0x%x\n",
client->in_chan, rc);
goto handle_in_err;
} else
atomic_set(&client->tx_enabled, 1);
mhi_dev_net_log(MHI_INFO, "IN %d, OUT %d channels are opened",
mhi_dev_net_log(MHI_INFO, "IN ch_id:%d, OUT ch_id:%d channels are opened",
client->in_chan, client->out_chan);
INIT_LIST_HEAD(&client->rx_buffers);
......@@ -612,7 +612,8 @@ static int mhi_dev_net_rgstr_client(struct mhi_dev_net_client *client, int idx)
mutex_init(&client->out_chan_lock);
spin_lock_init(&client->wrt_lock);
spin_lock_init(&client->rd_lock);
mhi_dev_net_log(MHI_INFO, "Registering out %d, In %d channels\n",
mhi_dev_net_log(MHI_INFO, "Registering OUT ch_id:%d\t"
"IN ch_id:%d channels\n",
client->out_chan, client->in_chan);
return 0;
}
......@@ -653,20 +654,20 @@ static void mhi_dev_net_state_cb(struct mhi_dev_client_cb_data *cb_data)
ret = mhi_ctrl_state_info(mhi_client->in_chan, &info_in_ch);
if (ret) {
mhi_dev_net_log(MHI_ERROR,
"Failed to obtain in_channel %d state\n",
"Failed to obtain IN ch_id:%d state\n",
mhi_client->in_chan);
return;
}
ret = mhi_ctrl_state_info(mhi_client->out_chan, &info_out_ch);
if (ret) {
mhi_dev_net_log(MHI_ERROR,
"Failed to obtain out_channel %d state\n",
"Failed to obtain OUT ch_id:%d state\n",
mhi_client->out_chan);
return;
}
mhi_dev_net_log(MHI_MSG_VERBOSE, "in_channel :%d, state :%d\n",
mhi_dev_net_log(MHI_MSG_VERBOSE, "IN ch_id::%d, state :%d\n",
mhi_client->in_chan, info_in_ch);
mhi_dev_net_log(MHI_MSG_VERBOSE, "out_channel :%d, state :%d\n",
mhi_dev_net_log(MHI_MSG_VERBOSE, "OUT ch_id:%d, state :%d\n",
mhi_client->out_chan, info_out_ch);
if (info_in_ch == MHI_STATE_CONNECTED &&
info_out_ch == MHI_STATE_CONNECTED) {
......
......@@ -101,7 +101,7 @@ static int mhi_dev_mmio_mask_set_chdb_int_a7(struct mhi_dev *dev,
chid_idx = chdb_id/32;
if (chid_idx >= MHI_MASK_ROWS_CH_EV_DB) {
mhi_log(MHI_MSG_ERROR, "Invalid channel id:%d\n", chid_idx);
mhi_log(MHI_MSG_ERROR, "Invalid ch_id:%d\n", chid_idx);
return -EINVAL;
}
......
......@@ -94,7 +94,7 @@ int mhi_dev_cache_ring(struct mhi_dev_ring *ring, size_t wr_offset)
if (ring->wr_offset == wr_offset) {
mhi_log(MHI_MSG_VERBOSE,
"nothing to cache for ring %d, local wr_ofst %lu\n",
"nothing to cache for ring_id:%d, local wr_ofst %lu\n",
ring->id, ring->wr_offset);
mhi_log(MHI_MSG_VERBOSE,
"new wr_offset %lu\n", wr_offset);
......@@ -112,16 +112,16 @@ int mhi_dev_cache_ring(struct mhi_dev_ring *ring, size_t wr_offset)
ring->id < (mhi_ctx->ev_ring_start +
mhi_ctx->cfg.event_rings)) {
mhi_log(MHI_MSG_VERBOSE,
"not caching event ring %d\n", ring->id);
"not caching event ring_id:%d\n", ring->id);
return 0;
}
mhi_log(MHI_MSG_VERBOSE, "caching ring %d, start %lu, end %lu\n",
mhi_log(MHI_MSG_VERBOSE, "caching ring_id:%d, start %lu, end %lu\n",
ring->id, old_offset, wr_offset);
if (mhi_dev_fetch_ring_elements(ring, old_offset, wr_offset)) {
mhi_log(MHI_MSG_ERROR,
"failed to fetch elements for ring %d, start %lu, end %lu\n",
"failed to fetch elements for ring_id:%d, start %lu, end %lu\n",
ring->id, old_offset, wr_offset);
return -EINVAL;
}
......@@ -147,7 +147,7 @@ int mhi_dev_update_wr_offset(struct mhi_dev_ring *ring)
return rc;
}
mhi_log(MHI_MSG_VERBOSE,
"ring %d wr_offset from db 0x%lx\n",
"ring_id:%d wr_offset from db 0x%lx\n",
ring->id, (size_t) wr_offset);
break;
case RING_TYPE_ER:
......@@ -164,7 +164,7 @@ int mhi_dev_update_wr_offset(struct mhi_dev_ring *ring)
return rc;
}
mhi_log(MHI_MSG_VERBOSE,
"ring %d wr_offset from db 0x%lx\n",
"ring_id:%d wr_offset from db 0x%lx\n",
ring->id, (size_t) wr_offset);
break;
default:
......@@ -202,7 +202,7 @@ int mhi_dev_process_ring_element(struct mhi_dev_ring *ring, size_t offset)
if (ring->ring_cb)
return ring->ring_cb(ring->mhi_dev, el, (void *)ring);
else
mhi_log(MHI_MSG_ERROR, "No callback registered for ring %d\n",
mhi_log(MHI_MSG_ERROR, "No callback registered for ring_id:%d\n",
ring->id);
return 0;
......@@ -217,19 +217,19 @@ int mhi_dev_process_ring(struct mhi_dev_ring *ring)
return -EINVAL;
mhi_log(MHI_MSG_VERBOSE,
"Before wr update ring_id (%d) rp:%lu wp:%lu\n",
"Before wr update ring_id:%d rp:%lu wp:%lu\n",
ring->id, ring->rd_offset, ring->wr_offset);
rc = mhi_dev_update_wr_offset(ring);
if (rc) {
mhi_log(MHI_MSG_ERROR,
"Error updating write-offset for ring %d\n",
"Error updating write-offset for ring_id:%d\n",
ring->id);
return rc;
}
mhi_log(MHI_MSG_VERBOSE,
"After wp update ring_id (%d) rp:%lu with wr:%lu\n",
"After wp update ring_id:%d rp:%lu with wr:%lu\n",
ring->id, ring->rd_offset, ring->wr_offset);
/*
......@@ -247,13 +247,13 @@ int mhi_dev_process_ring(struct mhi_dev_ring *ring)
while (ring->rd_offset != ring->wr_offset) {
mhi_log(MHI_MSG_VERBOSE,
"Processing ring (%d) rd_offset:%lu, wr_offset:%lu\n",
"Processing ring_id:%d rd_offset:%lu, wr_offset:%lu\n",
ring->id, ring->rd_offset, ring->wr_offset);
rc = mhi_dev_process_ring_element(ring, ring->rd_offset);
if (rc) {
mhi_log(MHI_MSG_ERROR,
"Error processing ring (%d) element(rp) (%lu)\n",
"Error processing ring_id:%d element(rp):%lu\n",
ring->id, ring->rd_offset);
return rc;
}
......@@ -298,7 +298,7 @@ int mhi_dev_add_element(struct mhi_dev_ring *ring,
ring->wr_offset - 1;
if (num_free_elem < num_elem) {
mhi_log(MHI_MSG_ERROR, "No space to add %d elem in ring (%d)\n",
mhi_log(MHI_MSG_ERROR, "No space to add %d elem in ring_id:%d\n",
num_elem, ring->id);
return -EINVAL;
}
......@@ -313,8 +313,9 @@ int mhi_dev_add_element(struct mhi_dev_ring *ring,
mhi_dev_ring_inc_index(ring, ring->rd_offset);
mhi_log(MHI_MSG_VERBOSE,
"Writing %d elements, ring old 0x%x, new 0x%x\n",
num_elem, old_offset, ring->rd_offset);
"Writing %d elements in ring_id:%d\t"
"ring old-offset 0x%x, new-offset 0x%x\n",
num_elem, ring->id, old_offset, ring->rd_offset);
ring->ring_ctx->generic.rp = (ring->rd_offset *
sizeof(union mhi_dev_ring_element_type)) +
......@@ -336,7 +337,7 @@ int mhi_dev_add_element(struct mhi_dev_ring *ring,
host_addr.virt_addr = element;
host_addr.size = sizeof(union mhi_dev_ring_element_type);
mhi_log(MHI_MSG_VERBOSE, "adding element to ring (%d)\n",
mhi_log(MHI_MSG_VERBOSE, "adding element to ring_id:%d\n",
ring->id);
mhi_log(MHI_MSG_VERBOSE, "rd_ofset %lu\n", ring->rd_offset);
mhi_log(MHI_MSG_VERBOSE, "type %d\n", element->generic.type);
......@@ -356,7 +357,7 @@ int mhi_dev_add_element(struct mhi_dev_ring *ring,
(element + i)->evt_tr_comp.code);
mhi_log(MHI_MSG_VERBOSE, "evnt type :0x%x\n",
(element + i)->evt_tr_comp.type);
mhi_log(MHI_MSG_VERBOSE, "evnt chid :0x%x\n",
mhi_log(MHI_MSG_VERBOSE, "evnt ch_id :0x%x\n",
(element + i)->evt_tr_comp.chid);
}
/* Adding multiple ring elements */
......
......@@ -452,7 +452,7 @@ static bool mhi_uci_are_channels_connected(struct uci_client *uci_client)
rc = mhi_ctrl_state_info(uci_client->in_chan, &info_ch_in);
if (rc) {
uci_log(UCI_DBG_DBG,
"Channels %d is not available with %d\n",
"ch_id:%d is not available with %d\n",
uci_client->out_chan, rc);
return false;
}
......@@ -460,7 +460,7 @@ static bool mhi_uci_are_channels_connected(struct uci_client *uci_client)
rc = mhi_ctrl_state_info(uci_client->out_chan, &info_ch_out);
if (rc) {
uci_log(UCI_DBG_DBG,
"Channels %d is not available with %d\n",
"ch_id:%d is not available with %d\n",
uci_client->out_chan, rc);
return false;
}
......@@ -468,7 +468,7 @@ static bool mhi_uci_are_channels_connected(struct uci_client *uci_client)
if ((info_ch_in != MHI_STATE_CONNECTED) ||
(info_ch_out != MHI_STATE_CONNECTED)) {
uci_log(UCI_DBG_DBG,
"Channels %d or %d are not connected\n",
"ch_id:%d or %d are not connected\n",
uci_client->in_chan, uci_client->out_chan);
return false;
}
......@@ -490,13 +490,13 @@ static int mhi_init_read_chan(struct uci_client *client_handle,
return -EINVAL;
}
if (chan >= MHI_MAX_SOFTWARE_CHANNELS) {
uci_log(UCI_DBG_ERROR, "Incorrect channel number %d\n", chan);
uci_log(UCI_DBG_ERROR, "Incorrect ch_id:%d\n", chan);
return -EINVAL;
}
in_chan_attr = client_handle->in_chan_attr;
if (!in_chan_attr) {
uci_log(UCI_DBG_ERROR, "Null channel attributes for chan %d\n",
uci_log(UCI_DBG_ERROR, "Null channel attributes for ch_id:%d\n",
client_handle->in_chan);
return -EINVAL;
}
......@@ -531,7 +531,7 @@ static struct mhi_req *mhi_uci_get_req(struct uci_client *uci_handle)
spin_lock_irqsave(&uci_handle->req_lock, flags);
if (list_empty(&uci_handle->req_list)) {
uci_log(UCI_DBG_ERROR, "Request pool empty for chans %d, %d\n",
uci_log(UCI_DBG_ERROR, "Request pool empty for ch_id:%d, %d\n",
uci_handle->in_chan, uci_handle->out_chan);
spin_unlock_irqrestore(&uci_handle->req_lock, flags);
return NULL;
......@@ -546,7 +546,7 @@ static struct mhi_req *mhi_uci_get_req(struct uci_client *uci_handle)
* req is re-used
*/
if (req->is_stale && req->buf && MHI_UCI_IS_CHAN_DIR_IN(req->chan)) {
uci_log(UCI_DBG_VERBOSE, "Freeing write buf for chan %d\n",
uci_log(UCI_DBG_VERBOSE, "Freeing write buf for ch_id:%d\n",
req->chan);
kfree(req->buf);
}
......@@ -565,7 +565,7 @@ static int mhi_uci_put_req(struct uci_client *uci_handle, struct mhi_req *req)
spin_lock_irqsave(&uci_handle->req_lock, flags);
if (req->is_stale) {
uci_log(UCI_DBG_VERBOSE,
"Got stale completion for ch %d, ignoring\n",
"Got stale completion for ch_id:%d, ignoring\n",
req->chan);
spin_unlock_irqrestore(&uci_handle->req_lock, flags);
return -EINVAL;
......@@ -630,7 +630,8 @@ static int mhi_uci_send_sync(struct uci_client *uci_handle,
int ret_val;
uci_log(UCI_DBG_VERBOSE,
"Sync write for ch %d size %d\n", uci_handle->out_chan, size);
"Sync write for ch_id:%d size %d\n",
uci_handle->out_chan, size);
ureq.client = uci_handle->out_handle;
ureq.buf = data_loc;
......@@ -652,7 +653,7 @@ static int mhi_uci_send_async(struct uci_client *uci_handle,
struct mhi_req *ureq;
uci_log(UCI_DBG_DBG,
"Async write for ch %d size %d\n",
"Async write for ch_id:%d size %d\n",
uci_handle->out_chan, size);
ureq = mhi_uci_get_req(uci_handle);
......@@ -691,7 +692,7 @@ static int mhi_uci_send_packet(struct uci_client *uci_handle, void *data_loc,
ret_val = uci_handle->send(uci_handle, data_loc, size);
if (!ret_val) {
uci_log(UCI_DBG_VERBOSE,
"No descriptors available, did we poll, chan %d?\n",
"No descriptors available, did we poll, ch_id:%d?\n",
uci_handle->out_chan);
mutex_unlock(&uci_handle->out_chan_lock);
if (uci_handle->f_flags & (O_NONBLOCK | O_NDELAY))
......@@ -711,7 +712,7 @@ static int mhi_uci_send_packet(struct uci_client *uci_handle, void *data_loc,
* Wait till pending writes complete or a timeout.
*/
uci_log(UCI_DBG_VERBOSE,
"Write req list empty for chan %d\n",
"Write req list empty for ch_id:%d\n",
uci_handle->out_chan);
mutex_unlock(&uci_handle->out_chan_lock);
if (uci_handle->f_flags & (O_NONBLOCK | O_NDELAY))
......@@ -726,14 +727,14 @@ static int mhi_uci_send_packet(struct uci_client *uci_handle, void *data_loc,
* retry the write.
*/
uci_log(UCI_DBG_VERBOSE,
"Write req struct available for chan %d\n",
"Write req struct available for ch_id:%d\n",
uci_handle->out_chan);
mutex_lock(&uci_handle->out_chan_lock);
ret_val = 0;
continue;
} else if (!ret_val) {
uci_log(UCI_DBG_ERROR,
"Timed out waiting for write req, chan %d\n",
"Timed out waiting for write req, ch_id:%d\n",
uci_handle->out_chan);
return -EIO;
} else if (-ERESTARTSYS == ret_val) {
......@@ -743,7 +744,7 @@ static int mhi_uci_send_packet(struct uci_client *uci_handle, void *data_loc,
}
} else if (ret_val < 0) {
uci_log(UCI_DBG_ERROR,
"Err sending data: chan %d, buf %pK, size %d\n",
"Err sending data: ch_id:%d, buf %pK, size %d\n",
uci_handle->out_chan, data_loc, size);
ret_val = -EIO;
break;
......@@ -807,18 +808,18 @@ static unsigned int mhi_uci_client_poll(struct file *file, poll_table *wait)
if (!atomic_read(&uci_ctxt.mhi_disabled) &&
!mhi_dev_channel_isempty(uci_handle->in_handle)) {
uci_log(UCI_DBG_VERBOSE,
"Client can read chan %d\n", uci_handle->in_chan);
"Client can read ch_id:%d\n", uci_handle->in_chan);
mask |= POLLIN | POLLRDNORM;
}
if (!atomic_read(&uci_ctxt.mhi_disabled) &&
!mhi_dev_channel_isempty(uci_handle->out_handle)) {
uci_log(UCI_DBG_VERBOSE,
"Client can write chan %d\n", uci_handle->out_chan);
"Client can write ch_id:%d\n", uci_handle->out_chan);
mask |= POLLOUT | POLLWRNORM;
}
uci_log(UCI_DBG_VERBOSE,
"Client attempted to poll chan %d, returning mask 0x%x\n",
"Client attempted to poll ch_id:%d, returning mask 0x%x\n",
uci_handle->in_chan, mask);
mutex_unlock(&uci_handle->client_lock);
......@@ -853,7 +854,7 @@ static int mhi_uci_alloc_reqs(struct uci_client *client)
list_add_tail(&client->reqs[i].list, &client->req_list);
uci_log(UCI_DBG_INFO,
"Allocated %d write reqs for chan %d\n",
"Allocated %d write reqs for ch_id:%d\n",
num_reqs, client->out_chan);
return 0;
}
......@@ -866,12 +867,12 @@ static int mhi_uci_read_async(struct uci_client *uci_handle, int *bytes_avail)
struct mhi_dev_client *client_handle;
uci_log(UCI_DBG_DBG,
"Async read for ch %d\n", uci_handle->in_chan);
"Async read for ch_id:%d\n", uci_handle->in_chan);
ureq = mhi_uci_get_req(uci_handle);
if (!ureq) {
uci_log(UCI_DBG_ERROR,
"Out of reqs for chan %d\n", uci_handle->in_chan);
"Out of reqs for ch_id:%d\n", uci_handle->in_chan);
return -EBUSY;
}
......@@ -917,14 +918,14 @@ static int mhi_uci_read_async(struct uci_client *uci_handle, int *bytes_avail)
uci_log(UCI_DBG_ERROR, "Exit signal caught\n");
return compl_ret;
} else if (compl_ret == 0) {
uci_log(UCI_DBG_ERROR, "Read timed out for ch %d\n",
uci_log(UCI_DBG_ERROR, "Read timed out for ch_id:%d\n",
uci_handle->in_chan);
return -EIO;
}
uci_log(UCI_DBG_VERBOSE,
"wk up Read completed on ch %d\n", uci_handle->in_chan);
"wk up Read completed on ch_id:%d\n", uci_handle->in_chan);
uci_log(UCI_DBG_VERBOSE,
"Got pkt of sz 0x%lx at adr %pK, ch %d\n",
"Got pkt of sz 0x%lx at adr %pK, ch_id:%d\n",
uci_handle->pkt_size,
uci_handle->pkt_loc, uci_handle->in_chan);
} else {
......@@ -945,7 +946,7 @@ static int mhi_uci_read_sync(struct uci_client *uci_handle, int *bytes_avail)
struct mhi_dev_client *client_handle;
uci_log(UCI_DBG_INFO,
"Sync read for ch %d\n", uci_handle->in_chan);
"Sync read for ch_id:%d\n", uci_handle->in_chan);
client_handle = uci_handle->in_handle;
ureq.chan = uci_handle->in_chan;
......@@ -969,7 +970,7 @@ static int mhi_uci_read_sync(struct uci_client *uci_handle, int *bytes_avail)
uci_handle->pkt_size = ureq.transfer_len;
uci_log(UCI_DBG_VERBOSE,
"Got pkt of sz 0x%lx at adr %pK, ch %d\n",
"Got pkt of sz 0x%lx at adr %pK, ch_id:%d\n",
uci_handle->pkt_size,
ureq.buf, ureq.chan);
} else {
......@@ -990,7 +991,7 @@ static int open_client_mhi_channels(struct uci_client *uci_client)
}
uci_log(UCI_DBG_DBG,
"Starting channels %d %d.\n",
"Starting channels OUT ch_id:%d IN ch_id:%d\n",
uci_client->out_chan,
uci_client->in_chan);
mutex_lock(&uci_client->out_chan_lock);
......@@ -1009,7 +1010,7 @@ static int open_client_mhi_channels(struct uci_client *uci_client)
}
uci_log(UCI_DBG_DBG,
"Initializing inbound chan %d.\n",
"Initializing inbound ch_id:%d.\n",
uci_client->in_chan);
rc = mhi_init_read_chan(uci_client, uci_client->in_chan);
if (rc < 0) {
......@@ -1030,7 +1031,7 @@ static int open_client_mhi_channels(struct uci_client *uci_client)
uci_ctxt.event_notifier);
if (rc < 0) {
uci_log(UCI_DBG_ERROR,
"Failed to open chan %d, ret %d\n",
"Failed to open ch_id:%d, ret %d\n",
uci_client->out_chan, rc);
goto handle_in_err;
}
......@@ -1133,14 +1134,14 @@ static int mhi_uci_client_release(struct inode *mhi_inode,
mutex_lock(&uci_handle->client_lock);
in_chan_attr = uci_handle->in_chan_attr;
if (!in_chan_attr) {
uci_log(UCI_DBG_ERROR, "Null channel attributes for chan %d\n",
uci_log(UCI_DBG_ERROR, "Null channel attributes for ch_id:%d\n",
uci_handle->in_chan);
mutex_unlock(&uci_handle->client_lock);
return -EINVAL;
}
if (atomic_sub_return(1, &uci_handle->ref_count)) {
uci_log(UCI_DBG_DBG, "Client close chan %d, ref count 0x%x\n",
uci_log(UCI_DBG_DBG, "Client close ch_id:%d, ref count 0x%x\n",
iminor(mhi_inode),
atomic_read(&uci_handle->ref_count));
mutex_unlock(&uci_handle->client_lock);
......@@ -1148,7 +1149,7 @@ static int mhi_uci_client_release(struct inode *mhi_inode,
}
uci_log(UCI_DBG_DBG,
"Last client left, closing channel 0x%x\n",
"Last client left, closing ch 0x%x\n",
iminor(mhi_inode));
do {
......@@ -1160,7 +1161,7 @@ static int mhi_uci_client_release(struct inode *mhi_inode,
} while (++count < MHI_UCI_RELEASE_TIMEOUT_COUNT);
if (count == MHI_UCI_RELEASE_TIMEOUT_COUNT) {
uci_log(UCI_DBG_DBG, "Channel %d has pending writes\n",
uci_log(UCI_DBG_DBG, "ch_id:%d has pending writes\n",
iminor(mhi_inode));
}
......@@ -1191,7 +1192,7 @@ static int mhi_uci_client_release(struct inode *mhi_inode,
list_del_init(&ureq->list);
ureq->is_stale = true;
uci_log(UCI_DBG_VERBOSE,
"Adding back req for chan %d to free list\n",
"Adding back req for ch_id:%d to free list\n",
ureq->chan);
list_add_tail(&ureq->list, &uci_handle->req_list);
count++;
......@@ -1256,12 +1257,12 @@ static int mhi_state_uevent(struct device *dev, struct kobj_uevent_env *env)
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_INFO, "Calling notify for ch %d\n",
uci_log(UCI_DBG_INFO, "Calling notify for ch_id:%d\n",
chan_attrib->chan_id);
rc = mhi_ctrl_state_info(chan_attrib->chan_id, &info);
if (rc) {
uci_log(UCI_DBG_ERROR,
"Failed to obtain channel %d state\n",
"Failed to obtain ch_id:%d state\n",
chan_attrib->chan_id);
return -EINVAL;
}
......@@ -1343,7 +1344,7 @@ static int __mhi_uci_client_read(struct uci_client *uci_handle,
/* If nothing was copied yet, wait for data */
uci_log(UCI_DBG_VERBOSE,
"No data read_data_ready %d, chan %d\n",
"No data read_data_ready %d, ch_id:%d\n",
atomic_read(&uci_handle->read_data_ready),
uci_handle->in_chan);
if (uci_handle->f_flags & (O_NONBLOCK | O_NDELAY))
......@@ -1359,13 +1360,13 @@ static int __mhi_uci_client_read(struct uci_client *uci_handle,
}
uci_log(UCI_DBG_VERBOSE,
"wk up Got data on ch %d read_data_ready %d\n",
"wk up Got data on ch_id:%d read_data_ready %d\n",
uci_handle->in_chan,
atomic_read(&uci_handle->read_data_ready));
} else if (*bytes_avail > 0) {
/* A valid packet was returned from MHI */
uci_log(UCI_DBG_VERBOSE,
"Got packet: avail pkts %d phy_adr %pK, ch %d\n",
"Got packet: avail pkts %d phy_adr %pK, ch_id:%d\n",
atomic_read(&uci_handle->read_data_ready),
uci_handle->pkt_loc,
uci_handle->in_chan);
......@@ -1398,7 +1399,7 @@ static ssize_t mhi_uci_client_read(struct file *file, char __user *ubuf,
mutex = &uci_handle->in_chan_lock;
mutex_lock(mutex);
uci_log(UCI_DBG_VERBOSE, "Client attempted read on chan %d\n",
uci_log(UCI_DBG_VERBOSE, "Client attempted read on ch_id:%d\n",
uci_handle->in_chan);
ret_val = __mhi_uci_client_read(uci_handle, &bytes_avail);
......@@ -1418,7 +1419,7 @@ static ssize_t mhi_uci_client_read(struct file *file, char __user *ubuf,
bytes_copied = *bytes_pending;
*bytes_pending = 0;
uci_log(UCI_DBG_VERBOSE, "Copied 0x%lx of 0x%x, chan %d\n",
uci_log(UCI_DBG_VERBOSE, "Copied 0x%lx of 0x%x, ch_id:%d\n",
bytes_copied, (u32)*bytes_pending, uci_handle->in_chan);
} else {
addr_offset = uci_handle->pkt_size - *bytes_pending;
......@@ -1429,7 +1430,7 @@ static ssize_t mhi_uci_client_read(struct file *file, char __user *ubuf,
}
bytes_copied = uspace_buf_size;
*bytes_pending -= uspace_buf_size;
uci_log(UCI_DBG_VERBOSE, "Copied 0x%lx of 0x%x,chan %d\n",
uci_log(UCI_DBG_VERBOSE, "Copied 0x%lx of 0x%x,ch_id:%d\n",
bytes_copied,
(u32)*bytes_pending,
uci_handle->in_chan);
......@@ -1437,7 +1438,7 @@ static ssize_t mhi_uci_client_read(struct file *file, char __user *ubuf,
/* We finished with this buffer, map it back */
if (*bytes_pending == 0) {
uci_log(UCI_DBG_VERBOSE,
"All data consumed. Pkt loc %p ,chan %d\n",
"All data consumed. Pkt loc %p ,ch_id:%d\n",
uci_handle->pkt_loc, uci_handle->in_chan);
uci_handle->pkt_loc = 0;
uci_handle->pkt_size = 0;
......@@ -1578,7 +1579,7 @@ void mhi_uci_chan_state_notify_all(struct mhi_dev *mhi,
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",
uci_log(UCI_DBG_ERROR, "Calling notify for ch_id:%d\n",
chan_attrib->chan_id);
mhi_uci_chan_state_notify(mhi, chan_attrib->chan_id,
ch_state);
......@@ -1595,14 +1596,14 @@ void mhi_uci_chan_state_notify(struct mhi_dev *mhi,
int rc;
if (ch_id < 0 || ch_id >= MHI_MAX_SOFTWARE_CHANNELS) {
uci_log(UCI_DBG_ERROR, "Invalid chan %d\n", ch_id);
uci_log(UCI_DBG_ERROR, "Invalid ch_id:%d\n", ch_id);
return;
}
uci_handle = &uci_ctxt.client_handles[CHAN_TO_CLIENT(ch_id)];
if (!uci_handle->out_chan_attr ||
!uci_handle->out_chan_attr->state_bcast) {
uci_log(UCI_DBG_VERBOSE, "Uevents not enabled for chan %d\n",
uci_log(UCI_DBG_VERBOSE, "Uevents not enabled for ch_id:%d\n",
ch_id);
return;
}
......@@ -1628,7 +1629,7 @@ void mhi_uci_chan_state_notify(struct mhi_dev *mhi,
rc = kobject_uevent_env(&mhi->dev->kobj, KOBJ_CHANGE, buf);
if (rc)
uci_log(UCI_DBG_ERROR,
"Sending uevent failed for chan %d\n", ch_id);