Re: [PATCH] drm/i915: fix comment referencing imaginary functions

Chris Wilson
2016-10-25T11:39:56Z

On Tue, Oct 25, 2016 at 12:29:41PM +0100, Matthew Auld wrote:
> > These are untraced mmio-accessors that are only valid to be used inside
> > critical sections inside IRQ handlers where forcewake is explicitly
> > controlled.
> >
> > Think twice, and think again, before using these.
> >
> > Those possibly should be used between:
> >
> > spin_lock_irq(&dev_priv->uncore.lock);
> > intel_uncore_forcewake_get();
> >
> > and
> >
> > intel_uncore_forcewake_put();
> > spin_unlock_irq(&dev_priv->uncore.lock);
> >
> >
> > Note: some registers may not need forcewake held, so
> > intel_uncore_forcewake_{get,put} can be omitted.
> >
> > Code may be serialised by different lock, so immediate
> > spin_{lock,unlock}_irq() may not be necessary.
> Maybe roll that up into a new patch? Assuming Chris is happy...
>

s/inside IRQ handlers/, such as inside IRQ handlers,/

As an example, these accessors can possibly be used between:

can be omitted, see intel_uncore_forcewake_for_reg().

Certain architectures will die if the same cacheline is concurrently
accessed by different clients (e.g. Ivybridge). Access to registers
should therefore generally be serialised, by either the
dev_priv->uncore.lock or a more localised lock guarding all access to
that bank of registers.

--
Chris Wilson, Intel Open Source Technology Centre