Received: by 10.223.185.111 with SMTP id b44csp820143wrg; Fri, 9 Mar 2018 14:30:01 -0800 (PST) X-Google-Smtp-Source: AG47ELtsPIUgZbQVbnxZSpMs3BOKEGQ/FQnuJoZtw6VchhJ53mSliqAhebqOPhtT/Nz1Cwc8lwkl X-Received: by 10.99.181.10 with SMTP id y10mr61598pge.222.1520634600952; Fri, 09 Mar 2018 14:30:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520634600; cv=none; d=google.com; s=arc-20160816; b=CvFQPNTh0emhl+C5E3NjL2YDLH+PBPdTOGuroOfT0RZAsV3W9wqmZHXDwannnr0Pnq OMxFse4KpivC08lpvhsqltNgj8zQhGwsnjzvTM2qqNRHijodi03yH2c+hcq4fbq3uu+R KzuKb42UZ9gauu0g5WmjGc+I10vXCf0Yp+cd8c59o+zTxGOkh7bhsFYbAQTRCikYDwsZ +ZI48LJtQQXEQOjEX+fGgdfqHuX8c9hsiEnPdi7wKbbl1Q/4ITN8orHZAKh+ZqQjXfmz SXEfvvbwppVMMyuLM19QcXscY7RKU7yE7kY64A3x/jbjZvSdYX01j/pQqvjBjadSFFvy JQJg== 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=IESDSCvc/2D/+0efs+Y/Gcig++di5v3pnyd0wPRCuS8=; b=Sv74szwRo23GXtQzoeSENVmCmYAerAiKMLoCbhEd7NPkYUdMfduA8/dinxFG78rcXq LDR2dzKXDx4Et/ODCdbBxuKzBx7gGYGicc1lDWAJ/wnZSaelORJfq4kMoLGkNaB20Lec yhrtHaXNgbvcmkQdKr47XKcmm1aUXhgua9tw6PltAoiEcLy0BYPZjucuHWgh+FmEPm6H gYA0mFa1LmKiAn6ePcxVea844tLmqf0Uh58FhLlAnGcfOi8NMMG1P/lqJ/ZSZORsWVyj qs1iMkDe3SsxIdF4N01gH1/2cSrJyno5kluNYhD9v5s77aYsSK6ipXWz9MwikbdzE/XB PkXw== 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 r16si1361975pgu.449.2018.03.09.14.29.46; Fri, 09 Mar 2018 14:30:00 -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 S933160AbeCIWYs (ORCPT + 99 others); Fri, 9 Mar 2018 17:24:48 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:42880 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933007AbeCIWYq (ORCPT ); Fri, 9 Mar 2018 17:24:46 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id B14F62792D2 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 v5 25/36] drm/bridge: analogix_dp: Properly log AUX CH errors Date: Fri, 9 Mar 2018 23:23:16 +0100 Message-Id: <20180309222327.18689-26-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180309222327.18689-1-enric.balletbo@collabora.com> References: <20180309222327.18689-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 --- 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.1