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 extmod/uzlib: Explicitly cast ptr-diff-expr to unsigned. 2019-12-23 00:07:03 +11:00
webrepl all: Rename "sys" module to "usys". 2020-09-04 00:10:24 +10:00
extmod.mk extmod: Disable -Wmissing-field-initializers for lfs2. 2020-10-22 11:47:36 +02:00
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 all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
machine_signal.h
machine_spi.c extmod/machine_spi: Remove "id" arg in SoftSPI constructor. 2020-10-01 12:57:10 +10:00
machine_spi.h ports: Support legacy soft I2C/SPI construction via id=-1 arg. 2020-10-01 12:57:10 +10:00
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 extmod/modbtree: Retain reference to underlying stream so it's not GC'd. 2020-05-02 16:08:04 +10:00
modframebuf.c extmod/modframebuf: Change int to unsigned int in format methods args. 2021-01-29 23:57:10 +11:00
modlwip.c extmod/modlwip: Fix error return for TCP recv when not connected. 2020-08-30 13:20:51 +10:00
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 all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
moductypes.c extmod/moductypes: Fix storing to (U)INT64 arrays on 32-bit archs. 2020-11-11 22:18:24 +11:00
moduhashlib.c all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
moduheapq.c all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
modujson.c all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
modurandom.c extmod/modurandom: Support urandom.seed() without an argument. 2020-10-29 14:15:16 +11:00
modure.c extmod/modure: Allow \\ in re.sub replacements. 2020-09-30 23:18:34 +10:00
moduselect.c all: Fix implicit floating point promotion. 2020-04-18 22:36:14 +10:00
modussl_axtls.c extmod/modussl_axtls: Reduce size of code that makes exception. 2020-09-11 10:22:19 +10:00
modussl_mbedtls.c extmod/modussl_mbedtls: Integrate shorter error strings. 2020-07-21 00:31:05 +10:00
modutimeq.c all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
moduwebsocket.c all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
moduwebsocket.h
moduzlib.c all: Use MP_ERROR_TEXT for all error messages. 2020-04-05 15:02:06 +10:00
modwebrepl.c all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
mpbthci.c extmod/modbluetooth: Refactor stack/hci/driver/port bindings. 2020-09-08 11:41:31 +10:00
mpbthci.h extmod/modbluetooth: Refactor stack/hci/driver/port bindings. 2020-09-08 11:41:31 +10:00
network_cyw43.c all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
network_cyw43.h
uos_dupterm.c all: Use MP_ERROR_TEXT for all error messages. 2020-04-05 15:02:06 +10:00
utime_mphal.c extmod/utime_mphal: Add generic utime.time_ns() function. 2020-10-01 14:20:42 +10:00
utime_mphal.h extmod/utime_mphal: Add generic utime.time_ns() function. 2020-10-01 14:20:42 +10:00
vfs.c extmod/vfs: Check block 0 and 1 when auto-detecting littlefs. 2021-01-29 15:02:55 +11:00
vfs.h extmod/vfs: Factor out vfs mount-and-chdir helper from stm32. 2020-03-11 14:24:26 +11:00
vfs_blockdev.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
vfs_fat.c all: Rename absolute time-based functions to include "epoch". 2020-09-18 17:20:34 +10:00
vfs_fat.h extmod: Factor out block-device struct to make independent of fatfs. 2019-10-29 12:12:37 +11:00
vfs_fat_diskio.c tools/uncrustify: Enable more opts to remove space between func and '('. 2020-06-19 22:07:32 +10:00
vfs_fat_file.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
vfs_lfs.c py, extmod: Add explicit initializers for default values. 2020-10-22 11:47:36 +02:00
vfs_lfs.h extmod: Add VFS littlefs bindings. 2019-10-29 14:17:29 +11:00
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 extmod/vfs_lfs: Add mtime support to littlefs files. 2020-08-25 17:35:19 +10:00
vfs_posix.c extmod/vfs: Support larger integer range in VFS stat time fields. 2020-09-01 12:36:28 +10:00
vfs_posix.h
vfs_posix_file.c all: Use MP_ERROR_TEXT for all error messages. 2020-04-05 15:02:06 +10:00
vfs_reader.c extmod/vfs_reader: Fix mp_reader_new_file to open file in "rb" mode. 2020-08-12 23:40:50 +10:00
virtpin.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
virtpin.h