Skip to content

Commit 9ebaf6b

Browse files
tmon-nordicrlubos
authored andcommitted
[nrf fromtree] usb: device_next: msc: Implement double buffering
Double buffering make it possible to significantly increase the transfer rates by avoiding idle states. With two SCSI buffers, one buffer can be used by disk subsystem while the other is being used by UDC (ideally with DMA). Signed-off-by: Tomasz Moń <[email protected]> (cherry picked from commit 1243aba)
1 parent 8321de5 commit 9ebaf6b

File tree

2 files changed

+186
-60
lines changed

2 files changed

+186
-60
lines changed

subsys/usb/device_next/class/Kconfig.msc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ config USBD_MSC_SCSI_BUFFER_SIZE
3030
Buffer size must be able to hold at least one sector. All LUNs within
3131
single instance share the SCSI buffer.
3232

33+
config USBD_MSC_DOUBLE_BUFFERING
34+
bool "SCSI double buffering"
35+
default y
36+
help
37+
Allocate two SCSI buffers instead of one to increase throughput by
38+
using one buffer by disk subsystem and one by USB at the same time.
39+
3340
module = USBD_MSC
3441
module-str = usbd msc
3542
default-count = 1

0 commit comments

Comments
 (0)