All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brad Campbell <brad@fnarfbargle.com>
To: alexdeucher@gmail.com
Cc: airlied@redhat.com, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Radeon regression fix
Date: Thu, 29 Sep 2011 22:21:08 +0800	[thread overview]
Message-ID: <4E847ED4.5090703@fnarfbargle.com> (raw)

This patch fixes a regression introduced between 2.6.39 & 3.1-rc1 
whereby the displayport AUX channel stopped re-trying commands that 
elicited a DEFER response.

Signed-off-by: Brad Campbell <brad@fnarfbargle.com>

diff --git a/drivers/gpu/drm/radeon/atombios_dp.c 
b/drivers/gpu/drm/radeon/atombios_dp.c
index 7ad43c6..b8450f4 100644
--- a/drivers/gpu/drm/radeon/atombios_dp.c
+++ b/drivers/gpu/drm/radeon/atombios_dp.c
@@ -60,11 +60,13 @@ static int radeon_process_aux_ch(struct 
radeon_i2c_chan *chan,
  	int index = GetIndexIntoMasterTable(COMMAND, 
ProcessAuxChannelTransaction);
  	unsigned char *base;
  	int recv_bytes;
+	int retry_count = 0;

  	memset(&args, 0, sizeof(args));

  	base = (unsigned char *)rdev->mode_info.atom_context->scratch;

+retry:
  	memcpy(base, send, send_bytes);

  	args.v1.lpAuxRequest = 0;
@@ -79,6 +81,16 @@ static int radeon_process_aux_ch(struct 
radeon_i2c_chan *chan,

  	*ack = args.v1.ucReplyStatus;

+	/* defer */
+	if (args.v1.ucReplyStatus == 0x20){
+		DRM_DEBUG_KMS("dp_aux_ch defer\n");
+			/* 10 is an arbitrary value from the pre-regression patch
+			in practice I've never seen more than one */
+			if (retry_count++ < 10)
+				goto retry;
+		return -EBUSY;
+	}
+
  	/* timeout */
  	if (args.v1.ucReplyStatus == 1) {
  		DRM_DEBUG_KMS("dp_aux_ch timeout\n");

             reply	other threads:[~2011-09-29 14:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29 14:21 Brad Campbell [this message]
2011-09-29 14:36 ` Radeon regression fix Alex Deucher
2011-09-29 15:10   ` Brad Campbell
2011-09-29 15:21   ` Brad Campbell
2011-09-30  0:23     ` Brad Campbell
2011-09-30  4:59       ` Alex Deucher
2011-09-30  5:14         ` Brad Campbell
2011-09-30  5:14           ` Brad Campbell
2011-09-30  5:39           ` Alex Deucher
2011-09-30  5:39             ` Alex Deucher
2011-10-03 13:13             ` [PATCH 1/2] drm/radeon/kms: fix regression in DP aux defer handling alexdeucher
2011-10-03 13:13             ` [PATCH 2/2] drm/radeon/kms: add retry limits for native DP aux defer alexdeucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E847ED4.5090703@fnarfbargle.com \
    --to=brad@fnarfbargle.com \
    --cc=airlied@redhat.com \
    --cc=alexdeucher@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.