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

Firmware boot failure after unloading and reloading driver #124

Closed
ZhendanYang opened this issue Sep 11, 2018 · 8 comments
Closed

Firmware boot failure after unloading and reloading driver #124

ZhendanYang opened this issue Sep 11, 2018 · 8 comments
Assignees
Labels
bug Something isn't working BYT Applies to Baytrail platform P2 Critical bugs or normal features

Comments

@ZhendanYang
Copy link

Summary:
run the "soft/kmod_scripts/sof_bootone.sh" script, that means do the module reload one time, but boot failed on APL, BYT and CNL.

Environment:
kernel: sof-dev 64cf3e3

Log on APL:
boot_fail.log

@ZhendanYang ZhendanYang added bug Something isn't working P1 Blocker bugs or important features labels Sep 11, 2018
@ZhendanYang ZhendanYang changed the title Firmware unload and reload failed on APL, BYT and CNL Firmware boot failure after unloading and reloading driver Sep 12, 2018
@ZhendanYang ZhendanYang added BYT Applies to Baytrail platform APL Applies to ApolloLake platform CNL Applies to Cannonlake labels Sep 12, 2018
@mengdonglin
Copy link
Collaborator

mengdonglin commented Sep 13, 2018

@lyakh could you help to check this issue?

@mengdonglin mengdonglin assigned lyakh and unassigned bardliao Sep 13, 2018
@ZhendanYang ZhendanYang removed APL Applies to ApolloLake platform CNL Applies to Cannonlake labels Sep 18, 2018
@lyakh
Copy link
Collaborator

lyakh commented Sep 20, 2018

@ZhendanYang could you please point out where in the attached log the failure is seeing? Also, on which specific platforms / test boards and with which topology configurations has it been possible to reproduce this?

@lgirdwood
Copy link
Member

lgirdwood commented Sep 20, 2018

@lyakh Looks like an earlier PM failure is breaking things.

[  264.573413] sof-audio sof-audio: tplg: complete pipeline PIPELINE.1.SSP0.OUT id 5
[  264.573422] sof-audio sof-audio: ipc tx: 0x30130000
[  264.573471] sof-audio sof-audio: ipc tx succeeded: 0x30130000
[  264.573494] sof-audio sof-audio: error: failed to enter PM idle -11
[  264.573571] sof-nocodec sof-nocodec: snd-soc-dummy-dai <-> SSP0 Pin mapping ok
[  264.573588] sof-nocodec sof-nocodec: snd-soc-dummy-dai <-> SSP1 Pin mapping ok

@mengdonglin
Copy link
Collaborator

@lyakh I think the firmware cannot support PM on byt. PM should only be enabled on APL and GLK. Could you try to disable PM on BYT?

@ranj063 Is runtime PM on BYT disabled by default? Or need manually disabling?

@ZhendanYang Which firmware branch are you testing with? Could you share the latest result for both sof master and 1.2-stable branch?

@lgirdwood
Copy link
Member

@mengdonglin yes - S0ix should be disabled on BYT Minnowboard, there should be a runtime flag set in platform data whether to enable or disable S0ix. @lyakh checking DMI name in sof-acpi-dev.c and then setting a flag to disable runtime_pm should be enough here.

@ZhendanYang
Copy link
Author

This issue still exists.
Test env:
kernel: sof-dev 160b45f
sof tool: 57b5212
sof stable-1.2 : 7dd4b1d
boot_fail.log

@mengdonglin mengdonglin added P2 Critical bugs or normal features and removed P1 Blocker bugs or important features labels Oct 10, 2018
@mengdonglin
Copy link
Collaborator

@stevyan @markyang Could you help to check if this issue is gone with fixing of #144 by #311?

@markyang
Copy link

Summary:
This issue cannot be reproduced on BYT with ALC5651 using the build on Dec 7.
There is no Kernel Panic, both arecord and aplay worked fine.

Test steps:
kmod_scripts/sof_bootone.sh
arecord -Dhw:0,0 -c2 -fS16_LE -vv -i ~/mytest.wav #OK
aplay -Dhw:0,0 -c2 -fS16_LE -vv -i ~/mytest.wav #OK

Test env:
sof master: b5d6c71 #Dec 7
kernel sof-dev: a71221d #Dec 7
tplg: test-ssp2-mclk-0-I2S-volume-s16le-s16le-48k-19200k-codec.tplg

naveen-manohar pushed a commit to naveen-manohar/linux that referenced this issue May 23, 2019
[ Upstream commit 25384ce ]

This fixes the following warning at boot when the kernel is booted on a
board with more CPU cores than was configured in NR_CPUS:

  smp_init_cpus: Core Count = 8
  smp_init_cpus: Core Id = 0
  ------------[ cut here ]------------
  WARNING: CPU: 0 PID: 0 at include/linux/cpumask.h:121 smp_init_cpus+0x54/0x74
  Modules linked in:
  CPU: 0 PID: 0 Comm: swapper Not tainted 5.0.0-rc3-00015-g1459333f88a0 thesofproject#124
  Call Trace:
    __warn$part$3+0x6a/0x7c
    warn_slowpath_null+0x35/0x3c
    smp_init_cpus+0x54/0x74
    setup_arch+0x1c0/0x1d0
    start_kernel+0x44/0x310
    _startup+0x107/0x107

Signed-off-by: Max Filippov <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
aiChaoSONG pushed a commit to aiChaoSONG/linux that referenced this issue May 6, 2021
Handle possible allocation failure in `user_ptr`.
vijendarmukunda pushed a commit to vijendarmukunda/linux that referenced this issue Feb 13, 2024
Like commit 1cf3bfc ("bpf: Support 64-bit pointers to kfuncs")
for s390x, add support for 64-bit pointers to kfuncs for LoongArch.
Since the infrastructure is already implemented in BPF core, the only
thing need to be done is to override bpf_jit_supports_far_kfunc_call().

Before this change, several test_verifier tests failed:

  # ./test_verifier | grep # | grep FAIL
  thesofproject#119/p calls: invalid kfunc call: ptr_to_mem to struct with non-scalar FAIL
  thesofproject#120/p calls: invalid kfunc call: ptr_to_mem to struct with nesting depth > 4 FAIL
  thesofproject#121/p calls: invalid kfunc call: ptr_to_mem to struct with FAM FAIL
  thesofproject#122/p calls: invalid kfunc call: reg->type != PTR_TO_CTX FAIL
  thesofproject#123/p calls: invalid kfunc call: void * not allowed in func proto without mem size arg FAIL
  thesofproject#124/p calls: trigger reg2btf_ids[reg->type] for reg->type > __BPF_REG_TYPE_MAX FAIL
  thesofproject#125/p calls: invalid kfunc call: reg->off must be zero when passed to release kfunc FAIL
  thesofproject#126/p calls: invalid kfunc call: don't match first member type when passed to release kfunc FAIL
  thesofproject#127/p calls: invalid kfunc call: PTR_TO_BTF_ID with negative offset FAIL
  thesofproject#128/p calls: invalid kfunc call: PTR_TO_BTF_ID with variable offset FAIL
  thesofproject#129/p calls: invalid kfunc call: referenced arg needs refcounted PTR_TO_BTF_ID FAIL
  thesofproject#130/p calls: valid kfunc call: referenced arg needs refcounted PTR_TO_BTF_ID FAIL
  thesofproject#486/p map_kptr: ref: reference state created and released on xchg FAIL

This is because the kfuncs in the loaded module are far away from
__bpf_call_base:

  ffff800002009440 t bpf_kfunc_call_test_fail1    [bpf_testmod]
  9000000002e128d8 T __bpf_call_base

The offset relative to __bpf_call_base does NOT fit in s32, which breaks
the assumption in BPF core. Enable bpf_jit_supports_far_kfunc_call() lifts
this limit.

Note that to reproduce the above result, tools/testing/selftests/bpf/config
should be applied, and run the test with JIT enabled, unpriv BPF enabled.

With this change, the test_verifier tests now all passed:

  # ./test_verifier
  ...
  Summary: 777 PASSED, 0 SKIPPED, 0 FAILED

Tested-by: Tiezhu Yang <[email protected]>
Signed-off-by: Hengqi Chen <[email protected]>
Signed-off-by: Huacai Chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working BYT Applies to Baytrail platform P2 Critical bugs or normal features
Projects
None yet
Development

No branches or pull requests

6 participants