zephyr/subsys/usb/class
Aurelien Jarno 7f334c84d6 usb: cdc_acm: call the IRQ callback from the system work queue
The IRQ callback function of the USB CDC ACM driver can currently be
called from:
- the USB thread when a bulk in or a bulk out interrupt has been
  triggered
- the thread calling cdc_acm_irq_rx_enable or cdc_acm_irq_tx_enable when
  enabling the interrupt fires an irq (ie if there is data to read or if
  there is no pending data to send)

This causes some issues with at least the shell uart backend, as the
IRQ callback function ends up being called twice concurrently in case a
USB driver sends the requested data almost instantaneously. This is the
case for example of the USB nRF driver which uses DMA. In turn this
cause ring_buf_item_get to be called concurrently, leading to data
corruption:

  uart:~$ help
  Please press the <Tab> button to see all available commandands.
  You can also use the e <Tab> button to prompt or auto-coomplelete all
  commands or its subcommands.
  You can try toto call commands with <-h> or <--help> parameter for
  more informatation.
  uart:~$

Fix that by always calling the IRQ callback function through the system
work queue.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-01-09 07:47:43 -06:00
..
hid usb: hid: boot protocol 2018-12-19 07:36:18 -06:00
netusb net/pkt: Remove parameters to "reserve" some headroom 2018-12-14 14:16:37 +01:00
bluetooth.c usb: add SoF event 2018-11-23 09:18:41 -05:00
cdc_acm.c usb: cdc_acm: call the IRQ callback from the system work queue 2019-01-09 07:47:43 -06:00
CMakeLists.txt subsys: usb: class: add loopback function 2018-07-06 11:56:16 -05:00
Kconfig usb: cdc_acm: select SERIAL_HAS_DRIVER and SERIAL_SUPPORT_INTERRUPT 2018-12-05 08:53:15 -05:00
loopback.c logging: Fix errors in log usage 2018-11-10 12:38:29 -05:00
mass_storage.c misra-c: Add 'U' to unsigned variable assignments in subsys/ 2018-12-04 22:51:56 -05:00
usb_dfu.c usb: class: dfu: Add a worker thread to flash data from usb to flash 2018-12-30 16:24:33 -05:00