diff --git a/drivers/platform/msm/mhi_dev/mhi.c b/drivers/platform/msm/mhi_dev/mhi.c index 89cb1a703035..1b6259bdcaba 100644 --- a/drivers/platform/msm/mhi_dev/mhi.c +++ b/drivers/platform/msm/mhi_dev/mhi.c @@ -300,14 +300,16 @@ static int mhi_dev_schedule_msi_ipa(struct mhi_dev *mhi, struct event_req *ereq) ereq->msi_cb = mhi_dev_event_msi_cb; ch->msi_cnt++; mhi_log(MHI_MSG_VERBOSE, - "Sending MSI %d to 0x%llx as data = 0x%x for ch %d msi_count %d, ereq flush_num %d\n", + "Sending MSI %d to 0x%llx as data = 0x%x for ch_id:%d\t" + "msi_count %d, ereq flush_num %d\n", ctx->ev.msivec, msi_addr.host_pa, *ring->msi_buf, ch->ch_id, ch->msi_cnt, ereq->flush_num); } else { ereq->msi_cb = mhi_dev_cmd_event_msi_cb; mhi_log(MHI_MSG_VERBOSE, - "Sending MSI %d to 0x%llx as data = 0x%x for cmd ack, ereq flush_num %d\n", + "Sending MSI %d to 0x%llx as data = 0x%x for cmd ack\t" + "ereq flush_num %d\n", ctx->ev.msivec, msi_addr.host_pa, *ring->msi_buf, ereq->flush_num); } @@ -471,12 +473,12 @@ static int mhi_dev_send_multiple_tr_events(struct mhi_dev *mhi, int evnt_ring, if (evnt_ring_idx > mhi->cfg.event_rings) { mhi_log(MHI_MSG_ERROR, - "Invalid event ring idx: %lld\n", evnt_ring_idx); + "Invalid event ring_id:%lld\n", evnt_ring_idx); return -EINVAL; } if (!ring) { - mhi_log(MHI_MSG_ERROR, "Ring %d not present\n", + mhi_log(MHI_MSG_ERROR, "ring_id:%d not present\n", evnt_ring_idx); return -EINVAL; } @@ -487,7 +489,8 @@ static int mhi_dev_send_multiple_tr_events(struct mhi_dev *mhi, int evnt_ring, rc = mhi_ring_start(ring, ctx, mhi); if (rc) { mhi_log(MHI_MSG_ERROR, - "error starting event ring %d\n", evnt_ring); + "error starting event ring_id:%d\n", + evnt_ring_idx); return rc; } } @@ -513,12 +516,12 @@ static int mhi_dev_send_multiple_tr_events(struct mhi_dev *mhi, int evnt_ring, if (ch->state == MHI_DEV_CH_STOPPED || ch->state == MHI_DEV_CH_PENDING_STOP) { mhi_log(MHI_MSG_ERROR, - "Ch:%d is in %d state, abort sending completion evnt\n" + "ch_id:%d is in %d state, abort sending cmpl evnt\n" , ch->ch_id, ch->state); rc = -ENXIO; goto exit; } - mhi_log(MHI_MSG_VERBOSE, "Flushing %d cmpl events of ch %d\n", + mhi_log(MHI_MSG_VERBOSE, "Flushing %d cmpl events of ch_id:%d\n", ereq->num_events, ch->ch_id); } else { mhi_log(MHI_MSG_VERBOSE, @@ -651,7 +654,7 @@ static int mhi_dev_flush_transfer_completion_events(struct mhi_dev *mhi, if (ch->state == MHI_DEV_CH_CLOSED || ch->state == MHI_DEV_CH_STOPPED) { mhi_log(MHI_MSG_DBG, - "Ch %d closed with %d writes pending\n", + "ch_id:%d closed with %d writes pending\n", ch->ch_id, ch->pend_wr_count + 1); rc = -ENODEV; break; @@ -667,7 +670,7 @@ static int mhi_dev_flush_transfer_completion_events(struct mhi_dev *mhi, if (ch->flush_req_cnt++ >= U32_MAX) ch->flush_req_cnt = 0; flush_ereq->flush_num = ch->flush_req_cnt; - mhi_log(MHI_MSG_DBG, "Flush num %d called for ch %d\n", + mhi_log(MHI_MSG_DBG, "Flush num %d called for ch_id:%d\n", ch->flush_req_cnt, ch->ch_id); /* Check the limits of the buffer to be flushed */ @@ -852,12 +855,14 @@ int mhi_transfer_host_to_device_ipa(void *dev, uint64_t host_pa, uint32_t len, mhi_log(MHI_MSG_VERBOSE, "device 0x%llx <-- host 0x%llx, size %d\n", (uint64_t) mhi->read_dma_handle, host_addr_pa, (int) len); + ch = mreq->client->channel; if (mreq->mode == DMA_SYNC) { rc = ipa_dma_sync_memcpy((u64) mhi->read_dma_handle, host_addr_pa, (int) len); if (rc) { mhi_log(MHI_MSG_ERROR, - "error while reading chan using sync:%d\n", rc); + "error while reading ch_id:%d using sync, rc\n", + ch->ch_id, rc); return rc; } memcpy(dev, mhi->read_handle, len); @@ -870,7 +875,8 @@ int mhi_transfer_host_to_device_ipa(void *dev, uint64_t host_pa, uint32_t len, if (ring->rd_offset == ring->wr_offset) { mhi_log(MHI_MSG_VERBOSE, - "Setting snd_cmpl to 1 for ch %d\n", ch->ch_id); + "Setting snd_cmpl to 1 for ch_id:%d\n", + ch->ch_id); mreq->snd_cmpl = 1; } @@ -878,7 +884,7 @@ int mhi_transfer_host_to_device_ipa(void *dev, uint64_t host_pa, uint32_t len, rc = mhi_dev_queue_transfer_completion(mreq, NULL); if (rc) { mhi_log(MHI_MSG_ERROR, - "Failed to queue completion for ch %d, rc %d\n", + "Failed to queue completion for ch_id:%d, rc %d\n", ch->ch_id, rc); return rc; } @@ -888,7 +894,8 @@ int mhi_transfer_host_to_device_ipa(void *dev, uint64_t host_pa, uint32_t len, mreq); if (rc) { mhi_log(MHI_MSG_ERROR, - "DMA read error %d for ch %d\n", rc, ch->ch_id); + "DMA read error %d for ch_id:%d\n", + rc, ch->ch_id); /* Roll back the completion event that we wrote above */ mhi_dev_rollback_compl_evt(ch); /* Unmap the buffer */ @@ -1187,7 +1194,8 @@ int mhi_transfer_host_to_device_edma(void *dev, uint64_t host_pa, uint32_t len, if (ring->rd_offset == ring->wr_offset) { mhi_log(MHI_MSG_VERBOSE, - "Setting snd_cmpl to 1 for ch %d\n", ch->ch_id); + "Setting snd_cmpl to 1 for ch_id:%d\n", + ch->ch_id); mreq->snd_cmpl = 1; } @@ -1489,7 +1497,7 @@ static void mhi_hwc_cb(void *priv, enum ipa_mhi_event_type event, switch (event) { case IPA_MHI_EVENT_READY: mhi_log(MHI_MSG_INFO, - "HW Channel uC is ready event=0x%X\n", event); + "HW ch uC is ready event=0x%X\n", event); rc = mhi_hwc_start(mhi_ctx); if (rc) { mhi_log(MHI_MSG_ERROR, @@ -1516,7 +1524,7 @@ static void mhi_hwc_cb(void *priv, enum ipa_mhi_event_type event, break; default: mhi_log(MHI_MSG_ERROR, - "HW Channel uC unknown event 0x%X\n", event); + "HW ch uC unknown event 0x%X\n", event); break; } } @@ -1534,7 +1542,7 @@ static int mhi_hwc_chcmd(struct mhi_dev *mhi, uint chid, case MHI_DEV_RING_EL_STOP: if ((chid-HW_CHANNEL_BASE) > NUM_HW_CHANNELS) { mhi_log(MHI_MSG_ERROR, - "Invalid Channel ID = 0x%X\n", chid); + "Invalid HW ch_id:%d\n", chid); return -EINVAL; } @@ -1542,7 +1550,7 @@ static int mhi_hwc_chcmd(struct mhi_dev *mhi, uint chid, mhi->ipa_clnt_hndl[chid-HW_CHANNEL_BASE]); if (rc) mhi_log(MHI_MSG_ERROR, - "Stopping HW Channel%d failed 0x%X\n", + "Stopping HW ch_id:%d failed 0x%X\n", chid, rc); break; case MHI_DEV_RING_EL_START: @@ -1551,13 +1559,13 @@ static int mhi_hwc_chcmd(struct mhi_dev *mhi, uint chid, if (chid > HW_CHANNEL_END) { mhi_log(MHI_MSG_ERROR, - "Channel DB for %d not enabled\n", chid); + "ch DB for ch_id:%d not enabled\n", chid); return -EINVAL; } if ((chid-HW_CHANNEL_BASE) > NUM_HW_CHANNELS) { mhi_log(MHI_MSG_ERROR, - "Invalid Channel = 0x%X\n", chid); + "Invalid HW ch_id:%d\n", chid); return -EINVAL; } @@ -1565,7 +1573,7 @@ static int mhi_hwc_chcmd(struct mhi_dev *mhi, uint chid, &mhi->ipa_clnt_hndl[chid-HW_CHANNEL_BASE]); if (rc) mhi_log(MHI_MSG_ERROR, - "HW Channel%d start failed : %d\n", + "HW ch_id:%d start failed : %d\n", chid, rc); break; case MHI_DEV_RING_EL_INVALID: @@ -1641,7 +1649,7 @@ int mhi_dev_send_event(struct mhi_dev *mhi, int evnt_ring, if (evnt_ring_idx > mhi->cfg.event_rings) { mhi_log(MHI_MSG_ERROR, - "Invalid event ring idx: %lld\n", evnt_ring_idx); + "Invalid event ring_id: %lld\n", evnt_ring_idx); return -EINVAL; } @@ -1650,7 +1658,8 @@ int mhi_dev_send_event(struct mhi_dev *mhi, int evnt_ring, rc = mhi_ring_start(ring, ctx, mhi); if (rc) { mhi_log(MHI_MSG_ERROR, - "error starting event ring %d\n", evnt_ring); + "error starting event ring_id:%d\n", + evnt_ring_idx); return rc; } } @@ -1719,12 +1728,12 @@ static int mhi_dev_send_completion_event_async(struct mhi_dev_channel *ch, rc = mhi_dev_queue_transfer_completion(mreq, NULL); if (rc) { mhi_log(MHI_MSG_ERROR, - "Failed to queue completion for ch %d, rc %d\n", + "Failed to queue completion for ch_id:%d, rc %d\n", ch->ch_id, rc); return rc; } - mhi_log(MHI_MSG_VERBOSE, "Calling flush for ch %d\n", ch->ch_id); + mhi_log(MHI_MSG_VERBOSE, "Calling flush for ch_id:%d\n", ch->ch_id); rc = mhi_dev_flush_transfer_completion_events(mhi, ch); if (rc) { mhi_log(MHI_MSG_ERROR, @@ -1878,7 +1887,7 @@ static void mhi_dev_process_reset_cmd(struct mhi_dev *mhi, int ch_id) rc = mhi_dev_mmio_disable_chdb_a7(mhi, ch_id); if (rc) { mhi_log(MHI_MSG_VERBOSE, - "Failed to disable chdb for ch %d\n", ch_id); + "Failed to disable chdb for ch_id:%d\n", ch_id); rc = mhi_dev_send_cmd_comp_event(mhi, MHI_CMD_COMPL_CODE_UNDEFINED); if (rc) @@ -1888,7 +1897,7 @@ static void mhi_dev_process_reset_cmd(struct mhi_dev *mhi, int ch_id) } ch = &mhi->ch[ch_id]; - mhi_log(MHI_MSG_VERBOSE, "Processing reset cmd for ch%d\n", ch_id); + mhi_log(MHI_MSG_VERBOSE, "Processing reset cmd for ch_id:%d\n", ch_id); /* * Ensure that the completions that are present in the flush list are * removed from the list and added to event req list before channel @@ -1946,18 +1955,18 @@ static int mhi_dev_process_cmd_ring(struct mhi_dev *mhi, union mhi_dev_ring_ctx *evt_ctx; ch_id = el->generic.chid; - mhi_log(MHI_MSG_VERBOSE, "for channel:%d and cmd:%d\n", + mhi_log(MHI_MSG_VERBOSE, "for ch_id:%d and cmd %d\n", ch_id, el->generic.type); switch (el->generic.type) { case MHI_DEV_RING_EL_START: - mhi_log(MHI_MSG_VERBOSE, "received start cmd for channel %d\n", + mhi_log(MHI_MSG_VERBOSE, "received start cmd for ch_id:%d\n", ch_id); if (ch_id >= (HW_CHANNEL_BASE)) { rc = mhi_hwc_chcmd(mhi, ch_id, el->generic.type); if (rc) { mhi_log(MHI_MSG_ERROR, - "Error with HW channel cmd %d\n", rc); + "Error with HW ch cmd %d\n", rc); rc = mhi_dev_send_cmd_comp_event(mhi, MHI_CMD_COMPL_CODE_UNDEFINED); if (rc) @@ -1970,7 +1979,7 @@ static int mhi_dev_process_cmd_ring(struct mhi_dev *mhi, rc = mhi_dev_mmio_enable_chdb_a7(mhi, ch_id); if (rc) { mhi_log(MHI_MSG_VERBOSE, - "Failed to enable chdb for ch %d\n", + "Failed to enable chdb for ch_id:%d\n", ch_id); goto send_undef_completion_event; } @@ -1985,7 +1994,7 @@ static int mhi_dev_process_cmd_ring(struct mhi_dev *mhi, mhi); if (rc) { mhi_log(MHI_MSG_ERROR, - "start ring failed for ch %d\n", ch_id); + "start ring failed for ch_id:%d\n", ch_id); goto send_undef_completion_event; } @@ -2010,7 +2019,7 @@ static int mhi_dev_process_cmd_ring(struct mhi_dev *mhi, rc = mhi_ring_start(evt_ring, evt_ctx, mhi); if (rc) { mhi_log(MHI_MSG_ERROR, - "error starting event ring %d\n", + "error starting event ring_id:%d\n", mhi->ch_ctx_cache[ch_id].err_indx); goto send_undef_completion_event; } @@ -2034,7 +2043,8 @@ send_start_completion_event: MHI_CMD_COMPL_CODE_SUCCESS); if (rc) mhi_log(MHI_MSG_ERROR, - "Error sending command completion event\n"); + "Error sending compl event for ch_id:%d\n", + ch_id); mhi_update_state_info_ch(ch_id, MHI_STATE_CONNECTED); /* Trigger callback to clients */ @@ -2060,7 +2070,8 @@ send_undef_completion_event: rc = mhi_hwc_chcmd(mhi, ch_id, el->generic.type); if (rc) mhi_log(MHI_MSG_ERROR, - "send channel stop cmd event failed\n"); + "send ch stop cmd event failed for ch_id:%d\n", + ch_id); /* send the completion event to the host */ event.evt_cmd_comp.ptr = mhi->cmd_ctx_cache->rbase + @@ -2092,7 +2103,8 @@ send_undef_completion_event: ring = &mhi->ring[ch_id + mhi->ch_ring_start]; if (ring->state == RING_STATE_UINT) { mhi_log(MHI_MSG_ERROR, - "Channel not opened for %d\n", ch_id); + "Channel not opened for ch_id:%d\n", + ch_id); return -EINVAL; } @@ -2125,7 +2137,8 @@ send_undef_completion_event: rc = mhi_hwc_chcmd(mhi, ch_id, el->generic.type); if (rc) mhi_log(MHI_MSG_ERROR, - "send channel stop cmd event failed\n"); + "send ch stop cmd event failed ch_id:%d\n", + ch_id); /* send the completion event to the host */ event.evt_cmd_comp.ptr = mhi->cmd_ctx_cache->rbase + @@ -2143,7 +2156,8 @@ send_undef_completion_event: rc = mhi_dev_flush_cmd_completion_events(mhi, &event); if (rc) { mhi_log(MHI_MSG_ERROR, - "stop event send failed\n"); + "stop event send failed for ch_id:%d\n", + ch_id); return rc; } } else { @@ -2155,7 +2169,8 @@ send_undef_completion_event: ring = &mhi->ring[ch_id + mhi->ch_ring_start]; if (ring->state == RING_STATE_UINT) { mhi_log(MHI_MSG_ERROR, - "Channel not opened for %d\n", ch_id); + "Channel not opened for ch_id:%d\n", + ch_id); return -EINVAL; } ch = &mhi->ch[ch_id]; @@ -2163,7 +2178,7 @@ send_undef_completion_event: mutex_lock(&ch->ring->event_lock); if (ch->db_pending) { mhi_log(MHI_MSG_ERROR, - "skipping reset cmd ack for channel %d\n", + "skipping reset cmd ack for ch_id:%d\n", ch_id); ch->reset_pending = true; mutex_unlock(&ch->ring->event_lock); @@ -2182,7 +2197,8 @@ send_undef_completion_event: break; default: mhi_log(MHI_MSG_ERROR, - "Invalid command:%d\n", el->generic.type); + "Invalid command:%d, ch_id:%d\n", + el->generic.type, ch_id); break; } return rc; @@ -2197,7 +2213,7 @@ static int mhi_dev_process_tre_ring(struct mhi_dev *mhi, if (ring->id < mhi->ch_ring_start) { mhi_log(MHI_MSG_VERBOSE, - "invalid channel ring id (%d), should be < %lu\n", + "invalid channel ring_id:%d, should be < %lu\n", ring->id, mhi->ch_ring_start); return -EINVAL; } @@ -2236,11 +2252,11 @@ static void mhi_dev_process_ring_pending(struct work_struct *work) list_for_each_safe(cp, q, &mhi->process_ring_list) { ring = list_entry(cp, struct mhi_dev_ring, list); list_del(cp); - mhi_log(MHI_MSG_VERBOSE, "processing ring %d\n", ring->id); + mhi_log(MHI_MSG_VERBOSE, "processing ring_id:%d\n", ring->id); if (ring->id < mhi->ch_ring_start) { mhi_log(MHI_MSG_ERROR, - "ring (%d) is not a channel ring\n", ring->id); + "ring_id:%d is not a channel ring\n", ring->id); goto exit; } @@ -2249,7 +2265,7 @@ static void mhi_dev_process_ring_pending(struct work_struct *work) rc = mhi_dev_process_ring(ring); if (rc) { mhi_log(MHI_MSG_ERROR, - "error processing ring %d\n", ring->id); + "error processing ring_id:%d\n", ring->id); goto exit; } mutex_lock(&ch->ch_lock); @@ -2264,7 +2280,7 @@ static void mhi_dev_process_ring_pending(struct work_struct *work) */ ch_id = ch->ch_id; mhi_log(MHI_MSG_VERBOSE, - "processing pending ch:%d reset\n", ch_id); + "processing pending ch_id:%d reset\n", ch_id); rc = mhi_dev_process_ring( &mhi->ring[mhi->cmd_ring_idx]); if (rc) { @@ -2325,7 +2341,8 @@ static bool mhi_dev_queue_channel_db(struct mhi_dev *mhi, if (chintr_value & 1) { ring = &mhi->ring[ch_num + mhi->ch_ring_start]; if (ring->state == RING_STATE_UINT) { - pr_debug("Channel not opened for %d\n", ch_num); + pr_debug("Channel not opened for ch_id:%d\n", + ch_num); continue; } mhi_ring_set_state(ring, RING_STATE_PENDING); @@ -2449,7 +2466,7 @@ static int mhi_dev_abort(struct mhi_dev *mhi) rc = mhi_dev_mmio_mask_chdb_interrupts(mhi_ctx); if (rc) { mhi_log(MHI_MSG_ERROR, - "Failed to enable channel db\n"); + "Failed to enable ch db\n"); return rc; } @@ -2518,11 +2535,11 @@ static void mhi_dev_transfer_completion_cb(void *mreq) ch->state == MHI_DEV_CH_STOPPED) { if (inbound) mhi_log(MHI_MSG_DBG, - "Ch %d closed with %d writes pending\n", + "ch_id:%d closed with %d writes pending\n", ch->ch_id, ch->pend_wr_count + 1); else mhi_log(MHI_MSG_DBG, - "Ch %d closed with read pending\n", ch->ch_id); + "ch_id:%d closed with read pending\n", ch->ch_id); return; } @@ -2533,7 +2550,7 @@ static void mhi_dev_transfer_completion_cb(void *mreq) /* Flush read completions to host */ if (snd_cmpl && mhi_ctx->ch_ctx_cache[ch->ch_id].ch_type == MHI_DEV_CH_TYPE_OUTBOUND_CHANNEL) { - mhi_log(MHI_MSG_DBG, "Calling flush for ch %d\n", ch->ch_id); + mhi_log(MHI_MSG_DBG, "Calling flush for ch_id:%d\n", ch->ch_id); rc = mhi_dev_flush_transfer_completion_events(mhi_ctx, ch); if (rc) { mhi_log(MHI_MSG_ERROR, @@ -2546,7 +2563,7 @@ static void mhi_dev_transfer_completion_cb(void *mreq) rc = mhi_dev_process_stop_cmd(ch->ring, ch->ch_id, mhi_ctx); if (rc) mhi_log(MHI_MSG_ERROR, - "Error while stopping channel (%d)\n", ch->ch_id); + "Error while stopping ch_id:%d\n", ch->ch_id); } } @@ -2742,7 +2759,7 @@ static int mhi_dev_cache_host_cfg(struct mhi_dev *mhi) /* Get Channel, event and command context base pointer */ rc = mhi_dev_mmio_get_chc_base(mhi); if (rc) { - mhi_log(MHI_MSG_ERROR, "Fetching channel context failed\n"); + mhi_log(MHI_MSG_ERROR, "Fetching ch context failed\n"); return rc; } @@ -3114,7 +3131,7 @@ static int mhi_dev_alloc_evt_buf_evt_req(struct mhi_dev *mhi, if (!size) { mhi_log(MHI_MSG_ERROR, - "Evt buf size is 0 for channel %d", ch->ch_id); + "Evt buf size is 0 for ch_id:%d", ch->ch_id); return -EINVAL; } @@ -3139,13 +3156,13 @@ static int mhi_dev_alloc_evt_buf_evt_req(struct mhi_dev *mhi, ch->evt_req_size = size; mhi_log(MHI_MSG_INFO, - "Channel %d evt buf size is %d\n", ch->ch_id, ch->evt_buf_size); + "ch_id:%d evt buf size is %d\n", ch->ch_id, ch->evt_buf_size); /* Allocate event requests */ ch->ereqs = kcalloc(ch->evt_req_size, sizeof(*ch->ereqs), GFP_KERNEL); if (!ch->ereqs) { mhi_log(MHI_MSG_ERROR, - "Failed to alloc ereqs for Channel %d\n", ch->ch_id); + "Failed to alloc ereqs for ch_id:%d\n", ch->ch_id); rc = -ENOMEM; goto free_ereqs; } @@ -3155,7 +3172,7 @@ static int mhi_dev_alloc_evt_buf_evt_req(struct mhi_dev *mhi, GFP_KERNEL); if (!ch->tr_events) { mhi_log(MHI_MSG_ERROR, - "Failed to alloc tr_events buffer for Channel %d\n", + "Failed to alloc tr_events buffer for ch_id:%d\n", ch->ch_id); rc = -ENOMEM; goto free_ereqs; @@ -3212,7 +3229,7 @@ int mhi_dev_open_channel(uint32_t chan_id, if (ch->active_client) { mhi_log(MHI_MSG_ERROR, - "Channel (%d) already opened by client\n", chan_id); + "ch_id:%d already opened by client\n", chan_id); rc = -EINVAL; goto exit; } @@ -3260,7 +3277,7 @@ int mhi_dev_channel_isempty(struct mhi_dev_client *handle) int rc; if (!handle) { - mhi_log(MHI_MSG_ERROR, "Invalid channel access\n"); + mhi_log(MHI_MSG_ERROR, "Invalid ch access\n"); return -EINVAL; } @@ -3279,7 +3296,7 @@ bool mhi_dev_channel_has_pending_write(struct mhi_dev_client *handle) struct mhi_dev_channel *ch; if (!handle) { - mhi_log(MHI_MSG_ERROR, "Invalid channel access\n"); + mhi_log(MHI_MSG_ERROR, "Invalid ch access\n"); return -EINVAL; } @@ -3298,7 +3315,7 @@ void mhi_dev_close_channel(struct mhi_dev_client *handle) int rc = 0; struct event_req *itr, *tmp; if (!handle) { - mhi_log(MHI_MSG_ERROR, "Invalid channel access:%d\n", -ENODEV); + mhi_log(MHI_MSG_ERROR, "Invalid ch access:%d\n", -ENODEV); return; } ch = handle->channel; @@ -3319,17 +3336,17 @@ void mhi_dev_close_channel(struct mhi_dev_client *handle) } while (++count < MHI_DEV_CH_CLOSE_TIMEOUT_COUNT); if (ch->pend_wr_count) - mhi_log(MHI_MSG_ERROR, "%d writes pending for channel %d\n", + mhi_log(MHI_MSG_ERROR, "%d writes pending for ch_id:%d\n", ch->pend_wr_count, ch->ch_id); if (!list_empty(&ch->event_req_buffers)) - mhi_log(MHI_MSG_ERROR, "%d pending flush for channel %d\n", + mhi_log(MHI_MSG_ERROR, "%d pending flush for ch_id:%d\n", ch->pend_wr_count, ch->ch_id); if (ch->state != MHI_DEV_CH_PENDING_START) if ((ch->ch_type == MHI_DEV_CH_TYPE_OUTBOUND_CHANNEL && !mhi_dev_channel_isempty(handle)) || ch->tre_loc) mhi_log(MHI_MSG_DBG, - "Trying to close an active channel (%d)\n", + "Trying to close an active ch_id:%d\n", ch->ch_id); if (!list_empty(&ch->flush_event_req_buffers)) { @@ -3401,7 +3418,7 @@ int mhi_dev_read_channel(struct mhi_req *mreq) if (mhi_ctx->ctrl_info != MHI_STATE_CONNECTED) { mhi_log(MHI_MSG_ERROR, - "Channel not connected:%d\n", mhi_ctx->ctrl_info); + "ch not connected:%d\n", mhi_ctx->ctrl_info); return -ENODEV; } @@ -3412,7 +3429,7 @@ int mhi_dev_read_channel(struct mhi_req *mreq) if (atomic_read(&mhi_ctx->is_suspended)) { mhi_log(MHI_MSG_ERROR, - "mhi still in suspend, return %d for read ch:%d\n", + "mhi still in suspend, return %d for read ch_id:%d\n", rc, mreq->client->channel->ch_id); return -ENODEV; } @@ -3428,7 +3445,7 @@ int mhi_dev_read_channel(struct mhi_req *mreq) do { if (ch->state == MHI_DEV_CH_STOPPED || ch->reset_pending) { mhi_log(MHI_MSG_VERBOSE, - "channel (%d) already stopped or RST pending\n", + "ch_id:%d already stopped or RST pending\n", mreq->chan); bytes_read = -1; goto exit; @@ -3475,13 +3492,13 @@ int mhi_dev_read_channel(struct mhi_req *mreq) mreq->el = el; mreq->transfer_len = bytes_to_read; mreq->rd_offset = ring->rd_offset; - mhi_log(MHI_MSG_VERBOSE, "reading %lu bytes from chan %d\n", + mhi_log(MHI_MSG_VERBOSE, "reading %lu bytes from ch_id:%d\n", bytes_to_read, mreq->chan); rc = mhi_ctx->host_to_device((void *) write_to_loc, read_from_loc, bytes_to_read, mhi_ctx, mreq); if (rc) { mhi_log(MHI_MSG_ERROR, - "Error while reading chan (%d) rc %d\n", + "Error while reading ch_id:%d rc %d\n", mreq->chan, rc); mutex_unlock(&ch->ch_lock); return rc; @@ -3502,7 +3519,7 @@ int mhi_dev_read_channel(struct mhi_req *mreq) rc = mhi_dev_process_stop_cmd(ring, mreq->chan, mhi_ctx); if (rc) { mhi_log(MHI_MSG_ERROR, - "Error while stopping channel (%d)\n", + "Error while stopping ch_id:%d\n", mreq->chan); bytes_read = -EIO; } @@ -3559,7 +3576,7 @@ int mhi_dev_write_channel(struct mhi_req *wreq) if (mhi_ctx->ctrl_info != MHI_STATE_CONNECTED) { mhi_log(MHI_MSG_ERROR, - "Channel not connected:%d\n", mhi_ctx->ctrl_info); + "ch not connected:%d\n", mhi_ctx->ctrl_info); return -ENODEV; } @@ -3574,7 +3591,7 @@ int mhi_dev_write_channel(struct mhi_req *wreq) * to the MHI core -> notify SM. */ mutex_lock(&mhi_ctx->mhi_lock); - mhi_log(MHI_MSG_CRITICAL, "Wakeup by chan:%d\n", ch->ch_id); + mhi_log(MHI_MSG_CRITICAL, "Wakeup by ch_id:%d\n", ch->ch_id); rc = mhi_dev_notify_sm_event(MHI_DEV_EVENT_CORE_WAKEUP); if (rc) { mhi_log(MHI_MSG_ERROR, @@ -3607,7 +3624,7 @@ int mhi_dev_write_channel(struct mhi_req *wreq) rc = mhi_ctrl_state_info(ch->ch_id, &info); if (rc || (info != MHI_STATE_CONNECTED)) { - mhi_log(MHI_MSG_ERROR, "Channel %d not started by host\n", + mhi_log(MHI_MSG_ERROR, "ch_id %d not started by host\n", ch->ch_id); mutex_unlock(&ch->ch_lock); mutex_unlock(&mhi_ctx->mhi_write_test); @@ -3617,7 +3634,7 @@ int mhi_dev_write_channel(struct mhi_req *wreq) ch->pend_wr_count++; if (ch->state == MHI_DEV_CH_STOPPED || ch->reset_pending) { mhi_log(MHI_MSG_ERROR, - "channel %d already stopped or RST pending\n", + "ch_id:%d already stopped or RST pending\n", wreq->chan); bytes_written = -1; goto exit; @@ -3635,7 +3652,7 @@ int mhi_dev_write_channel(struct mhi_req *wreq) do { if (ring->rd_offset == ring->wr_offset) { mhi_log(MHI_MSG_ERROR, - "rd & wr offsets are equal for channel-id %d\n", + "rd & wr offsets are equal for ch_id:%d\n", wreq->chan); mhi_log(MHI_MSG_INFO, "No TREs available\n"); break; @@ -3664,7 +3681,7 @@ int mhi_dev_write_channel(struct mhi_req *wreq) mhi_ctx, wreq); if (rc) { mhi_log(MHI_MSG_ERROR, - "Error while writing chan (%d) rc %d\n", + "Error while writing ch_id:%d rc %d\n", wreq->chan, rc); goto exit; } else if (wreq->mode == DMA_ASYNC) @@ -3687,7 +3704,7 @@ int mhi_dev_write_channel(struct mhi_req *wreq) ring->rd_offset, bytes_to_write, code); if (rc) { mhi_log(MHI_MSG_VERBOSE, - "err in snding cmpl evt ch:%d\n", + "err in snding cmpl evt ch_id:%d\n", wreq->chan); } mhi_dev_ring_inc_index(ring, ring->rd_offset); @@ -3705,7 +3722,7 @@ int mhi_dev_write_channel(struct mhi_req *wreq) rc = mhi_dev_process_stop_cmd(ring, wreq->chan, mhi_ctx); if (rc) { mhi_log(MHI_MSG_ERROR, - "channel %d stop failed\n", wreq->chan); + "ch_id:%d stop failed\n", wreq->chan); } } exit: @@ -3930,7 +3947,7 @@ int mhi_register_state_cb(void (*mhi_state_cb) return -ENXIO; if (channel >= MHI_MAX_SOFTWARE_CHANNELS) { - mhi_log(MHI_MSG_ERROR, "Invalid channel :%d\n", channel); + mhi_log(MHI_MSG_ERROR, "Invalid ch_id:%d\n", channel); return -EINVAL; } @@ -4492,20 +4509,20 @@ static int mhi_edma_init(struct device *dev) mhi_ctx->tx_dma_chan = dma_request_slave_channel(dev, "tx"); if (IS_ERR_OR_NULL(mhi_ctx->tx_dma_chan)) { mhi_log(MHI_MSG_ERROR, - "request for TX chan failed\n"); + "request for TX ch failed\n"); return -EIO; } - mhi_log(MHI_MSG_VERBOSE, "request for TX chan returned :%pK\n", + mhi_log(MHI_MSG_VERBOSE, "request for TX ch returned :%pK\n", mhi_ctx->tx_dma_chan); mhi_ctx->rx_dma_chan = dma_request_slave_channel(dev, "rx"); if (IS_ERR_OR_NULL(mhi_ctx->rx_dma_chan)) { mhi_log(MHI_MSG_ERROR, - "request for RX chan failed\n"); + "request for RX ch failed\n"); return -EIO; } - mhi_log(MHI_MSG_VERBOSE, "request for RX chan returned :%pK\n", + mhi_log(MHI_MSG_VERBOSE, "request for RX ch returned :%pK\n", mhi_ctx->rx_dma_chan); return 0; } diff --git a/drivers/platform/msm/mhi_dev/mhi_dev_net.c b/drivers/platform/msm/mhi_dev/mhi_dev_net.c index ac236edfe928..d05bbe5f1f4f 100644 --- a/drivers/platform/msm/mhi_dev/mhi_dev_net.c +++ b/drivers/platform/msm/mhi_dev/mhi_dev_net.c @@ -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) { diff --git a/drivers/platform/msm/mhi_dev/mhi_mmio.c b/drivers/platform/msm/mhi_dev/mhi_mmio.c index 44f64b679cb5..a306b58511c1 100644 --- a/drivers/platform/msm/mhi_dev/mhi_mmio.c +++ b/drivers/platform/msm/mhi_dev/mhi_mmio.c @@ -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; } diff --git a/drivers/platform/msm/mhi_dev/mhi_ring.c b/drivers/platform/msm/mhi_dev/mhi_ring.c index 9ef1134c0eca..06d18c81e9ce 100644 --- a/drivers/platform/msm/mhi_dev/mhi_ring.c +++ b/drivers/platform/msm/mhi_dev/mhi_ring.c @@ -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 */ diff --git a/drivers/platform/msm/mhi_dev/mhi_uci.c b/drivers/platform/msm/mhi_dev/mhi_uci.c index 2b458e130201..53ddfc75ab42 100644 --- a/drivers/platform/msm/mhi_dev/mhi_uci.c +++ b/drivers/platform/msm/mhi_dev/mhi_uci.c @@ -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); + "Sending uevent failed for ch_id:%d\n", ch_id); if (ch_state == MHI_STATE_DISCONNECTED && !atomic_read(&uci_handle->ref_count)) { @@ -1674,7 +1675,7 @@ static void uci_event_notifier(struct mhi_dev_client_cb_reason *reason) uci_handle->out_chan_attr->tre_notif_cb(reason); } else if (reason->reason == MHI_DEV_TRE_AVAILABLE) { uci_log(UCI_DBG_DBG, - "recived TRE available event for chan %d\n", + "recived TRE available event for ch_id:%d\n", uci_handle->in_chan); if (reason->ch_id % 2) { atomic_set(&uci_handle->write_data_ready, 1); @@ -1699,7 +1700,7 @@ static int mhi_register_client(struct uci_client *mhi_client, int index) /* Init the completion event for AT ctrl read */ init_completion(&mhi_client->at_ctrl_read_done); - uci_log(UCI_DBG_DBG, "Registering chan %d.\n", mhi_client->out_chan); + uci_log(UCI_DBG_DBG, "Registering ch_id:%d.\n", mhi_client->out_chan); return 0; } @@ -2066,7 +2067,7 @@ static void mhi_uci_at_ctrl_client_cb(struct mhi_dev_client_cb_data *cb_data) int rc, i; struct mhi_req *ureq; - uci_log(UCI_DBG_VERBOSE, " Rcvd MHI cb for channel %d, state %d\n", + uci_log(UCI_DBG_VERBOSE, " Rcvd MHI cb for ch_id:%d, state %d\n", cb_data->channel, cb_data->ctrl_info); if (cb_data->ctrl_info == MHI_STATE_CONNECTED) { @@ -2117,7 +2118,7 @@ static void mhi_uci_generic_client_cb(struct mhi_dev_client_cb_data *cb_data) { struct uci_client *client = cb_data->user_data; - uci_log(UCI_DBG_DBG, "Rcvd MHI cb for channel %d, state %d\n", + uci_log(UCI_DBG_DBG, "Rcvd MHI cb for ch_id:%d, state %d\n", cb_data->channel, cb_data->ctrl_info); if (cb_data->ctrl_info == MHI_STATE_CONNECTED)