From: Imre Deak <imre.deak@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: fix DP AUX errors due to false timeouts when using wait_event_timeout
Date: Thu, 02 May 2013 12:33:21 +0300 [thread overview]
Message-ID: <1367487201.3969.3.camel@ideak-mobl> (raw)
In-Reply-To: <20130502091710.GC13946@cantiga.alporthouse.com>
On Thu, 2013-05-02 at 10:17 +0100, Chris Wilson wrote:
> On Thu, May 02, 2013 at 12:00:03PM +0300, Imre Deak wrote:
> > Due to possible scheduling latencies wait_event_timeout doesn't
> > guarantee a non-zero return value, even if the condition becomes true
> > before the specified timeout expires. Thus we can incorrectly signal a
> > timeout and abort a DP AUX transaction.
> >
> > If wait_event_timeout returns 0, it's guaranteed that at least the
> > specified timeout (minus one jiffies, see below) had passed, so we can
> > fix this by checking the condition explicitly in this case.
> >
> > Also the timeout that wait_event_timeout() is guaranteed to wait if the
> > condition doesn't become true is one less jiffies than what is passed to
> > it as a parameter. This is because the absolute expiration time in
> > schedule_timeout() may be calculated at a moment close to the next
> > scheduling tick, when jiffies is incremented. So make sure we pass always
> > a jiffies value of 2 or greater. Here this makes a difference only for
> > HZ=100.
> >
> > This fixes DP AUX errors I saw during booting on an ILK.
> >
> > This should ideally be fixed in wait_event_timeout(), but that can take
> > a while. Until that's done use this fix as a band-aid.
>
> As we have 3 such vulnerable callsite in our driver alone, perhaps we
> should push for your general fix.
Yes, I've sent a patch for wait_event_timeout() to start the discussion,
I'm not sure how long it will take..
--Imre
prev parent reply other threads:[~2013-05-02 9:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-02 9:00 [PATCH] drm/i915: fix DP AUX errors due to false timeouts when using wait_event_timeout Imre Deak
2013-05-02 9:17 ` Chris Wilson
2013-05-02 9:31 ` Daniel Vetter
2013-05-02 9:33 ` Daniel Vetter
2013-05-02 9:37 ` Imre Deak
2013-05-02 9:33 ` Imre Deak [this message]
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=1367487201.3969.3.camel@ideak-mobl \
--to=imre.deak@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox