From: Scott Wood <scottwood@freescale.com>
To: Timur Tabi <timur@freescale.com>
Cc: linuxppc-dev@ozlabs.org, Roland Dreier <rdreier@cisco.com>
Subject: Re: [PATCH v5] introduce macro spin_event_timeout()
Date: Wed, 11 Mar 2009 14:22:39 -0500 [thread overview]
Message-ID: <49B80F7F.30705@freescale.com> (raw)
In-Reply-To: <ed82fe3e0903111214j2072319pe985e6bbecdd1665@mail.gmail.com>
Timur Tabi wrote:
> On Wed, Mar 11, 2009 at 11:51 AM, Scott Wood <scottwood@freescale.com> wrote:
>
>> One jiffy is fine, but two is just too long?
>
> Any number of jiffies is *not* too long if a timeout occurs. However,
> I think even one jiffy is too long if that's the normal condition.
I was under the impression that we were only talking about timeouts, and
that the common case was significantly shorter than that.
> Unfortunately, the driver may not have any choice in some
> circumstances. If the hardware is just too slow to respond, and it
> doesn't provide interrupts, but the code is running in atomic context,
> and the function what else can it do?
Rework the driver to poll from a periodic timer (like we do with PHYs).
However, that's overkill when the hardware is supposed to respond in a
handful of clocks, and preemption is enabled in case the timeout path
does happen.
>> Disallow that, enforced with a call to might_sleep().
>
> I think we need to be able to allow this function to work in atomic
> context. Is jiffies updated in atomic context?
If it's atomic because preemption was disabled, yes -- but even a rare
extended spin in such a context would be bad for hard realtime. If
interrupts are disabled, or the code is executing from a timer interrupt
(or possibly other interrupts depending on the hardware and its priority
scheme), no.
>> Alternatively, do something with get_cycles(), and have some sort of #define
>> by which arches can say if get_cycles actually works. In the absence of a
>> working get_cycles() or equivalent, timeouts with interrupts disabled aren't
>> going to happen whether we abstract it with a macro or not.
>
> I think I can live with that.
Another option is to use udelay() on platforms without a working
get_cycles().
-Scott
next prev parent reply other threads:[~2009-03-11 19:22 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-10 22:11 [PATCH v5] introduce macro spin_event_timeout() Timur Tabi
2009-03-10 22:33 ` Scott Wood
2009-03-10 22:37 ` Josh Boyer
2009-03-10 22:58 ` Scott Wood
2009-03-11 0:32 ` Josh Boyer
2009-03-10 23:59 ` Benjamin Herrenschmidt
2009-03-11 0:22 ` Timur Tabi
2009-03-11 0:24 ` Benjamin Herrenschmidt
2009-03-11 17:10 ` Grant Likely
2009-03-11 21:49 ` Benjamin Herrenschmidt
2009-03-11 21:54 ` Timur Tabi
2009-03-11 22:49 ` Scott Wood
2009-03-11 5:09 ` Roland Dreier
2009-03-11 16:31 ` Timur Tabi
2009-03-11 16:51 ` Scott Wood
2009-03-11 19:14 ` Timur Tabi
2009-03-11 19:22 ` Scott Wood [this message]
2009-03-11 20:45 ` Timur Tabi
2009-03-11 21:00 ` Scott Wood
2009-03-11 21:02 ` Timur Tabi
2009-03-11 21:03 ` Scott Wood
2009-03-11 0:44 ` Josh Boyer
2009-03-10 23:58 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49B80F7F.30705@freescale.com \
--to=scottwood@freescale.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=rdreier@cisco.com \
--cc=timur@freescale.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.