Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wifi/bt/gps modules not listed in MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS #1

Open
koenkooi opened this issue Oct 17, 2015 · 8 comments
Open

Comments

@koenkooi
Copy link
Contributor

I'm assuming they are enabled in the kernel build. The EULA has been accepted:

root@dragonboard-410c:~# opkg list_installed | grep dragon
firmware-qcom-dragonboard410c - 1.1.0-r0.0

And:

root@dragonboard-410c:~# opkg list_installed | grep kernel
kernel - 4.2-r0.1
kernel-4.2.0+yocto - 4.2-r0.1
kernel-image-4.2.0+yocto - 4.2-r0.1
kernel-module-configfs - 4.2-r0.1
kernel-module-g-ether - 4.2-r0.1
kernel-module-g-mass-storage - 4.2-r0.1
kernel-module-g-serial - 4.2-r0.1
kernel-module-libcomposite - 4.2-r0.1
kernel-module-u-ether - 4.2-r0.1
kernel-module-usb-f-mass-storage - 4.2-r0.1
kernel-module-usb-f-rndis - 4.2-r0.1
root@dragonboard-410c:~# 
@koenkooi koenkooi mentioned this issue Oct 17, 2015
lugu added a commit to lugu/meta-qcom that referenced this issue Mar 8, 2019
This change fix a boot issue:

    [    0.849690] Initramfs unpacking failed: junk in compressed archive
    [    0.913369] ufs_qcom_phy_qmp_14nm 627000.phy: invalid resource
    [    0.916028] qcom-pcie 600000.pcie: Failed to get supply 'vddpe-3v3': -517
    [    1.924849] qcom-pcie 608000.pcie: Phy link never came up
    [    1.926456] qcom-pcie 608000.pcie: cannot initialize host
    [    2.173672] ufshcd-qcom 624000.ufshc: ufshcd_print_pwr_info:[RX, TX]: gear=[1, 1], lane[1, 1], pwr[SLOWAUTO_MODE, SLOWAUTO_MODE], rate = 0
    [    2.235323] dwc3 7600000.dwc3: Failed to get clk 'ref': -2
    [    2.237718] dwc3 6a00000.dwc3: Failed to get clk 'ref': -2
    [    2.242360] i2c_qup 75b5000.i2c:
    [    2.242360]  tx channel not available
    [    2.246507] i2c_qup 75b6000.i2c:
    [    2.246507]  tx channel not available
    [    2.253187] i2c_qup 7577000.i2c:
    [    2.253187]  tx channel not available
    [    2.416921] ufshcd-qcom 624000.ufshc: ufshcd_print_pwr_info:[RX, TX]: gear=[3, 3], lane[1, 1], pwr[FAST MODE, FAST MODE], rate = 2
    [    2.530560] dwc3 7600000.dwc3: Failed to get clk 'ref': -2
    [    2.538541] dwc3 6a00000.dwc3: Failed to get clk 'ref': -2
    [    2.574903] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(259,2)
    [    2.574928] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.0.0-rc1 qualcomm-linux#1
    [    2.582393] Hardware name: Qualcomm Technologies, Inc. DB820c (DT)
    [    2.588382] Call trace:
    [    2.594552]  dump_backtrace+0x0/0x178
    [    2.596888]  show_stack+0x14/0x20
    [    2.600710]  dump_stack+0x84/0xa4
    [    2.604007]  panic+0x13c/0x2ec
    [    2.607306]  mount_block_root+0x1a0/0x284
    [    2.610254]  mount_root+0x140/0x174
    [    2.614335]  prepare_namespace+0x138/0x180
    [    2.617634]  kernel_init_freeable+0x220/0x240
    [    2.621804]  kernel_init+0x10/0x108
    [    2.626229]  ret_from_fork+0x10/0x18
    [    2.629539] SMP: stopping secondary CPUs
    [    2.633465] Kernel Offset: disabled
    [    2.637253] CPU features: 0x002,20802008
    [    2.640463] Memory Limit: none
    [    2.644645] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(259,2) ]---

This problem was introduced by this change on Linux:

    commit ff1522bb7d98450c72aea729f0b4147bc9986aed
    Author: David Engraf <[email protected]>
    Date:   Thu Jan 3 15:28:31 2019 -0800

	initramfs: cleanup incomplete rootfs

	Unpacking an external initrd may fail e.g.  not enough memory.  This
	leads to an incomplete rootfs because some files might be extracted
	already.  Fixed by cleaning the rootfs so the kernel is not using an
	incomplete rootfs.

	Link: http://lkml.kernel.org/r/[email protected]
	Signed-off-by: David Engraf <[email protected]>
	Cc: Dominik Brodowski <[email protected]>
	Cc: Greg Kroah-Hartman <[email protected]>
	Cc: Philippe Ombredanne <[email protected]>
	Cc: Arnd Bergmann <[email protected]>
	Cc: Luc Van Oostenryck <[email protected]>
	Signed-off-by: Andrew Morton <[email protected]>
	Signed-off-by: Linus Torvalds <[email protected]>
alimon pushed a commit to alimon/meta-qcom that referenced this issue Jul 29, 2021
Fixes,

...
(gdb) bt
 #0  0x0000000000402268 in rmtfs_iovec (pkt=0xffffde2d4dc8, sock=7) at rmtfs.c:230
 qualcomm-linux#1  handle_rmtfs (sock=sock@entry=7) at rmtfs.c:399
 qualcomm-linux#2  0x00000000004017ec in run_rmtfs (rprocfd=3) at rmtfs.c:477
 qualcomm-linux#3  main (argc=<optimized out>, argv=<optimized out>) at rmtfs.c:563
...

Signed-off-by: Aníbal Limón <[email protected]>
alimon pushed a commit to alimon/meta-qcom that referenced this issue Jul 29, 2021
Fixes,

...
(gdb) bt
 #0  0x0000000000402268 in rmtfs_iovec (pkt=0xffffde2d4dc8, sock=7) at rmtfs.c:230
 qualcomm-linux#1  handle_rmtfs (sock=sock@entry=7) at rmtfs.c:399
 qualcomm-linux#2  0x00000000004017ec in run_rmtfs (rprocfd=3) at rmtfs.c:477
 qualcomm-linux#3  main (argc=<optimized out>, argv=<optimized out>) at rmtfs.c:563
...

Signed-off-by: Aníbal Limón <[email protected]>
@koenkooi
Copy link
Contributor Author

Same issue for display and GPU modules

@lumag
Copy link
Collaborator

lumag commented Feb 13, 2025

I'd say that depends on the list of modules that are considered essential. I think it might be a good idea to use packagegroups and then to make packagegroups be selected via this variable. This way we can push decisions to that packagegroup (think about kgsl&sde vs msm.ko, vidc vs iris / venus, etc).

@koenkooi
Copy link
Contributor Author

After install all modules and launching weston, this is what I have running on rb3gen2:

root@qcs6490-rb3gen2-core-kit:~# cat /proc/modules | awk '{print " | " $1 " | " $4 " | " }'

Module Dependencies
bluetooth -
ecdh_generic bluetooth,
ecc ecdh_generic,
snd_soc_hdmi_codec -
rpmsg_ctrl -
fastrpc -
qrtr_smd -
rpmsg_char rpmsg_ctrl,
venus_dec -
venus_enc -
videobuf2_dma_contig venus_dec,venus_enc,
videobuf2_memops videobuf2_dma_contig,
phy_qcom_edp -
qcom_pd_mapper -
nb7vpq904m -
lontium_lt9611uxc -
pmic_glink_altmode -
ucsi_glink -
qcom_battmgr -
aux_hpd_bridge pmic_glink_altmode,
typec_ucsi ucsi_glink,
venus_core venus_dec,venus_enc,
msm -
v4l2_mem2mem venus_dec,venus_enc,venus_core,
videobuf2_v4l2 venus_dec,venus_enc,v4l2_mem2mem,
ocmem msm,
drm_exec msm,
videodev venus_dec,venus_enc,venus_core,v4l2_mem2mem,videobuf2_v4l2,
qcom_spmi_adc5 -
gpu_sched msm,
videobuf2_common venus_dec,venus_enc,videobuf2_dma_contig,videobuf2_memops,venus_core,v4l2_mem2mem,videobuf2_v4l2,
qcom_q6v5_pas -
qcom_spmi_temp_alarm -
qcom_vadc_common qcom_spmi_adc5,
qcom_pil_info qcom_q6v5_pas,
nvmem_qcom_spmi_sdam -
qcom_pon -
rtc_pm8xxx -
drm_dp_aux_bus msm,
drm_display_helper msm,
qcom_stats -
qcom_q6v5 qcom_q6v5_pas,
camcc_sc7280 -
mc v4l2_mem2mem,videobuf2_v4l2,videodev,videobuf2_common,
videocc_sc7280 -
crct10dif_ce -
drm_client_lib msm,
coresight_stm -
qcom_sysmon qcom_q6v5_pas,qcom_q6v5,
phy_qcom_qmp_combo -
dispcc_sc7280 -
i2c_qcom_geni -
phy_qcom_snps_femto_v2 -
stm_core coresight_stm,
llcc_qcom msm,
coresight_tmc -
coresight_replicator -
coresight_funnel -
aux_bridge nb7vpq904m,phy_qcom_qmp_combo,
pinctrl_sc7280_lpass_lpi -
qcom_common qcom_q6v5_pas,
typec nb7vpq904m,pmic_glink_altmode,ucsi_glink,typec_ucsi,phy_qcom_qmp_combo,
ath11k_ahb -
qcom_glink_smem qcom_common,
gpi [permanent],
qrtr qrtr_smd,
icc_bwmon -
coresight coresight_stm,coresight_tmc,coresight_replicator,coresight_funnel,
lpassaudiocc_sc7280 -
gpucc_sc7280 -
pinctrl_lpass_lpi pinctrl_sc7280_lpass_lpi,
mdt_loader venus_core,msm,qcom_q6v5_pas,
ath11k ath11k_ahb,
qcrypto -
authenc qcrypto,
pmic_glink pmic_glink_altmode,ucsi_glink,qcom_battmgr,
libdes qcrypto,
mac80211 ath11k,
pdr_interface pmic_glink,
libarc4 mac80211,
qcom_pdr_msg qcom_pd_mapper,pdr_interface,
qcom_rng -
icc_osm_l3 -
socinfo -
qmi_helpers qcom_pd_mapper,qcom_sysmon,ath11k,pdr_interface,qcom_pdr_msg,
nvmem_reboot_mode -
display_connector -
drm_kms_helper msm,drm_display_helper,drm_client_lib,aux_bridge,display_connector,
cfg80211 ath11k,mac80211,
rfkill bluetooth,cfg80211,
fuse -
drm lontium_lt9611uxc,aux_hpd_bridge,msm,drm_exec,gpu_sched,drm_display_helper,drm_client_lib,aux_bridge,display_connector,drm_kms_helper,
backlight drm_display_helper,drm,
nfnetlink -
ipv6 [permanent],

@koenkooi
Copy link
Contributor Author

koenkooi commented Feb 13, 2025

I'd say that depends on the list of modules that are considered essential. I think it might be a good idea to use packagegroups and then to make packagegroups be selected via this variable. This way we can push decisions to that packagegroup (think about kgsl&sde vs msm.ko, vidc vs iris / venus, etc).

In oe-core we already have MACHINE_ESSENTIAL_RDEPENDS, MACHINE_ESSENTIAL_RRECOMMENDS and MACHINE_EXTRA_RECOMMENDS to denote the degree of importance. Adding packagegroups in a BSP is a degree of abstraction too much, but is not mutually exclusive with what I'm proposing:

My current idea is to have something like this in each machine:

QCOM_VIDEO_MODULES = "venus-core"
QCOM_DRM_MODULES = "msm"
QCOM_MISC_HW = "pci-bridge-driver"

And in the shared .inc something like this:

MACHINE_ESSENTIAL_RDEPENDS = "${QCOM_MISC_HW}"
MACHINE_ESSENTIAL_RRECOMMENDS = "${QCOM_DRM_MODULES }"
MACHINE_EXTRA_RECOMMENDS = "${QCOM_VIDEO_MODULES}"

That would make anything (re)using bits from core-image- work a lot better out of the box.

@lumag
Copy link
Collaborator

lumag commented Feb 13, 2025

With this approach we are encoding BSP details directly into machine config. How would you select between kgsl and msm drivers for the GPU? Or between venus and vidc(?) drivers for video encoders? Having that in packagegroups haves the same problem, but in a more traditional way: how to select dependent packages basing on 10 external conditions. And then those packagegroups can be added to MACHINE_ESSENTIAL/EXTRA_RDEPENDS/RRECOMMENDS.

@ricardosalveti
Copy link
Contributor

At least for rb3gen2 the missing modules can all be listed via MACHINE_EXTRA_RECOMMENDS (following same behavior from other BSPs), as what is essential to boot is already part of the kernel.

Using package groups for modules is really not that common (in BSP layers), but can be done if we decide to facilitate not including certain modules as part of the build. Personally I would prefer us having the upstream modules in a common qcom MACHINE_EXTRA_RECOMMENDS definition and have a custom package-group / recipe for the downstream components, with the required denylist changes and so on, otherwise we might have to maintain a large set of possible options and combinations.

This would make the basic BSP experience from upstream be mostly functional and complete as the default behavior.

@ricardosalveti
Copy link
Contributor

Quite often people just install kernel-modules directly (which is the default in most BSP layers), so having the downstream logic separated, with the required configuration to disable the upstream modules and so on, would probably work better.

@lumag
Copy link
Collaborator

lumag commented Feb 17, 2025

The split between upstream/downstream modules sounds perfect to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants