zephyr/subsys/usb
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
..
class usb: cdc_acm: call the IRQ callback from the system work queue 2019-01-09 07:47:43 -06:00
CMakeLists.txt usb: osdesc: Add MS OS Descriptors version 1 support 2018-07-12 23:10:22 -04:00
Kconfig usb: add SoF event 2018-11-23 09:18:41 -05:00
bos.c logging: Fix errors in log usage 2018-11-10 12:38:29 -05:00
os_desc.c logging: Fix errors in log usage 2018-11-10 12:38:29 -05:00
os_desc.h usb: osdesc: Use definition for string descriptor index 2018-07-12 23:10:22 -04:00
usb_descriptor.c misra-c: Add 'U' to unsigned variable assignments in subsys/ 2018-12-04 22:51:56 -05:00
usb_descriptor.h usb: set SN string descriptor at runtime 2018-07-16 17:20:58 +02:00
usb_device.c misra-c: Add 'U' to unsigned variable assignments in subsys/ 2018-12-04 22:51:56 -05:00