From patchwork Tue Mar 15 11:38:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kahola X-Patchwork-Id: 8587451 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 6D748C0553 for ; Tue, 15 Mar 2016 11:39:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A5549202A1 for ; Tue, 15 Mar 2016 11:39:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BC04220295 for ; Tue, 15 Mar 2016 11:39:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 033E56E211; Tue, 15 Mar 2016 11:39:03 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 99D8C6E211 for ; Tue, 15 Mar 2016 11:39:00 +0000 (UTC) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 15 Mar 2016 04:39:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,338,1455004800"; d="scan'208";a="66652579" Received: from sorvi.fi.intel.com ([10.237.72.50]) by fmsmga004.fm.intel.com with ESMTP; 15 Mar 2016 04:38:59 -0700 From: Mika Kahola To: intel-gfx@lists.freedesktop.org Date: Tue, 15 Mar 2016 13:38:58 +0200 Message-Id: <1458041938-3279-1-git-send-email-mika.kahola@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [Intel-gfx] [PATCH] drm/i915: Add delay on DPCD reads 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Additional 50 ms delay is needed between DPCD reads on HP Bizlink 1326 DP to VGA adapter. Having said that, I haven't noticed a need for additional delay between DPCD reads on other DP-VGA dongles. While at it, let's replace mdelay() with usleep_range() routine. Signed-off-by: Mika Kahola --- drivers/gpu/drm/i915/intel_dp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 0e326e7..ff3883c 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -3125,9 +3125,11 @@ intel_dp_dpcd_read_wake(struct drm_dp_aux *aux, unsigned int offset, for (i = 0; i < 3; i++) { ret = drm_dp_dpcd_read(aux, offset, buffer, size); - if (ret == size) + if (ret == size) { + usleep_range(50000, 50100); return ret; - msleep(1); + } + usleep_range(1000, 1100); } return ret;