From fc9753acb75a9f6442367a467fa56ddc15aad683 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 23 Oct 2012 11:48:45 +0100 Subject: [PATCH] sdvo --- drivers/gpu/drm/i915/intel_sdvo.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 30f1752..822cd12 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c @@ -523,13 +523,22 @@ static bool intel_sdvo_read_response(struct intel_sdvo *intel_sdvo, &status)) goto log_fail; - while (status == SDVO_CMD_STATUS_PENDING && retry--) { - udelay(15); - if (!intel_sdvo_read_byte(intel_sdvo, - SDVO_I2C_CMD_STATUS, - &status)) - goto log_fail; - } + do { + int quick = 5; + + while (status == SDVO_CMD_STATUS_PENDING && quick--) { + udelay(15); + if (!intel_sdvo_read_byte(intel_sdvo, + SDVO_I2C_CMD_STATUS, + &status)) + goto log_fail; + } + + if (status != SDVO_CMD_STATUS_PENDING || --retry == 0) + break; + + msleep(15); + } while (1); if (status <= SDVO_CMD_STATUS_SCALING_NOT_SUPP) DRM_LOG_KMS("(%s)", cmd_status_names[status]); -- 1.7.10.4