zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.52k stars 6.44k forks source link

BT_HCI_IPC should define its own heap requirement #66698

Open jhedberg opened 9 months ago

jhedberg commented 9 months ago

Describe the bug The following pattern keeps repeating for most (maybe all) boards that use the BT_HCI_IPC driver:

❯ git grep -A 2 HEAP_MEM_POOL_ADD_SIZE_
boards/arm/bl5340_dvk/Kconfig.defconfig:config HEAP_MEM_POOL_ADD_SIZE_BOARD
boards/arm/bl5340_dvk/Kconfig.defconfig-        int
boards/arm/bl5340_dvk/Kconfig.defconfig-        default 4096 if BT_HCI_IPC
--
boards/arm/mimxrt595_evk/Kconfig.defconfig:config HEAP_MEM_POOL_ADD_SIZE_BOARD
boards/arm/mimxrt595_evk/Kconfig.defconfig-     int
boards/arm/mimxrt595_evk/Kconfig.defconfig-     default 4096
--
boards/arm/pan1783_pan1783a_evb/Kconfig.defconfig:config HEAP_MEM_POOL_ADD_SIZE_BOARD
boards/arm/pan1783_pan1783a_evb/Kconfig.defconfig-      int
boards/arm/pan1783_pan1783a_evb/Kconfig.defconfig-      default 4096 if BT_HCI_IPC
--
...

Expected behavior

It looks like the BT_HCI_IPC driver should define its own heap requirement instead of having the boards define this on its behalf. There is now a standard way of doing this by defining a Kconfig option with the prefix HEAP_MEM_POOL_ADD_SIZE_. So for BT_HCI_IPC it should likely look like:

config HEAP_MEM_POOL_ADD_SIZE_BT_HCI_IPC
    def_int 4096
    depends on BT_HCI_IPC

Note that when grepping for places to change in board defconfig files, it looks like there are some boards declaring 4096 heap values but without an explicit dependency on the BT_HCI_IPC driver. Someone needs to check if the heap requirement for those is because of the HCI driver or because of something else.

github-actions[bot] commented 7 months ago

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

github-actions[bot] commented 5 months ago

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

github-actions[bot] commented 3 months ago

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

github-actions[bot] commented 1 month ago

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.