Received: by 10.192.165.148 with SMTP id m20csp3277590imm; Mon, 23 Apr 2018 03:57:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+9GNcE7mwjATrfa+3UXWuXYvDbrSNjyRNNhq9J33+skLyRzq5SxKNXuRSAytsMzctII7tj X-Received: by 10.99.95.130 with SMTP id t124mr16810794pgb.150.1524481028554; Mon, 23 Apr 2018 03:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524481028; cv=none; d=google.com; s=arc-20160816; b=k6zbanbPc/ZatRke8Lbj63sjGbtC0spii8qWyNmu7fATCYIdvHERbSoEjndx/rOE7n 8m1q0sNmBT8EyRmX3/pB37hEyy0O2B87t8ELEcI99d6ZwwzO4e4msNLQjg9pgxtxsDkm ns1I/TZ2wt6K5u2NG2if/65irJOQl2SZvu5xcH2zc1QMxSzfkQOoR5Qot9ZSyyOutqCo QbvXHaVjznkjyC3qulib0TvJ9vNOksEFi/A2osqPqDOdCJbf1c7W/m120ovIUcAO+OyN o+Pd5lJNQ5ii76yW0R1ahXtTdBTgQVaNMyixY8YIwlMz0Tpd8Auzo6Gyw+wrUzVqP+Vp 0cCQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=NFMR2k1RVsbirABJ3KZsXdlN6TtKqnsDQfxQJg+CZm8=; b=sG5npetHxw3CVHq5193iPlw/luR4hubZVwob6Rq3FQYRmmlCUPxyq0/bYAhTVdpEdU Ifaoa865MUhLgxW7VTZ5V1/XEkEK3n2ibs3MHkrHfJMFKLGpVP93CMlyHwcony/q9QWF t99QWB2hdQ353dn7MPnzAm7RYquj/OIeLbG59X4Gbqc2bUNOxNA52UjorEM55eOy/3qa Q/B6IavDpCXtNE6ljnN6tZ6LlgdgjwwchKE9Tls42yz1JvTu6P67/bZEyNrr95isoW3Z Kuwd+agx5IgD4zw8E3lqa/Sd8I2ReeTY9ImNqua5Ge89fcdWaNfOwSeGK9pseo0itqWY ErEg== 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 i35-v6si10844856plg.504.2018.04.23.03.56.54; Mon, 23 Apr 2018 03:57:08 -0700 (PDT) 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 S1755243AbeDWKy4 (ORCPT + 99 others); Mon, 23 Apr 2018 06:54:56 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:38970 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755092AbeDWKu5 (ORCPT ); Mon, 23 Apr 2018 06:50:57 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 5E270277B96 From: Enric Balletbo i Serra To: architt@codeaurora.org, inki.dae@samsung.com, thierry.reding@gmail.com, hjc@rock-chips.com, seanpaul@chromium.org, airlied@linux.ie, tfiga@chromium.org, heiko@sntech.de Cc: dri-devel@lists.freedesktop.org, dianders@chromium.org, a.hajda@samsung.com, kernel@collabora.com, m.szyprowski@samsung.com, linux-samsung-soc@vger.kernel.org, jy0922.shim@samsung.com, rydberg@bitmath.org, krzk@kernel.org, linux-rockchip@lists.infradead.org, kgene@kernel.org, orjan.eide@arm.com, wxt@rock-chips.com, jeffy.chen@rock-chips.com, linux-arm-kernel@lists.infradead.org, wzz@rock-chips.com, hl@rock-chips.com, jingoohan1@gmail.com, sw0312.kim@samsung.com, linux-kernel@vger.kernel.org, kyungmin.park@samsung.com, Laurent.pinchart@ideasonboard.com, kuankuan.y@gmail.com, hshi@chromium.org, Enric Balletbo i Serra Subject: [RESEND PATCH v6 19/27] drm/bridge: analogix_dp: Properly log AUX CH errors Date: Mon, 23 Apr 2018 12:49:55 +0200 Message-Id: <20180423105003.9004-20-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180423105003.9004-1-enric.balletbo@collabora.com> References: <20180423105003.9004-1-enric.balletbo@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 Signed-off-by: Enric Balletbo i Serra Tested-by: Marek Szyprowski Reviewed-by: Archit Taneja --- 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.17.0