diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-01-26 10:19:19 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-01-26 17:09:44 +0000 |
commit | 9fcee2f77e88f1d7c3f72fca418cdae3e79a6e83 (patch) | |
tree | 1ea77d4b3d6092ea96be32a7e5ceacfc19caaa89 /drivers/gpu/drm/i915/intel_sideband.c | |
parent | 611032bfa71a7634e801142016f2d41485f8638f (diff) | |
download | linux-stable-9fcee2f77e88f1d7c3f72fca418cdae3e79a6e83.tar.gz linux-stable-9fcee2f77e88f1d7c3f72fca418cdae3e79a6e83.tar.bz2 linux-stable-9fcee2f77e88f1d7c3f72fca418cdae3e79a6e83.zip |
drm/i915: Report the failure to write to the punit
The write to the punit may fail, so propagate the error code back to its
callers. Of particular interest are the RPS writes, so add appropriate
user error codes and logging.
v2: Add DEBUG for failed frequency changes during RPS.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170126101919.13211-1-chris@chris-wilson.co.uk
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_sideband.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_sideband.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_sideband.c b/drivers/gpu/drm/i915/intel_sideband.c index 1a840bf92eea..d3d49a09c919 100644 --- a/drivers/gpu/drm/i915/intel_sideband.c +++ b/drivers/gpu/drm/i915/intel_sideband.c @@ -93,14 +93,18 @@ u32 vlv_punit_read(struct drm_i915_private *dev_priv, u32 addr) return val; } -void vlv_punit_write(struct drm_i915_private *dev_priv, u32 addr, u32 val) +int vlv_punit_write(struct drm_i915_private *dev_priv, u32 addr, u32 val) { + int err; + WARN_ON(!mutex_is_locked(&dev_priv->rps.hw_lock)); mutex_lock(&dev_priv->sb_lock); - vlv_sideband_rw(dev_priv, PCI_DEVFN(0, 0), IOSF_PORT_PUNIT, - SB_CRWRDA_NP, addr, &val); + err = vlv_sideband_rw(dev_priv, PCI_DEVFN(0, 0), IOSF_PORT_PUNIT, + SB_CRWRDA_NP, addr, &val); mutex_unlock(&dev_priv->sb_lock); + + return err; } u32 vlv_bunit_read(struct drm_i915_private *dev_priv, u32 reg) |