Bluetooth: Make bt_buf_get() wait if necessary & possible
Bluetooth: Make bt_buf_get() wait if necessary & possible

If we are low on buffers we don't necessarily need to have
bt_buf_get() fail if we are in any other scheduling context besides an
ISR. This patch makes the bt_buf_get() function implicitly wait for
more buffers in case none are immediately available. The call to
get_wait() is done as a second step after a non-waiting call so that
we can give a warning log that the stack is running low on available
buffers.

Change-Id: I37430acc337302df23e516c07d38e08b9d61c57c
Signed-off-by: Johan Hedberg <628991c7b0a19c384f9b99c21ec330ce952bb838@intel.com>

runchip/zephyr-cc3220,nashif/zephyr,bboozzoo/zephyr,runchip/zephyr-cc3200,finikorg/zephyr,finikorg/zephyr,fractalclone/zephyr-riscv,pklazy/zephyr,Vudentz/zephyr,Vudentz/zephyr,aceofall/zephyr-iotos,galak/zephyr,mbolivar/zephyr,erwango/zephyr,zephyrproject-rtos/zephyr,runchip/zephyr-cc3220,32bitmicro/zephyr,nashif/zephyr,coldnew/zephyr-project-fork,galak/zephyr,sharronliu/zephyr,bboozzoo/zephyr,bigdinotech/zephyr,mbolivar/zephyr,zephyriot/zephyr,explora26/zephyr,GiulianoFranchetto/zephyr,aceofall/zephyr-iotos,fbsder/zephyr,32bitmicro/zephyr,galak/zephyr,sharronliu/zephyr,Vudentz/zephyr,finikorg/zephyr,nashif/zephyr,mirzak/zephyr-os,32bitmicro/zephyr,erwango/zephyr,jamesonwilliams/zephyr-kernel,tidyjiang8/zephyr-doc,runchip/zephyr-cc3220,zephyrproject-rtos/zephyr,bboozzoo/zephyr,zephyrproject-rtos/zephyr,jamesonwilliams/zephyr-kernel,mbolivar/zephyr,mbolivar/zephyr,finikorg/zephyr,nashif/zephyr,runchip/zephyr-cc3220,tidyjiang8/zephyr-doc,sharronliu/zephyr,punitvara/zephyr,fbsder/zephyr,fractalclone/zephyr-riscv,erwango/zephyr,kraj/zephyr,jamesonwilliams/zephyr-kernel,punitvara/zephyr,bboozzoo/zephyr,GiulianoFranchetto/zephyr,holtmann/zephyr,pklazy/zephyr,mirzak/zephyr-os,fractalclone/zephyr-riscv,coldnew/zephyr-project-fork,explora26/zephyr,pklazy/zephyr,nashif/zephyr,aceofall/zephyr-iotos,Vudentz/zephyr,finikorg/zephyr,fractalclone/zephyr-riscv,GiulianoFranchetto/zephyr,runchip/zephyr-cc3200,rsalveti/zephyr,galak/zephyr,rsalveti/zephyr,holtmann/zephyr,GiulianoFranchetto/zephyr,holtmann/zephyr,ldts/zephyr,mirzak/zephyr-os,tidyjiang8/zephyr-doc,mbolivar/zephyr,32bitmicro/zephyr,ldts/zephyr,ldts/zephyr,runchip/zephyr-cc3200,kraj/zephyr,rsalveti/zephyr,fractalclone/zephyr-riscv,kraj/zephyr,fbsder/zephyr,bboozzoo/zephyr,tidyjiang8/zephyr-doc,pklazy/zephyr,mirzak/zephyr-os,coldnew/zephyr-project-fork,galak/zephyr,sharronliu/zephyr,holtmann/zephyr,ldts/zephyr,punitvara/zephyr,pklazy/zephyr,mirzak/zephyr-os,runchip/zephyr-cc3200,kraj/zephyr,aceofall/zephyr-iotos,GiulianoFranchetto/zephyr,zephyriot/zephyr,zephyriot/zephyr,kraj/zephyr,32bitmicro/zephyr,ldts/zephyr,rsalveti/zephyr,punitvara/zephyr,erwango/zephyr,zephyriot/zephyr,tidyjiang8/zephyr-doc,sharronliu/zephyr,explora26/zephyr,aceofall/zephyr-iotos,runchip/zephyr-cc3220,jamesonwilliams/zephyr-kernel,bigdinotech/zephyr,holtmann/zephyr,bigdinotech/zephyr,coldnew/zephyr-project-fork,Vudentz/zephyr,zephyrproject-rtos/zephyr,explora26/zephyr,runchip/zephyr-cc3200,punitvara/zephyr,rsalveti/zephyr,bigdinotech/zephyr,Vudentz/zephyr,zephyriot/zephyr,explora26/zephyr,zephyrproject-rtos/zephyr,coldnew/zephyr-project-fork,fbsder/zephyr,bigdinotech/zephyr,erwango/zephyr,jamesonwilliams/zephyr-kernel,fbsder/zephyr