Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2657947pxa; Mon, 17 Aug 2020 15:44:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUxCh6RC828BOfcHlg7t6t9DElgKMKvN278qq0Jvafd9q9n3mkkN0qVSALIilY1Cy+3P9u X-Received: by 2002:a17:906:ca4f:: with SMTP id jx15mr18145984ejb.449.1597704269294; Mon, 17 Aug 2020 15:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704269; cv=none; d=google.com; s=arc-20160816; b=Eh/NmOaN+DdnEd9nwt5lI6q/V8lsv+uS/Ksvz3nP/ckugZ8u4RBE4m1x5HDuTDeO5v ieTxPMtg2QojwCd2Fz04VuGKNNP2B9iU444R6RpYaBafTFDFGh5vWa03rUkTpCeNGUl4 e1EIb4UB2sihm31WQOKlHKSteEYPI3JvuwiAXLU9bYeTduAakc4PteVsqdalR0ZTbpwR +z1gpYydy5xDlTrkzo5rcb0avkJcGT8IkjLkGfVbM+G0KzOKOSMG4fyEo7McZz6B+jf5 kNF8NjATla+hvWqLW4Wi6mGO5bnfQKpdo+s0nNwNUE/TO6cb1bWZxLxlRtmi+5HpnMeM 5y4w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HA7wVeL0suIwVdOK7HaTQn05zI6VuGUlAQ4QF8qhecE=; b=bcrWU4J0ogWvVlmAr55P1M3s77LASNK9koub8kaiiRTVhKw54/163vpYVkhqrj0RWZ hDnYkCcEpoTWBBlCEfCVzS6qtXbLwf2Ylqh2J+Be/mhVWaPbPBR4Qux1mGuNgfaO4aBS CGvNSdcXG+3JyjxSdWOJxlOrOP7a/RqWu67pOBT1xW8HZDMLKcGelOMlT79e2VgcxmW7 O/yelokTKWeu868UrwGn8c7LlfPvhBu/9TsT0neBhR3GMR3kD0zZ+MiwaUWzSiFU+Ev9 dmjILx0qvNT/Ido6amSNrVLzdn745LokouHC6EGAIO1ZCFheXc8e9xzvaL05+/KllgIc h2Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AmnxeODP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si13217195edb.127.2020.08.17.15.44.00; Mon, 17 Aug 2020 15:44:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AmnxeODP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404013AbgHQTBf (ORCPT + 99 others); Mon, 17 Aug 2020 15:01:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:59754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730265AbgHQPrl (ORCPT ); Mon, 17 Aug 2020 11:47:41 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DAAB92067C; Mon, 17 Aug 2020 15:47:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679260; bh=VPk1/68gAeSbr4dY1na6HaYHqUTOTZcN9LqH9WMmFag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AmnxeODPRdaDfkVvgcoyjM0rpKLqUMSTr6yXGP1fusFJfhX76VG4VyoxRaVfDppbt tM/hOXfcT4odZQUNg9XJ5UA69LpTgWlXSwRcNLCy3BPuTNNoH5VIBPRgWcJyAAslFs Nc0/QKvijgnnpdOzcQ5SKHYmuW8PBrhUOf+EWqwQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Douglas Anderson , Rob Clark , Sam Ravnborg , Sasha Levin Subject: [PATCH 5.7 123/393] drm/bridge: ti-sn65dsi86: Clear old error bits before AUX transfers Date: Mon, 17 Aug 2020 17:12:53 +0200 Message-Id: <20200817143825.576027194@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit baef4d56195b6d6e0f681f6eac03d8c6db011d34 ] The AUX channel transfer error bits in the status register are latched and need to be cleared. Clear them before doing our transfer so we don't see old bits and get confused. Without this patch having a single failure would mean that all future transfers would look like they failed. Fixes: b814ec6d4535 ("drm/bridge: ti-sn65dsi86: Implement AUX channel") Signed-off-by: Douglas Anderson Reviewed-by: Rob Clark Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200508163314.1.Idfa69d5d3fc9623083c0ff78572fea87dccb199c@changeid Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 6ad688b320aee..d865cc2565bc0 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -827,6 +827,12 @@ static ssize_t ti_sn_aux_transfer(struct drm_dp_aux *aux, buf[i]); } + /* Clear old status bits before start so we don't get confused */ + regmap_write(pdata->regmap, SN_AUX_CMD_STATUS_REG, + AUX_IRQ_STATUS_NAT_I2C_FAIL | + AUX_IRQ_STATUS_AUX_RPLY_TOUT | + AUX_IRQ_STATUS_AUX_SHORT); + regmap_write(pdata->regmap, SN_AUX_CMD_REG, request_val | AUX_CMD_SEND); ret = regmap_read_poll_timeout(pdata->regmap, SN_AUX_CMD_REG, val, -- 2.25.1