Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4879491pjb; Mon, 27 Jul 2020 07:27:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDhKt+X2BVMH7TPeGTGkVN3Kr2o7xuwWkT/prhwHEXUH+GIIFEZyD5t71zkNSCb0HUuNdk X-Received: by 2002:a17:906:4685:: with SMTP id a5mr21127996ejr.46.1595860058543; Mon, 27 Jul 2020 07:27:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860058; cv=none; d=google.com; s=arc-20160816; b=PjAv885mO86jyE+DJnrA3LAHfeAo4uCf1G1yeWyFX6aeNbZPk3cnB9mI/eG6aspJap +XV+4xv0Umq7sE3ON8JZ7S2yxz7KL2vp0GO8vawMr5bkhFh0YhzJS6cm8el/1/h3u4HR l3+XdivwbHcDT7eWlxLqFD9LqnACtD1gcqjQDRbetXGU2p0WG6G0azwUO0mQeQnH4DUu gicORmX0l7B/gQXBhb6/PjIbWUaeql/Bw5lYzqLgl2uaNuX6dRwXkQku9Oz+YgEL4/eV rm6zVJswdlbqoAD9wulZMKhsbMetKrn7Q+h1CbaGXB1Kv+t8FWKGWqCjrzOYPV3r2fkJ rt/A== 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=LL+XpNj/QchpLqzqqcJvdoxvGDdB4+RWbBVxrY6C8CE=; b=m6Xg3iPGPY39imRWijFxfx+HODg7ZzBMZha3TGF71XSNSoN2vdlmprh6pgAKtL4uz+ XiEwxmRwP7TVCadEMD73lvJa/hsgM8VWdvAwDeE9JogHh40ZaoEkamXX0pFwhxs/EnyG Arx51xZw15xskFx9q5dsyz/5rvuWmAEPqDFl5vXpiWQSg+DVN0VVJ2yf2UCFh2rE0Ugi Zt+/0ffMVAhfuYwJtS1UhWxQuYroXnYxFkGUc4avPsN4siuzc/ebBx40N8gtut5M/QK4 xZXxTjg0uQjinwO+B2tWANUBzonIGXoMxuQzG0tDXwMvv8gjjF35GOEeh4bDrqHLmj6J QIoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xwRUIvuG; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r14si5743917eds.270.2020.07.27.07.27.16; Mon, 27 Jul 2020 07:27:38 -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=xwRUIvuG; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732185AbgG0OX6 (ORCPT + 99 others); Mon, 27 Jul 2020 10:23:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:53204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732156AbgG0OXt (ORCPT ); Mon, 27 Jul 2020 10:23:49 -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 F1AC2208E4; Mon, 27 Jul 2020 14:23:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859829; bh=r3iHyGQz9boyggQI7VCb+3Xt73g++0A/lGYtI0CTALU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xwRUIvuGm29/eyXhZqt9/MITr313t16O2etJzsPNHnAs3xOfeQSoXvN19KjqMTWF4 m0F1pTtOJfiw40H4vWkaNLaGQlAq+c5682xq31vK2d5Tt9/euKwzopqDgB77Qe08Zp x+qLpT1dxCx7Ooc5sk4VGRgPlx08lW2aMUJZZ+r4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wolfram Sang , Wolfram Sang , Sasha Levin Subject: [PATCH 5.7 091/179] i2c: rcar: always clear ICSAR to avoid side effects Date: Mon, 27 Jul 2020 16:04:26 +0200 Message-Id: <20200727134937.109276982@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@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: Wolfram Sang [ Upstream commit eb01597158ffb1853a7a7fc2c57d4c844640f75e ] On R-Car Gen2, we get a timeout when reading from the address set in ICSAR, even though the slave interface is disabled. Clearing it fixes this situation. Note that Gen3 is not affected. To reproduce: bind and undbind an I2C slave on some bus, run 'i2cdetect' on that bus. Fixes: de20d1857dd6 ("i2c: rcar: add slave support") Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-rcar.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index 3b5397aa4ca60..50dd98803ca0c 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c @@ -868,6 +868,7 @@ static int rcar_unreg_slave(struct i2c_client *slave) /* disable irqs and ensure none is running before clearing ptr */ rcar_i2c_write(priv, ICSIER, 0); rcar_i2c_write(priv, ICSCR, 0); + rcar_i2c_write(priv, ICSAR, 0); /* Gen2: must be 0 if not using slave */ synchronize_irq(priv->irq); priv->slave = NULL; @@ -971,6 +972,8 @@ static int rcar_i2c_probe(struct platform_device *pdev) if (ret < 0) goto out_pm_put; + rcar_i2c_write(priv, ICSAR, 0); /* Gen2: must be 0 if not using slave */ + if (priv->devtype == I2C_RCAR_GEN3) { priv->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL); if (!IS_ERR(priv->rstc)) { -- 2.25.1