Received: by 10.223.176.46 with SMTP id f43csp685372wra; Fri, 26 Jan 2018 05:22:22 -0800 (PST) X-Google-Smtp-Source: AH8x2258q0AH8t3qjDwfvMSw5QH6QSxVfhkVBtx062/0NQDXrxUiE7W0JiYKqydodO1QACHbqiJl X-Received: by 2002:a17:902:47c2:: with SMTP id d2-v6mr12250711plh.222.1516972942002; Fri, 26 Jan 2018 05:22:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516972941; cv=none; d=google.com; s=arc-20160816; b=f2AxwuwsLHYrxxpnbMao+58sWOPIRBFJer4JTPLrAl+/U50wFv+WvfZ6a9EjRwMKxv kcAYKwTSdD9/XYKQ4n7Nx5Xwoan5Pg+/ivM1L4rpPcg/ZqJeKXlRESGXtHR5Q6IAI7QS aGiWCFesR5HsbgpmkwQKR5mxge7FdZDtjxaYibBoIQR27EQzxAuxkCu82HrXnqB6ERWo pK11/8NwiSMHTcs1yOrbVi1P7KbfBtjahtjPnIAMHP8T+8TyKzbmP5lr6/FeC0AgUSXF f8/3LXAAXoMawKyJ7aiVlE4UZq6elDRWbFjyKRAeePk2k2AmWYPdhg/zNON+Y8SoOiq2 iHBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-transfert-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=c8fAG39xoysjJIns0yFdaoiGmGv6jYQUKhUSYGPLWgg=; b=kO9n9NpL84f6UTfMyKBtXvkon6rmQpnTYI6GzbFk+h3hEckmgU082faONDl8Nqwi1f /U58/xynq/+PRI4E6VRc6wVvGN9VOxQtetNnEaVrjEUuPsa+6BJk7dUmdpYDA8GYMTDB x6GrfOYxstxM68G5oUO649UTMPVGUUh3IW9XDhfS3lA7jWaOmTpQGvXlVKTyy+EB/uFI 1OTiJsEq7P20g/OzH9XR1HGyqawzb9DlIk6M+WV2H8QQCDOMORWPP5CKObCWJERaTyC8 1rCi8SEWifeoh5WN1jNBevoB7D+khbKWABcsnvU0V7MwzCGMy/bRtZe78BTJisQzsO3J N90A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z7si6347443pfa.360.2018.01.26.05.22.07; Fri, 26 Jan 2018 05:22:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752723AbeAZNUw (ORCPT + 99 others); Fri, 26 Jan 2018 08:20:52 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:34818 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752345AbeAZNSA (ORCPT ); Fri, 26 Jan 2018 08:18:00 -0500 Received: from localhost.localdomain (unknown [IPv6:2a01:e35:8a7e:4790:a8d7:ca4:7b4f:7f87]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tescande) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 295D4274ECA; Fri, 26 Jan 2018 13:17:59 +0000 (GMT) From: Thierry Escande To: Archit Taneja , Inki Dae , Thierry Reding , Sandy Huang , Sean Paul , David Airlie , Tomasz Figa Cc: Haixia Shi , =?UTF-8?q?=C3=98rjan=20Eide?= , Zain Wang , Yakir Yang , Lin Huang , Douglas Anderson , Mark Yao , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2 31/43] drm/bridge: analogix_dp: Properly log AUX CH errors Date: Fri, 26 Jan 2018 14:16:58 +0100 Message-Id: <20180126131710.7622-32-thierry.escande@collabora.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180126131710.7622-1-thierry.escande@collabora.com> References: <20180126131710.7622-1-thierry.escande@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset = "utf-8" Content-Transfert-Encoding: 8bit Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Thierry Escande 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 4eae206ec31b..58e8a28e99aa 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c @@ -1105,6 +1105,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; @@ -1193,16 +1194,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; } -- 2.14.1