[PATCH 2/2] spi: add support for generic linux,use-rt-queue flag

Matthias Schiffer matthias.schiffer at ew.tq-group.com
Fri Jun 2 04:52:01 PDT 2023


Instead of requiring per-driver support to handle the message queue with
realtime priority, add handling for a linux,use-rt-queue DT flag to the
generic SPI controller initialization.

Signed-off-by: Matthias Schiffer <matthias.schiffer at ew.tq-group.com>
---
 drivers/spi/spi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 9291b2a0e8871..f069f1aef5378 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -3185,6 +3185,11 @@ int spi_register_controller(struct spi_controller *ctlr)
 		ctlr->mode_bits |= SPI_CS_HIGH;
 	}
 
+	/* Run message pump with realtime priority */
+	if (ctlr->dev.of_node &&
+	    of_property_read_bool(ctlr->dev.of_node, "linux,use-rt-queue"))
+		ctlr->rt = true;
+
 	/*
 	 * Even if it's just one always-selected device, there must
 	 * be at least one chipselect.
-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/




More information about the linux-arm-kernel mailing list