[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160718121427.GS30372@sirena.org.uk>
Date: Mon, 18 Jul 2016 13:14:27 +0100
From: Mark Brown <broonie@...nel.org>
To: Geert Uytterhoeven <geert+renesas@...der.be>
Cc: Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Magnus Damm <magnus.damm@...il.com>,
Hisashi Nakamura <hisashi.nakamura.ak@...esas.com>,
Hiromitsu Yamasaki <hiromitsu.yamasaki.ym@...esas.com>,
linux-spi@...r.kernel.org, devicetree@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH/RFC 4/6] spi: slave: Add SPI slave handler reporting boot
up time
On Wed, Jun 22, 2016 at 03:42:07PM +0200, Geert Uytterhoeven wrote:
> Add an SPI slave handler responding with the time of reception of the
> last SPI message.
>
> This can be used by an external microcontroller as a dead man's switch.
The subject says boot up time, this says time of reception of the last
message. Which is it?
> +static int spi_slave_time_send(struct spi_device *spi)
> +{
> + __be32 msg[2];
> + u32 rem_ns;
> + u64 ts;
> +
> + ts = local_clock();
> + rem_ns = do_div(ts, 1000000000) / 1000;
> +
> + msg[0] = cpu_to_be32(ts);
> + msg[1] = cpu_to_be32(rem_ns);
> +
> + return spi_write(spi, &msg, sizeof(msg));
> +}
Looks like uptime which is a third thing.
> +static int spi_slave_time_remove(struct spi_device *spi)
> +{
> + struct spi_slave_time_priv *priv = spi_get_drvdata(spi);
> +
> + /* FIXME Doesn't work, as spi_write() is blocked on a completion */
> + kthread_stop(priv->thread);
spi_async()? Still no cancellation on the actual operation but it
pushes it more inside the framework.
Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)
Powered by blists - more mailing lists