aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni.dodonov@intel.com>2012-06-08 15:43:19 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-06-18 03:57:07 -0400
commit39fb50f6178d7dbd70142b25193d722ebf3f8193 (patch)
treee6dbd47956146d41db3e364108a21021de431da7 /drivers/gpu/drm/i915/intel_display.c
parentaaa377302b2994fcc2c66741b47da33feb489dca (diff)
drm/i915: properly wait for SBI status
Somehow this went unnoticed in the past reviews, but the condition would never timeout properly. This was initially introduced in the v2 of original SBI enabling patch. Highly embarrassing. Note that we now actually time out for the read, which resulted in gcc complaining that we can now return unitialized garbage if that happens. There's not much we can do here because there's not much point in thread -EIO all the way down through these functions. Hence simply shut up the compiler. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com> [danvet: Added note and squashed uninitialized value shut-up into this patch.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 308e1a2967e7..97301621f48a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1350,7 +1350,7 @@ intel_sbi_write(struct drm_i915_private *dev_priv, u16 reg, u32 value)
1350 unsigned long flags; 1350 unsigned long flags;
1351 1351
1352 spin_lock_irqsave(&dev_priv->dpio_lock, flags); 1352 spin_lock_irqsave(&dev_priv->dpio_lock, flags);
1353 if (wait_for((I915_READ(SBI_CTL_STAT) & SBI_READY) == 0, 1353 if (wait_for((I915_READ(SBI_CTL_STAT) & SBI_BUSY) == 0,
1354 100)) { 1354 100)) {
1355 DRM_ERROR("timeout waiting for SBI to become ready\n"); 1355 DRM_ERROR("timeout waiting for SBI to become ready\n");
1356 goto out_unlock; 1356 goto out_unlock;
@@ -1364,7 +1364,7 @@ intel_sbi_write(struct drm_i915_private *dev_priv, u16 reg, u32 value)
1364 SBI_BUSY | 1364 SBI_BUSY |
1365 SBI_CTL_OP_CRWR); 1365 SBI_CTL_OP_CRWR);
1366 1366
1367 if (wait_for((I915_READ(SBI_CTL_STAT) & (SBI_READY | SBI_RESPONSE_SUCCESS)) == 0, 1367 if (wait_for((I915_READ(SBI_CTL_STAT) & (SBI_BUSY | SBI_RESPONSE_FAIL)) == 0,
1368 100)) { 1368 100)) {
1369 DRM_ERROR("timeout waiting for SBI to complete write transaction\n"); 1369 DRM_ERROR("timeout waiting for SBI to complete write transaction\n");
1370 goto out_unlock; 1370 goto out_unlock;
@@ -1378,10 +1378,10 @@ static u32
1378intel_sbi_read(struct drm_i915_private *dev_priv, u16 reg) 1378intel_sbi_read(struct drm_i915_private *dev_priv, u16 reg)
1379{ 1379{
1380 unsigned long flags; 1380 unsigned long flags;
1381 u32 value; 1381 u32 value = 0;
1382 1382
1383 spin_lock_irqsave(&dev_priv->dpio_lock, flags); 1383 spin_lock_irqsave(&dev_priv->dpio_lock, flags);
1384 if (wait_for((I915_READ(SBI_CTL_STAT) & SBI_READY) == 0, 1384 if (wait_for((I915_READ(SBI_CTL_STAT) & SBI_BUSY) == 0,
1385 100)) { 1385 100)) {
1386 DRM_ERROR("timeout waiting for SBI to become ready\n"); 1386 DRM_ERROR("timeout waiting for SBI to become ready\n");
1387 goto out_unlock; 1387 goto out_unlock;
@@ -1393,7 +1393,7 @@ intel_sbi_read(struct drm_i915_private *dev_priv, u16 reg)
1393 SBI_BUSY | 1393 SBI_BUSY |
1394 SBI_CTL_OP_CRRD); 1394 SBI_CTL_OP_CRRD);
1395 1395
1396 if (wait_for((I915_READ(SBI_CTL_STAT) & (SBI_READY | SBI_RESPONSE_SUCCESS)) == 0, 1396 if (wait_for((I915_READ(SBI_CTL_STAT) & (SBI_BUSY | SBI_RESPONSE_FAIL)) == 0,
1397 100)) { 1397 100)) {
1398 DRM_ERROR("timeout waiting for SBI to complete read transaction\n"); 1398 DRM_ERROR("timeout waiting for SBI to complete read transaction\n");
1399 goto out_unlock; 1399 goto out_unlock;