diff options
| author | Eli Billauer <eli.billauer@gmail.com> | 2026-10-09 09:45:51 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-10-13 16:31:16 +0200 |
| commit | 305876de50cc691ffdcb6aa7fd9805c8e6ff789e (patch) | |
| tree | 22a5c00b2c3663b3174a268daff8748f6e9fb1b3 /tools/lib/python/kdoc/python_version.py | |
| parent | fe26c195c265c033e474d015061a0183c7a02193 (diff) | |
char: xillybus: Improve control of execution flow with mutexes
This commit addresses two issues by using mutexes:
(1) Add a mutex to protect the fifo_buf_order global variable. The
purpose of this variable is avoid repeated failed calls to
__get_free_pages() for allocating FIFO memory, when the chunk
size was too big. However, if two drivers are initialized at the
same time, fifo_init() may run in parallel, and fifo_buf_order
may be reduced too much. This is a far-fetched scenario, now
completely prevented by fifo_buf_order_mutex.
(2) setup_channels() acquires process_in_mutex to prevent
process_bulk_in() from accessing the xillyusb_dev struct. With
correctly working hardware, process_bulk_in() is never called while
setup_channels() runs, because the device has no reason to send data
in that phase. The mutex ensures that process_bulk_in() does not
touch the members that setup_channels() alters.
There is no similar protection for data flow in the other direction,
because during the setup process, the only outbound data is the
BULK endpoint used for commands, and it remains untouched after its
initial setup.
Assisted-by: Deepseek:v4-pro Kimi:K2.6 ChatGPT:GPT-5.5 Claude:Sonnet-4.6
Assisted-by: Sashiko-0.2.5:gemini-3.1-pro-preview
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Link: https://patch.msgid.link/20261009074557.19996-2-eli.billauer@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
