Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1445427 > unrolled thread

Re: [PATCH/RFC 4/6] spi: slave: Add SPI slave handler reporting boot up time

Started byMark Brown <broonie@kernel.org>
First post2016-07-18 14:20 +0200
Last post2016-07-18 14:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH/RFC 4/6] spi: slave: Add SPI slave handler reporting boot  up time Mark Brown <broonie@kernel.org> - 2016-07-18 14:20 +0200

#1445427 — Re: [PATCH/RFC 4/6] spi: slave: Add SPI slave handler reporting boot up time

FromMark Brown <broonie@kernel.org>
Date2016-07-18 14:20 +0200
SubjectRe: [PATCH/RFC 4/6] spi: slave: Add SPI slave handler reporting boot up time
Message-ID<rWfGF-62e-25@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

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.

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web