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


Groups > linux.kernel > #1435503

Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS

From Doug Anderson <dianders@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS
Date 2016-07-01 19:10 +0200
Message-ID <rQa70-Tn-37@gated-at.bofh.it> (permalink)
References <rPBiV-4y7-3@gated-at.bofh.it> <rPYpb-24z-17@gated-at.bofh.it> <rQ1ZM-4iE-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

On Fri, Jul 1, 2016 at 1:21 AM, Mark Brown <broonie@kernel.org> wrote:
> On Thu, Jun 30, 2016 at 09:23:26PM -0700, Doug Anderson wrote:
>
>> Also, something doesn't seem terribly robust about this, buy maybe I'm
>> being paranoid.  If something happens where the timer hasn't fired
>> quickly enough then you might not know that you need to assert the
>> wakeup, right?  I don't think there's a 100% guarantee that a timer
>> will fire and finish running within a certain period of time, is
>> there?
>
> No, or at least a minimum bound on accuracy - you'd need to set the
> timer for something lower than the actual limit.

I'm curious why you you need a timer at all.  Can't you just keep
track of the jiffies that you last sent and do subtraction?  ...or you
could get even more accurate and use a ktime_t.  That avoids a whole
lot of synchronization / locking issues too...

Also: presumably you'll need to make sure that there's some margin in
this whole thing.  I'd imagine that if the timeout is 10000
nanoseconds and you do the calculation and you last sent 9999
nanoseconds ago then you might decide that the other side isn't asleep
yet.  ...but by the time the transfer starts it might be asleep...

-Doug

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/4] spi: Add option to wake a device by toggling CS apronin@chromium.org - 2016-06-30 06:00 +0200
  [PATCH 4/4] spi: Document option to insert delay between transactions apronin@chromium.org - 2016-06-30 06:00 +0200
    Re: [PATCH 4/4] spi: Document option to insert delay between transactions Geert Uytterhoeven <geert@linux-m68k.org> - 2016-06-30 09:30 +0200
      Re: [PATCH 4/4] spi: Document option to insert delay between transactions Doug Anderson <dianders@chromium.org> - 2016-07-01 06:50 +0200
  Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS Doug Anderson <dianders@chromium.org> - 2016-07-01 06:40 +0200
    Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS Mark Brown <broonie@kernel.org> - 2016-07-01 10:30 +0200
      Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS Doug Anderson <dianders@chromium.org> - 2016-07-01 19:10 +0200
        Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS Mark Brown <broonie@kernel.org> - 2016-07-01 19:20 +0200
          Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS Andrey Pronin <apronin@chromium.org> - 2016-07-02 04:10 +0200
  Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS Mark Brown <broonie@kernel.org> - 2016-07-01 10:30 +0200
    Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS Andrey Pronin <apronin@chromium.org> - 2016-07-02 03:50 +0200

csiph-web