From patchwork Fri May 3 12:29:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163300 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546199ill; Fri, 3 May 2019 05:30:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7hSbncDiEZJejbjrQaloYvZOMdYS/fkVpFt2q3NhE0vnR4m8oLGiNlIb4sLQQ5GTF1ZzT X-Received: by 2002:aa7:93bb:: with SMTP id x27mr10234352pff.104.1556886648345; Fri, 03 May 2019 05:30:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886648; cv=none; d=google.com; s=arc-20160816; b=EgmACv3JgjCxrGp3yW9PKE8AdvAw/Y0ZdWojdIeBm2OlpuXVkl94n/2Y7IaWhSrvJO MKLCWGmqu2ERZf0MMqrSRZ4K5z4IgU1x3N96SjOlev5GnO6G9BwXigDMjxHCXiQg1xdy FQhQB6wazUcKkqu2FXXvZ6GWy2VZKLZgVfi0O0wVQX5ZVlrTNBn60wXYFi36urRzxiIn tDQrm2PIA2bR1Vs5Q11t8QxkLJHjT+XTHU5aNBZR/7C4eWImO/X8VtGRPOgDfibPPLu7 nsjhEX3DTmmQZb1amma2sxVNy0VVli7C0dmvID2+QzVxxnHL5f1moy3rujHQyAvjjmg1 jgQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=mF+YyrV1qrJUI4Fn+o4rfNWTEeryXvmJRik8BYE6ApA=; b=cM16JI7zj1Uv2+MKHKZtBEdSV8kOmxpp0QbVJlFAFHwVonz7lE/DQqApnQoUYD4NRJ HbWKIfLmm618Apa725l8C9Wz9djbXOYc+HxldCRzKi522/Vi3u/EH+vxVMGfedzb/Cj8 1FpO3+ePpE20MG20eE2TwcN9QqN7tH3m6f+R5sZby4Kwbta2E/t0vnzb5TGpvsqb3Twp QDEtj6bRj4mS/KNCSjsxXtR4eGfX+KJgZkcNUbGMctJxjMN5HBydnPl4qn5TPNBPaIAo HrExzh94AjUT6XY/lXlOBn59SIWTPK0HzBfiDFy+0OthV/4eeyqsFJwiirOaZM0Icvs0 decw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id j30si2048971pgl.338.2019.05.03.05.30.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:30:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 17D3B89134; Fri, 3 May 2019 12:30:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8101789134 for ; Fri, 3 May 2019 12:30:45 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x43CUgKr017285; Fri, 3 May 2019 07:30:42 -0500 Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CUgIL109856 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:30:42 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 3 May 2019 07:30:39 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 3 May 2019 07:30:40 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYtj002029; Fri, 3 May 2019 07:30:37 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 01/23] drm/bridge: tc358767: fix tc_aux_get_status error handling Date: Fri, 3 May 2019 15:29:27 +0300 Message-ID: <20190503122949.12266-2-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1556886642; bh=9OH+WmDrr+S93M5OoAEvbWqUz1QW5s2P6JjdkXc1j1A=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=yI9Gk/8W/mXYx8ovoZ613CCr4gL9kBS7LLD25QIOrVRPi52Ic4JwyizBcHIfBVda3 nxCPr7wFy8oa3P4xDSzDTNHgSM3LWlM7fzh2Up2UPj1B1m5NnD63uTYx6YhY1Y5bnZ k9p0WuxLCSTnB+numTOiaTwFwb5kTswyDEkSQB+Y= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" tc_aux_get_status() does not report AUX_TIMEOUT correctly, as it only checks the AUX_TIMEOUT if aux is still busy. Fix this by always checking for AUX_TIMEOUT. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/tc358767.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 888980d4bc74..7031c4f52c57 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -286,14 +286,17 @@ static int tc_aux_get_status(struct tc_data *tc, u8 *reply) ret = regmap_read(tc->regmap, DP0_AUXSTATUS, &value); if (ret < 0) return ret; + if (value & AUX_BUSY) { - if (value & AUX_TIMEOUT) { - dev_err(tc->dev, "i2c access timeout!\n"); - return -ETIMEDOUT; - } + dev_err(tc->dev, "aux busy!\n"); return -EBUSY; } + if (value & AUX_TIMEOUT) { + dev_err(tc->dev, "aux access timeout!\n"); + return -ETIMEDOUT; + } + *reply = (value & AUX_STATUS_MASK) >> AUX_STATUS_SHIFT; return 0; }