Commit graph

48511 commits

Author SHA1 Message Date
Anas Nashif 99827d9c00 release: Update patch level to 99 after the 2.5.0 release
Sets the patch level to 99 for the 2.6 development cycle.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-14 11:52:38 -05:00
Anas Nashif fe7c2efca8 release: Bump version to 2.5.0
Final 2.5.0 tag.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-14 09:58:55 -05:00
Anas Nashif 39d7d34710 release: add more fixes issues to notes
Add more resolved issues to notes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-14 09:58:55 -05:00
Anas Nashif 554fca0e5c release: make release notes final
Remove "Working Draft" from title.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-14 09:58:55 -05:00
Anas Nashif ccc185be63 doc: add 2.5.0 to pick list
Add 2.5 to release list to be shown on documentation side bar.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-14 09:58:55 -05:00
Anas Nashif 769d91b922 actions: publish release docs to correct folder
We have been publishing docs to the wrong folter on AWS S3. We still had
the official docs published to the correct place manually though, so all
was good.

This change will eliminate the manual step of publishing documentation
and will put things where they belong.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-12 11:07:43 -05:00
Andrzej Głąbek c2b5e68953 doc: release-notes-2.5: Add notes for ADC and PWM
Plus one note about the nrf_qspi_nor driver.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-02-12 11:06:40 -05:00
Anas Nashif 5396350701 release: bump version to 2.5.0-rc4
Bump version to 2.5.0-rc4.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-11 22:12:11 -05:00
Jennifer Williams af81648a18 doc: releases: 2.5: add misc x86 to boards and socs
Add misc changes still needed in release notes for
x86 Boards and SoCs after checking their history:
- zefi.py: Use cross compiler while building zephyr
- boards: x86: ehl_crb: Add board variant for Slim Bootloader
- tests: enable the code coverage report for qemu_x86_64
- drivers/timer: Remove legacy APIC driver
- x86: add common memory.ld
- x86: reserve the first megabyte

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2021-02-11 16:57:12 -05:00
Joakim Andersson 2b3a2c8573 Bluetooth: host: Fail pairing if remote cannot meet required security
Fail after pairing request and response have been exchanged if the
selected pairing method would not result in the required security level.
This avoids the case where we would discover this after having encrypted
the connection and disconnect instead.

This was partially attempted but lacked checking for authentication
requirement when L3 was required, as well as skipping the check if L4
was required but remote did not support Secure Connections since the
check was after we had taken the legacy branch.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 14:58:03 -05:00
Joakim Andersson 6b8fbfa68a Bluetooth: host: Set error in security changed when not required level
Set the error in the security changed callback when the encryption has
not reached the required security level.
Terminate the pairing procedure in SMP on failure to avoid the security
changed callback being called twice in this case.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 14:58:03 -05:00
Joakim Andersson 09eb7e066b Bluetooth: host: Terminate the pairing procedure when disconnected
Terminate the pairing procedure when disconnected while this was in
progress. This notifies the application that security has failed and
removes the key entry.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 14:58:03 -05:00
Joakim Andersson 6b72e6584c Bluetooth: host: Set encryption pending when LE SC bond exists
Set the SMP flag encryption pending in the case where a bond exists
with ediv and rand equal to zero, i.e LE Secure Connections bond.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 14:58:03 -05:00
Joakim Andersson 0cc5dc1839 Bluetooth: host: Don't call callbacks on unexpected SMP PDUs
When receiving unexpected SMP PDUs with no pairing procedures in
progress don't treat it as a pairing procedure that has failed.
This causes unexpected SMP PDUs to trigger the pairing failed and
security changed callback at unexpected times.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 14:58:03 -05:00
Joakim Andersson 500ac369ed Bluetooth: shell: Improve security error readability
Improve the readability of security errors by converting the error code
to a string.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 14:58:03 -05:00
Joakim Andersson 1bf90c6f2f Bluetooth: shell: Add only pairing failed and pairing complete callbacks
Add status only pairing failed callbacks (complete and failed) so that
these handlers can be added without providing the ability for MITM
pairing procedures.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 14:58:03 -05:00
Joakim Andersson 00d8068b45 Bluetooth: host: Fix wrong error code type passed to security changed
Fix wrong error code type passed to security changed, passed SMP error
code instead of HCI error code.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 14:58:03 -05:00
Joakim Andersson bdf1452b4e Bluetooth: host: Rename auth_err_get to security_err_get
Rename auth_err_get to security_err_get which better reflect the
error namespace it converts to. Also update to using the enum definition
instead of uint8_t for local variable holding returned value.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 14:58:03 -05:00
Andy Ross 746c65acb7 soc/intel_adsp: Move KERNEL_COHERENCE to cavs15
Only the CAVS 1.5 linker script has full support for the coherence
features, don't advertise it on the other SoC's yet.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-02-11 14:47:40 -05:00
Andy Ross 015b4f7303 tests/kernel: Coherence: no shared data on stacks
A fairly common idiom in our test code is to put test-local data
structures onto the stack, even when they are to be used from another
thread.  But stacks are incoherent memory on some platforms, which
means that such things may not get a consistent view of memory between
threads.

Just make these things static.  A few of these spots were causing test
failures on intel_adsp_cavs15.  More were found by inspection while
hunting for mistakes.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-02-11 14:47:40 -05:00
Andy Ross 1ba7414029 kernel/sched: Correct coherence assert
Some legacy spots in our IPC layer (legally) pass a NULL wait queue to
pend().  Allow this in the coherence assertion.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-02-11 14:47:40 -05:00
Andy Ross 4dc6a0b89b kernel/poll: Remove dummy waitq from stack
The poll code uses a dummy wait queue so the threads have something to
block on, but the previous coherence pass (which rearranged things to
put the _poller data elsewhere) missed that this was on the stack,
which is not allowed.  It actually has no use except as a list, so
make it a global static instead.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-02-11 14:47:40 -05:00
Andy Ross 95bcba5946 tests/kernel/thread_stack: Fix KERNEL_COHERENCE interactions
Thread stack memory on coherence platforms needs to be linked into a
special section (so it can be cached).

Also, the test_idle_stack case just can't work with coherence.  It's
measuring the CPU's idle stack's unused data, which was initialized at
boot from CPU0, and not necessarily the CPU on which the test is
running.  In practice on intel_adsp_cavs15, our CPU has stale zeroes
in the cache for its unused stack area (presumably from a firmware
memory clear at boot or something?).  Making this work would require a
cache invalidate on all CPUs at boot time before the idle threads
start, we can't do it here in the test because we don't know where the
idle stack pointer is.

Too much work for an esoteric stack size test, basically.  Just
disable on these platforms.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-02-11 14:47:40 -05:00
Andy Ross 1d51e888d8 kernel/z_swap: Remove on-stack dummy spinlock
The z_swap_unlocked() function used a dummy spinlock for simplicity.
But this runs afouls of checking for stack-resident spinlocks
(forbidden when KERNEL_COHERENCE is set).  And it's executing needless
code to release the lock anyway.  Replace with a compile time NULL,
which will improve performance, correctness and code size.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-02-11 14:47:40 -05:00
Andy Ross 38195d5dd1 kernel/include: Put kernel stack memory in the right memory
The CONFIG_KERNEL_COHERENCE framework merged with a typo that left its
validation asserts disabled.  But it was written before the "kernel
stacks" feature merged, and so missed the K_KERNEL_STACK_* macros,
which need to put their stacks into __stackmem and not merely
__noinit.

Turning the asserts on exposed the bug.

Fixes #32112

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-02-11 14:47:40 -05:00
Faisal Saleem b8c33efb78 Bluetooth: SMP: fix for bt fixed passkey BT_PASSKEY_INVALID
when BT_PASSKEY_INVALID was set, it never updated the fixed
passkey which made its use ineffective

Signed-off-by: Faisal Saleem <faisal.saleem@setec.com.au>
2021-02-11 14:46:24 -05:00
Jennifer Williams 54b7439cae doc: releases: fix format issue in Boards & SoCs
Remove extra space character which is causing wrong format for
the bulleted list.

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2021-02-11 14:38:48 -05:00
Maciej Perkowski 3e1badaaac samples: tests: Fix sample.boards.nrf.nrfx test
The sample was failing twister test with a timeout because there was
no pass/fail criteria for it (nothing was tested). The fix adds
harness on consolse and some output that can be verified.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2021-02-11 13:58:25 -05:00
Maciej Perkowski 0fb58735f1 samples: tests: Fix usb.audio.headset test
The sample was failing twister test with a timeout because there was
no pass/fail criteria for it (nothing was tested). The fix adds
harness on consolse and some output that can be verified.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2021-02-11 13:57:31 -05:00
Maciej Perkowski ce776f0c7e samples: tests: Fix usb.audio.headphones_microphone test
The sample was failing twister test with a timeout because there was
no pass/fail criteria for it (nothing was tested). The fix adds
harness on consolse and some output that can be verified.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2021-02-11 13:57:31 -05:00
Alexander Wachter 09fea5cc5e drivers: flash: stm32g4: Flush caches after erase
This commit fixes sporadic kernel panics when writing big data chunks
to the flash. (data bus errors)
Reference manual:
If an erase operation in Flash memory also concerns data in the data
or instruction cache, you have to make sure that these data are
rewritten before they are accessed during code execution.
If this cannot be done safely, it is recommended to flush the caches
by setting the DCRST and ICRST bits in the Flash access control
register (FLASH_ACR).

Signed-off-by: Alexander Wachter <alexander.wachter@leica-geosystems.com>
2021-02-11 13:55:35 -05:00
Jian Kang 8c9b06ad82 board: cavs15: Add a option to control signing ways
Zephyr testcases(not SOF case) not use kernel DSP driver to load image
on ADSP board, thus do not need signing with xman. So add a input
'--no-manifest' to specify signing without xman in image. If use DSP
driver load image, we should not specify this.

Signed-off-by: Jian Kang <jianx.kang@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-11 13:52:30 -05:00
Jian Kang fb24ded7d8 board: cavs15: fixed size error that load firmware by script
When load firmware by script, the buffer size and data size are not
same, so specify size when copy data to buffer.

Signed-off-by: Jian Kang <jianx.kang@intel.com>
2021-02-11 13:52:30 -05:00
Joakim Andersson 10841b9a14 Bluetooth: host: Release ATT request buffers once sent
The ATT request buffers are held until the ATT response has been
received. This means that the ATT request buffers are released by the
RX thread, instead of the from the RX priority context of
num_complete.
This can cause a deadlock in the RX thread when we allocate buffers
and all the available buffers are ATT requests, since the RX thread is
the only thread that can release buffers.

Release the ATT request buffers once they have been sent and instead
handle ATT request resending by reconstructing the buffer from the
GATT parameters.

Also re-order the order of resource allocation by allocating the
request context before the buffer. This ensures that we cannot
allocate more buffers for ATT requests than there are ATT requests.

Fixed a buf reference leak that could occur when the ATT request buffer
has been allocated, but GATT returns an error before handing the
responsebility of the buffer to ATT, for example when bt_att_req_alloc
fails.
This is fixed by moving the functionality of att_req_destroy to
bt_att_req_free.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 12:59:01 -05:00
Joakim Andersson 5cbfdf6311 Bluetooth: host: Remove unused ATT request destroy callback
Remove the ATT request destroy callback which is never assigned
by any of the ATT requests.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 12:59:01 -05:00
Joakim Andersson 75deefb1b2 Bluetooth: host: Fix indicate without user callback
Fix indicate without func not working properly, when sent as a
non-req by GATT this has two propblems:
 - The indicate would not be treated as a transaction, and back
   to back indicate would be sent without waiting for the confirm
 - The destroy callback would not be called on the indicate parameters
   since the indicate_rsp callback would not be called.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 12:59:01 -05:00
Luiz Augusto von Dentz 8df6124deb Bluetooth: ATT: Remove BT_ATT_TX_MAX
ATT channels do support queueing buffer so it no longer need to block
waiting the tx_sem besides the buffer allocation already serves the
same purpose as the application will not be able to have more requests
than there are buffers available.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2021-02-11 12:59:01 -05:00
Joakim Andersson 9752cee3d7 Bluetooth: host: Refactor smp handling of conn pointer
Refactor SMP to have a conn pointer where this pointer is used
multiple times.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 12:59:01 -05:00
Joakim Andersson fcdb2eef25 Bluetooth: host: Allow requesting new security when security changed
Allow to request a higher security level during the key distribution
phase.

This is required by ATT and L2CAP since they only react to the encrypt
change event where they resend the current request.
The current request might require a higher security level still and
might have to request a higher security level before the pairing
procedure has been finished.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 12:59:01 -05:00
Joakim Andersson 301317e8fd Bluetooth: host: Handle multiple step security elevation
When ATT resends an ATT request it is sent as a "response" instead of
as a request. This causes the ATT request buffer to be released and
the ATT request cannot be resent one more time.

This causes a problem when the ATT request requires authentication
but the elevation of security is not enforcing MITM protection.
In this case the ATT will first require security level 2 and then resend
the request once this has been reached.
This will lead to a new ATT error response and ATT will require security
level L3.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 12:59:01 -05:00
Joakim Andersson 2f588f946f Bluetooth: host: Fix update keys when using debug public key check
Fix the update keys check allowing to overwrite the keys when using
debug keys. Instead the check disallowed overwriting keys made using
debug keys.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 12:59:01 -05:00
Joakim Andersson abd470cbe6 Bluetooth: shell: Fix gatt write command not cleanup up on error
Fix gatt write command returned "write in progress" when either
hex2bin or bt_gatt_write returned an error.
The write_params.func should not be set if the write command was not
successful.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-11 12:59:01 -05:00
Anas Nashif e8317920b1 release notes: add top level bullets, misc. changes
Add top level bullets and misc. changes to other areas.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-11 12:55:18 -05:00
Anas Nashif 5a605778f8 release: add resolved issues
Add list of all resolved issues since 2.4.0.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-11 12:55:18 -05:00
Alexander Wachter 9f858ac1b6 tests: drivers: can: timing: Fix potential div by zero
If the prescaler is zero in the test, a div by zero would happen.
Add an assert to check for zero prescaler.
Fix CID 216790

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2021-02-11 08:54:12 -05:00
Johann Fischer 902dd26908 doc: release-notes-2.5: add release notes for USB
Add release notes for USB.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-11 08:53:00 -05:00
Krzysztof Chruscinski 820d828947 drivers: serial: nrfx_uarte: Add missing check
If statement was unconditionally reading a field from async struct
while pointer to this struct may be null if asynchronous API is
enabled but given driver instance is not using it.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-02-11 08:52:36 -05:00
Anas Nashif 5d1c535fc8 license: add missing SPDX headers
Add SPDX header to files with existing license.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-11 08:05:16 -05:00
Anas Nashif 1cea902fad license: add missing SPDX headers
Add missing SPDX header.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-11 08:05:16 -05:00
Anas Nashif 37d1ed8b4d intc: mvic: remove unused header
File is not being used anymore, mvic interrupt controller was dropped
long time ago.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-11 08:05:16 -05:00