summaryrefslogtreecommitdiff
path: root/drivers/usb/cdns3
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/cdns3')
-rw-r--r--drivers/usb/cdns3/cdns3-debug.h8
-rw-r--r--drivers/usb/cdns3/cdns3-trace.h28
-rw-r--r--drivers/usb/cdns3/cdnsp-trace.h12
3 files changed, 15 insertions, 33 deletions
diff --git a/drivers/usb/cdns3/cdns3-debug.h b/drivers/usb/cdns3/cdns3-debug.h
index a5c6a29e1340..4618cfe85a4f 100644
--- a/drivers/usb/cdns3/cdns3-debug.h
+++ b/drivers/usb/cdns3/cdns3-debug.h
@@ -107,8 +107,7 @@ static inline char *cdns3_decode_ep0_irq(char *str,
* Prints out all TRBs in the endpoint ring, even those after the Link TRB.
*.
*/
-static inline char *cdns3_dbg_ring(struct cdns3_endpoint *priv_ep,
- struct cdns3_trb *ring, char *str)
+static inline char *cdns3_dbg_ring(struct cdns3_endpoint *priv_ep, char *str)
{
dma_addr_t addr = priv_ep->trb_pool_dma;
struct cdns3_trb *trb;
@@ -136,9 +135,6 @@ static inline char *cdns3_dbg_ring(struct cdns3_endpoint *priv_ep,
"\t\tfree trbs: %d, CCS=%d, PCS=%d\n",
priv_ep->free_trbs, priv_ep->ccs, priv_ep->pcs);
- if (trb_per_sector > TRBS_PER_SEGMENT)
- trb_per_sector = TRBS_PER_SEGMENT;
-
if (trb_per_sector > TRBS_PER_SEGMENT) {
sprintf(str + ret, "\t\tTransfer ring %d too big\n",
trb_per_sector);
@@ -146,7 +142,7 @@ static inline char *cdns3_dbg_ring(struct cdns3_endpoint *priv_ep,
}
for (i = 0; i < trb_per_sector; ++i) {
- trb = &ring[i];
+ trb = &priv_ep->trb_pool[i];
ret += sprintf(str + ret,
"\t\t@%pad %08x %08x %08x\n", &addr,
le32_to_cpu(trb->buffer),
diff --git a/drivers/usb/cdns3/cdns3-trace.h b/drivers/usb/cdns3/cdns3-trace.h
index 7574b4a62813..40db89e3333c 100644
--- a/drivers/usb/cdns3/cdns3-trace.h
+++ b/drivers/usb/cdns3/cdns3-trace.h
@@ -100,13 +100,12 @@ DECLARE_EVENT_CLASS(cdns3_log_usb_irq,
TP_STRUCT__entry(
__field(enum usb_device_speed, speed)
__field(u32, usb_ists)
- __dynamic_array(char, str, CDNS3_MSG_MAX)
),
TP_fast_assign(
__entry->speed = cdns3_get_speed(priv_dev);
__entry->usb_ists = usb_ists;
),
- TP_printk("%s", cdns3_decode_usb_irq(__get_str(str), __entry->speed,
+ TP_printk("%s", cdns3_decode_usb_irq(__get_buf(CDNS3_MSG_MAX), __entry->speed,
__entry->usb_ists))
);
@@ -124,7 +123,6 @@ DECLARE_EVENT_CLASS(cdns3_log_epx_irq,
__field(u32, ep_traddr)
__field(u32, ep_last_sid)
__field(u32, use_streams)
- __dynamic_array(char, str, CDNS3_MSG_MAX)
),
TP_fast_assign(
__assign_str(ep_name, priv_ep->name);
@@ -134,7 +132,7 @@ DECLARE_EVENT_CLASS(cdns3_log_epx_irq,
__entry->use_streams = priv_ep->use_streams;
),
TP_printk("%s, ep_traddr: %08x ep_last_sid: %08x use_streams: %d",
- cdns3_decode_epx_irq(__get_str(str),
+ cdns3_decode_epx_irq(__get_buf(CDNS3_MSG_MAX),
__get_str(ep_name),
__entry->ep_sts),
__entry->ep_traddr,
@@ -153,13 +151,12 @@ DECLARE_EVENT_CLASS(cdns3_log_ep0_irq,
TP_STRUCT__entry(
__field(int, ep_dir)
__field(u32, ep_sts)
- __dynamic_array(char, str, CDNS3_MSG_MAX)
),
TP_fast_assign(
__entry->ep_dir = priv_dev->selected_ep;
__entry->ep_sts = ep_sts;
),
- TP_printk("%s", cdns3_decode_ep0_irq(__get_str(str),
+ TP_printk("%s", cdns3_decode_ep0_irq(__get_buf(CDNS3_MSG_MAX),
__entry->ep_dir,
__entry->ep_sts))
);
@@ -178,7 +175,6 @@ DECLARE_EVENT_CLASS(cdns3_log_ctrl,
__field(u16, wValue)
__field(u16, wIndex)
__field(u16, wLength)
- __dynamic_array(char, str, CDNS3_MSG_MAX)
),
TP_fast_assign(
__entry->bRequestType = ctrl->bRequestType;
@@ -187,7 +183,7 @@ DECLARE_EVENT_CLASS(cdns3_log_ctrl,
__entry->wIndex = le16_to_cpu(ctrl->wIndex);
__entry->wLength = le16_to_cpu(ctrl->wLength);
),
- TP_printk("%s", usb_decode_ctrl(__get_str(str), CDNS3_MSG_MAX,
+ TP_printk("%s", usb_decode_ctrl(__get_buf(CDNS3_MSG_MAX), CDNS3_MSG_MAX,
__entry->bRequestType,
__entry->bRequest, __entry->wValue,
__entry->wIndex, __entry->wLength)
@@ -438,22 +434,16 @@ DECLARE_EVENT_CLASS(cdns3_log_ring,
TP_PROTO(struct cdns3_endpoint *priv_ep),
TP_ARGS(priv_ep),
TP_STRUCT__entry(
- __dynamic_array(u8, ring, TRB_RING_SIZE)
- __dynamic_array(u8, priv_ep, sizeof(struct cdns3_endpoint))
__dynamic_array(char, buffer,
- (TRBS_PER_SEGMENT * 65) + CDNS3_MSG_MAX)
+ GET_TRBS_PER_SEGMENT(priv_ep->type) > TRBS_PER_SEGMENT ?
+ CDNS3_MSG_MAX :
+ (GET_TRBS_PER_SEGMENT(priv_ep->type) * 65) + CDNS3_MSG_MAX)
),
TP_fast_assign(
- memcpy(__get_dynamic_array(priv_ep), priv_ep,
- sizeof(struct cdns3_endpoint));
- memcpy(__get_dynamic_array(ring), priv_ep->trb_pool,
- TRB_RING_SIZE);
+ cdns3_dbg_ring(priv_ep, __get_str(buffer));
),
- TP_printk("%s",
- cdns3_dbg_ring((struct cdns3_endpoint *)__get_str(priv_ep),
- (struct cdns3_trb *)__get_str(ring),
- __get_str(buffer)))
+ TP_printk("%s", __get_str(buffer))
);
DEFINE_EVENT(cdns3_log_ring, cdns3_ring,
diff --git a/drivers/usb/cdns3/cdnsp-trace.h b/drivers/usb/cdns3/cdnsp-trace.h
index 5983dfb99653..4b51011eb00b 100644
--- a/drivers/usb/cdns3/cdnsp-trace.h
+++ b/drivers/usb/cdns3/cdnsp-trace.h
@@ -271,7 +271,6 @@ DECLARE_EVENT_CLASS(cdnsp_log_ctrl,
__field(u16, wValue)
__field(u16, wIndex)
__field(u16, wLength)
- __dynamic_array(char, str, CDNSP_MSG_MAX)
),
TP_fast_assign(
__entry->bRequestType = ctrl->bRequestType;
@@ -280,7 +279,7 @@ DECLARE_EVENT_CLASS(cdnsp_log_ctrl,
__entry->wIndex = le16_to_cpu(ctrl->wIndex);
__entry->wLength = le16_to_cpu(ctrl->wLength);
),
- TP_printk("%s", usb_decode_ctrl(__get_str(str), CDNSP_MSG_MAX,
+ TP_printk("%s", usb_decode_ctrl(__get_buf(CDNSP_MSG_MAX), CDNSP_MSG_MAX,
__entry->bRequestType,
__entry->bRequest, __entry->wValue,
__entry->wIndex, __entry->wLength)
@@ -345,7 +344,6 @@ DECLARE_EVENT_CLASS(cdnsp_log_trb,
__field(u32, field3)
__field(union cdnsp_trb *, trb)
__field(dma_addr_t, trb_dma)
- __dynamic_array(char, str, CDNSP_MSG_MAX)
),
TP_fast_assign(
__entry->type = ring->type;
@@ -359,7 +357,7 @@ DECLARE_EVENT_CLASS(cdnsp_log_trb,
),
TP_printk("%s: %s trb: %p(%pad)", cdnsp_ring_type_string(__entry->type),
- cdnsp_decode_trb(__get_str(str), CDNSP_MSG_MAX,
+ cdnsp_decode_trb(__get_buf(CDNSP_MSG_MAX), CDNSP_MSG_MAX,
__entry->field0, __entry->field1,
__entry->field2, __entry->field3),
__entry->trb, &__entry->trb_dma
@@ -544,7 +542,6 @@ DECLARE_EVENT_CLASS(cdnsp_log_ep_ctx,
__field(u32, info2)
__field(u64, deq)
__field(u32, tx_info)
- __dynamic_array(char, str, CDNSP_MSG_MAX)
),
TP_fast_assign(
__entry->info = le32_to_cpu(ctx->ep_info);
@@ -552,7 +549,7 @@ DECLARE_EVENT_CLASS(cdnsp_log_ep_ctx,
__entry->deq = le64_to_cpu(ctx->deq);
__entry->tx_info = le32_to_cpu(ctx->tx_info);
),
- TP_printk("%s", cdnsp_decode_ep_context(__get_str(str), CDNSP_MSG_MAX,
+ TP_printk("%s", cdnsp_decode_ep_context(__get_buf(CDNSP_MSG_MAX), CDNSP_MSG_MAX,
__entry->info, __entry->info2,
__entry->deq, __entry->tx_info)
)
@@ -777,7 +774,6 @@ DECLARE_EVENT_CLASS(cdnsp_log_portsc,
TP_STRUCT__entry(
__field(u32, portnum)
__field(u32, portsc)
- __dynamic_array(char, str, CDNSP_MSG_MAX)
),
TP_fast_assign(
__entry->portnum = portnum;
@@ -785,7 +781,7 @@ DECLARE_EVENT_CLASS(cdnsp_log_portsc,
),
TP_printk("port-%d: %s",
__entry->portnum,
- cdnsp_decode_portsc(__get_str(str), CDNSP_MSG_MAX,
+ cdnsp_decode_portsc(__get_buf(CDNSP_MSG_MAX), CDNSP_MSG_MAX,
__entry->portsc)
)
);