Skip to content

Commit 60bc5a1

Browse files
committed
[squashed] Several topics covered
* Migration to configurable work queue * Due to possible stall of the system_wq work queue SymSPI error recovery might be blocked by some agent, which uses the system_wq as well. * To separate the affected scopes, SymSPI was done configurable on which work queue to use: "SYMSPI_WQ_SYSTEM" - uses as before the global system work queue, "SYMSPI_WQ_SYSTEM_HIGHPRI" - uses high priority system global work queue, "SYMSPI_WQ_PRIVATE" - uses the current SymSPI dedicated workque with high priority. Macro/config name: SYMSPI_QUEUE_MODE -> ["SYMSPI_WQ_SYSTEM", "SYMSPI_WQ_SYSTEM_HIGHPRI" , "SYMSPI_WQ_PRIVATE"] * If it is SymSPI code which causes the stall, it will keep stalling, if other code causes the work queue stall, then this stall will not affect SymSPI in "private" work queue configuration. * Added also a bit of grooming to init and close procedures: they are separated in stages at least for now and symspi_close(...) can consistently continue from the point where symspi_init(...) left. * A bit of logging update * Log level "trace" added. * SymSPI state switches, timer states, ISRs were moved to the trace level, otherwise they make debug info level unusable in a long run cause of too much flood per byte transfered. * A bit less verbose logging. * Increased other side reaction wait timeout * To avoid error recovery for situations when we just we too slow, but function without error. So timeout must trigger the error recovery only when our "sloooow" reaction looks already like something nasty, so error recovery will execute its direct function: to purge/wake-up other side facilities if they got stalled somehow, so the system will keep functioning. * Added configuration options: * other side reaction timeout, * workqueue mode selection. * Added proc info entry to SymSPI * Allows to monitor the SymSPI state and configuration from User Space.
1 parent f3ded68 commit 60bc5a1

File tree

4 files changed

+607
-52
lines changed

4 files changed

+607
-52
lines changed

src/Kconfig

+26
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,29 @@ config BOSCH_SYMSPI_TEST_MODULE
4646
depends on BOSCH_SYMSPI
4747
---help---
4848
This flag enables the SYMSPI test module.
49+
50+
config BOSCH_SYMSPI_THEIR_FLAG_WAIT_TIMEOUT_MSEC
51+
int "Max other side reaction time [ms]"
52+
default 60
53+
range 20 1000
54+
depends on BOSCH_SYMSPI
55+
---help---
56+
Defines how much time we will wait for other side
57+
reaction [ms], before starting the error recovery
58+
sequence
59+
60+
config BOSCH_SYMSPI_WORKQUEUE_MODE
61+
int "SymSPI WQ mode: 0 - system, 1 - system-highprio, 2 - private-highprio"
62+
default 2
63+
range 0 2
64+
depends on BOSCH_SYMSPI
65+
---help---
66+
Defines which workqueue SymSPI should use to process the
67+
incoming data, valid values:
68+
0 - use the global system workqueue,
69+
1 - use the global system high priority workqueue,
70+
2 - use private high priority workqueue,
71+
The higher the value the higher priority an less
72+
dependencies SymSPI data processing will have. Use
73+
higher value when SymSPI processes time-critical information
74+
and shall not be blocked by other system facilities.

src/Makefile

+16
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,19 @@ obj-$(CONFIG_BOSCH_SYMSPI) += symspi.o
1515
ifeq ($(CONFIG_BOSCH_SYMSPI_TEST_MODULE), y)
1616
obj-$(CONFIG_BOSCH_SYMSPI) += symspi_test.o
1717
endif
18+
19+
ifdef CONFIG_BOSCH_SYMSPI_THEIR_FLAG_WAIT_TIMEOUT_MSEC
20+
ccflags-y +=\
21+
-DSYMSPI_THEIR_FLAG_WAIT_TIMEOUT_MSEC=${CONFIG_BOSCH_SYMSPI_THEIR_FLAG_WAIT_TIMEOUT_MSEC}
22+
endif
23+
24+
ifeq (${CONFIG_BOSCH_SYMSPI_WORKQUEUE_MODE}, 0)
25+
ccflags-y +=\
26+
-DSYMSPI_WORKQUEUE_MODE=SYMSPI_WQ_SYSTEM
27+
else ifeq (${CONFIG_BOSCH_SYMSPI_WORKQUEUE_MODE}, 1)
28+
ccflags-y +=\
29+
-DSYMSPI_WORKQUEUE_MODE=SYMSPI_WQ_SYSTEM_HIGHPRI
30+
else ifeq (${CONFIG_BOSCH_SYMSPI_WORKQUEUE_MODE}, 2)
31+
ccflags-y +=\
32+
-DSYMSPI_WORKQUEUE_MODE=SYMSPI_WQ_PRIVATE
33+
endif

0 commit comments

Comments
 (0)