From patchwork Fri Mar 10 04:32:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 9614789 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E6CB060415 for ; Fri, 10 Mar 2017 04:51:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D975A286C0 for ; Fri, 10 Mar 2017 04:51:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCCEC286EF; Fri, 10 Mar 2017 04:51:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8DB4B286C0 for ; Fri, 10 Mar 2017 04:51:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 298C26EDB2; Fri, 10 Mar 2017 04:50:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x231.google.com (mail-qk0-x231.google.com [IPv6:2607:f8b0:400d:c09::231]) by gabe.freedesktop.org (Postfix) with ESMTPS id 98EE26ED96 for ; Fri, 10 Mar 2017 04:50:38 +0000 (UTC) Received: by mail-qk0-x231.google.com with SMTP id 1so151801903qkl.3 for ; Thu, 09 Mar 2017 20:50:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nTike/N7xISNEe3WvQMsoBweiheJXH/fWSvwlFta0fQ=; b=jr7O5Syay5lT8FhwGkfsoCyt/+GubiXOFTzIrCrCE3MIC4tOBbwAbQEeLimiVfmCVi EZL4KHRhdoM6BNHTzDXCENV42JXID3lCOroYOk+yIg16U8/40Fest/283gaxVMyBfQlx wDOajAGMoeNc295L+EqB8eQKWL53zjle4vbjo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nTike/N7xISNEe3WvQMsoBweiheJXH/fWSvwlFta0fQ=; b=nLMWxAgCJwrL2hYjqQDKgzZwg9CIJsAee2P7JwuKHNHeYqiDnIFnMZZvQJQrMHn9eU aDfeULyZu+CWgsJXWLh0TxFRx+jZNN6VXj1D3V+rfSwzujjD3P3H9AgHzy5M99AisGFF 4KPWJKcT/zJRjIYGDTS9PfE5ZYzAEi9OLzVsvS0z5oKAoFfHXJEI657ufF/Udp2Ra9df AuThRC6YodsDD8Y4Y79/7+o9oJVGobmcQG7Y6mY2DhTWjdmL1FrSTL6sv+mIsAT7XLHr 0rUjLefRx46Qay/FesJVIxD0NaHGJdfVfOBk9ZNwiosHsJV9eFOCtFS7Us6eYkOIctMC FN6A== X-Gm-Message-State: AFeK/H2GpPcwC4Zd94eQddWuTn0EAsaCPE2f3FExLN1OLM9LByCjE+DaSwk6LSMVWhsfhMFa X-Received: by 10.55.118.1 with SMTP id r1mr16516051qkc.236.1489120989276; Thu, 09 Mar 2017 20:43:09 -0800 (PST) Received: from boxwood.roam.corp.google.com (cpe-75-189-128-87.nc.res.rr.com. [75.189.128.87]) by smtp.gmail.com with ESMTPSA id n19sm5697731qtn.35.2017.03.09.20.43.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Mar 2017 20:43:08 -0800 (PST) From: Sean Paul To: linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: [PATCH 40/41] drm/bridge: analogix_dp: Properly log AUX CH errors Date: Thu, 9 Mar 2017 23:32:55 -0500 Message-Id: <20170310043305.17216-41-seanpaul@chromium.org> X-Mailer: git-send-email 2.12.0.246.ga2ecc84866-goog In-Reply-To: <20170310043305.17216-1-seanpaul@chromium.org> References: <20170310043305.17216-1-seanpaul@chromium.org> MIME-Version: 1.0 Cc: =?UTF-8?q?=E5=BE=81=E5=A2=9E=20=E7=8E=8B?= , Lin Huang , Tomeu Vizoso , Douglas Anderson , Krzysztof Kozlowski , Yakir Yang X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Douglas Anderson The code in analogix_dp_transfer() that was supposed to print out: AUX CH error happened Was actually dead code. That's because the previous check (whether the interrupt status indicated any errors) would have hit for all errors anyway. Let's combine the two error checks so we can actually see AUX CH errors. We'll also downgrade the message to a warning since some of these types of errors might be expected for some displays. If this gets too noisy we can downgrade again to debug. Cc: 征增 王 Signed-off-by: Douglas Anderson Signed-off-by: Sean Paul Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c index ddc8165947c1..29d130222636 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c @@ -1104,6 +1104,7 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, struct drm_dp_aux_msg *msg) { u32 reg; + u32 status_reg; u8 *buffer = msg->buffer; unsigned int i; int num_transferred = 0; @@ -1192,16 +1193,12 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, /* Clear interrupt source for AUX CH access error */ reg = readl(dp->reg_base + ANALOGIX_DP_INT_STA); - if (reg & AUX_ERR) { + status_reg = readl(dp->reg_base + ANALOGIX_DP_AUX_CH_STA); + if ((reg & AUX_ERR) || (status_reg & AUX_STATUS_MASK)) { writel(AUX_ERR, dp->reg_base + ANALOGIX_DP_INT_STA); - goto aux_error; - } - /* Check AUX CH error access status */ - reg = readl(dp->reg_base + ANALOGIX_DP_AUX_CH_STA); - if ((reg & AUX_STATUS_MASK)) { - dev_err(dp->dev, "AUX CH error happened: %d\n\n", - reg & AUX_STATUS_MASK); + dev_warn(dp->dev, "AUX CH error happened: %#x (%d)\n", + status_reg & AUX_STATUS_MASK, !!(reg & AUX_ERR)); goto aux_error; }