Re: [PATCH v1 3/4] usb: typec: tps6598x: Add trace event for power status register

From: kernel test robot
Date: Thu Feb 11 2021 - 18:01:59 EST


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
Reported-by: kernel test robot <lkp@xxxxxxxxx>

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@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip