Content-Type: multipart/mixed; boundary="===============0108827060279275073==" MIME-Version: 1.0 From: Chen, Rong A To: kbuild-all@lists.01.org Subject: Re: [linux-next:master 11818/12026] drivers/phy/tegra/xusb.c:941: undefined reference to `usb_get_maximum_speed' Date: Sat, 28 Mar 2020 21:43:07 +0800 Message-ID: In-Reply-To: <20200327203436.GA54333@ubuntu-m2-xlarge-x86> List-Id: --===============0108827060279275073== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 3/28/2020 4:34 AM, Nathan Chancellor wrote: > On Fri, Mar 27, 2020 at 12:22:04PM -0700, 'Nick Desaulniers' via Clang Bu= ilt Linux wrote: >> This is a known bug in bfd; it doesn't seem to emit "range extending >> thunks" for 32b ARM; it's very easy to trigger this for large kernel >> images. When using LD=3Dld.lld, lld emits the range extending thunks, >> so this issue doesn't occur. > This does not apply this situation as this is not an arm32 build, it's > an arm64 randconfig build. This is not a ClangBuiltLinux issue, it > happens with GCC and binutils. > > The issue is that usb_get_maximum_speed is in the USB common folder but > CONFIG_USB_COMMON is not selected by PHY_TEGRA_XUSB. This should fix it > but I don't know if it is proper or not: > > diff --git a/drivers/phy/tegra/Kconfig b/drivers/phy/tegra/Kconfig > index a208aca4ba7b..4b0df6e90d25 100644 > --- a/drivers/phy/tegra/Kconfig > +++ b/drivers/phy/tegra/Kconfig > @@ -2,6 +2,7 @@ > config PHY_TEGRA_XUSB > tristate "NVIDIA Tegra XUSB pad controller driver" > depends on ARCH_TEGRA > + select USB_COMMON > select USB_CONN_GPIO > select USB_PHY > help > >> Philip, I'm trying to simplify the llvm builds a bit, but if your >> build with `make CC=3Dclang LD=3Dld.lld` then we don't observe these. We >> should circle back on that once I've simplified the build. > This does not take away from the fact that ld.lld should be used > wherever possible. Hi, Thanks you all, we'll add LD=3Dld.lld. Best Regards, Rong Chen > > Cheers, > Nathan > >> On Fri, Mar 27, 2020 at 11:50 AM kbuild test robot wro= te: >>> Hi Stephen, >>> >>> It's probably a bug fix that unveils the link errors. >>> >>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next= .git master >>> head: 89295c59c1f063b533d071ca49d0fa0c0783ca6f >>> commit: bf5dea0572a06529edc5429263b23d05d30c78a5 [11818/12026] Merge re= mote-tracking branch 'tegra/for-next' >>> config: arm64-randconfig-a001-20200327 (attached as .config) >>> compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 2a= 43a1610db335afcccd1a179a33a0886a5a2c4d) >>> reproduce: >>> wget https://raw.githubusercontent.com/intel/lkp-tests/master/= sbin/make.cross -O ~/bin/make.cross >>> chmod +x ~/bin/make.cross >>> git checkout bf5dea0572a06529edc5429263b23d05d30c78a5 >>> # save the attached .config to linux build tree >>> COMPILER=3Dclang make.cross ARCH=3Darm64 >>> >>> If you fix the issue, kindly add following tag >>> Reported-by: kbuild test robot >>> >>> All errors (new ones prefixed by >>): >>> >>> aarch64-linux-gnu-ld: drivers/phy/tegra/xusb.o: in function `tegra_= xusb_usb3_port_parse_dt': >>>>> drivers/phy/tegra/xusb.c:941: undefined reference to `usb_get_maximum= _speed' >>> drivers/phy/tegra/xusb.c:941:(.text+0x166c): relocation truncated t= o fit: R_AARCH64_CALL26 against undefined symbol `usb_get_maximum_speed' >>> >>> vim +941 drivers/phy/tegra/xusb.c >>> >>> e78fdbad1e902f Thierry Reding 2020-03-19 921 >>> 53d2a715c24034 Thierry Reding 2015-11-11 922 static int tegra_xusb_us= b3_port_parse_dt(struct tegra_xusb_usb3_port *usb3) >>> 53d2a715c24034 Thierry Reding 2015-11-11 923 { >>> 53d2a715c24034 Thierry Reding 2015-11-11 924 struct tegra_xusb_port = *port =3D &usb3->base; >>> 53d2a715c24034 Thierry Reding 2015-11-11 925 struct device_node *np = =3D port->dev.of_node; >>> 1ef535c6ba8ebc JC Kuo 2020-02-12 926 enum usb_device_speed m= aximum_speed; >>> 53d2a715c24034 Thierry Reding 2015-11-11 927 u32 value; >>> 53d2a715c24034 Thierry Reding 2015-11-11 928 int err; >>> 53d2a715c24034 Thierry Reding 2015-11-11 929 >>> 53d2a715c24034 Thierry Reding 2015-11-11 930 err =3D of_property_rea= d_u32(np, "nvidia,usb2-companion", &value); >>> 53d2a715c24034 Thierry Reding 2015-11-11 931 if (err < 0) { >>> 53d2a715c24034 Thierry Reding 2015-11-11 932 dev_err(&port->= dev, "failed to read port: %d\n", err); >>> 53d2a715c24034 Thierry Reding 2015-11-11 933 return err; >>> 53d2a715c24034 Thierry Reding 2015-11-11 934 } >>> 53d2a715c24034 Thierry Reding 2015-11-11 935 >>> 53d2a715c24034 Thierry Reding 2015-11-11 936 usb3->port =3D value; >>> 53d2a715c24034 Thierry Reding 2015-11-11 937 >>> 53d2a715c24034 Thierry Reding 2015-11-11 938 usb3->internal =3D of_p= roperty_read_bool(np, "nvidia,internal"); >>> 53d2a715c24034 Thierry Reding 2015-11-11 939 >>> 1ef535c6ba8ebc JC Kuo 2020-02-12 940 if (device_property_pre= sent(&port->dev, "maximum-speed")) { >>> 1ef535c6ba8ebc JC Kuo 2020-02-12 @941 maximum_speed = =3D usb_get_maximum_speed(&port->dev); >>> 1ef535c6ba8ebc JC Kuo 2020-02-12 942 if (maximum_spe= ed =3D=3D USB_SPEED_SUPER) >>> 1ef535c6ba8ebc JC Kuo 2020-02-12 943 usb3->d= isable_gen2 =3D true; >>> 1ef535c6ba8ebc JC Kuo 2020-02-12 944 else if (maximu= m_speed =3D=3D USB_SPEED_SUPER_PLUS) >>> 1ef535c6ba8ebc JC Kuo 2020-02-12 945 usb3->d= isable_gen2 =3D false; >>> 1ef535c6ba8ebc JC Kuo 2020-02-12 946 else >>> 1ef535c6ba8ebc JC Kuo 2020-02-12 947 return = -EINVAL; >>> 1ef535c6ba8ebc JC Kuo 2020-02-12 948 } >>> 1ef535c6ba8ebc JC Kuo 2020-02-12 949 >>> 2f8da84def73e1 Thierry Reding 2020-03-18 950 usb3->supply =3D regula= tor_get(&port->dev, "vbus"); >>> 045ef3115382fa Vivek Gautam 2016-10-20 951 return PTR_ERR_OR_ZERO(= usb3->supply); >>> 53d2a715c24034 Thierry Reding 2015-11-11 952 } >>> 53d2a715c24034 Thierry Reding 2015-11-11 953 >>> >>> :::::: The code at line 941 was first introduced by commit >>> :::::: 1ef535c6ba8ebcad1ced47a9d382b162c34fba3a phy: tegra: xusb: Add T= egra194 support >>> >>> :::::: TO: JC Kuo >>> :::::: CC: Thierry Reding >>> >>> --- >>> 0-DAY CI Kernel Test Service, Intel Corporation >>> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org >>> >>> -- >>> You received this message because you are subscribed to the Google Grou= ps "Clang Built Linux" group. >>> To unsubscribe from this group and stop receiving emails from it, send = an email to clang-built-linux+unsubscribe(a)googlegroups.com. >>> To view this discussion on the web visit https://groups.google.com/d/ms= gid/clang-built-linux/202003280210.EVgWpDIL%25lkp%40intel.com. >> >> >> -- = >> Thanks, >> ~Nick Desaulniers --===============0108827060279275073==--