From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752472AbcHFU1J (ORCPT ); Sat, 6 Aug 2016 16:27:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40004 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752136AbcHFU1H (ORCPT ); Sat, 6 Aug 2016 16:27:07 -0400 From: Lyude To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, xorg-driver-ati@lists.freedesktop.org Cc: Lyude , David Airlie , linux-kernel@vger.kernel.org Subject: [PATCH 7/7] drm/dp_helper: Rate limit timeout errors from drm_dp_i2c_do_msg() Date: Fri, 5 Aug 2016 20:30:39 -0400 Message-Id: <1470443443-27252-8-git-send-email-cpaul@redhat.com> In-Reply-To: <1470443443-27252-1-git-send-email-cpaul@redhat.com> References: <1470443443-27252-1-git-send-email-cpaul@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sat, 06 Aug 2016 00:31:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Timeouts can be errors, but timeouts are also usually normal behavior and happen a lot. Since the kernel already lets us know when we're suppressing messages due to rate limiting, rate limit timeout errors so we don't make too much noise in the kernel log. Signed-off-by: Lyude --- drivers/gpu/drm/drm_dp_helper.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index 43be189..5ca72d25 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -574,7 +574,17 @@ static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg) if (ret == -EBUSY) continue; - DRM_DEBUG_KMS("transaction failed: %d\n", ret); + /* + * While timeouts can be errors, they're usually normal + * behavior (for instance, when a driver tries to + * communicate with a non-existant DisplayPort device). + * Avoid spamming the kernel log with timeout errors. + */ + if (ret == -ETIMEDOUT) + DRM_DEBUG_KMS_RATELIMITED("transaction timed out\n"); + else + DRM_DEBUG_KMS("transaction failed: %d\n", ret); + return ret; } -- 2.7.4