From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukas Wunner Subject: Re: [PATCH 2/2] spi: bcm2835: Allow platform to set realtime priority Date: Thu, 23 Mar 2017 12:24:03 +0100 Message-ID: <20170323112403.GA20546@h08.hostsharing.net> References: <1503363fcfb92adfa765d1c1c3e69fc673e72dde.1490264661.git.lukas@wunner.de> <8946695.jF9BQzhoEd@ws-stein> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Mark Brown , linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Mathias Duckeck , Linus Walleij , Stephen Warren , Eric Anholt To: Alexander Stein Return-path: Content-Disposition: inline In-Reply-To: <8946695.jF9BQzhoEd@ws-stein> Sender: linux-spi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: 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 > > Cc: Stephen Warren > > Cc: Eric Anholt > > Cc: Mathias Duckeck > > Signed-off-by: Lukas Wunner > > --- > > 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@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); > -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html