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

[BUG] Various IPC timed out with multi-core run simultaneously #8642

Closed
keqiaozhang opened this issue Dec 18, 2023 · 12 comments
Closed

[BUG] Various IPC timed out with multi-core run simultaneously #8642

keqiaozhang opened this issue Dec 18, 2023 · 12 comments
Assignees
Labels
bug Something isn't working as expected I2S Applies to I2S bus for codec connection IPC timeout IPC timeout observed MTL Applies to Meteor Lake platform multi-stream multicore Issues observed when not only core#0 is used. P1 Blocker bugs or important features

Comments

@keqiaozhang
Copy link
Collaborator

Describe the bug
Observed this issue on both main branch and mtl-007-drop-stable when checking the multiple-pipeline stress test. The reproduction rate is almost 100%. Sometimes it fails with a simple I/O error and no error logs in kernel message, but sometimes it fails with different IPC timed out.

dmesg

[  311.736404] kernel: snd_sof:sof_ipc4_widget_setup: sof-audio-pci-intel-mtl 0000:00:1f.3: Create pipeline pipeline.1 (pipe 1) - instance 0, core 0
[  311.736409] kernel: snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc tx      : 0x11000005|0x0: GLB_CREATE_PIPELINE
[  312.241983] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc timed out for 0x11000005|0x0
[  312.242016] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Attempting to prevent DSP from entering D3 state to preserve context
[  312.242021] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ------------[ IPC dump start ]------------
[  312.242067] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Host IPC initiator: 0x91000005|0x0|0x0, target: 0x1b060000|0x0|0x0, ctl: 0x3
[  312.242094] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ------------[ IPC dump end ]------------
[  312.242113] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ------------[ DSP dump start ]------------
[  312.242132] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: IPC timeout
[  312.242147] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: fw_state: SOF_FW_BOOT_COMPLETE (7)
[  312.242187] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ROM status: 0x5, ROM error: 0x0
[  312.242205] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ROM debug status: 0x50000005, ROM debug error: 0x0
[  312.242244] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ROM feature bit enabled
[  312.242282] kernel: snd_sof:sof_ipc4_find_debug_slot_offset_by_type: sof-audio-pci-intel-mtl 0000:00:1f.3: Slot type 0x4c455400 is not available in debug window
[  312.242286] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ------------[ DSP dump end ]------------
[  312.242326] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: failed to create module pipeline.1
[  312.242349] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Failed to set up connected widgets
[  312.242375] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: error: failed widget list set up for pcm 0 dir 0
[  312.242397] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ASoC: error at snd_soc_pcm_component_hw_params on 0000:00:1f.3: -110
[  312.242444] kernel:  Port0: ASoC: error at __soc_pcm_hw_params on Port0: -110
[  312.242470] kernel:  Port0: ASoC: error at dpcm_fe_dai_hw_params on Port0: -110
  946.451242] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc tx      : 0x12060000|0x0: GLB_DELETE_PIPELINE
[  946.550780] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc tx reply: 0x32000000|0x0: GLB_DELETE_PIPELINE
[  946.551127] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc tx done : 0x12060000|0x0: GLB_DELETE_PIPELINE
[  946.551144] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc tx      : 0x47000000|0x0: MOD_SET_DX [data size: 8]
[  947.058649] sof-audio-pci-intel-mtl 0000:00:1f.3: ipc timed out for 0x47000000|0x0
[  947.058690] sof-audio-pci-intel-mtl 0000:00:1f.3: Attempting to prevent DSP from entering D3 state to preserve context
[  947.058695] sof-audio-pci-intel-mtl 0000:00:1f.3: ------------[ IPC dump start ]------------
[  947.058742] sof-audio-pci-intel-mtl 0000:00:1f.3: Host IPC initiator: 0x47000000|0x0|0x0, target: 0x1b060000|0x0|0x0, ctl: 0x3
[  947.058774] sof-audio-pci-intel-mtl 0000:00:1f.3: ------------[ IPC dump end ]------------
[  947.058798] sof-audio-pci-intel-mtl 0000:00:1f.3: ------------[ DSP dump start ]------------
[  947.058822] sof-audio-pci-intel-mtl 0000:00:1f.3: IPC timeout
[  947.058840] sof-audio-pci-intel-mtl 0000:00:1f.3: fw_state: SOF_FW_BOOT_COMPLETE (7)
[  947.058883] sof-audio-pci-intel-mtl 0000:00:1f.3: ROM status: 0x0, ROM error: 0x0
[  947.058905] sof-audio-pci-intel-mtl 0000:00:1f.3: ROM debug status: 0x50000005, ROM debug error: 0x0
[  947.058948] sof-audio-pci-intel-mtl 0000:00:1f.3: ROM feature bit enabled
[  947.058994] snd_sof:sof_ipc4_find_debug_slot_offset_by_type: sof-audio-pci-intel-mtl 0000:00:1f.3: Slot type 0x4c455400 is not available in debug window
[  947.058996] sof-audio-pci-intel-mtl 0000:00:1f.3: ------------[ DSP dump end ]------------
[  947.059033] sof-audio-pci-intel-mtl 0000:00:1f.3: failed to disable target core: 1 for pipeline pipeline.4
[  947.059061] sof-audio-pci-intel-mtl 0000:00:1f.3: Failed to free connected widgets
[  947.059092] sof-audio-pci-intel-mtl 0000:00:1f.3: ASoC: error at snd_soc_pcm_component_hw_free on 0000:00:1f.3: -110

To Reproduce
~/sof-test/test-case/multiple-pipeline.sh -f a -c 20 -l 100

Reproduction Rate
100%

Environment

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
    • Kernel: {c052a47323f9}
    • SOF: {[mtl-007-drop-stable] and main branch}
  2. Name of the topology file
    • Topology: {development/sof-mtl-nocodec.tplg}
  3. Name of the platform(s) on which the bug is observed.
    • Platform: {MTLP_RVP_NOCODEC}

dmesg.txt
mtrace.txt

@keqiaozhang keqiaozhang added bug Something isn't working as expected P1 Blocker bugs or important features multicore Issues observed when not only core#0 is used. multi-stream MTL Applies to Meteor Lake platform labels Dec 18, 2023
@mengdonglin mengdonglin added the I2S Applies to I2S bus for codec connection label Dec 18, 2023
@keqiaozhang
Copy link
Collaborator Author

A new IPC timed out error on ADLP-NOCODEC when checking check-capture-50rounds(Test ID 36111):

[ 3786.426946] kernel: Message payload: 00000000: 00000003 00000002 00000001 00000000
[ 3786.426948] kernel: snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx      : 0x13000004|0x1: GLB_SET_PIPELINE_STATE [data size: 16]
[ 3786.933519] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc timed out for 0x13000004|0x1
[ 3786.933850] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: Attempting to prevent DSP from entering D3 state to preserve context
[ 3786.933859] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ------------[ IPC dump start ]------------
[ 3786.933888] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: hda irq intsts 0x00000000 intlctl 0xc0000000 rirb 00
[ 3786.933899] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: dsp irq ppsts 0x00000000 adspis 0x00000000
[ 3786.933925] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: Host IPC initiator: 0x93000004|0x1|0x0, target: 0x0|0x0|0x0, ctl: 0x3
[ 3786.933937] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ------------[ IPC dump end ]------------
[ 3786.933945] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ------------[ DSP dump start ]------------
[ 3786.933952] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: IPC timeout
[ 3786.933959] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: fw_state: SOF_FW_BOOT_COMPLETE (7)
[ 3786.933982] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: 0x00000005: module: ROM, state: FW_ENTERED, running
[ 3786.934087] kernel: snd_sof:sof_ipc4_find_debug_slot_offset_by_type: sof-audio-pci-intel-tgl 0000:00:1f.3: Slot type 0x4c455400 is not available in debug window
[ 3786.934096] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ------------[ DSP dump end ]------------
[ 3786.934147] kernel: Message payload: 00000000: 00000003 00000002 00000001 00000000
[ 3786.934156] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: failed to set final state 4 for all pipelines
[ 3786.934170] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ASoC: error at soc_component_trigger on 0000:00:1f.3: -110
[ 3786.934186] kernel:  DMIC SFX2: ASoC: trigger FE cmd: 1 failed: -110

@RanderWang
Copy link
Collaborator

The ipc timeout issue for: Create pipeline pipeline.1 (pipe 1) - instance 0, core 0 was not caused by this ipc message, it was caused by last set_dx. I add memory print in fw and found FW didn't received ipc msg for creating pipeline

@mengdonglin mengdonglin added the IPC timeout IPC timeout observed label Jan 3, 2024
@keqiaozhang
Copy link
Collaborator Author

keqiaozhang commented Jan 9, 2024

For tip of mtl-007-drop-stable, the IPC timed out issues are very easy to reproduce on MTLP_RVP_NOCODEC. Inner test report ID: 36618

For SOF main branch, it seems that this issue does not exist on SOF main branch, or the reproduction rate is extremely low on MTLP_RVP_NOCODEC. We haven't observed this issue in previous 3 weekly stress testing with main branch.
Please refer to the inner test reports:
2023-12-28: 36337 - clock gating was enabled on main branch at that time.
2023-12-30: 36366
2024-01-06: 36554

@keqiaozhang
Copy link
Collaborator Author

Observed a new IPC error on mtl-007/519c597182ef. Inner test ID:37207.

[49810.582551] kernel: snd_sof:sof_ipc4_trigger_pipelines: sof-audio-pci-intel-mtl 0000:00:1f.3: trigger cmd: 0 state: 2
[49810.582559] kernel: snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc tx      : 0x13000002|0x1: GLB_SET_PIPELINE_STATE [data size: 12]
[49810.583040] kernel: snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc tx reply: 0x330000a4|0x1: GLB_SET_PIPELINE_STATE
[49810.583045] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: FW reported error: 164 - Unknown
[49810.583066] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc error for msg 0x13000002|0x1
[49810.583075] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: failed to set final state 2 for all pipelines
[49810.583093] kernel: snd_sof:sof_ipc4_route_free: sof-audio-pci-intel-mtl 0000:00:1f.3: unbind modules dai-copier.SSP.NoCodec-2.capture:0 -> src.11.1:0
[49810.583099] kernel: snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc tx      : 0x46130004|0x10008: MOD_UNBIND
[49810.583531] kernel: snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc tx reply: 0x66000000|0x10008: MOD_UNBIND
[49810.583552] kernel: snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc tx done : 0x46130004|0x10008: MOD_UNBIND
[49810.583561] kernel: snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc tx      : 0x120f0000|0x0: GLB_DELETE_PIPELINE
[49810.583940] kernel: snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc tx reply: 0x3200000c|0x0: GLB_DELETE_PIPELINE
[49810.583944] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: FW reported error: 12 - Required resource is in invalid state
[49810.583959] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc error for msg 0x120f0000|0x0
[49810.583967] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: failed to free pipeline widget pipeline.12
[49810.583974] kernel: snd_sof:sof_ipc4_route_free: sof-audio-pci-intel-mtl 0000:00:1f.3: unbind modules src.11.1:0 -> host-copier.2.capture:0
[49810.583980] kernel: snd_sof:sof_widget_free_unlocked: sof-audio-pci-intel-mtl 0000:00:1f.3: widget src.11.1 freed
[49810.583986] kernel: snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc tx      : 0x12100000|0x0: GLB_DELETE_PIPELINE
[49810.584438] kernel: snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc tx reply: 0x3200000c|0x0: GLB_DELETE_PIPELINE
[49810.584442] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: FW reported error: 12 - Required resource is in invalid state
[49810.584456] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc error for msg 0x12100000|0x0
[49810.584461] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: failed to free pipeline widget pipeline.11
[49810.584466] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Failed to free connected widgets
[49810.584474] kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ASoC: error at snd_soc_pcm_component_hw_free on 0000:00:1f.3: -22

@jsarha
Copy link
Contributor

jsarha commented Jan 24, 2024

By removing irrelevant logging from FW I am now sometimes able to seeing the first symptoms of DSP being stuck

    - one of the scenarios is:
      - ipc4_init_module_instance() calling ipc4_process_on_core(), and idc_send_msg() getting -EBUSY from k_p4wq_wait()
      - after this core 0 still returns to ipc_cmd() and reports
        - "MODULE_MSG failed with err 4"
	- after this the FW does not anymore respond to IPC from host, but parts of DSP remain active, for instance mtrace keeps printing:
	  - "ll_schedule: zephyr_domain_thread_fn: ll core 1 timer avg 9885, max 11690, overruns 0"

@lgirdwood
Copy link
Member

@kv2019i pls see above info from @jxstelter - is this addressed in your current IDC PR #8753 ?

@kv2019i
Copy link
Collaborator

kv2019i commented Jan 24, 2024

@lgirdwood @jsarha 's comment. Yes, I believe Jyri has #8753 included as he gets the EBUSY to log (with mainline and mtl-007, p4wq_wait will just block).

Current understanding:

  • with latest mtl-007 (c1f730f) at least I cannot reproduce this bug (and idc: zephyr: set of fixes to IDC in multicore scenario #8753 is NOT part of this branch) -- there is no explicit fix included, but some seemingly unrelated commits have been removed (since the original mtl-007 for which this bug was filed) and a few added ; multiple people have reviewed the code changes but no clear linkage to the failures has been found
  • if SOF is built with debug (-d), the p4wq problem can be hit with higher repro rate (but we cannot say for sure this is the same problem as the original bug of this)
  • with earlier mtl-007 version, issue matching the bug description was hit with idc: zephyr: set of fixes to IDC in multicore scenario #8753 included in the build (tested by @abonislawski ), so we can definitely say 8753 is NOT the fix either

So IOW quite inconclusive. With current mainline and mtl-007 branches, the issue is very hard to reproduce (even with longer multi-hour test runs), but we cannot point to a specific fix.

kv2019i added a commit to kv2019i/zephyr that referenced this issue Feb 12, 2024
When exiting PM_STATE_SOFT_OFF, the primary core state is always
used to restore bootctl register and the clock and power gating
settings.

This can lead to problems if non-primary core is powered up and down
many times before primary core 0 is powered down the first time.
The saved state in core_desc[0].bctl will be null, and as a result-
power gating and clock gating is not disabled correctly for
non-primary cores.

Link: thesofproject/sof#8642
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
kv2019i added a commit to kv2019i/zephyr that referenced this issue Feb 12, 2024
When exiting PM_STATE_SOFT_OFF, the primary core state is always
used to restore bootctl register and the clock and power gating
settings.

This can lead to problems if non-primary core is powered up and down
many times before primary core 0 is powered down the first time.
The saved state in core_desc[0].bctl will be null, and as a result-
power gating and clock gating is not disabled correctly for
non-primary cores.

Link: thesofproject/sof#8642
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
kv2019i added a commit to kv2019i/zephyr that referenced this issue Feb 12, 2024
When exiting PM_STATE_SOFT_OFF, the primary core state is always
used to restore bootctl register and the clock and power gating
settings.

This can lead to problems if non-primary core is powered up and down
many times before primary core 0 is powered down the first time.
The saved state in core_desc[0].bctl will be null, and as a result-
power gating and clock gating is not disabled correctly for
non-primary cores.

Link: thesofproject/sof#8642
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
abonislawski pushed a commit to abonislawski/zephyr that referenced this issue Feb 13, 2024
When exiting PM_STATE_SOFT_OFF, the primary core state is always
used to restore bootctl register and the clock and power gating
settings.

This can lead to problems if non-primary core is powered up and down
many times before primary core 0 is powered down the first time.
The saved state in core_desc[0].bctl will be null, and as a result-
power gating and clock gating is not disabled correctly for
non-primary cores.

Link: thesofproject/sof#8642
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
henrikbrixandersen pushed a commit to zephyrproject-rtos/zephyr that referenced this issue Feb 13, 2024
When exiting PM_STATE_SOFT_OFF, the primary core state is always
used to restore bootctl register and the clock and power gating
settings.

This can lead to problems if non-primary core is powered up and down
many times before primary core 0 is powered down the first time.
The saved state in core_desc[0].bctl will be null, and as a result-
power gating and clock gating is not disabled correctly for
non-primary cores.

Link: thesofproject/sof#8642
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
coreboot-org-bot pushed a commit to coreboot/zephyr-cros that referenced this issue Feb 13, 2024
When exiting PM_STATE_SOFT_OFF, the primary core state is always
used to restore bootctl register and the clock and power gating
settings.

This can lead to problems if non-primary core is powered up and down
many times before primary core 0 is powered down the first time.
The saved state in core_desc[0].bctl will be null, and as a result-
power gating and clock gating is not disabled correctly for
non-primary cores.

(cherry picked from commit a8af622)

Original-Link: thesofproject/sof#8642
Original-Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
GitOrigin-RevId: a8af622
Change-Id: Ic24b61f395a1847d48034580b27c9f4473edfec8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5290619
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Tested-by: Fabio Baltieri <fabiobaltieri@google.com>
@marc-hb
Copy link
Collaborator

marc-hb commented Feb 14, 2024

One recent reproduction on the stable-v2.8 branch, internal run:
planresultdetail/37902?model=MTLP_RVP_NOCODEC&testcase=multiple-pipeline-playback-200

This left the device in a bad state which made all consecutive tests fail - very slowly. Not cool. Much worse than a "fail fast" hard crash.

Maybe https://sof-ci.01.org/sofpr/PR8855/build2720/devicetest/index.html?model=MTLP_RVP_NOCODEC&testcase=multiple-pause-resume-50 (same branch) had the same cause

kv2019i added a commit to kv2019i/zephyr that referenced this issue Feb 14, 2024
When exiting PM_STATE_SOFT_OFF, the primary core state is always
used to restore bootctl register and the clock and power gating
settings.

This can lead to problems if non-primary core is powered up and down
many times before primary core 0 is powered down the first time.
The saved state in core_desc[0].bctl will be null, and as a result-
power gating and clock gating is not disabled correctly for
non-primary cores.

Link: thesofproject/sof#8642
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
(cherry picked from commit a8af622)
kv2019i added a commit to kv2019i/zephyr that referenced this issue Feb 14, 2024
When exiting PM_STATE_SOFT_OFF, the primary core state is always
used to restore bootctl register and the clock and power gating
settings.

This can lead to problems if non-primary core is powered up and down
many times before primary core 0 is powered down the first time.
The saved state in core_desc[0].bctl will be null, and as a result-
power gating and clock gating is not disabled correctly for
non-primary cores.

Link: thesofproject/sof#8642
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
(cherry picked from commit a8af622)
@wszypelt
Copy link

@keqiaozhang
Copy link
Collaborator Author

kv2019i added a commit to kv2019i/zephyr that referenced this issue Mar 4, 2024
When exiting PM_STATE_SOFT_OFF, the primary core state is always
used to restore bootctl register and the clock and power gating
settings.

This can lead to problems if non-primary core is powered up and down
many times before primary core 0 is powered down the first time.
The saved state in core_desc[0].bctl will be null, and as a result-
power gating and clock gating is not disabled correctly for
non-primary cores.

Link: thesofproject/sof#8642
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
(cherry picked from commit a8af622)
kv2019i added a commit to thesofproject/zephyr that referenced this issue Mar 5, 2024
When exiting PM_STATE_SOFT_OFF, the primary core state is always
used to restore bootctl register and the clock and power gating
settings.

This can lead to problems if non-primary core is powered up and down
many times before primary core 0 is powered down the first time.
The saved state in core_desc[0].bctl will be null, and as a result-
power gating and clock gating is not disabled correctly for
non-primary cores.

Link: thesofproject/sof#8642
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
(cherry picked from commit a8af622)
@kv2019i
Copy link
Collaborator

kv2019i commented Mar 6, 2024

Adding @lyakh you as bug owner as well to track merging of zephyrproject-rtos/zephyr@792a569 (or equivalent) to SOF main.

@kv2019i
Copy link
Collaborator

kv2019i commented Mar 22, 2024

All fixed merged, closing.

@kv2019i kv2019i closed this as completed Mar 22, 2024
matthew-morgan-molex added a commit to matthew-morgan-molex/zephyr that referenced this issue Jul 24, 2024
* drivers: w1: fix return check in bit_read for w1-gpio

The driver masked the return value of a pin read operation before
checking the error.
Thus not detecting a potential error and leading to logically
dead code, which was detected by coverity in CID 340853.
Anther instance XORs 1 before returning, resulting in an unexpected
return value;

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>

* doc: add how to run application in QEMU on Windows

Documentation does not describe how to run QEMU on Windows.
Add description of steps needed to run QEMU and use QEMU
with Twister on Windows in Beyond the Getting Started
Guide. Add a reference to it in Aplication Development
section.
Tested using Windows 11 and QEMU installer from
https://qemu.weilnetz.de/w64/

Signed-off-by: Michal Smola <michal.smola@nxp.com>

* drivers: dma: dma_dw_common: Disable channel even if draining times out

If the channel suspend with draining fails on stop because of reasons
outside of the scope of the DMA driver (the peripheral is powered off
before trying to drain for example) we must continue and disable the
channel.

The channel can be released by the client despite of it remained enabled.
A new DMA channel request can pick the channel (as it is released) but
re-configuration is going to be skipped and the use of the channel is going
to fail. Then we will see the same drain timeout on channel stop again
since the channel retained the configuration which resulted the first
timeout.

The drain timeout was made fatal by an earlier commit which fixed the
WAIT_FOR return value handling.

Fixes: 6226f9e6e44f ("dma: dw: fix the return value check")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>

* MAINTAINERS: Add myself as LED-strip collaborator

I am applying for Collaborator on the recommendation
of @simonguinot.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>

* drivers: mipi_dbi: mipi_dbi_spi: change reset pin polarity

Change reset pin polarity for MIPI DBI SPI controller, so that the board
devicetree is responsible for setting the GPIO to active low, and the
driver always sets the pin to a logic 1 to reset the display.

Fixes #68562

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>

* doc: migration-guide-3.6: update MIPI DBI display migration note

Update MIPI DBI display migration note to match the correct display
configuration settings for reset and MIPI DBI command pins after ILI9xxx
display was transitioned to this API.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>

* Kconfig LTO: Prevent with native simulator based targets

LTO cannot be really used with the native simulator based
targets neither today.

When doing a partial link as we do for these targets
the linker will complain if we are mixing LTO and non LTO
built code, and fall back to only produce non-LTO output.
(The link warning will cause twister to fail the test)

Today not all inputs to this partial link are built
with LTO enabled (offsets.c and the app library are not).

Even if they were, the native targets are mostly
a test and debugging facility, so optimizations like
these are not beneficial in general.

Let's just prevent selecting LTO for these targets.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>

* docs: update Golioth URLs

Update outdated links. This includes a new repository address for the
Golioth OTA sample and an updated path for the OTA documentation.

Signed-off-by: Mike Szczys <mike@golioth.io>

* twister: pytest: update device id when testing with pytest harness

Updated the instance with the device id to have it in the summary
report also when using pytest harness.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>

* Bluetooth: controller: Fix PHY Update TX Q

Resume the TX Data Q when a LL_UNKNOWN_RSP is recieved instead of a
LL_PHY_RSP.

Update PHY Update unit test with more coverage of the TX Data Q pause
state.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>

* Bluetooth: controller: Fix Data Length Update

Before a LL_FEATURE_REQ is sent, verify that the Data Length Update
procedure is still supported as it could have been unmasked as the result
of a previously completed Feature Exchange procedure.

Add unit test to verify the case of enqueuing both a
Feature Exchange procedure and Data Length Update procedure, where the
Feature Exchange procedure would result in the unmasking of the Data
Length Update procedure.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>

* Bluetooth: BAP: Reset _prev_seq_num on ISO connection

Once an ISO channel has connected, the sequence number
always starts at 0. This reset was missing in the implementation,
and the _prev_seq_num from a previous connection may have
been kept.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>

* drivers: dma: dma_nxp_edma: query channel number from HAL config

Currently, the number of channels supported by the controlled
is computed based on the size of the channel array. This
works well only if there's no gaps (i.e: "dma-channels" property
is used or "valid-channels" property is used with contiguous
channels) but will break if there are any gaps. For instance,
if the user wants to use channels 16 and 17 and specifies them
through the "valid-channels" property, they won't be allowed
to do so because dma_request_channels() will stop at channel 1.
As such, to fix this, simply use the number of channels from
the HAL configuration which is the maximum number of channels.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

* drivers: dma: dma_nxp_edma: switch to using DT_INST_IRQN_BY_IDX

After #63289, multi-level interrupts are now encoded using
macro magic. This means that using the generic DT_INST_IRQ_BY_IDX()
to fetch the INTID is no longer an option as the queried INTID
will be the one specified through the node's `interrupts`
properties. To fix this, switch to using DT_INST_IRQN_BY_IDX()
which will return the correctly encoded INTID.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

* drivers: dma: dma_nxp_edma: add function for channel filtering

The point of this commit is to allow users to request specific
channels. The following code snippet shows how this may now be
achieved:

	int requested_channel = 5;
	int ret = dma_request_channel(dev, &requested_channel);

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

* net: sockets: tls: Timeout DTLS with poll

Changed poll to perform incoming data check with connected
DTLS connections. This allows the CONFIG_NET_SOCKETS_DTLS_TIMEOUT
to timeout the connections to server socket if there is no
incoming data.

Previously, if the remote client closed the DTLS connection without
close notify, the timeout of the ongoing connection only happened
when next connection was taken to the server socket. Depending on
the timeouts, this could prevent the next connection from succeeding.

Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>

* usb: device_next: correct internal class API documentation

Correct documentation of the internal class API.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>

* drivers: Fix signs in max31865 temperature calculation

The reference document says that the formula for negative
temperatures has two minus signs missing.

fixes #68710

Signed-off-by: Tobias Röhmel <tobias.roehmel@rwth-aachen.de>

* usb: device_next: fix buffer count configuration in CDC ACM pool

Multiple CDC ACM instances can block each other because there are only
buffers for a single instance. Fix this by configuring the number of
buffers in the pool based on the number of CDC ACM instances.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>

* lib: acpi: Add more ASSERT() in ACPI table parsing

Add more assert() to DMAR parsing functions.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

* lib: acpi: Add asserts catching overflow

Add asserts catching sub-sctructure overflow.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

* tests: lib: acpi: Refactor DMAR structure and tests

Refactor DMAR structure to allow more tests. Use fake void function
for invalid size tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

* tests: lib: acpi: Add testing for dmar_foreach_devscope()

Add unit testing for dmar_foreach_devscope() function.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

* tests: lib: acpi: Add testing acpi_dmar_ioapic_get()

Add testing for acpi_dmar_ioapic_get() function.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

* tests: lib: acpi: Verify assert() on invalid size

Catch assert() when invalid unit size is bigger then actual
table or subtable size.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

* tests: lib: acpi: General header cleanup

Cleanup headers and definitions to make code more readable.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

* tests: lib: acpi: Add test verifying assert on devscope overflow

Add test verifying we catch assert() when subsctrucure is too big.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

* kernel: thread: Allow stack in coherent memory

When allowing dynamic thread stack allocation the stack may come from
the heap in coherent memory, trying to use cached memory is over
complicated because of heap meta data and cache line sizes.
Also when userspace is enabled, stacks have to be page aligned and the
address of the stack is used to track kernel objects.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>

* tests: dynamic_thread_stack: Fix problems in multicore

When running it in a multicore and with incoherent cache environment it
is possible that the thread allocating dynamic stacks is switched to a
different cpu. In this situation further access to that memory (like
when releasing resources) will be invalid.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>

* net: tcp: Rate-limiting of neighbor reachability hints

This commit implements simple rate-limiting for Neighbor Reachability
Hints in TCP module to prevent the potentially costly process of
frequent neighbor searches in the table, enhancing system performance.

Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no>

* Bluetooth: conn: check for disconnected earlier when sending

Verify the connection is active before popping the buffer from the TX
queue.

The current behavior enables a race condition between `create_frag` and
the connection being torn down, as `buf` can be popped from the TX queue
but not destroyed by `bt_conn_process_tx`.

In that case, `buf` will be leaked.

Original analysis and fix proposal by @watsug.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Reported-by: Adam Augustyn<watsug@gmail.com>

* Bluetooth: conn: document obfuscated function: `send_buf()`

It is unclear from a cursory glance at the code what the caller of
`send_buf(buf)` should do with `buf` based on the returned error codes.

Document when ownership is and isn't transferred to `send_buf()`.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>

* docs: bluetooth: mesh: Add note about reordering in randomization feat

Add a note to the access randomization feature that reordering can
happen and what should be done to avoid it.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>

* Bluetooth: Mesh: Disable randomization in DFD model for canceling update

Disable randomization in the access layer when cancelling update in the
distribution server model. This is needed because the server sends 2
messages in a row and the gets reordered by the access layer
randomization feature making DFU/SR/FD/BV-43-C test to fail.

This fixes DFU/SR/FD/BV-43-C test.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>

* Bluetooth: Mesh: Disable randomization on Link Close in RPR server

Disable randomization at the access layer in the Remote Provisioning
server when sending Link Stauts message as a responce on Link Close
message and then sending Link Report message right after it. Because of
the randomization, the report message is sent before the status message
which makes MESH/SR/RPR/PDU/BV-03-C test to fail.

This fixes MESH/SR/RPR/PDU/BV-03-C test.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>

* Bluetooth: HCI: Add full opcode to hci_types.h

Mental arithmetic shouldn't be required to analyze logs.

With this, a user can just "grep" the Bluetooth tree for the opcode
reported in an HCI error.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>

* mgmt: hawkbit: Add error handling for HTTP requests

This patch adds error handling for HTTP requests in hawkbit

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>

* net: ipv6: Improve Neighbor Discovery thread safety

Currently, the only thread-safe part of the IPv6 Neighbor processing
implementation are stale_counter related operation.

Fix this, by extending the mutex protection over all of the module, so
that message handlers, timers and API functions do not interfere with
each other.

As IPv6 Neighbor cache is tightly coupled with the Routing module, use
the same mutex to protect both, neighbor and routing tables, to prevent
deadlocks.

Also, replace the semaphore used with a mutex, as it seems more fit for
this particular job.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>

* wifi: shell: added NULL check to net_mgmt callback

By default variable context.sh is set to NULL. If any net_mgmt
event will be called when the variable has default value, there
will be a system exception.

Signed-off-by: Wojciech Slenska <wsl@trackunit.com>

* doc: drivers: mipi-dbi: detail write-only and duplex options

Add clarifications to mipi-dbi bindings to avoid the confusion
between two options, write-only and duplex.

Signed-off-by: Eve Redero <eve.redero@gmail.com>

* boards: mimxrt1040_evk: Fix typo in CMakeLists.txt

Fix typo of board dir variable in CMakeLists.txt

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>

* manifest: Update trusted-firmware-m to address LPC55S69 failure

A bug was introduced with the TF-M 2.0 update. Patches have been
submitted to the TF-M upstream and were also applied to the Zephyr
fork.

Details on the patches applied:

Platform: nxp: Add initialization flag to the CMSIS USART driver.
Avoid possible USART_Deinit() stuck found in Zephyr TFM MCUBoot.
From Upstream TFM:SHA: I1f6c19c3e7e5556423ddf3aec7555ff44ed7e562

Crypto: Add FPU flags for p256m
Fixes build error in #67751
From Upstream TFM:SHA: I4ed6f6ac7c1f52fb5ced18f0006dd3eb7a6a7359

Fixes #67751

Signed-off-by: David Leach <david.leach@nxp.com>

* drivers: led: lp50xx: brightness: don't check uint >= 0

No need to check if an uint8_t is greater or equal 0 in
lp50xx_set_brightness.
Fixes CID 322654

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>

* Bluetooth: BAP: Fix BASE_SUBGROUP_MAX_COUNT value

The calculation for BASE_SUBGROUP_MAX_COUNT was off by one.
The macro did not consider the non-subgroup parameters of
the BASE that take up space. This effectively modifies
BASE_SUBGROUP_MAX_COUNT to be 24 instead of 25.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>

* doc: release: 3.6: Adding additional ARM boards.

This adds the Adafruit QTPy RP2040 and the Wiznet W5500 Evaluation Pico
boards to the 3.6 release notes.

Signed-off-by: Ian Wakely <raveious.irw@gmail.com>

* release: Zephyr v3.6.0-rc2

Sets the version to v3.6.0-rc2.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>

* imxrt1010_evk: Fix i2c pinctrl dts

i2c pads were incorrectly configured and failed to work when testing
against an external fram part. Correct the i2c pinctrl settings for
arduino i2c to match other boards in the mimxrt lineup.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>

* tests: cmsis-dsp: rename tag to match west module name

Rename all tags to match module name.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>

* tests: devmux: fix test identifiers

Fix test identifier, use correct component/sub-component.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>

* doc: release: 3.6: Add notes about Atmel

Add 3.6.0 release notes for Atmel.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>

* doc: release: 3.6: Add notes about Gigadevices

Add 3.6.0 release notes for Gigadevices.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>

* drivers: adc: stm32: add dma support for stm32f4 adc

Add ADC DMA support for STM32F4 (and similar series F2, F7 and L1)

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>

* tests: drivers: adc_dma: add nucleo_f401re to the adc_dma test

Add Nucleo F401RE to the adc_dma test

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>

* drivers: serial: nrfx_uarte: Fix misbehavior due to preemption

UART_RX_RDY event can be generated from UARTE interrupt or k_timer
handler. When ENDRX event occurs then k_timer is stopped (it can
be restarted if there is another buffer provided). However, if UARTE
interrupt priority is higher than k_timer priority (RTC is used
underneath) then k_timer handler may still be executed later.
K_timer notifies new bytes based on RXDRDY HW event which is
counter by the TIMER (using PPI). It may happen that RXDRDY
event arrives due to byte received into RX FIFO but since there is
not buffer provided it stays in that FIFO. Given all this, it
was possible that RX_RDY event was reported from ENDRX UARTE event,
timer was stopped but because UARTE interrupt had higher priority
timer handler is executed after UARTE interrupt is handled. In
timer handler TIMER counter reports more bytes and calls
UART_RX_RDY event with null buffer and non-zero amount of bytes.

Fixed by generating UART_RX_RDY event only if RX buffer is not
null.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>

* Bluetooth: ISO: Introduce bt_iso_chan_send_ts

The bt_iso_chan_send function could take an optional
timestamp by using 0 as an indicator. The issue with
this approach was that a timestamp value of 0 is valid,
and could cause potential issue with syncing streams
in a group.

To fully support transmitting with and without timestamp,
bt_iso_chan_send_ts has been introduced, which is the only
function of the two (bt_iso_chan_send being the other) that
supports timestamps.

A new function, rather than adding a boolean to the existing,
was chosen as it simplifies the individual functions as well
as making it more explicit what the function does.

Since the bt_iso_chan_send function is used by LE audio, both
the BAP and CAP send functions have similarly been updated.
Likewise, all tests and samples have been updated to use the
updated function(s), and BT_ISO_TIMESTAMP_NONE has been
removed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>

* samples: mgmt: mcumgr: smp_svr: Fix shell mgmt overlay

Fixes a wrong Kconfig selection in the overlay file

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>

* tests: mem_protect/obj_validation: fix check for heap size

Commit 3fbf12487c6c01c488210bc56b0f342f07098df9 introduced a way
to add to CONFIG_HEAP_MEM_POOL_SIZE if, for example, subsystems
need more heap space. However, the size check in obj_validation
was still using the old kconfig, and was failing when extra
space was specified. So update the size check to use the updated
size.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>

* doc: zbus: improve sensor-based illustration example

The sensor-based illustration example did not consider the HLP feature
and used the work queue to publish to the Trigger channel. With the HLP,
that is not necessary anymore. The timer ISR can publish to the channel
directly. So, this commit improves the example description by
considering the HLP feature.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>

* doc: releases: release-notes: 3.6: no relevant EEPROM changes

Remove the EEPROM subsection from the v3.6.0 release notes.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>

* doc: input: add two paragraphs about keymap and hid mapping

Add a paragraph about the input-keymap binding and one about the HID
mapping functions.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>

* boards native_posix: Detect attempt to configure not existing int

Prevent overrunning the irq vector table.
This is not happening today in tree, but coverity thinks it
may. Checking for it to prevent it is not a bad idea
anyhow, so let's do it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>

* nvs: add documentation about the crc in nvs

fixed nvs part of #68699

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
Co-authored-by: Benjamin Cabé <kartben@gmail.com>

* posix: pthread: ensure pthread_exit() has noreturn attribute

The function pthread_exit() does not return. It should be declared
with the noreturn attribute.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>

* scripts/requirements: bump imgtool to 2.0.0

Resolves incorrectly located `image_ok` tag in generated hex files when
CONFIG_MCUBOOT_GENERATE_CONFIRMED_IMAGE is used.

Fixes #64098

Signed-off-by: Abram Early <abram.early@gmail.com>

* mbedtls: option for MBEDTLS_PLATFORM_ZEROIZE_ALT

Add a Kconfig option for enabling `MBEDTLS_PLATFORM_ZEROIZE_ALT`, which
is required if the mbed backend already provides an implementation.

For example, the Nordic cryptocell precompiled backends.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>

* doc: releases: release-notes: 3.6: add CAN release notes for v3.6.0

Add CAN release notes for v3.6.0.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>

* drivers: espi: mec172x: Do not enable interrupt if VW is disabled

Do check if a VW is enabled before enabling interrupt

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>

* fix: lvgl: modules: keypad input log module

Compilation error "undefined reference to log_const_lvgl"
happened in lvgl_keypad_input.c when trying to get logs with
lvgl keypad module. Fixed by adding log level parameter
in log module macro.

Signed-off-by: Eve Redero <eve.redero@gmail.com>

* doc: releases: 3.6: Add release notes for LVGL module

Adds release notes for LVGL module.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>

* doc: release: 3.6: Add management subsys changes

Add to management subsystem section of release notes:
- Fix image confirm for Direct XIP
- Support for finding registered command groups

Signed-off-by: Ben Marsh <ben.marsh@helvar.com>

* modem: bg9x: ignore sem return value

The semaphore waits forever, ignore the return value.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>

* drivers: counter: maxim_ds3231: Remove unused variables

data->rtc_base is not being used anywhere while data->rtc_registers is
only used as a temporary variable. Remove them from the driver.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>

* drivers: counter: maxim_ds3231: Fix coverity errors

Casting 64-bit time_t values into 32-bit unsigned integers causes
CWE-197 violations. Explicitly truncate these values by masking
time_t to avoid these warnings.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>

* drivers: entropy: neorv32: add missing soc.h include

Add missing soc.h include for NEORV32_SYSINFO_FEATURES.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>

* doc: releases: flash: nrf_qspi_nor timeout Kconfig

Adds reference to new Kconfig,
CONFIG_NORDIC_QSPI_NOR_TIMEOUT_MS,
enabled by updates to nrfx.

Reference: zephyrproject-rtos/zephyr#66711

Signed-off-by: Helmut Lord <kellyhlord@gmail.com>

* soc: xtensa: intel_adsp: restore bootctl with per-core state

When exiting PM_STATE_SOFT_OFF, the primary core state is always
used to restore bootctl register and the clock and power gating
settings.

This can lead to problems if non-primary core is powered up and down
many times before primary core 0 is powered down the first time.
The saved state in core_desc[0].bctl will be null, and as a result-
power gating and clock gating is not disabled correctly for
non-primary cores.

Link: https://github.com/thesofproject/sof/issues/8642
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>

* net: coap: add TOO_MANY_REQUESTS to return codes

Add COAP_RESPONSE_CODE_TOO_MANY_REQUESTS to coap_header_get_code(). CoAP
4.29 response code for "Too many requests" is defined in coap.h but was
missing from the list of cases, resulting in a 0 being returned instead
of the proper code.

Signed-off-by: Mike Szczys <mike@golioth.io>

* manifest: Update hal_nordic revision

Updated hal_nordic fixes APPROTECT handling on nRF91 target,
as well as fixes missing alignment of nrfx samples
to modified API of the GPIOTE driver.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>

* soc: riscv: nrf54h: fix VPR core dependencies

The actual RISC-V core needs to select RISCV, and specific SoC CPU
depend on it.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>

* samples: Bluetooth: Add missing svc data for broadcast audio sink

Add missing service data for BASS for the broadcast audio sink
sample.

This also required the controller to increase its maximum data
length. Increased more than minimum required so that the name
can be changed without needing to increase this again.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>

* doc: release-notes: add relevant pinctrl changes

Add a list of relevant new features or new drivers.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>

* boards: nucleo_f722ze: Add code-partition chosen

If slots partitions are defined, related chosen should be configured.

Fixes build issue in samples/subsys/usb/dfu

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>

* net: trickle: Print the abs value using %u

The Imax_abs value should be printed using %u instead of %d
as it can be large and should be printed as positive value.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>

* doc: release: 3.6: Add release notes for MCUmgr

Adds release notes for MCUmgr for this release

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>

* thrift: null-terminate certificates in samples and tests

The thrift methods loadCertificateFromBuffer(),
loadPrivateKeyFromBuffer(), and
loadTrustedCertificatesFromBuffer() expect a null-terminated
string.

Append '\0' to each array used to hold a certificate in
thrift samples and tests.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>

* modules: tf-m: Remove TFM_TEST_REPO_PATH

TF-M 2.0.0 doesn't use the TFM_TEST_REPO_PATH anymore so removing it.

Signed-off-by: Markus Swarowsky <markus.swarowsky@nordicsemi.no>

* modules: tf-m: Remove QCBOR path from build

QCBOR is only needed  by the TF-M tests, as they are not build
separately due to the TF-M split build.
If we still set it there is a CMake build warning.

Signed-off-by: Markus Swarowsky <markus.swarowsky@nordicsemi.no>

* modules: tf-m: Rename crypto modules to ENABLED

The TF-M crypto modules got renames from CRYPTO_XXX_MODULE_DISABLED to
CRYPTO_XXX_MODULE_ENABLED
Therefore also re naming it in zephyr build integration.

Signed-off-by: Markus Swarowsky <markus.swarowsky@nordicsemi.no>

* doc: release-notes/3.6: add some bits about I3C

This adds some bits on changes of I3C to the release notes.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>

* doc: release-notes/3.6: add some bits about PCIe

This adds some bits on changes of PCIe to the release notes.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>

* doc: release-notes/3.6: add some bits about UART

This adds a few bits about more significant changes in UART.
Small changes and bug fixes are omitted.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>

* docs: migration-guide-3.6: notes about userspace funcs renaming

Quite a few of userspace related functions, macros and struct
have been renamed (z_ to k_). So make notes in the migration
guide.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>

* doc: release-notes/migration-guide/3.6: add bits on Xtensa

This adds some bits in both migration guide and release notes
about changhes in Xtensa.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>

* doc: release: 3.6: Add Ethernet and Wi-Fi info

Add changes to Ethernet and Wi-Fi drivers for v3.6.
Also add information about generic Ethernet and Wi-Fi changes.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>

* doc: release: 3.6: add posix api release notes

Add highlights between v3.5.0 and today for the the POSIX API.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>

* drivers: sensor: ltrf216a: fix overflow in conversion

The conversion of the raw sensor value overflows because
only a 32 bit multiplication is executed.
Fix the issue by promoting the raw sensor value to uint64_t before
executing the multiplication.

Analysis:
The current implementation overflows for all raw values grater
than 9544(14-bit).
But according to the datasheet the sensor has a maximum resolution of
20-bit. So Multiplying that value with 450.000 would need at least 39
bit to avoid an overflow, hence do it using 64-bit arithmetic.

Fixes CID 330657

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>

* samples: doc: Add README for Grove sensor samples

Added a README.rst for grove_light and grove_temperature sensor
sample applications.

Signed-off-by: Doug Foster <dougwfost@gmail.com>

* boards: nrf54*: Add a note about current status

The nRF54* SoCs are in a very early stage of production and the software
supporting them is to be considered experimental. Document this
accordingly in the respective boards.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>

* Bluetooth: Host: Add ISO tx check for LOG_WRN in le_init_iso

The warning should only apply for configurations where the
device may actually send ISO data (e.g. not the ISO sync receiver).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>

* drivers: bbram: stm32: add include to fix compilation error

Driver BBRAM for STM32 had a compilation error: "unknown type name
'RTC_TypeDef'" due to missing include file.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>

* boards: x86/acrn: add devicetree PCIe controller node

Commit 940c66f82e8cd3fe1850d95b6ca57cbc4e365e12 added a bunch of
ACPI PNP ID to x86 boards but skipped those for ACRN. And commit
34a2fbfba1ce3df187bd5177b472b304b1d257c8 changed the behavior of
PCIe controller to looking for PNP ID, it results in compilation
error due to build asserts. So add the PCIe controller node to
the ACRN base DTS file.

Fixes #68956

Signed-off-by: Daniel Leung <daniel.leung@intel.com>

* samples: posix: gettimeofday: Fix fatal error caused by small stack

Fix #68727.

Signed-off-by: Cui Wei <chris.wei.cui@foxmail.com>

* boards: arm: nrf52840_blip: add zephyr,code-partition chosen property

Add missing zephyr,code-partition chosen property.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>

* boards: arm: nrf52840_papyr: add zephyr,code-partition chosen property

Add missing zephyr,code-partition chosen property.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>

* drivers: i2c_mchp: Replace slave by target

Replace slave_register with target_register and slave_unregister
with target_unregister.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>

* doc: release: Add sensor release notes for v3.6.0

Adds notes about sensor driver changes since the last release.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>

* doc: release: Add ADI boards for v3.6.0

Adds notes about new ADI boards added since the last release.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>

* doc: release-notes-3.6: STM32 changes

Update V3.6.0 release notes with STM32 related changes

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>

* doc: release-notes-3.6: Shields additions changes

Update V3.6.0 release notes with shields additions.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>

* drivers: led_strip: tlc5971: fix brightness control bit shifting

The lower bits of the brightness control registers were erroneously
shifted even though FIELD_PREP already does the shifting. In practice,
the effect is negliglible but of course should be fixed.

Also add missing parenthesis around shifting operations to satisy static
analysis.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>

* doc: build: snippets: application required snippets

Document how an application can automatically include snippets when
being built.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>

* settings: NVS: add entry into cache after writing

Settings NVS adds entry into Settings NVS cache after writing it
into flash. Previously, the entry was added into cache only
on the second writing attempt that caused very huge timing
despite cache was enabled since it was still empty.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>

* samples: Bluetooth: Broadcast Audio Source: Fix potential memory leak

In error cases, where send_data() returns early, the allocated net_buf
is not free'd, causing a memory leak affecting the net_buf pool.
Fix this by freeing the allocated net_buf before returning early
from send_data().

Signed-off-by: Sean Farrelly <sean.farrelly@outlook.com>

* mgmt: mcumgr: img_mgmt_client: avoid using uninitialized variable

Make sure temp_data is initialized before use.

Fixes: #68636

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>

* doc: fix include path of log_ctrl.h

fix zephyr/log_ctrl.h -> zephyr/logging/log_ctrl.h

Fixes #68902

Signed-off-by: Anas Nashif <anas.nashif@intel.com>

* doc: release-notes: Add 3.6.0 release notes for networking

Add 3.6.0 release notes for networking.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>

* modem: modem_cellular: CID 338164

strncpy() passed incorrect size

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>

* modem: modem_cellular: CID 338140

incorrect size passed to strncpy

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>

* modem: modem_cellular: CID 338115

incorrect size passed to strncpy()

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>

* modem: modem_cellular: CID 338073

incorrect size passed to strncpy()

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>

* modem: modem_cellular: CID 338067

incorrect size passed to strncpy()

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>

* doc: ipc: fix header location

Header for ip_service was wrong in the docs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>

* modem: hl7800: validate IPv4 DNS addr len for IPv6

If the IPv6 DNS address is not a valid address, DNS will fallback
to the IPv4 DNS address.
Fix copying the IPv4 address to the IPv6 address by using
the IPv6 address destination length.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>

* twister: support domains when cleaning up binaries

Binaries are located in multiple build directory subfolders when built for
multiple domains (sysbuild is one example). Parse domains.yaml and preserve
files across all domains for testing when --prep-artifacts-for-testing
option is used.

Signed-off-by: Mike Szczys <szczys@hotmail.com>

* Bluetooth: Audio: define bt_bap_bass_subgroup struct.

The Broadcast Assistant API should be fully independent of the scan
delegator. Therefore the new struct bt_bap_bass_subgroup has been
defined to avoid a dependency.

Fixes: #68338

Signed-off-by: Ping Wang <pinw@demant.com>

* doc: release-notes: Fix typo when referring to Socket Service

Use singular Service when referring to Socket Service library.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>

* drivers: can: mcan: fix handling of bus-off status events

Fix handling bus-off events in the Bosch M_CAN driver backend:
- Cancel all pending TX buffers when entering bus-off state
- Call all pending TX buffer callbacks with -ENETUNREACH when entering
  bus-off
- Automatically initiate bus-off recovery if
  CONFIG_CAN_AUTO_BUS_OFF_RECOVERY=y

Fixes: #68953

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>

* logging: rename log2_generic to log_generic

The log2 prefix was deprecated and changed to log some time ago,
but log2_generic() seems to have been inadvertantly left with
the old prefix.

Rename log2_generic() to log_generic() to follow suit.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>

* boards: stm32h573i_dk: Enable debug support with pyocd

Support of stm32h5 targets with pyocd is required to allow debugging.
Provide runner configuration and update board documentation.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>

* boards: x86/up_squared: use HPET timer

The UP Squared board comes with different CPUs where Atom ones
run at 1.6GHz while the Pentium and Celeron ones run at 1.1GHz.
Since the APIC TSC Deadline timer driver is tied to the CPU
speed, and we were using 1.6GHz as the hardware clock speed,
real world time would not be correct for Pentium and Celeron
based boards (i.e. 1 second sleep requested in application does
not translate to 1 second in real world). Change it to use HPET
timer instead as HPET has the same clock rate for all board
variants. Applications requiring more precise clock rate can
override this in their configuration.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>

* tests: c_lib/thrd: more stack for up_squared board

Similar to qemu_x86_64, the up_squared needs more stack space
to run the tests.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>

* tests: workq/user_work: change how resource pool is exhausted

The assumption of going through 100 iterations of allocating for
work queue is that the HEAP size is 1024 bytes. However, there
are platforms where the HEAP size is inflated due to subsystems
and/or drivers being included. So change the for loop into
a loop where it only stops until there is no memory to be
allocated.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>

* modem: hl7800: fix parsing APN username

Ensure a null reference cannot happen if there is an issue
parsing the APN username.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>

* Bluetooth: Controller: Fix lll ISO stream get by group

Fix LLL ISO stream get by group to return stream context
sorted by CIS offset in ascending order.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>

* Bluetooth: Audio: Shell: Fix context for the audio shell

The context had a bug where if GMAP was enabled, the context
was only BT_AUDIO_CONTEXT_TYPE_GAME.

The context should also (per BAP spec requirement) contain the
BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED context.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>

* Bluetooth: CAP: Shell: Fix argument issue for unicast_stop

The unicast_stop command takes either "all" or one or more
stream pointers as argument, but the argument handler did
not allow this.

The documentation for the command was also out of date.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>

* twister: Add support for GTEST_SKIP()

Calling GTEST_SKIP will print the test as DISABLED, add support and unit
tests for this.

Signed-off-by: Yuval Peress <peress@google.com>

* toolchain: do not use posix C code for asm language in gcc.h

Toolchain headers can be include in assembler files causing compilation
error for posix architecture. The fix involves adding
`!defined(_ASMLANGUAGE)` condition to exclude including posix C code in
this case.

Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>

* samples: Bluetooth: Minor improvements for broadcast audio sink

Increases some of the timeouts so that when using this sample
against other interactive devices (such as a phone or the
Zephyr audio shell), then it's easier to do it in time.

Also updates a few of the printks and ensures that we are not
doing name filtering when we have been requested to sync to
a specific broadcast source by a broadcast assistant.

The test for the sample has also been modified to have a longer
timeout to accomodate for the new semaphore timeout values.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>

* build: gen_isr_tables.py: fix bad IRQ index computation for L3 interrupts

According to the Zephyr documentation, the multi-level interrupts
are encoded as follows:

`L1_ID | ((L2_ID + 1) << L2_BITS) | ((L3_ID + 1) << (L3_BITS + L2_BITS))`

This means that when L3 interrupts are enabled, the gen_isr_table.py
script will receive the value of L2_ID + 1. Currently, the script
takes this value and directly compares it with the offsets set via
`CONFIG_3RD_LVL_INTR_xx_OFFSET`. This is wrong because the values from
said configurations are the same as L2_ID and because of that the
script will generate an error. To fix this, use the value of L2_ID
instead of L2_ID + 1.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

* tests: lib: deviceteee: api: remove deprecated, unused labels

Remove deprecated, unused devicetree label properties.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>

* doc: release notes: Add GNSS to release notes

Add notes covering:
* New GNSS subsystem
* GNSS utilities
* New generic NMEA0183 device driver
* New Quectel LCX6G device driver

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>

* drivers: serial: liteuart: Enable interrupt driven mode

This commit enables interrupt driven liteuart.

Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>

* drivers: clock_control: ra: sub-clock oscillator select fix

Due to a typo it is not possible to select the sub-clock oscillator
(SOSC) as a clock source for an RA Microcontroller. This patch resolves
the issue.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>

* doc: logging: remove references to logging v2

Since the removal of logging v1, there's only one version,
so remove the '2' from the function references for the docs
to link to the correct functions properly.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>

* modules: openthread: platform: logging: catch up on log2_generic rename

The log2_generic() function was renamed to log_generic().

Fixes: 2155a9e5f7771e05bd80b3505dd7804865ca1360

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>

* modem: cmux: Prevent NULL deref in connect_response_transmit

Prevent potential NULL dereference identified by CID 338026

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>

* modem: cmux: Prevent NULL deref in connect_handler

Prevent unlikely item == NULL scenario (CID 323091) and remove
superflous cmux == NULL check (CID 334904)

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>

* modem: cmux: Prevent NULL deref in dlci_open_handler

Prevent unlikely item == NULL scenario (CID 323102) and remove
superflous cmux == NULL check (CID 334903)

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>

* modem: cmux: Prevent NULL deref in dlci_close_handler

Prevent unlikely item == NULL scenario identifed by CID
323104

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>

* lib: acpi: fix for build error when acpi not enabled

fix for acpi.h header file generates invalid C-code when
 CONFIG_ACPI=n

Signed-off-by: Najumon B.A <najumon.ba@intel.com>

* lib: acpi: update shell and test app with the modifed resource struct

update shell and test app with the modifed resource struct such as
acpi_irq_resource and acpi_mmio_resource

Signed-off-by: Najumon B.A <najumon.ba@intel.com>

* doc: releases: Add release notes for logging

Add section with logging changes.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>

* doc: release notes: Modem modules

Add release notes detailing:
* Addition of TRANSMIT_IDLE event to modem_pipe module
* Implementation of TRANSMIT_IDLE event in all modem backends
* Extended all modem modules to use TRANSMIT_IDLE event
* Improved modem pipe event dispatching
* CMUX extended to act both as DCE and DTE

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>

* doc: release notes: add 1-wire release notes for 3.6.0

Add 1-Wire related release notes for Zephyr v3.6.0.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>

* doc: releases: Add release notes for LE Audio

Adds release notes for LE Audio for the Zephyr 3.6 release.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>

* dma: intel-adsp: hda: avoid division by 0

A division by 0 has once been observed inside
intel_adsp_hda_dma_host_reload(). It is apparently caused by a
preceding logic or hardware error, but in any case values, read from
the hardware should be checked for 0 before being used as a divisor.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>

* doc: migration-guide-3.6: add note about async serial shell

Following PR 68475, CONFIG_SHELL_ASYNC_API needs to be enabled, in
addition to CONFIG_UART_SYNC_API, to be able to use async serial shell.

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>

* samples: esp32: docs: add proper header description

Add Sphinx model header content so that it can be
mapped into release notes.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>

* doc: release-notes-3.6: ESP32 related changes

Highlights a few ESP32 updates for 3.6

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>

* doc: releases: Add release notes for picolibc

Document changes related to Kconfig settings so that users can see how to
adjust their settings for best results with Zephyr 3.6.

Signed-off-by: Keith Packard <keithp@keithp.com>

* modem: hl7800: Fix null reference in hl7800_net_addr6_pton

Ensure a potential null pointer is not incremented.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>

* drivers: eth_mcux: Fix PM_DEVICE build failure

device power management is not yet supported with eth_mcux
except on the kinetis series, but this should not break
the build for other platforms when PM_DEVICE is set

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>

* drivers: ecia: microchip: Prevent lost eSPI interrupts

Clearing virtual wire interrupt after calling callback may cause
interrupt miss if the same virtual wire changes due to action
in handler.

e.g. HOST_RST_WRN pulse within 50 us

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>

* smp: fix a race when starting / resuming multiple CPUs

cpu_start_fn is global, it's used by the initiator CPU to start or
resume secondary CPUs. However it's possible, that the initiator CPU
goes ahead and starts a second secondary CPU before the first one has
finished using the object. Fix this by creating a local copy of the
global object.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>

* tests: Fix pytest scenarios for boot with mcumgr.

Clear buffer before restarting DUT. This is to avoid using
lines from previous initial boot, when verifying if upgrade was
done as expected in test.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>

* doc: release-notes-3.6: mbedTLS update notes

Add release notes for mbedTLS.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>

* doc: release: 3.6: Add auxdisplay release notes

Adds release notes for this driver

Signed-off-by: Jamie McCrae <spam@helper3000.net>

* doc: add note to twister documentation

It could be helpfull to have a note about running single testsuite,
and adding more runners to the note, that are supported in hardware map

Signed-off-by: Patryk Kuniecki <patryk.kuniecki@intel.com>

* cmake/compiler/gcc: use -flto only for gcc >= 4.5.0

Fixes commit 26c8776c70ea ("buildsystem: Add an option to enable LTO")

Fixes the following error when compiling offsets.c

  xt-xcc ERROR parsing -fno-lto:  unknown flag

LTO options were introduced in gcc 4.5.0, compare:

https://gcc.gnu.org/onlinedocs/gcc-4.4.6/gcc/Option-Summary.html
https://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Option-Summary.html

Signed-off-by: Marc Herbert <marc.herbert@intel.com>

* Bluetooth: Correct `bt_att_create_rsp_pdu` reservation when EATT is enabled

When EATT is enabled, bt_att_create_rsp_pdu used to reserve headroom for
the SDU header even when responding on the UATT bearer.

That subtracted from the room for the ATT payload in the buffers. The
remaining buffer size was insufficient to create a PDU of ATT MTU size,
since the exchanged local MTU is calculated the with the assumption that
the SDU header is not present.

This broke the ATT MTU promise, and e.g. our read response will have two
bytes fewer than promised. This caused a failure in PTS.

The new bt_att_create_rsp_pdu pays attention to the bearer type and only
allocates the SDU header on EATT bearers.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>

* Bluetooth: Remove `len` param of `bt_att_create_rsp_pdu`

This served no purpose for responces. The minimum MTU is sufficient for
all ATT headers.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>

* twister: only parse specified tests when using --test

Enhance the -s option of twister, used to point to a single scenario in
a testsuite.
- Now accept --scenario on the command line, --test still supported.
- If no testsuite is provided, extract testsuite from scenario
  identifier and avoid parsing the whole tree if we only want to address
  one scenario in a testsuite.
- If just the identifier of the scenario is provided to
  --test/--scenario option, try to find this as well, do not need the
  full path for that.

Something like this is now possible:

twister  --scenario kernel.threads.init --list-tests
twister -T <path> --scenario kernel.threads.init --list-tests
twister -T <path>/kernel.threads.init --list-tests

All should print the same output.

Fixes #67307

Signed-off-by: Anas Nashif <anas.nashif@intel.com>

* twister: always add integration platforms to platform scope

Add integration_platforms to the list of the default platforms per test
for improved coverage when not running in integration mode.

Some tests when run without any option do not exercise any tests and
skip the integration platforms completely.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>

* doc: build: sysbuild: Remove mention of child image

Removes mention of child image to prevent confusion with other
systems that have no relation to sysbuild

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>

* xcc/cmake: fix error message when TOOLCHAIN_VER is undefined

The exact set of environment variables required by xt-xcc and xt-clang
is a bit of a dark magic and error-prone. TOOLCHAIN_VER is definitely
one of them and the error message was puzzling when TOOLCHAIN_VER was
undefined or not exported.

- Add TOOLCHAIN_VER to the list of variables in the error message

- Replace the vague "toolchain not found" in the error message with the
  more useful "XCC/install/tools//XtensaTools/bin/xt-xcc not found" where
  the double slash and comparison with the filesystem clearly point at
  where TOOLCHAIN_VER is missing.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>

* drivers: wifi: esp_at: fix ssid_len calucation for AP query.

The driver seems to be designed to use the very last byte of the
buffer(scan, connect), so null terminating the status query
might have unintended consequences.
However we should not use strlen to determine the ssid_len,
to avoid depending on the following buffer(bssid) to be zeroed.
Related to CID 316354

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>

* doc: release-notes: LoRa/LoRaWAN

Add release notes for LoRa/LoRaWAN subsystem for v3.6.0.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>

* doc: release-notes: zbus kconfig reference fixes

Fix usage of `:kconfig:option:` in the zbus release notes.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>

* Bluetooth: BAP: UC: Fix call to bt_gatt_get_mtu in notify

In the unicast_client_ep_notify we would always call
bt_gatt_get_mtu, regardless of whether data == NULL.

When there is a disconnection, the notify callbacks are
called with data == NULL to indicate a unsubscription.
In the case of the unicast client, this would also trigger
calls to bt_gatt_get_mtu when there is a disconnect, which
in turn would trigger a warning that ATT is not connected.

Postponing the call to bt_gatt_get_mtu fixes this.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>

* Bluetooth: BAP: Fix bad bcast assistant bis sync shift

The shift is currently necessary due to a mismatch of the
specs and the API, but the shift should not be done when
the value is BT_BAP_BIS_SYNC_NO_PREF as that is a special value.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>

* doc: usb: explain interface number and endpoint address assignment

This also applies to the new experimental device stack, but
documentation for it has not yet begun.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>

* Samples: Bluetooth: Fix PAST support for broadcast sink

Fix missing support for PAST in the broadcast audio sink
sample, where it previously failed to request PAST from
the broadcast assistant by not setting the PA state to
BT_BAP_PA_STATE_INFO_REQ.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>

* samples/modules/lvgl/demos: Increase heap for native 64 targets

For this targets, the widgets demo run out of heap and crashes.
Let's just increase the heap size.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>

* doc: releases: ST BlueNRG changes

Update release-notes and migration-guide version 3.6.0 with the changes
related to BlueNRG devices.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>

* doc: releases: Changes to SPI properties

Update release-notes version 3.6.0 with the SPI properties changes.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>

* doc: release-notes-3.6: PM related changes

Power management release notes for 3.6

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>

* doc: release-notes-3.6: add SD and SDHC changes

Add SD and SDHC release notes, including the addition of the SDIO
subsystem

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>

* doc: release-notes-3.6: remove section for disk drivers

No changes have been made to disk drivers since 3.5, so remove the
section for this release.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>

* doc: release-notes-3.6: MDIO changes

Add changes to 3.6 release notes for MDIO drivers

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>

* soc: arm: nxp_imx: fix flexspi frequency setting for iMXRT11xx SOC

Commit a10fee2d5e9 (drivers: clock_control: ccm_rev2: add support for
reclocking FlexSPI) introduced the ability to set the FlexSPI
clock frequency at runtime on RT11xx series SOCs. However, this
implementation resulted in the clock frequency being rounded up, not
down. This can result in flash clock frequency violations on some
flash parts, causing the system to crash when running in XIP mode.

Fixes #69088

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>

* samples: drivers: mbox: remove mimxrt595_evk_cm33

Remove mimxrt595_evk_cm33 from the MBOX sample. Although this SOC has
support for both cores, there is no support in tree for booting the
secondary core from the primary one, so this sample cannot run on
hardware.

Fixes #69092

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>

* native_simulator: Get latest from upstream

Align with native_simulator's upstream main
f02906708cf1668fe54ef2c2f1e159ed947573aa

Which includes:
* f029067 CPU ctrl: Fix two malformed error/warning messages
* 114f78b Host trampolines: Fix typos in comment

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>

* doc: release-notes-3.6: Update release notes for NXP additions

NXP additions for 3.6 release

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>

* ieee802154: ieee802154_cc13xx_cc26xx_subg: Fix 6lowpan for cc1352p7

- Fix using custom setup function
- Enable pRegOverrideTxStd and pRegOverrideTx20 in
  ieee802154_cc13xx_subg_radio_div_setup struct

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>

* doc: security: cve-2023-6749 left embargo

Disclose information about cve-2023-6749.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>

* doc: security: cve-2023-6249 left embargo

Disclose information about cve-2023-6249.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>

* doc: security: cve-2023-5779 left embargo

Disclose information about cve-2023-5779.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>

* arch: Fix bounds checking for dynamic shared interrupts

Fixes z_isr_install() and z_isr_uninstall() routines to check the isr
table index against the correct number of isr table entries. This
prevents out-of-bounds isr table accesses when
CONFIG_GEN_IRQ_START_VECTOR is greater than zero, such as on the ARC
architecture.

Coverity-CID: 347187
Coverity-CID: 347189
Coverity-CID: 347097
Coverity-CID: 347203
Coverity-CID: 347210

Signed-off-by: Maureen Helm <maureen.helm@analog.com>

* samples: esp32: do not search for all regions

Current SPIRAM sample code tries to search for any available
heap, causing this test to fail. Make sure the sample code
only malloc data from external ram.

Fixes #65997

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>

* doc: release: 3.6: Release notes for mfd and regulators

Added release notes for mfd and regulators

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>

* doc: release: Add Arm arch to 3.6 release notes

Adds highlights for the Arm architecture to the 3.6 release notes.

Signed-off-by: Kevin Townsend <kevin.townsend@analog.com>

* drivers: charger: bq25180: fix return value check

Fix missing check of the return value of `bq25180_set_charge_current`
function, resulting in logically dead code, as indicated by Coverity
CID 347197.

Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>

* net: lib: coap: Add error check when waking server thread

There's not much to be done in case waking up the server thread with
socketpair send() fails, but at least we can log an error on such event
(to please coverity).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>

* doc: release-notes-3.6: Update MCUboot change log.

Added new Zephyr MCUBoot supported platforms and
new CONFIG_MCUBOOT_IMGTOOL_OVERWRITE_ONLY parameter.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>

* docs/develop/test/bsim: Two trivial fixes

Fix a typo and let a file be a link instead of just
its name.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>

* doc: native_sim: Native logger backend is always enabled by default

Since bd9836be8c81f00337db226fef2e029b4d844821
the native logger is enabled always (even if a UART is present)
as it was though more conveniant for users.
But the documentation was not updated to reflect this.
Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>

* drivers: adc: mcp320x: use K_KERNEL_STACK_SIZEOF()

Use K_KERNEL_STACK_SIZEOF() for calculating thread stack size, as this
takes K_KERNEL_STACK_RESERVED into account.

Fixes: #69130

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>

* drivers: adc: lmp90xxx: use K_KERNEL_STACK_SIZEOF()

Use K_KERNEL_STACK_SIZEOF() for calculating thread stack size, as this
takes K_KERNEL_STACK_RESERVED into account.

Fixes: #69131

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>

* drivers: adc: ads7052: use K_KERNEL_STACK_SIZEOF()

Use K_KERNEL_STACK_SIZEOF() for calculating thread stack size, as this
takes K_KERNEL_STACK_RESERVED into account.

Fixes: #69132

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>

* drivers: adc: ad5592: use K_KERNEL_STACK_SIZEOF()

Use K_KERNEL_STACK_SIZEOF() for calculating thread stack size, as this
takes K_KERNEL_STACK_RESERVED into account.

Fixes: #69133

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>

* drivers: adc: max1125x: use K_KERNEL_STACK_SIZEOF()

Use K_KERNEL_STACK_SIZEOF() for calculating thread stack size, as this
takes K_KERNEL_STACK_RESERVED into account.

Fixes: #69129

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>

* drivers: espi: Clear virtual wire interrupt before calling handler

Clearing virtual wire interrupt after calling handler may cause next
interrupt miss if the same virtual wire changes due to action in handler.
As the interrupt source is read from register, it can be cleared before
calling handler to avoid next interrupt miss due to action/delay in the
callback handler.

Signed-off-by: Venkataramana Kotakonda <venkataramana.kotakonda@intel.com>

* ITE: drivers/gpio: Fix untrusted loop bound

The pin in the loop start counting from 0, so the condition of the
for loop should not be equal to num_pins.

Fixes #69118

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>

* doc: release-notes-3.6: add release note about -Wdouble-promotion

This adds a release note about -Wdouble-promotion now being a default
warning flag.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>

* Bluetooth: GATT: Add missing LESC_MASK for encrypt check

The LE Secure connection (LESC) mask also require encryption,
and some users have been using e.g. BT_GATT_PERM_READ_LESC
without BT_GATT_PERM_READ_ENCRYPT, and then the encryption
check in bt_gatt_check_perm was never properly applied.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>

* tests: bsim: Bluetooth: Fix GATT long read test

The test where it was supposed to read the long characteristic,
only read the "small" characteristic, due to setting the wrong handle.

With the right handle, the test failed and the test had to be
updated to store the data across multiple reads, and then do
the proper comparison.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>

* tests: bsim: Bluetooth: Add GATT encrypt tests

Add tests for the GATT permissions to read and write for
characteristics that require encryption and LESC encryption.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>

* doc: Bluetooth dev: Fix mention of nrf52 not supporting split builds

Since #67318 we support split builds in the simulated nRF52
over the UART, and we actually have this configuration
tested in CI.
This documentation paragraph was still mentioning this is not
supported. So let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>

* docs: BT tools: Fix description around native BT user chan use

With native_sim one uses the BT user channel driver (which connects
directly to the user channel linux socket), not a serial port.
Let's fix the description, and provide a nicer link.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>

* release: Zephyr v3.6.0-rc3

Sets the version to v3.6.0-rc3.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>

* docs: release: migration-guide: 3.6.0: reorder entries a bit

Reorder a few entries in the v3.6.0 migration guide in order to list the
ones likely to affect most people more prominently.

Group related entries together and get rid of a couple of empty headlines.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>

* doc: security: cve-2024-1638 left embar…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected I2S Applies to I2S bus for codec connection IPC timeout IPC timeout observed MTL Applies to Meteor Lake platform multi-stream multicore Issues observed when not only core#0 is used. P1 Blocker bugs or important features
Projects
None yet
Development

No branches or pull requests