[Intel-gfx] [PATCH] drm/i915: Busy-spin wait_for condition in atomic contexts

Chris Wilson chris at chris-wilson.co.uk
Fri Mar 25 09:34:46 CET 2011

On Thu, 24 Mar 2011 17:38:32 -0700, Keith Packard <keithp at keithp.com> wrote:
> On Thu, 24 Mar 2011 19:55:59 +0000, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> > -		if (W && !in_dbg_master()) msleep(W);			\
> > +		if (W && !(in_dbg_master() || in_atomic())) msleep(W);  \
> If the MSLEEP macro were ever used, would it need the same fix?

Not yet. There are places where we should be using it though I think, It
just requires inspecting each of the callpaths and seeing if we might be
called from an atomic modeswitch.
> wait_for_atomic is never used, so perhaps the _wait_for macro should
> just be renamed wait_for and the W hard-coded to 1.

A bit of over-engineering. I want to propose these as part of the core
kernel interface and so tried to cover all the bases. But I'm not sure if
they are actually clean enough to pass muster nor if anybody else is
interested in them.
> As a simple fix though,
> Reviewed-by: Keith Packard <keithp at keithp.com>

Indeed, a fix should limit itself to the bug described. Every else is an

Chris Wilson, Intel Open Source Technology Centre

More information about the Intel-gfx mailing list