# Can't build any 5.x kernel...

## nasaiya

Hello, 

I can't seem to get any 5.x kernel to build successfully (using the manual method)... It fails at the end with:

```
MODPOST 110 modules

Kernel: arch/x86/boot/bzImage is ready  (#1)

ERROR: "__devm_regmap_init_i2c" [drivers/media/i2c/tvp5150.ko] undefined!

make[1]: *** [scripts/Makefile.modpost:93: __modpost] Error 1

make: *** [Makefile:1283: modules] Error 2

```

```
# grep -r __devm_regmap_init_i2c

drivers/base/regmap/regmap-i2c.c:struct regmap *__devm_regmap_init_i2c(struct i2c_client *i2c,

drivers/base/regmap/regmap-i2c.c:EXPORT_SYMBOL_GPL(__devm_regmap_init_i2c);

Binary file drivers/media/i2c/tvp5150.o matches

include/linux/regmap.h:struct regmap *__devm_regmap_init_i2c(struct i2c_client *i2c,

include/linux/regmap.h: __regmap_lockdep_wrapper(__devm_regmap_init_i2c, #config,       \

```

```
 # grep TVP .config

CONFIG_VIDEO_TVP5150=m

```

```
# grep REGMAP .config

CONFIG_REGMAP=y

```

I've tried each of y/m/unset for CONFIG_VIDEO_TVP5150 with no effect. I also tried a clean config (and ran make distclean first) and still had the error...

I have no idea how else to debug this.... could something outside of the source tree be causing the problem?

Thanks for any help!

```
# emerge --info

Portage 2.3.89 (python 3.6.10-final-0, default/linux/amd64/17.0/desktop/plasma, gcc-9.2.0, glibc-2.29-r7, 4.19.97-gentoo x86_64)

=================================================================

System uname: Linux-4.19.97-gentoo-x86_64-AMD_Ryzen_5_1600X_Six-Core_Processor-with-gentoo-2.6

KiB Mem:    16418248 total,    811548 free

KiB Swap:          0 total,         0 free

Timestamp of repository gentoo: Thu, 09 Apr 2020 20:00:01 +0000

Head commit of repository gentoo: 75f31320689f76b7c55f5c854d3015de2737bf92

sh bash 4.4_p23-r1

ld GNU ld (Gentoo 2.33.1 p2) 2.33.1

app-shells/bash:          4.4_p23-r1::gentoo

dev-java/java-config:     2.2.0-r4::gentoo

dev-lang/perl:            5.30.1::gentoo

dev-lang/python:          2.7.17-r2::gentoo, 3.6.10-r1::gentoo, 3.7.7-r1::gentoo

dev-util/cmake:           3.16.5::gentoo

sys-apps/baselayout:      2.6-r1::gentoo

sys-apps/openrc:          0.42.1::gentoo

sys-apps/sandbox:         2.13::gentoo

sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo

sys-devel/automake:       1.11.6-r3::gentoo, 1.16.1-r1::gentoo

sys-devel/binutils:       2.33.1-r1::gentoo

sys-devel/gcc:            9.2.0-r2::gentoo

sys-devel/gcc-config:     2.2.1::gentoo

sys-devel/libtool:        2.4.6-r6::gentoo

sys-devel/make:           4.2.1-r4::gentoo

sys-kernel/linux-headers: 5.4::gentoo (virtual/os-headers)

sys-libs/glibc:           2.29-r7::gentoo

Repositories:

gentoo

    location: /usr/portage

    sync-type: rsync

    sync-uri: rsync://rsync.gentoo.org/gentoo-portage

    priority: -1000

    sync-rsync-verify-jobs: 1

    sync-rsync-verify-metamanifest: yes

    sync-rsync-verify-max-age: 24

    sync-rsync-extra-opts: 

x-portage

    location: /usr/local/portage

    masters: gentoo

    priority: 0

crossdev

    location: /usr/local/portage-crossdev

    masters: gentoo

    priority: 10

ACCEPT_KEYWORDS="amd64"

ACCEPT_LICENSE="*"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=znver1 -O2 -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.3/ext-active/ /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.3/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.3/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"

CXXFLAGS="-march=znver1 -O2 -pipe"

DISTDIR="/usr/portage/distfiles"

ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"

FCFLAGS="-march=znver1 -O2 -pipe"

FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch preserve-libs protect-owned qa-unresolved-soname-deps sandbox selinux sesandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"

FFLAGS="-march=znver1 -O2 -pipe"

GENTOO_MIRRORS="http://mirrors.evowise.com/gentoo/ https://mirrors.evowise.com/gentoo/ http://mirror.sjc02.svwh.net/gentoo/ http://gentoo.osuosl.org/ http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/"

LANG="en_US.utf8"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"

PORTAGE_TMPDIR="/var/tmp"

USE="X a52 aac acl acpi activities alsa amd64 bluetooth branding bzip2 cairo cdda cdr consolekit crypt cups dbus declarative dts dvd dvdr emboss encode exif flac gif gpm gtk hardened iconv icu ipv6 jpeg kde kipi kwallet lcms ldap libnotify libtirpc mad mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf phonon pie plasma png policykit ppds pulseaudio qml qt5 readline sdl seccomp selinux semantic-desktop spell split-usr ssl ssp startup-notification svg tiff truetype ubac udev udisks unconfined unicode upower usb vorbis widgets wxwidgets x264 xattr xcb xcomposite xml xtpax xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="radeon radeonsi r600" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

```

----------

## Jaglover

What is your active GCC version? As seen in emerge --info.

----------

## nasaiya

 *Jaglover wrote:*   

> What is your active GCC version? As seen in emerge --info.

 

Just added emerge --info output... 9.2.0

thanks

----------

## hdcg

Hi nasaiya,

do you have REGMAP_I2C enabled?

Best Regards,

Holger

----------

## nasaiya

 *hdcg wrote:*   

> Hi nasaiya,
> 
> do you have REGMAP_I2C enabled?
> 
> Best Regards,
> ...

 

No I do not... That option wasn't in the config file and I couldn't find it anywhere, so I tried adding it to the config file manually and still got the some error... 

```

# echo "CONFIG_REGMAP_I2C=y" >> .config                   

# make -j12 && make install && make modules_install

scripts/kconfig/conf  --syncconfig Kconfig

  DESCEND  objtool

  CALL    scripts/atomic/check-atomics.sh

  CALL    scripts/checksyscalls.sh

  CHK     include/generated/compile.h

  GZIP    kernel/config_data.gz

  CC      kernel/configs.o

  AR      kernel/built-in.a

  GEN     .version

  CHK     include/generated/compile.h

  UPD     include/generated/compile.h

  CC      init/version.o

  AR      init/built-in.a

  LD      vmlinux.o

  MODPOST vmlinux.o

  MODINFO modules.builtin.modinfo

  GEN     modules.builtin

  LD      .tmp_vmlinux1

  KSYM    .tmp_kallsyms1.o

  LD      .tmp_vmlinux2

  KSYM    .tmp_kallsyms2.o

  LD      vmlinux

  SORTTAB vmlinux

  SYSMAP  System.map

  MODPOST 110 modules

  CC      arch/x86/boot/version.o

  VOFFSET arch/x86/boot/compressed/../voffset.h

  OBJCOPY arch/x86/boot/compressed/vmlinux.bin

  GZIP    arch/x86/boot/compressed/vmlinux.bin.gz

  CC      arch/x86/boot/compressed/misc.o

ERROR: "__devm_regmap_init_i2c" [drivers/media/i2c/tvp5150.ko] undefined!

make[1]: *** [scripts/Makefile.modpost:93: __modpost] Error 1

make: *** [Makefile:1283: modules] Error 2

make: *** Waiting for unfinished jobs....

  MKPIGGY arch/x86/boot/compressed/piggy.S

  AS      arch/x86/boot/compressed/piggy.o

  LD      arch/x86/boot/compressed/vmlinux

ld: arch/x86/boot/compressed/head_64.o: warning: relocation in read-only section `.head.text'

ld: warning: creating a DT_TEXTREL in object

  ZOFFSET arch/x86/boot/zoffset.h

  OBJCOPY arch/x86/boot/vmlinux.bin

  AS      arch/x86/boot/header.o

  LD      arch/x86/boot/setup.elf

  OBJCOPY arch/x86/boot/setup.bin

  BUILD   arch/x86/boot/bzImage

Setup is 13948 bytes (padded to 14336 bytes).

System is 9401 kB

CRC 9e1ea72d

Kernel: arch/x86/boot/bzImage is ready  (#3)

```

That sure sounds like the possible culprit though... do you know where to find it and it's related options in the menu so I can enable them properly?

On a hunch, I tried disabling the "Device Drivers/Multimedia/Autoselect ancillary drivers (tuners, sensors, i2c, spi, frontends)" option and the build succeeded! Though I worry what may have been broken by de-selecting that option... I'll need to test my webcam etc... 

Thanks!

----------

## hdcg

Hi nasaiya,

to locate an option hit / while e.g. in "make menuconfig" selection.

On an arm64 box this yields: 

```
    Symbol: REGMAP_I2C [=m]                                                                                                                                 │   

  │ Type  : tristate                                                                                                                                        │   

  │   Defined at drivers/base/regmap/Kconfig:19                                                                                                             │   

  │   Depends on: I2C [=m]                                                                                                                                  │   

  │   Selected by [m]:                                                                                                                                      │   

  │   - PINCTRL_MCP23S08 [=m] && PINCTRL [=y] && (SPI_MASTER [=y] || I2C [=m]) && (I2C [=m] || I2C [=m]=n) && I2C [=m]                                      │   

  │   - SND_SOC [=m] && SOUND [=m] && !UML && SND [=m] && I2C [=m]                                                                                          │   

  │   Selected by [n]:

  │   ...
```

The option will only be visible if the "Depends on" term is true.

Best Regards,

Holger

----------

## Goverp

I think this is the same problem as a bug I opened a couple of weeks ago.  When I tested the fix, it appeared 5.6.2 was already fixed, but yesterday I found 5.6.3 was still broken.  I think I was wrong about 5.6.2; the same defect is in the drivers/power/supply/Kconfig file.  The same patch appears to be needed.

----------

## nasaiya

I thought this seemed like a bug of some sort... I've been on gentoo forever and have never had a kernel build fail before... everything appears to still be working after I found that "workaround" so I guess I'm satisfied for now.

Nice to know about that search feature in menuconfig!

Thanks for the help everyone!

----------

## figueroa

 *nasaiya wrote:*   

> I thought this seemed like a bug of some sort... I've been on gentoo forever and have never had a kernel build fail before... everything appears to still be working after I found that "workaround" so I guess I'm satisfied for now.
> 
> Nice to know about that search feature in menuconfig!
> 
> Thanks for the help everyone!

 

I'm having exactly the same problem as you building any 5.4 kernel moving up from 4.19.160. I don't understand the "work around" unless it is just to deselect  "Device Drivers/Multimedia/Autoselect ancillary drivers (tuners, sensors, i2c, spi, frontends)". Is that the long-term solution? It seems broken to me.

Nothing I've been able to do let's me add REGMAP_I2C. CONFIG_I2C=y comes up preselected and I can't change that to a module. Maybe if I understood the bug reports, but I don't.

My objective has been to get onto 5.4.~ and ride the long-term-support for a few years.

----------

## figueroa

I made some progress on this, only because I don't like being stuck. I'm working with gentoo-sources-5.4.80-gentoo-r1 which is the current stable version in the 5.4 series. The .config that I started with was 4.19.160 then make oldconfig and/or make olddefconfig (I tried both) and was still getting the same error at the modules_install stage.

1. I selected, randomly, one of the modules that was listed that would select CONFIG_REGMAP_I2C. I don't think there is any other way to activate it. The one I activated was CONFIG_EEPROM_AT24=m. There was strong evidence in the error message that CONFIG_REGMAP_I2C was needed.

2. Then I selected "Device Drivers/Multimedia/Autoselect ancillary drivers (tuners, sensors, i2c, spi, frontends)" which is CONFIG_I2C_HELPER_AUTO=y in the Device Drivers/Multimedia section.

3. Save, exit, and build with "make && make modules_install" which succeeded without error.

I can hardly wait till the next stable 5.4 version to see if I can move this .config forward.

----------

## Tony0945

If it's any help:

```
~ $ zgrep CONFIG_REGMAP_I2C /boot/config*

/boot/config-4.14.194-gentoo:CONFIG_REGMAP_I2C=y

/boot/config-4.17.19-gentoo:CONFIG_REGMAP_I2C=y

/boot/config-4.17.19-gentoo.old:CONFIG_REGMAP_I2C=y

/boot/config-4.19.141-gentoo:CONFIG_REGMAP_I2C=y

/boot/config-5.4.72-gentoo:CONFIG_REGMAP_I2C=m

/boot/config-5.4.72-gentoo.old:CONFIG_REGMAP_I2C=m

```

If I'm reading this link correctly,https://www.kernelconfig.io/config_regmap_i2c It'd done automatically by selecting CONFIG_I2C

And THAT is also autoselected:

```
Type  : tristate                                                                                                                                                     │  

  │ Prompt: I2C support                                                                                                                                                  │  

  │   Location:                                                                                                                                                          │  

  │     -> Device Drivers                                                                                                                                                │  

  │ (1)   -> I2C support                                                                                                                                                 │  

  │   Defined at drivers/i2c/Kconfig:8                                                                                                                                   │  

  │   Selects: RT_MUTEXES [=y] && IRQ_DOMAIN [=y]                                                                                                                        │  

  │   Selected by [y]:                                                                                                                                                   │  

  │   - DRM [=y] && HAS_IOMEM [=y] && (AGP [=n] || AGP [=n]=n) && !EMULATED_CMPXCHG && HAS_DMA [=y]                                                                      │  

  │   Selected by [n]:                                                                                                                                                   │  

  │   - X86_INTEL_MID [=n] && X86_EXTENDED_PLATFORM [=n] && X86_PLATFORM_DEVICES [=y] && PCI [=y] && (X86_64 [=y] || PCI_GOANY [=n] && X86_32 [=n]) && X86_IO_APIC [=y]  │  

  │   - CAN_PEAK_PCIEC [=n] && NET [=y] && CAN [=n] && CAN_DEV [=n] && CAN_SJA1000 [=n] && CAN_PEAK_PCI [=n]                                                             │  

  │   - I3C [=n]                                                                                                                                                         │  

  │   - IGB [=n] && NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_INTEL [=n] && PCI [=y]                                                                                │  

  │   - SFC [=n] && NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_SOLARFLARE [=n] && PCI [=y]                                                                           │  

  │   - SFC_FALCON [=n] && NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_SOLARFLARE [=n] && PCI [=y]                                                                    │  

  │   - IPMI_SSIF [=n] && IPMI_HANDLER [=n]                                                                                                                              │  

  │   - MEDIA_SUBDRV_AUTOSELECT [=n] && MEDIA_SUPPORT [=y] && (MEDIA_ANALOG_TV_SUPPORT [=y] || MEDIA_DIGITAL_TV_SUPPORT [=y] || MEDIA_CAMERA_SUPPORT [=y] || MEDIA_SDR_S │  

  │   - FB_DDC [=n] && HAS_IOMEM [=y] && FB [=y]                                                                                                                         │  

  │   - SND_AOA_ONYX [=n] && SOUND [=y] && !UML && SND [=y] && SND_AOA [=n]                                                                                              │  

  │   - SND_AOA_TAS [=n] && SOUND [=y] && !UML && SND [=y] && SND_AOA [=n]                                                                                               │  

  │   - ARCH_R8A7790 [=n] && SOC_RENESAS [=n] && ARM && ARCH_RENESAS                                                                                                     │  

  │   - ARCH_R8A7791 [=n] && SOC_RENESAS [=n] && ARM && ARCH_RENESAS                                                                                                     │  

  │   - ARCH_R8A7793 [=n] && SOC_RENESAS [=n] && ARM && ARCH_RENESAS                                                                                                     │  

  │   - PHY_EXYNOS5250_SATA [=n] && SOC_EXYNOS5250 && HAS_IOMEM [=y] && OF [=n]
```

----------

## figueroa

 *Tony0945 wrote:*   

> If it's any help:
> 
> ```
> ~ $ zgrep CONFIG_REGMAP_I2C /boot/config*
> 
> ...

 

Thanks for  jumping in Tony0945.

I think the operative concept is that it should be and USED TO BE automatically selected by selecting CONFIG_I2C, but definitely NOT in 5.4.72 and 5.4.80-r1. I had to force it to be selected by selecting one of the modules that automatically select it. I don't need EPROM_AT24, so selecting it is definitely a work-around.

```
Symbol: REGMAP_I2C [=m]                                                 │  

  │ Type  : tristate                                                        │  

  │   Defined at drivers/base/regmap/Kconfig:19                             │  

  │   Depends on: I2C [=y]                                                  │  

  │   Selected by [m]:                                                      │  

  │   - EEPROM_AT24 [=m] && I2C [=y] && SYSFS [=y]                          │  

  │   Selected by [n]:                                                      │  

  │   - NET_DSA_MICROCHIP_KSZ9477_I2C [=n] && NETDEVICES [=y] && HAVE_NET_D │  

  │   - NET_DSA_SMSC_LAN9303_I2C [=n] && NETDEVICES [=y] && HAVE_NET_DSA [= │  

  │   - KEYBOARD_QT1050 [=n] && !UML && INPUT [=y] && INPUT_KEYBOARD [=y] & │  

  │   - KEYBOARD_CAP11XX [=n] && !UML && INPUT [=y] && INPUT_KEYBOARD [=y]  │  

  │   - TOUCHSCREEN_AD7879_I2C [=n] && !UML && INPUT [=y] && INPUT_TOUCHSCR │  

  │   - TOUCHSCREEN_TSC2004 [=n] && !UML && INPUT [=y] && INPUT_TOUCHSCREEN │  

  │   - INPUT_DRV260X_HAPTICS [=n] && !UML && INPUT_MISC [=y] && INPUT [=y] │  

  │   - INPUT_DRV2665_HAPTICS [=n] && !UML && INPUT_MISC [=y] && INPUT [=y] │  

  │   - INPUT_DRV2667_HAPTICS [=n] && !UML && INPUT_MISC [=y] && INPUT [=y]

─(  5%)─
```

 ... and so on. 

I'm running the resulting kernel now and it seems entirely satisfactory, but I don't like work-arounds.

----------

## GDH-gentoo

 *figueroa wrote:*   

> I'm having exactly the same problem as you building any 5.4 kernel moving up from 4.19.160.

 

So, which module is demanding __devm_regmap_init_i2c() in your case? tvp5150 as in the OP?

----------

## figueroa

 *GDH-gentoo wrote:*   

>  *figueroa wrote:*   I'm having exactly the same problem as you building any 5.4 kernel moving up from 4.19.160. 
> 
> So, which module is demanding __devm_regmap_init_i2c() in your case? tvp5150 as in the OP?

 

Yes, exactly the same as the OP.

----------

## Tony0945

andy, If I figure it right I got it by selecting DRM, I don't have the AT24.

Here's the complete config: https://dpaste.com/DF9BRD9PQ

It loads both radeon and nouveau modulues as well as r8196 so it5 might do as a start to get something going.

I did have v80 but blacklisted it because wired things were happening like losing the mouse and rebooting outr of the blue. the latter was only on old hardware.

EDIT: weird, not wiredLast edited by Tony0945 on Fri Dec 25, 2020 2:08 am; edited 1 time in total

----------

## GDH-gentoo

 *figueroa wrote:*   

> I'm running the resulting kernel now and it seems entirely satisfactory, but I don't like work-arounds.

 

I tried adding a line to drivers/media/i2c/Kconfig:

```
 config VIDEO_TVP5150

         tristate "Texas Instruments TVP5150 video decoder"

         depends on VIDEO_V4L2 && I2C

         select V4L2_FWNODE

+        select REGMAP_I2C

         help

           Support for the Texas Instruments TVP5150 video decoder.

 

           To compile this driver as a module, choose M here: the

           module will be called tvp5150.
```

like the configurations for other modules that call devm_regmap_init_i2c() have (such as adv748x - CONFIG_VIDEO_ADV748X), and it seemed to build fine. I did not boot the resulting kernel, but both regmap-i2c.ko and tvp5150.ko are in /lib/modules, and modules.dep says:

```
kernel/drivers/media/i2c/tvp5150.ko: kernel/drivers/base/regmap/regmap-i2c.ko
```

which looks correct as well.

Recent kernels already have this line added as well:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/media/i2c/Kconfig?id=6de18fa3bd1dd5114106abf6217587d6f6cb051d

5.9.x kernels have this change, but it hasn't been backported to the 5.4.x series yet.

----------

## figueroa

Thank you Tony0945 and GDH-gentoo. I'll look forward to the "fix" being backported into the 5.4 series.

It seems to hang together like a wood frame house; a little wobbly until all the pieces have been finished. I have a lean and mature .config that has been developing for years, and I use a stand-alone kernel without initrd. From time-to-time I tweak a security-related setting or something required or suggested by an installed application or library or a new piece of hardware (rare).

DRM was already selected going into this. I did NOT select or specifically need CONFIG_VIDEO_TVP5150. That was auto selected by CONFIG_MEDIA_SUBDRV_AUTOSELECT. Unfortunately, that didn't auto select REGMAP_I2C which was the apparent source of the error. Since I couldn't manually select REGMAP_I2C, I did the next best thing which was to select a different module manually (EPROM_AT24) to get REGMAP_I2C selected. It seems to be a decent work-around; kernel didn't get any bigger.

Here is my .config and I would gratefully accept suggestions. https://dpaste.com/E2Y25G4KQ

I'd been on the 4.9 series of kernel for years and only recently moved up to 4.19 a month or so ago which I intended to be a stepping stone to 5.4 where I intend to ride the LTS wave for a long while. I don't like being on the bleeding edge, but I also don't want to be left too far behind. I didn't expect trouble. I don't think I've ever had a kernel compile fail before -- actually, the kernel compiled fine, but failed at the modules -- hadn't had that happen either.

Yesterday I tried the gentoo-kernel to see if I could learn anything. I didn't. Mainly, I learned that it worked but I didn't like it. Just going with the default install, I think everything worked, but it was a like a big step backwards; and it took forever (almost an hour).

----------

## Tony0945

Andy, did you remember to run make clean and make oldconfig?

See my build script post 8549895  And I'd appreciate comments/improvements, especially how to autodetect multi-thread cores.

Here is my config-4.19.141-gentoo from my Ryzen machine. Compare it to yours, then use it as a start, editting appropriately in menuconfig. Try my script. I'd appreciate feedback.

----------

## GDH-gentoo

The code in module tvp5150 calls a function that is implemented in module regmap-i2c, so failure of CONFIG_VIDEO_TVP5150 to select CONFIG_REGMAP_I2C is a bug in the kernel's build system, and the fix is contained in the commit I linked to. It should be eventually backported to the 5.4.x series while it is a LTS one, because it is a bug fix.

 *figueroa wrote:*   

> I did NOT select or specifically need CONFIG_VIDEO_TVP5150. That was auto selected by CONFIG_MEDIA_SUBDRV_AUTOSELECT. [...]
> 
> Here is my .config and I would gratefully accept suggestions. https://dpaste.com/E2Y25G4KQ

 

With CONFIG_MEDIA_SUBDRV_AUTOSELECT enabled, the configuration that forces the building of tvp5150 is:

```
CONFIG_MEDIA_SUPPORT=m

#

# Multimedia core support

#

CONFIG_MEDIA_CAMERA_SUPPORT=y

...

#

# Media drivers

#

CONFIG_MEDIA_USB_SUPPORT=y

...

#

# Webcam, TV (analog/digital) USB devices

#

CONFIG_VIDEO_EM28XX=m

CONFIG_VIDEO_EM28XX_V4L2=m
```

which translates to:

```
Device drivers  --->

    <M> Multimedia support  --->

    [*]   Cameras/video grabbers support

    [*]   Media USB Adapters  --->

      <M>   Empia EM28xx USB devices support

      <M>     Empia EM28xx analog TV, video capture and/or webcam support
```

So, do you actually have Empia EM28xx USB devices? If you are using udev, lsmod should tell (modules em28xx and em28xx-v4l, I think)

----------

## figueroa

 *Tony0945 wrote:*   

> Andy, did you remember to run make clean and make oldconfig?
> 
> See my build script post 8549895  And I'd appreciate comments/improvements, especially how to autodetect multi-thread cores.
> 
> Here is my config-4.19.141-gentoo from my Ryzen machine. Compare it to yours, then use it as a start, editting appropriately in menuconfig. Try my script. I'd appreciate feedback.

 

Oh, yes, make clean, make distclean, followed by make oldconfig, several times, each time starting with my 4.19.160 config, which had been nicely bug-free to the extent that I could tell.

I'm happy with my 5.4.80-r1 now. The little work-around to get the modules built wasn't too extreme. Thanks for your script and .config. I'll study those over time and get back with you. I'm sure I'll learn a lot from them -- but not today.   :Smile: 

----------

## figueroa

 *GDH-gentoo wrote:*   

>  ...
> 
> So, do you actually have Empia EM28xx USB devices? If you are using udev, lsmod should tell (modules em28xx and em28xx-v4l, I think)

 

I'm pretty sure I don't own an EM28xx device. It's just one of the modules that gets built in order to have a reasonably full-service multimedia box that I could plug most A/V V4L things into. But, most of the hardware I have is built-in to the kernel.

The only modules that actually get activated, most of them automatically detected, are:

```
$ lsmod

Module                  Size  Used by

uas                    28672  0

rt2800pci              16384  0

eeprom_93cx6           16384  1 rt2800pci

rt2x00pci              16384  1 rt2800pci

rt2800mmio             16384  1 rt2800pci

rt2x00mmio             16384  2 rt2800mmio,rt2800pci

rt2800lib             122880  2 rt2800mmio,rt2800pci

crc_ccitt              16384  1 rt2800lib

rt2x00lib              53248  5 rt2x00mmio,rt2x00pci,rt2800mmio,rt2800pci,rt2800lib

mac80211              700416  3 rt2x00pci,rt2x00lib,rt2800lib

cfg80211              651264  2 rt2x00lib,mac80211

firewire_ohci          45056  0

firewire_core          69632  1 firewire_ohci

r8169                  86016  0

x86_pkg_temp_thermal    20480  0

vboxnetadp             28672  0

vboxnetflt             32768  0

vboxdrv               417792  2 vboxnetadp,vboxnetflt

f71882fg               40960  0

coretemp               16384  0
```

Thanks for the explanations. Most of the kernel is a mystery to me.

----------

## GDH-gentoo

 *figueroa wrote:*   

> I'm pretty sure I don't own an EM28xx device.

 

Then, another possibility you have is deselecting CONFIG_VIDEO_EM28XX. This should also disable the building of module tvp5150, and therefore avoid triggering the build bug.

----------

## Tony0945

 *figueroa wrote:*   

> I'll study those over time and get back with you. I'm sure I'll learn a lot from them -- but not today.  

 

No, not today! Have a happy holiday!  I spent most of yesterday trying to get my internet back. I'm pretty sure the three month old router gave up the ghost, or returned to default settings. Everything  was eventually solved.

----------

## figueroa

 *GDH-gentoo wrote:*   

>  *figueroa wrote:*   I'm pretty sure I don't own an EM28xx device. 
> 
> Then, another possibility you have is deselecting CONFIG_VIDEO_EM28XX. This should also disable the building of module tvp5150, and therefore avoid triggering the build bug.

 

I went through the exercise with "make menuconfig" and I can see that this will work as it unselects tvp5150. I didn't save the configuration. I don't see any reason to actually build it since I seem to already have a stable working solution.

----------

