usb: typec: tps6598x: Add IRQ flag and register tracing
Subsystems (2)
cover usb: typec: tps6598x: Add IRQ flag and register tracing
This series adds tracing events for the chips IRQ and registers that are useful to figure out the current data and power status. This came about since diagnosing why a certain usb-c hub or dp-alt-mode adapter fails is hard with the information in /sys/class/typec alone since this does not have a timeline of events (and we don't want every typec user having to also buy a PD analyzer). With this series debugging these kinds of things starts to become fun:
# echo 1 > /sys/kernel/debug/tracing/events/tps6598x/enable # cat /sys/kernel/debug/tracing/trace_pipe irq/79-0-003f-526 [003] .... 512.717871: tps6598x_irq: event1=PLUG_EVENT|DATA_STATUS_UPDATE|STATUS_UPDATE, event2= irq/79-0-003f-526 [003] .... 512.722408: tps6598x_status: conn: conn-Ra, pp_5v0: off, pp_hv: off, pp_ext: off, pp_cable: off, pwr-src: vin-3p3, vbus: vSafe0V, usb-host: no, legacy: no, flags: PLUG_PRESENT|PORTROLE|DATAROLE irq/79-0-003f-526 [003] .... 512.727127: tps6598x_data_status: DATA_CONNECTION|USB2_CONNECTION|USB3_CONNECTION irq/79-0-003f-526 [003] .... 512.769571: tps6598x_irq: event1=PP_SWITCH_CHANGED|STATUS_UPDATE, event2= irq/79-0-003f-526 [003] .... 512.773380: tps6598x_status: conn: conn-Ra, pp_5v0: out, pp_hv: off, pp_ext: off, pp_cable: in, pwr-src: vin-3p3, vbus: vSafe0V, usb-host: no, legacy: no, flags: PLUG_PRESENT|PORTROLE|DATAROLE|VCONN irq/79-0-003f-526 [003] .... 512.872450: tps6598x_irq: event1=POWER_STATUS_UPDATE|PD_STATUS_UPDATE, event2= irq/79-0-003f-526 [003] .... 512.876311: tps6598x_status: conn: conn-Ra, pp_5v0: out, pp_hv: off, pp_ext: off, pp_cable: in, pwr-src: vin-3p3, vbus: vSafe0V, usb-host: no, legacy: no, flags: PLUG_PRESENT|PORTROLE|DATAROLE|VCONN irq/79-0-003f-526 [003] .... 512.880237: tps6598x_power_status: conn: 1, pwr-role: source, typec: usb, bc: sdp irq/79-0-003f-526 [003] .... 513.072682: tps6598x_irq: event1=STATUS_UPDATE, event2= irq/79-0-003f-526 [003] .... 513.076390: tps6598x_status: conn: conn-Ra, pp_5v0: out, pp_hv: off, pp_ext: off, pp_cable: in, pwr-src: vin-3p3, vbus: vSafe5V, usb-host: no, legacy: no, flags: PLUG_PRESENT|PORTROLE|DATAROLE|VCONN irq/79-0-003f-526 [003] .... 513.090676: tps6598x_irq: event1=ERROR_CANNOT_PROVIDE_PWR, event2= irq/79-0-003f-526 [003] .... 513.094368: tps6598x_status: conn: conn-Ra, pp_5v0: out, pp_hv: off, pp_ext: off, pp_cable: in, pwr-src: vin-3p3, vbus: vSafe5V, usb-host: no, legacy: no, flags: PLUG_PRESENT|PORTROLE|DATAROLE|VCONN irq/79-0-003f-526 [003] .... 513.109606: tps6598x_irq: event1=NEW_CONTRACT_AS_PROVIDER|POWER_STATUS_UPDATE|STATUS_UPDATE|SRC_TRANSITION, event2= irq/79-0-003f-526 [003] .... 513.113777: tps6598x_status: conn: conn-Ra, pp_5v0: out, pp_hv: off, pp_ext: off, pp_cable: in, pwr-src: vin-3p3, vbus: pd, usb-host: no, legacy: no, flags: PLUG_PRESENT|PORTROLE|DATAROLE|VCONN irq/79-0-003f-526 [003] .... 513.117475: tps6598x_power_status: conn: 1, pwr-role: source, typec: pd, bc: sdp irq/79-0-003f-526 [003] .... 513.137469: tps6598x_irq: event1=VDM_RECEIVED, event2= irq/79-0-003f-526 [003] .... 513.141570: tps6598x_status: conn: conn-Ra, pp_5v0: out, pp_hv: off, pp_ext: off, pp_cable: in, pwr-src: vin-3p3, vbus: pd, usb-host: no, legacy: no, flags: PLUG_PRESENT|PORTROLE|DATAROLE|VCONN irq/79-0-003f-526 [003] .... 513.281926: tps6598x_irq: event1=VDM_RECEIVED, event2= irq/79-0-003f-526 [003] .... 513.285638: tps6598x_status: conn: conn-Ra, pp_5v0: out, pp_hv: off, pp_ext: off, pp_cable: in, pwr-src: vin-3p3, vbus: pd, usb-host: no, legacy: no, flags: PLUG_PRESENT|PORTROLE|DATAROLE|VCONN irq/79-0-003f-526 [003] .... 513.300515: tps6598x_irq: event1=VDM_RECEIVED|DATA_STATUS_UPDATE, event2= irq/79-0-003f-526 [003] .... 513.304226: tps6598x_status: conn: conn-Ra, pp_5v0: out, pp_hv: off, pp_ext: off, pp_cable: in, pwr-src: vin-3p3, vbus: pd, usb-host: no, legacy: no, flags: PLUG_PRESENT|PORTROLE|DATAROLE|VCONN irq/79-0-003f-526 [003] .... 513.308302: tps6598x_data_status: DATA_CONNECTION|USB2_CONNECTION|USB3_CONNECTION|DP_CONNECTION, DP pinout D
It should not impose any problems for firmwares that don't have IRQs for the registers enabled. The trace will then just be missing those events.
Patch is against next-20210210.
Guido Günther (4):
usb: typec: tps6598x: Add trace event for IRQ events
usb: typec: tps6598x: Add trace event for status register
usb: typec: tps6598x: Add trace event for power status register
usb: typec: tps6598x: Add trace event for data status
drivers/usb/typec/Makefile | 3 + drivers/usb/typec/tps6598x.c | 66 ++++--- drivers/usb/typec/tps6598x.h | 182 +++++++++++++++++++ drivers/usb/typec/tps6598x_trace.h | 283 +++++++++++++++++++++++++++++ 4 files changed, 508 insertions(+), 26 deletions(-) create mode 100644 drivers/usb/typec/tps6598x.h create mode 100644 drivers/usb/typec/tps6598x_trace.h
Signature · 1 line
2.30.0
PATCH 1/4 usb: typec: tps6598x: Add trace event for IRQ events
Allow to get irq event information via the tracing framework. This allows to inspect USB-C negotiation at runtime.
--- drivers/usb/typec/Makefile | 3 + drivers/usb/typec/tps6598x.c | 9 ++- drivers/usb/typec/tps6598x.h | 61 +++++++++++++++++++ drivers/usb/typec/tps6598x_trace.h | 97 ++++++++++++++++++++++++++++++ 4 files changed, 167 insertions(+), 3 deletions(-) create mode 100644 drivers/usb/typec/tps6598x.h create mode 100644 drivers/usb/typec/tps6598x_trace.h
drivers/usb/typec/Makefile +3 -0
@@ -1,4 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 +# define_trace.h needs to know how to find our header +CFLAGS_tps6598x.o := -I$(src) + obj-$(CONFIG_TYPEC) += typec.o typec-y := class.o mux.o bus.o obj-$(CONFIG_TYPEC) += altmodes/
drivers/usb/typec/tps6598x.c +6 -3
@@ -6,6 +6,8 @@* Author: Heikki Krogerus <[email protected]> */ +#include "tps6598x.h" +#include <linux/i2c.h> #include <linux/acpi.h> #include <linux/module.h>
@@ -15,6 +17,9 @@#include <linux/usb/typec.h> #include <linux/usb/role.h> +#define CREATE_TRACE_POINTS +#include "tps6598x_trace.h" +/* Register offsets */ #define TPS_REG_VID 0x00#define TPS_REG_MODE 0x03
@@ -32,9 +37,6 @@#define TPS_REG_POWER_STATUS 0x3f#define TPS_REG_RX_IDENTITY_SOP 0x48 -/* TPS_REG_INT_* bits */ -#define TPS_REG_INT_PLUG_EVENT BIT(3) -/* TPS_REG_STATUS bits */ #define TPS_STATUS_PLUG_PRESENT BIT(0)#define TPS_STATUS_ORIENTATION BIT(4)
@@ -428,6 +430,7 @@ static irqreturn_t tps6598x_interrupt(int irq, void *data)dev_err (tps->dev,"%s: failed to read events\n" , __func__); goto err_unlock; } +trace_tps6598x_irq (event1, event2); ret =tps6598x_read32 (tps,TPS_REG_STATUS , &status);if (ret) {
drivers/usb/typec/tps6598x.h new file +61 -0
61 lines not on this page · raw message
drivers/usb/typec/tps6598x_trace.h new file +97 -0
97 lines not on this page · raw message
Signature · 1 line
2.30.0
kernel test robot
build botRe: [PATCH v1 1/4] usb: typec: tps6598x: Add trace event for IRQ events
I love your patch! Perhaps something to improve:
Hi "Guido,
I love your patch! Perhaps something to improve:
[auto build test WARNING on usb/usb-testing]
[also build test WARNING on v5.11-rc7 next-20210211]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Guido-G-nther/usb-typec-tps6598x-Add-IRQ-flag-and-register-tracing/20210212-001108 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing config: mips-randconfig-r036-20210209 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://github.com/0day-ci/linux/commit/bb7c40815d7d301dc6d52b1213d82b18696abf14
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Guido-G-nther/usb-typec-tps6598x-Add-IRQ-flag-and-register-tracing/20210212-001108 git checkout bb7c40815d7d301dc6d52b1213d82b18696abf14
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:51:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_ERROR_DEVICE_INCOMPATIBLE, "ERROR_DEVICE_INCOMPATIBLE" }, \
^
drivers/usb/typec/tps6598x.h:31:48: note: expanded from macro 'TPS_REG_INT_ERROR_DEVICE_INCOMPATIBLE'
#define TPS_REG_INT_ERROR_DEVICE_INCOMPATIBLE BIT(0+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:52:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_ERROR_CANNOT_PROVIDE_PWR, "ERROR_CANNOT_PROVIDE_PWR" }, \
^
drivers/usb/typec/tps6598x.h:30:47: note: expanded from macro 'TPS_REG_INT_ERROR_CANNOT_PROVIDE_PWR'
#define TPS_REG_INT_ERROR_CANNOT_PROVIDE_PWR BIT(1+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:53:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_ERROR_CAN_PROVIDE_PWR_LATER, "ERROR_CAN_PROVIDE_PWR_LATER" }, \
^
drivers/usb/typec/tps6598x.h:29:50: note: expanded from macro 'TPS_REG_INT_ERROR_CAN_PROVIDE_PWR_LATER'
#define TPS_REG_INT_ERROR_CAN_PROVIDE_PWR_LATER BIT(2+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:54:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_ERROR_POWER_EVENT_OCCURRED, "ERROR_POWER_EVENT_OCCURRED" }, \
^
drivers/usb/typec/tps6598x.h:28:49: note: expanded from macro 'TPS_REG_INT_ERROR_POWER_EVENT_OCCURRED'
#define TPS_REG_INT_ERROR_POWER_EVENT_OCCURRED BIT(3+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:55:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_ERROR_MISSING_GET_CAP_MESSAGE, "ERROR_MISSING_GET_CAP_MESSAGE" }, \
^
drivers/usb/typec/tps6598x.h:27:51: note: expanded from macro 'TPS_REG_INT_ERROR_MISSING_GET_CAP_MESSAGE'
#define TPS_REG_INT_ERROR_MISSING_GET_CAP_MESSAGE BIT(4+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:56:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_ERROR_PROTOCOL_ERROR, "ERROR_PROTOCOL_ERROR" }, \
^
drivers/usb/typec/tps6598x.h:26:43: note: expanded from macro 'TPS_REG_INT_ERROR_PROTOCOL_ERROR'
#define TPS_REG_INT_ERROR_PROTOCOL_ERROR BIT(6+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:57:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_ERROR_MESSAGE_DATA, "ERROR_MESSAGE_DATA" }, \
^
drivers/usb/typec/tps6598x.h:25:42: note: expanded from macro 'TPS_REG_INT_ERROR_MESSAGE_DATA'
#define TPS_REG_INT_ERROR_MESSAGE_DATA BIT(7+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:58:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_ERROR_DISCHARGE_FAILED, "ERROR_DISCHARGE_FAILED" }, \
^
drivers/usb/typec/tps6598x.h:24:45: note: expanded from macro 'TPS_REG_INT_ERROR_DISCHARGE_FAILED'
#define TPS_REG_INT_ERROR_DISCHARGE_FAILED BIT(9+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:59:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_SRC_TRANSITION, "SRC_TRANSITION" }, \
^
drivers/usb/typec/tps6598x.h:23:38: note: expanded from macro 'TPS_REG_INT_SRC_TRANSITION'
#define TPS_REG_INT_SRC_TRANSITION BIT(10+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:60:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_ERROR_UNABLE_TO_SOURCE, "ERROR_UNABLE_TO_SOURCE" }, \
^
drivers/usb/typec/tps6598x.h:22:45: note: expanded from macro 'TPS_REG_INT_ERROR_UNABLE_TO_SOURCE'
#define TPS_REG_INT_ERROR_UNABLE_TO_SOURCE BIT(14+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:61:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_VDM_ENTERED_MODE, "VDM_ENTERED_MODE" }, \
^
drivers/usb/typec/tps6598x.h:21:40: note: expanded from macro 'TPS_REG_INT_VDM_ENTERED_MODE'
#define TPS_REG_INT_VDM_ENTERED_MODE BIT(17+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:62:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_VDM_MSG_SENT, "VDM_MSG_SENT" }, \
^
drivers/usb/typec/tps6598x.h:20:36: note: expanded from macro 'TPS_REG_INT_VDM_MSG_SENT'
#define TPS_REG_INT_VDM_MSG_SENT BIT(18+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:63:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_DISCOVER_MODES_COMPLETE, "DISCOVER_MODES_COMPLETE" }, \
^
drivers/usb/typec/tps6598x.h:19:46: note: expanded from macro 'TPS_REG_INT_DISCOVER_MODES_COMPLETE'
#define TPS_REG_INT_DISCOVER_MODES_COMPLETE BIT(19+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:64:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_EXIT_MODES_COMPLETE, "EXIT_MODES_COMPLETE" }, \
^
drivers/usb/typec/tps6598x.h:18:43: note: expanded from macro 'TPS_REG_INT_EXIT_MODES_COMPLETE'
#define TPS_REG_INT_EXIT_MODES_COMPLETE BIT(20+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:65:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_USER_VID_ALT_MODE_ENTERED, "USER_VID_ALT_MODE_ENTERED" }, \
^
drivers/usb/typec/tps6598x.h:17:48: note: expanded from macro 'TPS_REG_INT_USER_VID_ALT_MODE_ENTERED'
#define TPS_REG_INT_USER_VID_ALT_MODE_ENTERED BIT(24+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:66:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_USER_VID_ALT_MODE_EXIT, "USER_VID_ALT_MODE_EXIT" }, \
^
drivers/usb/typec/tps6598x.h:16:45: note: expanded from macro 'TPS_REG_INT_USER_VID_ALT_MODE_EXIT'
#define TPS_REG_INT_USER_VID_ALT_MODE_EXIT BIT(25+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:67:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_USER_VID_ALT_MODE_ATTN_VDM, "USER_VID_ALT_MODE_ATTN_VDM" }, \
^
drivers/usb/typec/tps6598x.h:15:49: note: expanded from macro 'TPS_REG_INT_USER_VID_ALT_MODE_ATTN_VDM'
#define TPS_REG_INT_USER_VID_ALT_MODE_ATTN_VDM BIT(26+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:86:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event1),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:68:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_USER_VID_ALT_MODE_OTHER_VDM, "USER_VID_ALT_MODE_OTHER_VDM" })
^
drivers/usb/typec/tps6598x.h:14:50: note: expanded from macro 'TPS_REG_INT_USER_VID_ALT_MODE_OTHER_VDM'
#define TPS_REG_INT_USER_VID_ALT_MODE_OTHER_VDM BIT(27+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:87:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:51:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_ERROR_DEVICE_INCOMPATIBLE, "ERROR_DEVICE_INCOMPATIBLE" }, \
^
drivers/usb/typec/tps6598x.h:31:48: note: expanded from macro 'TPS_REG_INT_ERROR_DEVICE_INCOMPATIBLE'
#define TPS_REG_INT_ERROR_DEVICE_INCOMPATIBLE BIT(0+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:87:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:52:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_ERROR_CANNOT_PROVIDE_PWR, "ERROR_CANNOT_PROVIDE_PWR" }, \
^
drivers/usb/typec/tps6598x.h:30:47: note: expanded from macro 'TPS_REG_INT_ERROR_CANNOT_PROVIDE_PWR'
#define TPS_REG_INT_ERROR_CANNOT_PROVIDE_PWR BIT(1+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:97:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:87:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:53:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_ERROR_CAN_PROVIDE_PWR_LATER, "ERROR_CAN_PROVIDE_PWR_LATER" }, \
^
drivers/usb/typec/tps6598x.h:29:50: note: expanded from macro 'TPS_REG_INT_ERROR_CAN_PROVIDE_PWR_LATER'
#define TPS_REG_INT_ERROR_CAN_PROVIDE_PWR_LATER BIT(2+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~ In file included from drivers/usb/typec/tps6598x.c:21:
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SSB_EMBEDDED Depends on SSB && SSB_DRIVER_MIPS && SSB_PCICORE_HOSTMODE Selected by
- BCM47XX_SSB && BCM47XX
vim +86 drivers/usb/typec/./tps6598x_trace.h
20
21 #define show_irq_flags(flags) \
22 __print_flags(flags, "|", \
23 { TPS_REG_INT_PD_SOFT_RESET, "PD_SOFT_RESET" }, \
24 { TPS_REG_INT_HARD_RESET, "HARD_RESET" }, \
25 { TPS_REG_INT_PLUG_EVENT, "PLUG_EVENT" }, \
26 { TPS_REG_INT_PR_SWAP_COMPLETE, "PR_SWAP_COMPLETE" }, \
27 { TPS_REG_INT_DR_SWAP_COMPLETE, "DR_SWAP_COMPLETE" }, \
28 { TPS_REG_INT_RDO_RECEIVED_FROM_SINK, "RDO_RECEIVED_FROM_SINK" }, \
29 { TPS_REG_INT_BIST, "BIST" }, \
30 { TPS_REG_INT_OVERCURRENT, "OVERCURRENT" }, \
31 { TPS_REG_INT_ATTENTION_RECEIVED, "ATTENTION_RECEIVED" }, \
32 { TPS_REG_INT_VDM_RECEIVED, "VDM_RECEIVED" }, \
33 { TPS_REG_INT_NEW_CONTRACT_AS_CONSUMER, "NEW_CONTRACT_AS_CONSUMER" }, \
34 { TPS_REG_INT_NEW_CONTRACT_AS_PROVIDER, "NEW_CONTRACT_AS_PROVIDER" }, \
35 { TPS_REG_INT_SOURCE_CAP_MESSAGE_READY, "SOURCE_CAP_MESSAGE_READY" }, \
36 { TPS_REG_INT_SINK_CAP_MESSAGE_READY, "SINK_CAP_MESSAGE_READY" }, \
37 { TPS_REG_INT_PR_SWAP_REQUESTED, "PR_SWAP_REQUESTED" }, \
38 { TPS_REG_INT_GOTO_MIN_RECEIVED, "GOTO_MIN_RECEIVED" }, \
39 { TPS_REG_INT_USB_HOST_PRESENT, "USB_HOST_PRESENT" }, \
40 { TPS_REG_INT_USB_HOST_PRESENT_NO_LONGER, "USB_HOST_PRESENT_NO_LONGER" }, \
41 { TPS_REG_INT_HIGH_VOLTAGE_WARNING, "HIGH_VOLTAGE_WARNING" }, \
42 { TPS_REG_INT_PP_SWITCH_CHANGED, "PP_SWITCH_CHANGED" }, \
43 { TPS_REG_INT_POWER_STATUS_UPDATE, "POWER_STATUS_UPDATE" }, \
44 { TPS_REG_INT_DATA_STATUS_UPDATE, "DATA_STATUS_UPDATE" }, \
45 { TPS_REG_INT_STATUS_UPDATE, "STATUS_UPDATE" }, \
46 { TPS_REG_INT_PD_STATUS_UPDATE, "PD_STATUS_UPDATE" }, \
47 { TPS_REG_INT_ADC_LOW_THRESHOLD, "ADC_LOW_THRESHOLD" }, \
48 { TPS_REG_INT_ADC_HIGH_THRESHOLD, "ADC_HIGH_THRESHOLD" }, \
49 { TPS_REG_INT_CMD1_COMPLETE, "CMD1_COMPLETE" }, \
50 { TPS_REG_INT_CMD2_COMPLETE, "CMD2_COMPLETE" }, \
51 { TPS_REG_INT_ERROR_DEVICE_INCOMPATIBLE, "ERROR_DEVICE_INCOMPATIBLE" }, \
52 { TPS_REG_INT_ERROR_CANNOT_PROVIDE_PWR, "ERROR_CANNOT_PROVIDE_PWR" }, \
53 { TPS_REG_INT_ERROR_CAN_PROVIDE_PWR_LATER, "ERROR_CAN_PROVIDE_PWR_LATER" }, \
54 { TPS_REG_INT_ERROR_POWER_EVENT_OCCURRED, "ERROR_POWER_EVENT_OCCURRED" }, \
55 { TPS_REG_INT_ERROR_MISSING_GET_CAP_MESSAGE, "ERROR_MISSING_GET_CAP_MESSAGE" }, \
56 { TPS_REG_INT_ERROR_PROTOCOL_ERROR, "ERROR_PROTOCOL_ERROR" }, \
57 { TPS_REG_INT_ERROR_MESSAGE_DATA, "ERROR_MESSAGE_DATA" }, \
58 { TPS_REG_INT_ERROR_DISCHARGE_FAILED, "ERROR_DISCHARGE_FAILED" }, \
59 { TPS_REG_INT_SRC_TRANSITION, "SRC_TRANSITION" }, \
60 { TPS_REG_INT_ERROR_UNABLE_TO_SOURCE, "ERROR_UNABLE_TO_SOURCE" }, \
61 { TPS_REG_INT_VDM_ENTERED_MODE, "VDM_ENTERED_MODE" }, \
62 { TPS_REG_INT_VDM_MSG_SENT, "VDM_MSG_SENT" }, \
63 { TPS_REG_INT_DISCOVER_MODES_COMPLETE, "DISCOVER_MODES_COMPLETE" }, \
64 { TPS_REG_INT_EXIT_MODES_COMPLETE, "EXIT_MODES_COMPLETE" }, \
65 { TPS_REG_INT_USER_VID_ALT_MODE_ENTERED, "USER_VID_ALT_MODE_ENTERED" }, \
66 { TPS_REG_INT_USER_VID_ALT_MODE_EXIT, "USER_VID_ALT_MODE_EXIT" }, \
67 { TPS_REG_INT_USER_VID_ALT_MODE_ATTN_VDM, "USER_VID_ALT_MODE_ATTN_VDM" }, \
68 { TPS_REG_INT_USER_VID_ALT_MODE_OTHER_VDM, "USER_VID_ALT_MODE_OTHER_VDM" })
69
70 TRACE_EVENT(tps6598x_irq,
71 TP_PROTO(u64 event1,
72 u64 event2),
73 TP_ARGS(event1, event2),
74
75 TP_STRUCT__entry(
76 __field(u64, event1)
77 __field(u64, event2)
78 ),
79
80 TP_fast_assign(
81 __entry->event1 = event1;
82 __entry->event2 = event2;
83 ),
84
85 TP_printk("event1=%s, event2=%s",
> 86 show_irq_flags(__entry->event1),
87 show_irq_flags(__entry->event2))
88 );
89 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
PATCH 2/4 usb: typec: tps6598x: Add trace event for status register
In reply to Guido GüntherThis allows to trace status information which helps to debug problems with role switching, etc.
--- drivers/usb/typec/tps6598x.c | 26 ++++----- drivers/usb/typec/tps6598x.h | 66 +++++++++++++++++++++ drivers/usb/typec/tps6598x_trace.h | 94 ++++++++++++++++++++++++++++++ 3 files changed, 171 insertions(+), 15 deletions(-)
drivers/usb/typec/tps6598x.c +11 -15
@@ -37,13 +37,6 @@#define TPS_REG_POWER_STATUS 0x3f#define TPS_REG_RX_IDENTITY_SOP 0x48 -/* TPS_REG_STATUS bits */ -#define TPS_STATUS_PLUG_PRESENT BIT(0) -#define TPS_STATUS_ORIENTATION BIT(4) -#define TPS_STATUS_PORTROLE (s) (!!((s) & BIT(5))) -#define TPS_STATUS_DATAROLE (s) (!!((s) & BIT(6))) -#define TPS_STATUS_VCONN (s) (!!((s) & BIT(7))) -/* TPS_REG_SYSTEM_CONF bits */ #define TPS_SYSCONF_PORTINFO (c) ((c) & 7)
@@ -258,9 +251,9 @@ static int tps6598x_connect(struct tps6598x *tps, u32 status) }typec_set_pwr_opmode (tps->port, mode); -typec_set_pwr_role (tps->port,TPS_STATUS_PORTROLE (status)); -typec_set_vconn_role (tps->port,TPS_STATUS_VCONN (status)); -tps6598x_set_data_role (tps,TPS_STATUS_DATAROLE (status), true); +typec_set_pwr_role (tps->port,TPS_STATUS_TO_TYPEC_PORTROLE (status)); +typec_set_vconn_role (tps->port,TPS_STATUS_TO_TYPEC_VCONN (status)); +tps6598x_set_data_role (tps,TPS_STATUS_TO_TYPEC_DATAROLE (status), true); tps->partner =typec_register_partner (tps->port, &desc);if (IS_ERR (tps->partner))
@@ -280,9 +273,10 @@ static void tps6598x_disconnect(struct tps6598x *tps, u32 status)typec_unregister_partner (tps->partner); tps->partner =NULL ;typec_set_pwr_opmode (tps->port,TYPEC_PWR_MODE_USB ); -typec_set_pwr_role (tps->port,TPS_STATUS_PORTROLE (status)); -typec_set_vconn_role (tps->port,TPS_STATUS_VCONN (status)); -tps6598x_set_data_role (tps,TPS_STATUS_DATAROLE (status), false); +typec_set_pwr_role (tps->port,TPS_STATUS_TO_TYPEC_PORTROLE (status)); +typec_set_vconn_role (tps->port,TPS_STATUS_TO_TYPEC_VCONN (status)); +tps6598x_set_data_role (tps,TPS_STATUS_TO_TYPEC_DATAROLE (status), false); +power_supply_changed (tps->psy); }
@@ -366,7 +360,7 @@ static int tps6598x_dr_set(struct typec_port *port, enum typec_data_role role)if (ret) goto out_unlock; -if (role !=TPS_STATUS_DATAROLE (status)) { +if (role !=TPS_STATUS_TO_TYPEC_DATAROLE (status)) { ret = -EPROTO ; goto out_unlock; }
@@ -396,7 +390,7 @@ static int tps6598x_pr_set(struct typec_port *port, enum typec_role role)if (ret) goto out_unlock; -if (role !=TPS_STATUS_PORTROLE (status)) { +if (role !=TPS_STATUS_TO_TYPEC_PORTROLE (status)) { ret = -EPROTO ; goto out_unlock; }
@@ -437,6 +431,7 @@ static irqreturn_t tps6598x_interrupt(int irq, void *data)dev_err (tps->dev,"%s: failed to read status\n" , __func__); goto err_clear_ints; } +trace_tps6598x_status (status);/* Handle plug insert or removal */ if ((event1 | event2) &TPS_REG_INT_PLUG_EVENT ) {
@@ -612,6 +607,7 @@ static int tps6598x_probe(struct i2c_client *client) ret =tps6598x_read32 (tps,TPS_REG_STATUS , &status);if (ret <0 )return ret; +trace_tps6598x_status (status); ret =tps6598x_read32 (tps,TPS_REG_SYSTEM_CONF , &conf);if (ret <0 )
drivers/usb/typec/tps6598x.h +66 -0
72 lines not on this page · raw message
drivers/usb/typec/tps6598x_trace.h +94 -0
106 lines not on this page · raw message
Signature · 1 line
2.30.0
kernel test robot
build botRe: [PATCH v1 2/4] usb: typec: tps6598x: Add trace event for status register
I love your patch! Yet something to improve:
Hi "Guido,
I love your patch! Yet something to improve:
[auto build test ERROR on usb/usb-testing]
[also build test ERROR on v5.11-rc7 next-20210211]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Guido-G-nther/usb-typec-tps6598x-Add-IRQ-flag-and-register-tracing/20210212-001108 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing config: microblaze-randconfig-r026-20210209 (attached as .config) compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/17785e43289bc7b92db7b401cd53a37c7a9faed2
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Guido-G-nther/usb-typec-tps6598x-Add-IRQ-flag-and-register-tracing/20210212-001108 git checkout 17785e43289bc7b92db7b401cd53a37c7a9faed2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
drivers/usb/typec/./tps6598x_trace.h:137:1: note: in expansion of macro 'TRACE_EVENT'
137 | TRACE_EVENT(tps6598x_irq,
| ^~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:152:6: note: in expansion of macro 'TP_printk'
152 | TP_printk("event1=%s, event2=%s",
| ^~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:22:2: note: in expansion of macro '__print_flags'
22 | __print_flags(flags, "|", \
| ^~~~~~~~~~~~~
drivers/usb/typec/tps6598x.h:83:48: note: in expansion of macro 'BIT'
83 | #define TPS_REG_INT_USER_VID_ALT_MODE_ENTERED BIT(24+32)
| ^~~
drivers/usb/typec/./tps6598x_trace.h:65:5: note: in expansion of macro 'TPS_REG_INT_USER_VID_ALT_MODE_ENTERED'
65 | { TPS_REG_INT_USER_VID_ALT_MODE_ENTERED, "USER_VID_ALT_MODE_ENTERED" }, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:154:9: note: in expansion of macro 'show_irq_flags'
154 | show_irq_flags(__entry->event2))
| ^~~~~~~~~~~~~~
include/vdso/bits.h:7:26: warning: left shift count >= width of type [-Wshift-count-overflow]
7 | #define BIT(nr) (UL(1) << (nr))
| ^~
include/trace/trace_events.h:367:22: note: in definition of macro 'DECLARE_EVENT_CLASS'
367 | trace_seq_printf(s, print); \
| ^~~~~
include/trace/trace_events.h:80:9: note: in expansion of macro 'PARAMS'
80 | PARAMS(print)); \
| ^~~~~~
drivers/usb/typec/./tps6598x_trace.h:137:1: note: in expansion of macro 'TRACE_EVENT'
137 | TRACE_EVENT(tps6598x_irq,
| ^~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:152:6: note: in expansion of macro 'TP_printk'
152 | TP_printk("event1=%s, event2=%s",
| ^~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:22:2: note: in expansion of macro '__print_flags'
22 | __print_flags(flags, "|", \
| ^~~~~~~~~~~~~
drivers/usb/typec/tps6598x.h:82:45: note: in expansion of macro 'BIT'
82 | #define TPS_REG_INT_USER_VID_ALT_MODE_EXIT BIT(25+32)
| ^~~
drivers/usb/typec/./tps6598x_trace.h:66:5: note: in expansion of macro 'TPS_REG_INT_USER_VID_ALT_MODE_EXIT'
66 | { TPS_REG_INT_USER_VID_ALT_MODE_EXIT, "USER_VID_ALT_MODE_EXIT" }, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:154:9: note: in expansion of macro 'show_irq_flags'
154 | show_irq_flags(__entry->event2))
| ^~~~~~~~~~~~~~
include/vdso/bits.h:7:26: warning: left shift count >= width of type [-Wshift-count-overflow]
7 | #define BIT(nr) (UL(1) << (nr))
| ^~
include/trace/trace_events.h:367:22: note: in definition of macro 'DECLARE_EVENT_CLASS'
367 | trace_seq_printf(s, print); \
| ^~~~~
include/trace/trace_events.h:80:9: note: in expansion of macro 'PARAMS'
80 | PARAMS(print)); \
| ^~~~~~
drivers/usb/typec/./tps6598x_trace.h:137:1: note: in expansion of macro 'TRACE_EVENT'
137 | TRACE_EVENT(tps6598x_irq,
| ^~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:152:6: note: in expansion of macro 'TP_printk'
152 | TP_printk("event1=%s, event2=%s",
| ^~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:22:2: note: in expansion of macro '__print_flags'
22 | __print_flags(flags, "|", \
| ^~~~~~~~~~~~~
drivers/usb/typec/tps6598x.h:81:49: note: in expansion of macro 'BIT'
81 | #define TPS_REG_INT_USER_VID_ALT_MODE_ATTN_VDM BIT(26+32)
| ^~~
drivers/usb/typec/./tps6598x_trace.h:67:5: note: in expansion of macro 'TPS_REG_INT_USER_VID_ALT_MODE_ATTN_VDM'
67 | { TPS_REG_INT_USER_VID_ALT_MODE_ATTN_VDM, "USER_VID_ALT_MODE_ATTN_VDM" }, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:154:9: note: in expansion of macro 'show_irq_flags'
154 | show_irq_flags(__entry->event2))
| ^~~~~~~~~~~~~~
include/vdso/bits.h:7:26: warning: left shift count >= width of type [-Wshift-count-overflow]
7 | #define BIT(nr) (UL(1) << (nr))
| ^~
include/trace/trace_events.h:367:22: note: in definition of macro 'DECLARE_EVENT_CLASS'
367 | trace_seq_printf(s, print); \
| ^~~~~
include/trace/trace_events.h:80:9: note: in expansion of macro 'PARAMS'
80 | PARAMS(print)); \
| ^~~~~~
drivers/usb/typec/./tps6598x_trace.h:137:1: note: in expansion of macro 'TRACE_EVENT'
137 | TRACE_EVENT(tps6598x_irq,
| ^~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:152:6: note: in expansion of macro 'TP_printk'
152 | TP_printk("event1=%s, event2=%s",
| ^~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:22:2: note: in expansion of macro '__print_flags'
22 | __print_flags(flags, "|", \
| ^~~~~~~~~~~~~
drivers/usb/typec/tps6598x.h:80:50: note: in expansion of macro 'BIT'
80 | #define TPS_REG_INT_USER_VID_ALT_MODE_OTHER_VDM BIT(27+32)
| ^~~
drivers/usb/typec/./tps6598x_trace.h:68:5: note: in expansion of macro 'TPS_REG_INT_USER_VID_ALT_MODE_OTHER_VDM'
68 | { TPS_REG_INT_USER_VID_ALT_MODE_OTHER_VDM, "USER_VID_ALT_MODE_OTHER_VDM" })
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:154:9: note: in expansion of macro 'show_irq_flags'
154 | show_irq_flags(__entry->event2))
| ^~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h: In function 'trace_raw_output_tps6598x_status':
>> drivers/usb/typec/tps6598x.h:28:35: error: implicit declaration of function 'FIELD_GET'; did you mean 'FOLL_GET'? [-Werror=implicit-function-declaration]
28 | #define TPS_STATUS_CONN_STATE(x) FIELD_GET(TPS_STATUS_CONN_STATE_MASK, (x))
| ^~~~~~~~~
include/trace/trace_events.h:367:22: note: in definition of macro 'DECLARE_EVENT_CLASS'
367 | trace_seq_printf(s, print); \
| ^~~~~
include/trace/trace_events.h:80:9: note: in expansion of macro 'PARAMS'
80 | PARAMS(print)); \
| ^~~~~~
drivers/usb/typec/./tps6598x_trace.h:157:1: note: in expansion of macro 'TRACE_EVENT'
157 | TRACE_EVENT(tps6598x_status,
| ^~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:169:6: note: in expansion of macro 'TP_printk'
169 | TP_printk("conn: %s, pp_5v0: %s, pp_hv: %s, pp_ext: %s, pp_cable: %s, "
| ^~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:81:2: note: in expansion of macro '__print_symbolic'
81 | __print_symbolic(TPS_STATUS_CONN_STATE((status)), \
| ^~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:81:19: note: in expansion of macro 'TPS_STATUS_CONN_STATE'
81 | __print_symbolic(TPS_STATUS_CONN_STATE((status)), \
| ^~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:171:9: note: in expansion of macro 'show_status_conn_state'
171 | show_status_conn_state(__entry->status),
| ^~~~~~~~~~~~~~~~~~~~~~cc1: some warnings being treated as errors
vim +28 drivers/usb/typec/tps6598x.h
26
27 #define TPS_STATUS_CONN_STATE_MASK GENMASK(3, 1)
> 28 #define TPS_STATUS_CONN_STATE(x) FIELD_GET(TPS_STATUS_CONN_STATE_MASK, (x))
29 #define TPS_STATUS_PP_5V0_SWITCH_MASK GENMASK(9, 8)
30 #define TPS_STATUS_PP_5V0_SWITCH(x) FIELD_GET(TPS_STATUS_PP_5V0_SWITCH_MASK, (x))
31 #define TPS_STATUS_PP_HV_SWITCH_MASK GENMASK(11, 10)
32 #define TPS_STATUS_PP_HV_SWITCH(x) FIELD_GET(TPS_STATUS_PP_HV_SWITCH_MASK, (x))
33 #define TPS_STATUS_PP_EXT_SWITCH_MASK GENMASK(13, 12)
34 #define TPS_STATUS_PP_EXT_SWITCH(x) FIELD_GET(TPS_STATUS_PP_EXT_SWITCH_MASK, (x))
35 #define TPS_STATUS_PP_CABLE_SWITCH_MASK GENMASK(15, 14)
36 #define TPS_STATUS_PP_CABLE_SWITCH(x) FIELD_GET(TPS_STATUS_PP_CABLE_SWITCH_MASK, (x))
37 #define TPS_STATUS_POWER_SOURCE_MASK GENMASK(19, 18)
38 #define TPS_STATUS_POWER_SOURCE(x) FIELD_GET(TPS_STATUS_POWER_SOURCE_MASK, (x))
39 #define TPS_STATUS_VBUS_STATUS_MASK GENMASK(21, 20)
40 #define TPS_STATUS_VBUS_STATUS(x) FIELD_GET(TPS_STATUS_VBUS_STATUS_MASK, (x))
41 #define TPS_STATUS_USB_HOST_PRESENT_MASK GENMASK(23, 22)
42 #define TPS_STATUS_USB_HOST_PRESENT(x) FIELD_GET(TPS_STATUS_USB_HOST_PRESENT_MASK, (x))
43 #define TPS_STATUS_LEGACY_MASK GENMASK(25, 24)
44 #define TPS_STATUS_LEGACY(x) FIELD_GET(TPS_STATUS_LEGACY_MASK, (x))
45 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botRe: [PATCH v1 2/4] usb: typec: tps6598x: Add trace event for status register
In reply to Guido GüntherI love your patch! Yet something to improve:
Hi "Guido,
I love your patch! Yet something to improve:
[auto build test ERROR on usb/usb-testing]
[also build test ERROR on v5.11-rc7 next-20210211]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Guido-G-nther/usb-typec-tps6598x-Add-IRQ-flag-and-register-tracing/20210212-001108 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing config: mips-randconfig-r036-20210209 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://github.com/0day-ci/linux/commit/17785e43289bc7b92db7b401cd53a37c7a9faed2
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Guido-G-nther/usb-typec-tps6598x-Add-IRQ-flag-and-register-tracing/20210212-001108 git checkout 17785e43289bc7b92db7b401cd53a37c7a9faed2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
{ TPS_REG_INT_USER_VID_ALT_MODE_ENTERED, "USER_VID_ALT_MODE_ENTERED" }, \
^
drivers/usb/typec/tps6598x.h:83:48: note: expanded from macro 'TPS_REG_INT_USER_VID_ALT_MODE_ENTERED'
#define TPS_REG_INT_USER_VID_ALT_MODE_ENTERED BIT(24+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:191:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:154:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:66:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_USER_VID_ALT_MODE_EXIT, "USER_VID_ALT_MODE_EXIT" }, \
^
drivers/usb/typec/tps6598x.h:82:45: note: expanded from macro 'TPS_REG_INT_USER_VID_ALT_MODE_EXIT'
#define TPS_REG_INT_USER_VID_ALT_MODE_EXIT BIT(25+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:191:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:154:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:67:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_USER_VID_ALT_MODE_ATTN_VDM, "USER_VID_ALT_MODE_ATTN_VDM" }, \
^
drivers/usb/typec/tps6598x.h:81:49: note: expanded from macro 'TPS_REG_INT_USER_VID_ALT_MODE_ATTN_VDM'
#define TPS_REG_INT_USER_VID_ALT_MODE_ATTN_VDM BIT(26+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:191:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:154:9: warning: shift count >= width of type [-Wshift-count-overflow]
show_irq_flags(__entry->event2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/./tps6598x_trace.h:68:5: note: expanded from macro 'show_irq_flags'
{ TPS_REG_INT_USER_VID_ALT_MODE_OTHER_VDM, "USER_VID_ALT_MODE_OTHER_VDM" })
^
drivers/usb/typec/tps6598x.h:80:50: note: expanded from macro 'TPS_REG_INT_USER_VID_ALT_MODE_OTHER_VDM'
#define TPS_REG_INT_USER_VID_ALT_MODE_OTHER_VDM BIT(27+32)
^
include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:80:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(print)); \
~~~~~~~^~~~~~~
include/linux/tracepoint.h:97:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:367:22: note: expanded from macro 'DECLARE_EVENT_CLASS'
trace_seq_printf(s, print); \
^~~~~
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:191:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
>> drivers/usb/typec/./tps6598x_trace.h:171:9: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_conn_state(__entry->status),
^
drivers/usb/typec/./tps6598x_trace.h:81:19: note: expanded from macro 'show_status_conn_state'
__print_symbolic(TPS_STATUS_CONN_STATE((status)), \
^
drivers/usb/typec/tps6598x.h:28:35: note: expanded from macro 'TPS_STATUS_CONN_STATE'
#define TPS_STATUS_CONN_STATE(x) FIELD_GET(TPS_STATUS_CONN_STATE_MASK, (x))
^
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:191:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:172:37: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_pp_switch_state(TPS_STATUS_PP_5V0_SWITCH(__entry->status)),
^
drivers/usb/typec/tps6598x.h:30:38: note: expanded from macro 'TPS_STATUS_PP_5V0_SWITCH'
#define TPS_STATUS_PP_5V0_SWITCH(x) FIELD_GET(TPS_STATUS_PP_5V0_SWITCH_MASK, (x))
^
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:191:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:173:37: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_pp_switch_state(TPS_STATUS_PP_HV_SWITCH(__entry->status)),
^
drivers/usb/typec/tps6598x.h:32:37: note: expanded from macro 'TPS_STATUS_PP_HV_SWITCH'
#define TPS_STATUS_PP_HV_SWITCH(x) FIELD_GET(TPS_STATUS_PP_HV_SWITCH_MASK, (x))
^
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:191:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:174:37: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_pp_switch_state(TPS_STATUS_PP_EXT_SWITCH(__entry->status)),
^
drivers/usb/typec/tps6598x.h:34:38: note: expanded from macro 'TPS_STATUS_PP_EXT_SWITCH'
#define TPS_STATUS_PP_EXT_SWITCH(x) FIELD_GET(TPS_STATUS_PP_EXT_SWITCH_MASK, (x))
^
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:191:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:175:37: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_pp_switch_state(TPS_STATUS_PP_CABLE_SWITCH(__entry->status)),
^
drivers/usb/typec/tps6598x.h:36:40: note: expanded from macro 'TPS_STATUS_PP_CABLE_SWITCH'
#define TPS_STATUS_PP_CABLE_SWITCH(x) FIELD_GET(TPS_STATUS_PP_CABLE_SWITCH_MASK, (x))
^
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:191:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:176:9: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_power_sources(__entry->status),
^
drivers/usb/typec/./tps6598x_trace.h:98:19: note: expanded from macro 'show_status_power_sources'
__print_symbolic(TPS_STATUS_POWER_SOURCE(status), \
^
drivers/usb/typec/tps6598x.h:38:37: note: expanded from macro 'TPS_STATUS_POWER_SOURCE'
#define TPS_STATUS_POWER_SOURCE(x) FIELD_GET(TPS_STATUS_POWER_SOURCE_MASK, (x))
^
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:191:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:177:9: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_vbus_status(__entry->status),
^
drivers/usb/typec/./tps6598x_trace.h:105:19: note: expanded from macro 'show_status_vbus_status'
__print_symbolic(TPS_STATUS_VBUS_STATUS(status), \
^
drivers/usb/typec/tps6598x.h:40:36: note: expanded from macro 'TPS_STATUS_VBUS_STATUS'
#define TPS_STATUS_VBUS_STATUS(x) FIELD_GET(TPS_STATUS_VBUS_STATUS_MASK, (x))
^
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:191:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:178:9: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_usb_host_present(__entry->status),
^
drivers/usb/typec/./tps6598x_trace.h:112:19: note: expanded from macro 'show_status_usb_host_present'
__print_symbolic(TPS_STATUS_USB_HOST_PRESENT(status), \
^
drivers/usb/typec/tps6598x.h:42:41: note: expanded from macro 'TPS_STATUS_USB_HOST_PRESENT'
#define TPS_STATUS_USB_HOST_PRESENT(x) FIELD_GET(TPS_STATUS_USB_HOST_PRESENT_MASK, (x))
^
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:191:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:179:9: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_legacy(__entry->status),
^
drivers/usb/typec/./tps6598x_trace.h:119:19: note: expanded from macro 'show_status_legacy'
__print_symbolic(TPS_STATUS_LEGACY(status), \
^
drivers/usb/typec/tps6598x.h:44:32: note: expanded from macro 'TPS_STATUS_LEGACY'
#define TPS_STATUS_LEGACY(x) FIELD_GET(TPS_STATUS_LEGACY_MASK, (x))
^Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SSB_EMBEDDED Depends on SSB && SSB_DRIVER_MIPS && SSB_PCICORE_HOSTMODE Selected by
- BCM47XX_SSB && BCM47XX
vim +/FIELD_GET +171 drivers/usb/typec/./tps6598x_trace.h
156
157 TRACE_EVENT(tps6598x_status,
158 TP_PROTO(u32 status),
159 TP_ARGS(status),
160
161 TP_STRUCT__entry(
162 __field(u32, status)
163 ),
164
165 TP_fast_assign(
166 __entry->status = status;
167 ),
168
169 TP_printk("conn: %s, pp_5v0: %s, pp_hv: %s, pp_ext: %s, pp_cable: %s, "
170 "pwr-src: %s, vbus: %s, usb-host: %s, legacy: %s, flags: %s", > 171 show_status_conn_state(__entry->status), 172 show_status_pp_switch_state(TPS_STATUS_PP_5V0_SWITCH(__entry->status)), 173 show_status_pp_switch_state(TPS_STATUS_PP_HV_SWITCH(__entry->status)), 174 show_status_pp_switch_state(TPS_STATUS_PP_EXT_SWITCH(__entry->status)), 175 show_status_pp_switch_state(TPS_STATUS_PP_CABLE_SWITCH(__entry->status)), 176 show_status_power_sources(__entry->status), 177 show_status_vbus_status(__entry->status), 178 show_status_usb_host_present(__entry->status), 179 show_status_legacy(__entry->status), 180 show_status_flags(__entry->status)
181 )
182 );
183
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
PATCH 3/4 usb: typec: tps6598x: Add trace event for power status register
In reply to Guido GüntherTogether with the PD status register this is vital for debugging power negotiations at runtime.
--- drivers/usb/typec/tps6598x.c | 19 +++++++++------ drivers/usb/typec/tps6598x.h | 19 +++++++++++++++ drivers/usb/typec/tps6598x_trace.h | 38 ++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 7 deletions(-)
drivers/usb/typec/tps6598x.c +12 -7
@@ -50,11 +50,6 @@ enum { TPS_PORTINFO_SOURCE, }; -/* TPS_REG_POWER_STATUS bits */ -#define TPS_POWER_STATUS_CONNECTION BIT(0) -#define TPS_POWER_STATUS_SOURCESINK BIT(1) -#define TPS_POWER_STATUS_PWROPMODE (p) (((p) & GENMASK(3, 2)) >> 2) -/* TPS_REG_RX_IDENTITY_SOP */ struct tps6598x_rx_identity_reg {u8 status;
@@ -414,6 +409,7 @@ static irqreturn_t tps6598x_interrupt(int irq, void *data)u64 event1;u64 event2;u32 status; +u16 pwr_status;int ret;mutex_lock (&tps->lock);
@@ -433,6 +429,15 @@ static irqreturn_t tps6598x_interrupt(int irq, void *data) }trace_tps6598x_status (status); +if ((event1 | event2) &TPS_REG_INT_POWER_STATUS_UPDATE ) { + ret =tps6598x_read16 (tps,TPS_REG_POWER_STATUS , &pwr_status); +if (ret <0 ) { +dev_err (tps->dev,"failed to read power status: %d\n" , ret); + goto err_clear_ints; + } +trace_tps6598x_power_status (pwr_status); + } +/* Handle plug insert or removal */ if ((event1 | event2) &TPS_REG_INT_PLUG_EVENT ) {if (status &TPS_STATUS_PLUG_PRESENT ) {
@@ -497,8 +502,8 @@ static int tps6598x_psy_get_online(struct tps6598x *tps,if (ret <0 )return ret; -if ((pwr_status &TPS_POWER_STATUS_CONNECTION ) && - (pwr_status &TPS_POWER_STATUS_SOURCESINK )) { +if (TPS_POWER_STATUS_CONNECTION (pwr_status) && +TPS_POWER_STATUS_SOURCESINK (pwr_status)) { val->intval =1 ; }else { val->intval =0 ;
drivers/usb/typec/tps6598x.h +19 -0
@@ -124,4 +124,23 @@#define TPS_REG_INT_HARD_RESET BIT(1)#define TPS_REG_INT_PD_SOFT_RESET BIT(0) +/* TPS_REG_POWER_STATUS bits */ +#define TPS_POWER_STATUS_CONNECTION (x) FIELD_GET(BIT(0), (x)) +#define TPS_POWER_STATUS_SOURCESINK (x) FIELD_GET(BIT(1), (x)) +#define TPS_POWER_STATUS_BC12_DET (x) FIELD_GET(BIT(2), (x)) + +#define TPS_POWER_STATUS_TYPEC_CURRENT_MASK GENMASK(3, 2) +#define TPS_POWER_STATUS_PWROPMODE (p) FIELD_GET(TPS_POWER_STATUS_TYPEC_CURRENT_MASK, (p)) +#define TPS_POWER_STATUS_BC12_STATUS_MASK GENMASK(6, 5) +#define TPS_POWER_STATUS_BC12_STATUS (p) FIELD_GET(TPS_POWER_STATUS_BC12_STATUS_MASK, (p)) + +#define TPS_POWER_STATUS_TYPEC_CURRENT_USB 0 +#define TPS_POWER_STATUS_TYPEC_CURRENT_1A5 1 +#define TPS_POWER_STATUS_TYPEC_CURRENT_3A0 2 +#define TPS_POWER_STATUS_TYPEC_CURRENT_PD 3 + +#define TPS_POWER_STATUS_BC12_STATUS_SDP 0 +#define TPS_POWER_STATUS_BC12_STATUS_CDP 2 +#define TPS_POWER_STATUS_BC12_STATUS_DCP 3 +#endif /* __TPS6598X_H__ */
drivers/usb/typec/tps6598x_trace.h +38 -0
@@ -134,6 +134,24 @@ { TPS_STATUS_HIGH_VOLAGE_WARNING, "HIGH_VOLAGE_WARNING" }, \ { TPS_STATUS_HIGH_LOW_VOLTAGE_WARNING, "HIGH_LOW_VOLTAGE_WARNING" }) +#define show_power_status_source_sink (power_status) \ + __print_symbolic(TPS_POWER_STATUS_SOURCESINK(power_status), \ + { 1, "sink" }, \ + { 0, "source" }) + +#define show_power_status_typec_status (power_status) \ + __print_symbolic(TPS_POWER_STATUS_PWROPMODE(power_status), \ + { TPS_POWER_STATUS_TYPEC_CURRENT_PD, "pd" }, \ + { TPS_POWER_STATUS_TYPEC_CURRENT_3A0, "3.0A" }, \ + { TPS_POWER_STATUS_TYPEC_CURRENT_1A5, "1.5A" }, \ + { TPS_POWER_STATUS_TYPEC_CURRENT_USB, "usb" }) + +#define show_power_status_bc12_status (power_status) \ + __print_symbolic(TPS_POWER_STATUS_BC12_STATUS(power_status), \ + { TPS_POWER_STATUS_BC12_STATUS_DCP, "dcp" }, \ + { TPS_POWER_STATUS_BC12_STATUS_CDP, "cdp" }, \ + { TPS_POWER_STATUS_BC12_STATUS_SDP, "sdp" }) + TRACE_EVENT(tps6598x_irq, TP_PROTO(u64 event1, u64 event2),
@@ -181,6 +199,26 @@ TRACE_EVENT(tps6598x_status, ) ); +TRACE_EVENT (tps6598x_power_status, + TP_PROTO(u16 power_status), +TP_ARGS (power_status), + +TP_STRUCT__entry ( +__field (u16, power_status) + ), + +TP_fast_assign ( + __entry->power_status = power_status; + ), + +TP_printk ("conn: %d, pwr-role: %s, typec: %s, bc: %s" , + !!TPS_POWER_STATUS_CONNECTION (__entry->power_status), +show_power_status_source_sink (__entry->power_status), +show_power_status_typec_status (__entry->power_status), +show_power_status_bc12_status (__entry->power_status) + ) +); +#endif /* _TPS6598X_TRACE_H_ */ /* This part must be outside protection */
Signature · 1 line
2.30.0
kernel test robot
build botRe: [PATCH v1 3/4] usb: typec: tps6598x: Add trace event for power status register
I love your patch! Yet something to improve:
Hi "Guido,
I love your patch! Yet something to improve:
[auto build test ERROR on usb/usb-testing]
[also build test ERROR on v5.11-rc7 next-20210211]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Guido-G-nther/usb-typec-tps6598x-Add-IRQ-flag-and-register-tracing/20210212-001108 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing config: mips-randconfig-r036-20210209 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://github.com/0day-ci/linux/commit/e726633dc82c8537d76fed3f4a2e55a28bc3e670
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Guido-G-nther/usb-typec-tps6598x-Add-IRQ-flag-and-register-tracing/20210212-001108 git checkout e726633dc82c8537d76fed3f4a2e55a28bc3e670
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:190:37: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_pp_switch_state(TPS_STATUS_PP_5V0_SWITCH(__entry->status)),
^
drivers/usb/typec/tps6598x.h:30:38: note: expanded from macro 'TPS_STATUS_PP_5V0_SWITCH'
#define TPS_STATUS_PP_5V0_SWITCH(x) FIELD_GET(TPS_STATUS_PP_5V0_SWITCH_MASK, (x))
^
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:229:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:191:37: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_pp_switch_state(TPS_STATUS_PP_HV_SWITCH(__entry->status)),
^
drivers/usb/typec/tps6598x.h:32:37: note: expanded from macro 'TPS_STATUS_PP_HV_SWITCH'
#define TPS_STATUS_PP_HV_SWITCH(x) FIELD_GET(TPS_STATUS_PP_HV_SWITCH_MASK, (x))
^
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:229:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:192:37: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_pp_switch_state(TPS_STATUS_PP_EXT_SWITCH(__entry->status)),
^
drivers/usb/typec/tps6598x.h:34:38: note: expanded from macro 'TPS_STATUS_PP_EXT_SWITCH'
#define TPS_STATUS_PP_EXT_SWITCH(x) FIELD_GET(TPS_STATUS_PP_EXT_SWITCH_MASK, (x))
^
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:229:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:193:37: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_pp_switch_state(TPS_STATUS_PP_CABLE_SWITCH(__entry->status)),
^
drivers/usb/typec/tps6598x.h:36:40: note: expanded from macro 'TPS_STATUS_PP_CABLE_SWITCH'
#define TPS_STATUS_PP_CABLE_SWITCH(x) FIELD_GET(TPS_STATUS_PP_CABLE_SWITCH_MASK, (x))
^
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:229:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:194:9: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_power_sources(__entry->status),
^
drivers/usb/typec/./tps6598x_trace.h:98:19: note: expanded from macro 'show_status_power_sources'
__print_symbolic(TPS_STATUS_POWER_SOURCE(status), \
^
drivers/usb/typec/tps6598x.h:38:37: note: expanded from macro 'TPS_STATUS_POWER_SOURCE'
#define TPS_STATUS_POWER_SOURCE(x) FIELD_GET(TPS_STATUS_POWER_SOURCE_MASK, (x))
^
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:229:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:195:9: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_vbus_status(__entry->status),
^
drivers/usb/typec/./tps6598x_trace.h:105:19: note: expanded from macro 'show_status_vbus_status'
__print_symbolic(TPS_STATUS_VBUS_STATUS(status), \
^
drivers/usb/typec/tps6598x.h:40:36: note: expanded from macro 'TPS_STATUS_VBUS_STATUS'
#define TPS_STATUS_VBUS_STATUS(x) FIELD_GET(TPS_STATUS_VBUS_STATUS_MASK, (x))
^
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:229:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:196:9: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_usb_host_present(__entry->status),
^
drivers/usb/typec/./tps6598x_trace.h:112:19: note: expanded from macro 'show_status_usb_host_present'
__print_symbolic(TPS_STATUS_USB_HOST_PRESENT(status), \
^
drivers/usb/typec/tps6598x.h:42:41: note: expanded from macro 'TPS_STATUS_USB_HOST_PRESENT'
#define TPS_STATUS_USB_HOST_PRESENT(x) FIELD_GET(TPS_STATUS_USB_HOST_PRESENT_MASK, (x))
^
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:229:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:197:9: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
show_status_legacy(__entry->status),
^
drivers/usb/typec/./tps6598x_trace.h:119:19: note: expanded from macro 'show_status_legacy'
__print_symbolic(TPS_STATUS_LEGACY(status), \
^
drivers/usb/typec/tps6598x.h:44:32: note: expanded from macro 'TPS_STATUS_LEGACY'
#define TPS_STATUS_LEGACY(x) FIELD_GET(TPS_STATUS_LEGACY_MASK, (x))
^
In file included from drivers/usb/typec/tps6598x.c:21:
In file included from drivers/usb/typec/./tps6598x_trace.h:229:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:401:
drivers/usb/typec/./tps6598x_trace.h:215:11: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
!!TPS_POWER_STATUS_CONNECTION(__entry->power_status),
^
drivers/usb/typec/tps6598x.h:128:41: note: expanded from macro 'TPS_POWER_STATUS_CONNECTION'
#define TPS_POWER_STATUS_CONNECTION(x) FIELD_GET(BIT(0), (x))
^
>> drivers/usb/typec/tps6598x.c:235:9: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
mode = TPS_POWER_STATUS_PWROPMODE(pwr_status);
^
drivers/usb/typec/tps6598x.h:133:43: note: expanded from macro 'TPS_POWER_STATUS_PWROPMODE'
#define TPS_POWER_STATUS_PWROPMODE(p) FIELD_GET(TPS_POWER_STATUS_TYPEC_CURRENT_MASK, (p))
^
drivers/usb/typec/tps6598x.c:505:6: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
if (TPS_POWER_STATUS_CONNECTION(pwr_status) &&
^
drivers/usb/typec/tps6598x.h:128:41: note: expanded from macro 'TPS_POWER_STATUS_CONNECTION'
#define TPS_POWER_STATUS_CONNECTION(x) FIELD_GET(BIT(0), (x))
^
drivers/usb/typec/tps6598x.c:527:7: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
if (TPS_POWER_STATUS_PWROPMODE(pwr_status) == TYPEC_PWR_MODE_PD)
^
drivers/usb/typec/tps6598x.h:133:43: note: expanded from macro 'TPS_POWER_STATUS_PWROPMODE'
#define TPS_POWER_STATUS_PWROPMODE(p) FIELD_GET(TPS_POWER_STATUS_TYPEC_CURRENT_MASK, (p))
^36 warnings and 13 errors generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SSB_EMBEDDED Depends on SSB && SSB_DRIVER_MIPS && SSB_PCICORE_HOSTMODE Selected by
- BCM47XX_SSB && BCM47XX
vim +/FIELD_GET +235 drivers/usb/typec/tps6598x.c
18a6c866bb191f Bryan O'Donoghue 2020-05-12 220
0a4c005bd1715d Heikki Krogerus 2017-09-25 221 static int tps6598x_connect(struct tps6598x *tps, u32 status)
0a4c005bd1715d Heikki Krogerus 2017-09-25 222 {
0a4c005bd1715d Heikki Krogerus 2017-09-25 223 struct typec_partner_desc desc;
0a4c005bd1715d Heikki Krogerus 2017-09-25 224 enum typec_pwr_opmode mode;
0a4c005bd1715d Heikki Krogerus 2017-09-25 225 u16 pwr_status;
0a4c005bd1715d Heikki Krogerus 2017-09-25 226 int ret;
0a4c005bd1715d Heikki Krogerus 2017-09-25 227
0a4c005bd1715d Heikki Krogerus 2017-09-25 228 if (tps->partner)
0a4c005bd1715d Heikki Krogerus 2017-09-25 229 return 0;
0a4c005bd1715d Heikki Krogerus 2017-09-25 230
0a4c005bd1715d Heikki Krogerus 2017-09-25 231 ret = tps6598x_read16(tps, TPS_REG_POWER_STATUS, &pwr_status);
0a4c005bd1715d Heikki Krogerus 2017-09-25 232 if (ret < 0)
0a4c005bd1715d Heikki Krogerus 2017-09-25 233 return ret;
0a4c005bd1715d Heikki Krogerus 2017-09-25 234
0a4c005bd1715d Heikki Krogerus 2017-09-25 @235 mode = TPS_POWER_STATUS_PWROPMODE(pwr_status);
0a4c005bd1715d Heikki Krogerus 2017-09-25 236
0a4c005bd1715d Heikki Krogerus 2017-09-25 237 desc.usb_pd = mode == TYPEC_PWR_MODE_PD;
0a4c005bd1715d Heikki Krogerus 2017-09-25 238 desc.accessory = TYPEC_ACCESSORY_NONE; /* XXX: handle accessories */
0a4c005bd1715d Heikki Krogerus 2017-09-25 239 desc.identity = NULL;
0a4c005bd1715d Heikki Krogerus 2017-09-25 240
0a4c005bd1715d Heikki Krogerus 2017-09-25 241 if (desc.usb_pd) {
0a4c005bd1715d Heikki Krogerus 2017-09-25 242 ret = tps6598x_read_partner_identity(tps);
0a4c005bd1715d Heikki Krogerus 2017-09-25 243 if (ret)
0a4c005bd1715d Heikki Krogerus 2017-09-25 244 return ret;
0a4c005bd1715d Heikki Krogerus 2017-09-25 245 desc.identity = &tps->partner_identity;
0a4c005bd1715d Heikki Krogerus 2017-09-25 246 }
0a4c005bd1715d Heikki Krogerus 2017-09-25 247
0a4c005bd1715d Heikki Krogerus 2017-09-25 248 typec_set_pwr_opmode(tps->port, mode);
17785e43289bc7 Guido Günther 2021-02-11 249 typec_set_pwr_role(tps->port, TPS_STATUS_TO_TYPEC_PORTROLE(status));
17785e43289bc7 Guido Günther 2021-02-11 250 typec_set_vconn_role(tps->port, TPS_STATUS_TO_TYPEC_VCONN(status));
17785e43289bc7 Guido Günther 2021-02-11 251 tps6598x_set_data_role(tps, TPS_STATUS_TO_TYPEC_DATAROLE(status), true);
0a4c005bd1715d Heikki Krogerus 2017-09-25 252
cf6e06cddf2972 Heikki Krogerus 2018-03-02 253 tps->partner = typec_register_partner(tps->port, &desc);
cf6e06cddf2972 Heikki Krogerus 2018-03-02 254 if (IS_ERR(tps->partner))
cf6e06cddf2972 Heikki Krogerus 2018-03-02 255 return PTR_ERR(tps->partner);
cf6e06cddf2972 Heikki Krogerus 2018-03-02 256
0a4c005bd1715d Heikki Krogerus 2017-09-25 257 if (desc.identity)
0a4c005bd1715d Heikki Krogerus 2017-09-25 258 typec_partner_set_identity(tps->partner);
0a4c005bd1715d Heikki Krogerus 2017-09-25 259
10eb0b6ac63a15 Guido Günther 2020-12-05 260 power_supply_changed(tps->psy);
10eb0b6ac63a15 Guido Günther 2020-12-05 261
0a4c005bd1715d Heikki Krogerus 2017-09-25 262 return 0;
0a4c005bd1715d Heikki Krogerus 2017-09-25 263 }
0a4c005bd1715d Heikki Krogerus 2017-09-25 264 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
PATCH 4/4 usb: typec: tps6598x: Add trace event for data status
In reply to Guido GüntherThis is useful to debug DP negotiation and pin assignment even when the firmware does all the work.
--- drivers/usb/typec/tps6598x.c | 12 ++++++- drivers/usb/typec/tps6598x.h | 36 ++++++++++++++++++++ drivers/usb/typec/tps6598x_trace.h | 54 ++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 1 deletion(-)
drivers/usb/typec/tps6598x.c +11 -1
@@ -36,6 +36,7 @@#define TPS_REG_CTRL_CONF 0x29#define TPS_REG_POWER_STATUS 0x3f#define TPS_REG_RX_IDENTITY_SOP 0x48 +#define TPS_REG_DATA_STATUS 0x5f/* TPS_REG_SYSTEM_CONF bits */ #define TPS_SYSCONF_PORTINFO (c) ((c) & 7)
@@ -408,7 +409,7 @@ static irqreturn_t tps6598x_interrupt(int irq, void *data)struct tps6598x *tps = data;u64 event1;u64 event2; -u32 status; +u32 status, data_status;u16 pwr_status;int ret;
@@ -438,6 +439,15 @@ static irqreturn_t tps6598x_interrupt(int irq, void *data)trace_tps6598x_power_status (pwr_status); } +if ((event1 | event2) &TPS_REG_INT_DATA_STATUS_UPDATE ) { + ret =tps6598x_read32 (tps,TPS_REG_DATA_STATUS , &data_status); +if (ret <0 ) { +dev_err (tps->dev,"failed to read data status: %d\n" , ret); + goto err_clear_ints; + } +trace_tps6598x_data_status (data_status); + } +/* Handle plug insert or removal */ if ((event1 | event2) &TPS_REG_INT_PLUG_EVENT ) {if (status &TPS_STATUS_PLUG_PRESENT ) {
drivers/usb/typec/tps6598x.h +36 -0
@@ -143,4 +143,40 @@#define TPS_POWER_STATUS_BC12_STATUS_CDP 2#define TPS_POWER_STATUS_BC12_STATUS_DCP 3 +/* TPS_REG_DATA_STATUS bits */ +#define TPS_DATA_STATUS_DATA_CONNECTION BIT(0) +#define TPS_DATA_STATUS_UPSIDE_DOWN BIT(1) +#define TPS_DATA_STATUS_ACTIVE_CABLE BIT(2) +#define TPS_DATA_STATUS_USB2_CONNECTION BIT(4) +#define TPS_DATA_STATUS_USB3_CONNECTION BIT(5) +#define TPS_DATA_STATUS_USB3_GEN2 BIT(6) +#define TPS_DATA_STATUS_USB_DATA_ROLE BIT(7) +#define TPS_DATA_STATUS_DP_CONNECTION BIT(8) +#define TPS_DATA_STATUS_DP_SINK BIT(9) +#define TPS_DATA_STATUS_TBT_CONNECTION BIT(16) +#define TPS_DATA_STATUS_TBT_TYPE BIT(17) +#define TPS_DATA_STATUS_OPTICAL_CABLE BIT(18) +#define TPS_DATA_STATUS_ACTIVE_LINK_TRAIN BIT(20) +#define TPS_DATA_STATUS_FORCE_LSX BIT(23) +#define TPS_DATA_STATUS_POWER_MISMATCH BIT(24) + +#define TPS_DATA_STATUS_DP_PIN_ASSIGNMENT_MASK GENMASK(11, 10) +#define TPS_DATA_STATUS_DP_PIN_ASSIGNMENT (x) \ + FIELD_GET(TPS_DATA_STATUS_DP_PIN_ASSIGNMENT_MASK, (x)) +#define TPS_DATA_STATUS_TBT_CABLE_SPEED_MASK GENMASK(27, 25) +#define TPS_DATA_STATUS_TBT_CABLE_SPEED FIELD_GET(TPS_DATA_STATUS_TBT_CABLE_SPEED_MASK, (x)) +#define TPS_DATA_STATUS_TBT_CABLE_GEN_MASK GENMASK(29, 28) +#define TPS_DATA_STATUS_TBT_CABLE_GEN FIELD_GET(TPS_DATA_STATUS_TBT_CABLE_GEN_MASK, (x)) + +/* Map data status to DP spec assignments */ +#define TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT (x) \ + ((TPS_DATA_STATUS_DP_PIN_ASSIGNMENT(x) << 1) | \ + FIELD_GET(TPS_DATA_STATUS_USB3_CONNECTION, (x))) +#define TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT_E 0 +#define TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT_F BIT(0) +#define TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT_C BIT(1) +#define TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT_D (BIT(1) | BIT(0)) +#define TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT_A BIT(2) +#define TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT_B (BIT(2) | BIT(1)) +#endif /* __TPS6598X_H__ */
drivers/usb/typec/tps6598x_trace.h +54 -0
66 lines not on this page · raw message
Signature · 1 line
2.30.0