[arm-platforms:hack/t6002-usb3 9/12] drivers/phy/apple/atc.c:828: undefined reference to `typec_switch_get_drvdata'

kernel test robot lkp at intel.com
Tue May 17 13:27:06 PDT 2022


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git hack/t6002-usb3
head:   30d2219bc762b9d23343007bb6c5ee5285ef4cf3
commit: 9a6e9c551badd748a2585fbd53b86113d280ec92 [9/12] WIP: atcphy
config: arm64-randconfig-c023-20220516 (https://download.01.org/0day-ci/archive/20220518/202205180412.d4RDT2qx-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 11.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://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?id=9a6e9c551badd748a2585fbd53b86113d280ec92
        git remote add arm-platforms https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git
        git fetch --no-tags arm-platforms hack/t6002-usb3
        git checkout 9a6e9c551badd748a2585fbd53b86113d280ec92
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All errors (new ones prefixed by >>):

   aarch64-linux-ld: Unexpected GOT/PLT entries detected!
   aarch64-linux-ld: Unexpected run-time procedure linkages detected!
   aarch64-linux-ld: drivers/phy/apple/atc.o: in function `atcphy_sw_set':
>> drivers/phy/apple/atc.c:828: undefined reference to `typec_switch_get_drvdata'
   aarch64-linux-ld: drivers/phy/apple/atc.o: in function `atcphy_mux_set':
>> drivers/phy/apple/atc.c:862: undefined reference to `typec_mux_get_drvdata'
   aarch64-linux-ld: drivers/phy/apple/atc.o: in function `atcphy_probe_mux':
>> drivers/phy/apple/atc.c:934: undefined reference to `typec_mux_register'
   aarch64-linux-ld: drivers/phy/apple/atc.o: in function `atcphy_probe_switch':
>> drivers/phy/apple/atc.c:857: undefined reference to `typec_switch_register'


vim +828 drivers/phy/apple/atc.c

   824	
   825	static int atcphy_sw_set(struct typec_switch *sw,
   826				 enum typec_orientation orientation)
   827	{
 > 828		struct apple_atcphy *atcphy = typec_switch_get_drvdata(sw);
   829	
   830		trace_atcphy_sw_set(orientation);
   831	
   832		mutex_lock(&atcphy->lock);
   833		switch (orientation) {
   834		case TYPEC_ORIENTATION_NONE:
   835			atcphy->target_mode = APPLE_ATCPHY_MODE_OFF;
   836			break;
   837		case TYPEC_ORIENTATION_NORMAL:
   838			atcphy->swap_lanes = false;
   839			break;
   840		case TYPEC_ORIENTATION_REVERSE:
   841			atcphy->swap_lanes = true;
   842			break;
   843		}
   844		mutex_unlock(&atcphy->lock);
   845	
   846		return 0;
   847	}
   848	
   849	static int atcphy_probe_switch(struct apple_atcphy *atcphy)
   850	{
   851		struct typec_switch_desc sw_desc = {
   852			.drvdata = atcphy,
   853			.fwnode = atcphy->dev->fwnode,
   854			.set = atcphy_sw_set,
   855		};
   856	
 > 857		return PTR_ERR_OR_ZERO(typec_switch_register(atcphy->dev, &sw_desc));
   858	}
   859	
   860	static int atcphy_mux_set(struct typec_mux *mux, struct typec_mux_state *state)
   861	{
 > 862		struct apple_atcphy *atcphy = typec_mux_get_drvdata(mux);
   863		unsigned long mode = state->mode;
   864	
   865		mutex_lock(&atcphy->lock);
   866		trace_atcphy_mux_set(state);
   867	
   868		if (state->alt != NULL) {
   869			dev_warn(
   870				atcphy->dev,
   871				"Attempted switch to alt mode not suppported; falling back to safe state\n");
   872			mode = TYPEC_STATE_SAFE;
   873		}
   874	
   875		if (mode == TYPEC_MODE_USB4) {
   876			dev_warn(
   877				atcphy->dev,
   878				"USB4/usb4 mode is not supported yet; falling back to safe state\n");
   879			mode = TYPEC_STATE_SAFE;
   880		}
   881	
   882		if (!atcphy->usb3_support) {
   883			switch (mode) {
   884			case TYPEC_MODE_USB3:
   885			case TYPEC_STATE_USB:
   886				dev_warn(
   887					atcphy->dev,
   888					"No USB3 support; falling back to USB2 only\n");
   889				mode = TYPEC_MODE_USB2;
   890				break;
   891			case TYPEC_MODE_USB2:
   892			case TYPEC_STATE_SAFE:
   893				break;
   894			default:
   895				dev_warn(
   896					atcphy->dev,
   897					"Unsupported mode with only usb2 support (%ld); falling back to safe state\n",
   898					mode);
   899				mode = TYPEC_STATE_SAFE;
   900			}
   901		}
   902	
   903		switch (mode) {
   904		case TYPEC_STATE_USB:
   905		case TYPEC_MODE_USB3:
   906			atcphy->target_mode = APPLE_ATCPHY_MODE_USB3;
   907			break;
   908		case TYPEC_MODE_USB2:
   909			atcphy->target_mode = APPLE_ATCPHY_MODE_USB2;
   910			break;
   911		default:
   912			dev_err(atcphy->dev,
   913				"Unknown mode in mux_set (%ld), falling back to safe state\n",
   914				state->mode);
   915			fallthrough;
   916		case TYPEC_STATE_SAFE:
   917			atcphy->target_mode = APPLE_ATCPHY_MODE_OFF;
   918			break;
   919		}
   920	
   921		mutex_unlock(&atcphy->lock);
   922	
   923		return 0;
   924	}
   925	
   926	static int atcphy_probe_mux(struct apple_atcphy *atcphy)
   927	{
   928		struct typec_mux_desc mux_desc = {
   929			.drvdata = atcphy,
   930			.fwnode = atcphy->dev->fwnode,
   931			.set = atcphy_mux_set,
   932		};
   933	
 > 934		return PTR_ERR_OR_ZERO(typec_mux_register(atcphy->dev, &mux_desc));
   935	}
   936	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



More information about the linux-arm-kernel mailing list