Received: by 10.213.65.68 with SMTP id h4csp1732884imn; Thu, 5 Apr 2018 02:52:49 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/yp9fQ1dBEdk5HDWYEilKPLCi/mI9R6TpNpEIhP8Z1D/kIa0ah8npbySdMJwvyNu1tQRz4 X-Received: by 10.99.99.65 with SMTP id x62mr14225522pgb.157.1522921969239; Thu, 05 Apr 2018 02:52:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522921969; cv=none; d=google.com; s=arc-20160816; b=N6r9QqEi07FOzn4fhhbxoCt1d8Z5N5dF4IQnKxft4IhSU8ViT3P6RCrV49lFflE7kq SZRqJqRce5giCWBFMLjs/WyAnc7cPXdolnLaDVe++cdSgiqf6MF5QQ8Tzte0avxolnEI Q5vQvV5XwvQuHqnvzS1oOwamW142k+lGPfOKWNJI8SxegwaacPZvQiIgm4GWAFDkg05J ogDC+jRYnjSCaY/NK6aD3M3wttb/Pinnp85fDYjZSuDnHsW3WNPMNOAzZKIUGo3gu5E5 449MRDqfvDSScvtvW+QztV47g9HmlJn0N5k4FuEuHoCq0dnMAggbQwtQssd4xDiKVsrf R+Rg== 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=ZSluZeWNDYAhVYQa3M6Rhg0NNPnLAZ9L7DBi1OIOLpA=; b=d4GBOkoO0xoXNhzI+X3QMji2oYTMaCvCQtu4HFovMabYCeadIXmlHxNPv2qO3XmW84 rCbJRVjLKh9UaybiftB6+YYxE+2TTsLqavX6y2f0lfZBOhBM+ku27I3IjFkm/mXrWZTV K6ruS+1yD2zAgy5BbJ9D5zNrNVnLPGn31dHF4vf7X3xtoO/YlxtqheB74fWGPuj0O+/V qujsSyk7w3WOtzDVj9UJlDQsoDWEglYPjs9oiCNzYnuVT0Gk3NjpfYpCxt3fyp40s+2o b7bXHMA6CVydFxpaZ77OCkX3f8eJhDUyYk0xxwv1tPoQDl1gaxuXo4wiwawFBhhscB1Q +ZUg== 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 f35-v6si7559985plh.569.2018.04.05.02.52.34; Thu, 05 Apr 2018 02:52:49 -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 S1752147AbeDEJvB (ORCPT + 99 others); Thu, 5 Apr 2018 05:51:01 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:60966 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752051AbeDEJuz (ORCPT ); Thu, 5 Apr 2018 05:50:55 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 5296A277A33 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, ykk@rock-chips.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, linux-input@vger.kernel.org, orjan.eide@arm.com, wxt@rock-chips.com, jeffy.chen@rock-chips.com, linux-arm-kernel@lists.infradead.org, mark.yao@rock-chips.com, 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: [PATCH v6 19/30] drm/bridge: analogix_dp: Properly log AUX CH errors Date: Thu, 5 Apr 2018 11:49:49 +0200 Message-Id: <20180405095000.9756-20-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180405095000.9756-1-enric.balletbo@collabora.com> References: <20180405095000.9756-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.16.3