From patchwork Fri Apr 10 16:12:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Previte X-Patchwork-Id: 6197931 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DB451BF4A6 for ; Fri, 10 Apr 2015 16:13:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0636A203ED for ; Fri, 10 Apr 2015 16:13:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C61C12035D for ; Fri, 10 Apr 2015 16:13:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 382686E9C3; Fri, 10 Apr 2015 09:13:07 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) by gabe.freedesktop.org (Postfix) with ESMTP id 9C5166E9BD for ; Fri, 10 Apr 2015 09:13:06 -0700 (PDT) Received: by pddn5 with SMTP id n5so27054370pdd.2 for ; Fri, 10 Apr 2015 09:13:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5jx0FOe5Ol90r3euAdYReCNygEphGEYH3lPstFYaYLM=; b=p+oz+3CcR/yPEToD41wYzMMwhC00XXOJgkEjilwb0IezyPzUV8X88qlnzeDv1UUmKW DswE9VS3QXlikp97jVeKVbmkLmX8nAxCoCpgoH2PKZiMyYJmazALm+YBY78FFkUzksz5 FZd5QOjyaQgFgXH788/tF54HnJDwJIFTTpV8L6aoU3pd0oV1Dq4TFD0x1GW9SKQD4XZ8 W0emFiv0hLQxHQ3qfwr3RoWggHdRz3yGxK0F5fjQeJpd8nn/9Y9XrKqt9slZbFXZXntl 3D6AL/Na6QviWBuQEz+ZEfyRA1Ro4hDiozVGJqU7iNH/1Cg07jJH1k2dz6vQf4iNAdqd ucmA== X-Received: by 10.69.15.99 with SMTP id fn3mr3866089pbd.45.1428682386420; Fri, 10 Apr 2015 09:13:06 -0700 (PDT) Received: from localhost.localdomain (ip70-162-72-208.ph.ph.cox.net. [70.162.72.208]) by mx.google.com with ESMTPSA id dk3sm2682849pbb.91.2015.04.10.09.13.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Apr 2015 09:13:05 -0700 (PDT) From: Todd Previte To: intel-gfx@lists.freedesktop.org Date: Fri, 10 Apr 2015 09:12:46 -0700 Message-Id: <1428682372-21586-6-git-send-email-tprevite@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1428682372-21586-1-git-send-email-tprevite@gmail.com> References: <1428682372-21586-1-git-send-email-tprevite@gmail.com> Subject: [Intel-gfx] [PATCH 05/11] drm/i915: Add a delay in Displayport AUX transactions for compliance testing X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The Displayport Link Layer Compliance Testing Specification 1.2 rev 1.1 specifies that repeated AUX transactions after a failure (no response / invalid response) must have a minimum delay of 400us before the resend can occur. Tests 4.2.1.1 and 4.2.1.2 are two tests that require this specifically. Also, the check for DP_AUX_CH_CTL_TIME_OUT_ERROR has been moved out into a separate case. This case just continues with the next iteration of the loop as the HW has already waited the required amount of time. V2: - Changed udelay() to usleep_range() V3: - Removed extraneous check for timeout - Updated comment to reflect this change V4: - Reformatted a comment V5: - Added separate check for HW timeout on AUX transactions. A message is logged upon detection of this case. V6: - Add continue statement to HW timeout detect case - Remove the log message indicating a timeout has been detected (review feedback) V7: - Updated the commit message to remove verbage about the HW timeout case that is no longer valid. Signed-off-by: Todd Previte Reviewed-by: Paulo Zanoni --- drivers/gpu/drm/i915/intel_dp.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index a5dfaff..77b6b15 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -877,9 +877,18 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, DP_AUX_CH_CTL_TIME_OUT_ERROR | DP_AUX_CH_CTL_RECEIVE_ERROR); - if (status & (DP_AUX_CH_CTL_TIME_OUT_ERROR | - DP_AUX_CH_CTL_RECEIVE_ERROR)) + if (status & DP_AUX_CH_CTL_TIME_OUT_ERROR) continue; + + /* DP CTS 1.2 Core Rev 1.1, 4.2.1.1 & 4.2.1.2 + * 400us delay required for errors and timeouts + * Timeout errors from the HW already meet this + * requirement so skip to next iteration + */ + if (status & DP_AUX_CH_CTL_RECEIVE_ERROR) { + usleep_range(400, 500); + continue; + } if (status & DP_AUX_CH_CTL_DONE) break; }