[PATCH 2/2] spi: bcm2835: Allow platform to set realtime priority

Lukas Wunner lukas at wunner.de
Thu Mar 23 04:24:03 PDT 2017


On Thu, Mar 23, 2017 at 11:51:33AM +0100, Alexander Stein wrote:
> interesting, but why is this property specific to bcm2835 when the priority is 
> used in generic code only?

Well, I'd be happy to rework the patches to introduce a generic "rt-prio"
property if that is preferred?  Maybe Mark or some driver maintainers can
chime in?

For pl022, I guess I could let the legacy "pl022,rt" property take
precedence over a generic "rt-prio" property.

Thanks,

Lukas

> 
> Best regards,
> Alexander
> 
> On Thursday 23 March 2017 11:36:45, Lukas Wunner wrote:
> > Revolution Pi (a set of IoT products based on the Raspberry Pi and
> > geared towards industrial usage) uses the bcm2835's SPI master to
> > interface with an IEC 61158 fieldbus, which requires its kworker thread
> > to run at a realtime priority.  To this end, allow the platform to
> > specify the desired priority.
> > 
> > Cc: Mark Brown <broonie at kernel.org>
> > Cc: Stephen Warren <swarren at wwwdotorg.org>
> > Cc: Eric Anholt <eric at anholt.net>
> > Cc: Mathias Duckeck <m.duckeck at kunbus.de>
> > Signed-off-by: Lukas Wunner <lukas at wunner.de>
> > ---
> >  Documentation/devicetree/bindings/spi/brcm,bcm2835-spi.txt | 4 ++++
> >  drivers/spi/spi-bcm2835.c                                  | 2 ++
> >  2 files changed, 6 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/spi/brcm,bcm2835-spi.txt
> > b/Documentation/devicetree/bindings/spi/brcm,bcm2835-spi.txt index
> > f11f295c8450..13ffc2b15e7d 100644
> > --- a/Documentation/devicetree/bindings/spi/brcm,bcm2835-spi.txt
> > +++ b/Documentation/devicetree/bindings/spi/brcm,bcm2835-spi.txt
> > @@ -10,6 +10,10 @@ Required properties:
> >  - interrupts: Should contain interrupt.
> >  - clocks: The clock feeding the SPI controller.
> > 
> > +Optional properties:
> > +- bcm2835,rt_prio: Realtime priority of the message pump to minimize
> > latency +                   on the bus (0..99).
> > +
> >  Example:
> > 
> >  spi at 20204000 {
> > diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
> > index f35cc10772f6..319523686f73 100644
> > --- a/drivers/spi/spi-bcm2835.c
> > +++ b/drivers/spi/spi-bcm2835.c
> > @@ -755,6 +755,8 @@ static int bcm2835_spi_probe(struct platform_device
> > *pdev) master->handle_err = bcm2835_spi_handle_err;
> >  	master->prepare_message = bcm2835_spi_prepare_message;
> >  	master->dev.of_node = pdev->dev.of_node;
> > +	of_property_read_u32(pdev->dev.of_node,
> > +			     "bcm2835,rt_prio", &master->rt_prio);
> > 
> >  	bs = spi_master_get_devdata(master);
> 



More information about the linux-rpi-kernel mailing list