zephyr/drivers
Marcin Niestroj 956923f8e5 drivers: wifi: esp: schedule each RX packet on separate work
So far a dedicated FIFO was used for all RX packets, which was consumed
in single submitted work. This work was also responsible for closing
socket and notifying uppper network layers if some errors occurred
previously or socket was simply closed by peer. There is however a
potential race condition in scenario described below:

  esp_rx thread             | esp_workq thread
  --------------------------|-----------------------------
                            | ---- esp_recv_work ----
                            | handle RX packets from FIFO
                            |
  ---- on_cmd_ipd ----      |
  put new RX packet to FIFO |
  ---- on_cmd_ipd ----      |
                            |
  ---- on_cmd_closed ----   |
  mark socket as closed     |
  ---- on_cmd_closed ----   |
                            |
                            | handle close
                            | ---- esp_recv_work ----

In this case we assume that esp_workq was preempted just after
processing all RX packets from FIFO and before checking if socket was
closed. In such scenario RX packet put to FIFO just before doing close
is going to be unhandled, so application layer will miss part of the
data.

Change the way RX packets are scheduled to workqueue, by using the
already available net_pkt->work objects (used for example in native TCP
stack). Create a separate work for closing connection. As a result all
RX packets and close handlers are on the same queue and there is no risk
of handling close events before handling all previously received data.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-01-22 12:02:10 +01:00
..
adc device: Remove DEVICE_DT_DECLARE / DEVICE_DT_INST_DECLARE 2021-01-15 07:16:21 -06:00
audio audio: intel_dmic: convert to use devicetree 2021-01-05 12:08:51 -06:00
bluetooth bluetooth: hci: rpmsg: Use RPMsg Service 2021-01-19 22:07:09 +01:00
can drivers: can: flexcan: Fix incorrect timing. 2021-01-12 09:34:45 -06:00
clock_control drivers/clock_control: stm32: Add AHB3 bus support 2021-01-15 10:29:30 -05:00
console drivers: console: Convert DEVICE_AND_API_INIT to DEVICE_DEFINE 2020-12-18 13:25:22 -06:00
counter device: Remove DEVICE_DT_DECLARE / DEVICE_DT_INST_DECLARE 2021-01-15 07:16:21 -06:00
crypto drivers: crypto_nrf_ecb: Convert to use devicetree 2021-01-13 12:57:13 +01:00
dac drivers: dac: Convert drivers to new DT device macros 2020-12-15 08:04:04 -06:00
debug debug: tracing: Add Segger RTT and SystemView linker section options 2020-11-20 12:54:09 -06:00
display drivers: display: Added Sharp memory display drivers. 2021-01-21 17:26:37 +01:00
dma drivers: dma: Add iProc PAXDMA driver 2021-01-18 16:58:55 -05:00
ec_host_cmd_periph drivers: ec_host_cmd_periph: Convert drivers to new DT device macros 2020-12-15 15:17:59 -06:00
edac edac: Remove magic numbers 2021-01-21 08:34:07 -05:00
eeprom drivers: eeprom: Convert drivers to new DT device macros 2020-12-16 12:18:59 -05:00
entropy device: Remove DEVICE_DT_DECLARE / DEVICE_DT_INST_DECLARE 2021-01-15 07:16:21 -06:00
espi emul: espi: Add support for eSPI emulators 2021-01-20 17:49:19 -05:00
ethernet drivers: ethernet: Verify returned value from net_if_set_link_addr 2021-01-20 13:54:32 +02:00
flash drivers: flash: nrf_qspi: support JESD216 API 2021-01-18 16:58:09 -05:00
gpio drivers: gpio: Add Cypress PSoC-6 gpio driver 2021-01-21 17:33:11 +01:00
hwinfo drivers: hwinfo: stm32: use generic LL headers 2020-11-30 15:50:03 +01:00
i2c drivers: i2c_mchp_xec: Set Default Configuration 2021-01-20 14:16:27 -05:00
i2s i2s: cavs: Fix build issues with driver 2021-01-20 09:13:29 -06:00
ieee802154 drivers: ieee802154_nrf5: Allocate net_pkt from correct pool 2021-01-21 21:27:14 +02:00
interrupt_controller device: Remove DEVICE_DT_DECLARE / DEVICE_DT_INST_DECLARE 2021-01-15 07:16:21 -06:00
ipm device: Remove DEVICE_DT_DECLARE / DEVICE_DT_INST_DECLARE 2021-01-15 07:16:21 -06:00
kscan device: Remove DEVICE_DT_DECLARE / DEVICE_DT_INST_DECLARE 2021-01-15 07:16:21 -06:00
led drivers: led: ht16k33: fix a typo 2021-01-15 11:38:39 -05:00
led_strip drivers: led_strip: Convert drivers to new DT device macros 2020-12-16 11:10:08 -06:00
lora drivers: lora: Convert drivers to new DT device macros 2020-12-15 15:17:59 -06:00
memc drivers: memc: Convert drivers to new DT device macros 2020-12-18 07:53:15 -06:00
modem drivers: modem: ublox-sara-r4: remove redundant wait after sendto 2021-01-15 12:41:25 +02:00
net net: ppp: Avoid wrapping each byte in muxing headers 2020-10-19 18:29:02 +02:00
neural_net neural_net: intel_gna: convert driver to use device-tree 2021-01-06 05:59:21 -06:00
pcie device: Remove DEVICE_DT_DECLARE / DEVICE_DT_INST_DECLARE 2021-01-15 07:16:21 -06:00
peci drivers: peci: Convert drivers to new DT device macros 2020-12-15 15:17:59 -06:00
pinmux driver: gpio: add 1p8v level detection support in npcx series. 2021-01-18 19:09:34 +01:00
ps2 drivers: ps2: Convert drivers to new DT device macros 2020-12-15 15:17:59 -06:00
psci drivers: PSCI: Add driver and subsystem 2021-01-18 19:06:53 +01:00
ptp_clock device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
pwm drivers: pwm: add driver for the NXP Kinetis Pulse Width Timer (PWT) 2021-01-20 08:05:57 -06:00
regulator drivers: Convert to use new DEVICE_DT_INST_* macros 2020-12-09 14:06:48 -06:00
sensor drivers/sensor: iis2dlpc: Add multi-instance support 2021-01-21 16:49:55 -05:00
serial drivers/apbuart: add TX FIFO interrupt support 2021-01-21 15:53:03 -05:00
spi drivers: spi: cc13xx_cc26xx: Fix compile error 2020-12-11 03:34:50 -06:00
timer timer: TICKLESS_CAPABLE is now without prompt 2021-01-21 22:51:19 -05:00
usb drivers: usb_dc_sam: get the maximum speed from DT as enum 2021-01-10 18:11:37 -05:00
video drivers: video: ov7725: add sensor driver for ov7725 2021-01-06 08:33:38 -06:00
virtualization drivers/virtualization: Make ivshmem driver userspace ready 2020-12-16 18:47:35 -05:00
watchdog drivers: wdt: add watchdog driver support for NPCX7 series. 2021-01-15 11:27:10 -05:00
wifi drivers: wifi: esp: schedule each RX packet on separate work 2021-01-22 12:02:10 +01:00
CMakeLists.txt edac: Add Zephyr EDAC configuration 2021-01-21 08:34:07 -05:00
Kconfig edac: Add Zephyr EDAC configuration 2021-01-21 08:34:07 -05:00