micropython/extmod
Jim Mussared 47d02b3104 extmod/nimble: Improve the flow control for l2cap recv path.
If the _IRQ_L2CAP_RECV handler does the actual consumption of the incoming
data (i.e. via l2cap_recvinto), rather than setting a flag for
non-scheduler-context to handle it later, then two things can happen:

- It can starve the VM (i.e. the scheduled task never terminates).  This is
  because calling l2cap_recvinto will empty the rx buffer, which will grant
  more credits to the channel (an HCI command), meaning more data can
  arrive.  This means that the loop in hal_uart.c that keeps reading HCI
  data from the uart and executing NimBLE events as they are created will
  not terminate, preventing other VM code from running.

- There's no flow control (i.e. data will arrive too quickly).  The channel
  shouldn't be given credits until after we return from scheduler context.

It's preferable that no work is done in scheduler/IRQ context.  But to
prevent this being a problem this commit changes l2cap_recvinto so that if
it is called in IRQ context, and the Python handler empties the rx buffer,
then don't grant credits until the Python handler is complete.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-01-30 13:22:40 +11:00
..
axtls-include
btstack extmod/modbluetooth: Add gap_pair(conn_handle) func to intiate pairing. 2020-12-02 14:41:26 +11:00
crypto-algorithms
lwip-include
nimble extmod/nimble: Improve the flow control for l2cap recv path. 2021-01-30 13:22:40 +11:00
re1.5 py, extmod: Introduce and use MP_FALLTHROUGH macro. 2020-10-22 11:53:16 +02:00
uasyncio extmod/uasyncio: Fix cancellation handling of wait_for. 2020-12-02 12:31:37 +11:00
uzlib
webrepl
extmod.mk
machine_i2c.c extmod/machine_i2c: Add init protocol method for generic I2C bindings. 2020-11-23 19:45:04 +11:00
machine_i2c.h extmod/machine_i2c: Add init protocol method for generic I2C bindings. 2020-11-23 19:45:04 +11:00
machine_mem.c extmod/machine_mem: Only allow integers in machine.memX subscript. 2020-11-13 11:13:37 +11:00
machine_mem.h
machine_pinbase.c
machine_pinbase.h
machine_pulse.c
machine_pulse.h
machine_signal.c
machine_signal.h
machine_spi.c
machine_spi.h
misc.h
modbluetooth.c extmod/modbluetooth: Add ble.hci_cmd(ogf, ocf, req, resp) function. 2021-01-22 18:15:12 +11:00
modbluetooth.h extmod/modbluetooth: Add ble.hci_cmd(ogf, ocf, req, resp) function. 2021-01-22 18:15:12 +11:00
modbtree.c
modframebuf.c extmod/modframebuf: Change int to unsigned int in format methods args. 2021-01-29 23:57:10 +11:00
modlwip.c
modonewire.c extmod/modonewire: Use pin_od_high/pin_od_low instead of pin_write. 2021-01-29 23:57:10 +11:00
moduasyncio.c extmod/uasyncio: Add Task.done() method. 2020-12-02 12:07:06 +11:00
modubinascii.c extmod/modubinascii: Update code, docs for hexlify now CPython has sep. 2020-12-14 14:35:29 +11:00
moducryptolib.c
moductypes.c extmod/moductypes: Fix storing to (U)INT64 arrays on 32-bit archs. 2020-11-11 22:18:24 +11:00
moduhashlib.c
moduheapq.c
modujson.c
modurandom.c extmod/modurandom: Support urandom.seed() without an argument. 2020-10-29 14:15:16 +11:00
modure.c
moduselect.c
modussl_axtls.c
modussl_mbedtls.c
modutimeq.c
moduwebsocket.c
moduwebsocket.h
moduzlib.c
modwebrepl.c
mpbthci.c
mpbthci.h
network_cyw43.c
network_cyw43.h
uos_dupterm.c
utime_mphal.c
utime_mphal.h
vfs.c extmod/vfs: Check block 0 and 1 when auto-detecting littlefs. 2021-01-29 15:02:55 +11:00
vfs.h
vfs_blockdev.c
vfs_fat.c
vfs_fat.h
vfs_fat_diskio.c
vfs_fat_file.c
vfs_lfs.c
vfs_lfs.h
vfs_lfsx.c extmod/vfs_lfs: Support mounting LFS filesystems in read-only mode. 2020-10-29 11:43:52 +11:00
vfs_lfsx_file.c
vfs_posix.c
vfs_posix.h
vfs_posix_file.c
vfs_reader.c
virtpin.c
virtpin.h