Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1241586pxa; Thu, 20 Aug 2020 06:32:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTRi3wCMhV422bl7aTB3Nbq8TXAocbaSs+g+NXv4Pn1WSkXNIMsNF7Ua48XrNQ4jxhjg+d X-Received: by 2002:a17:906:b286:: with SMTP id q6mr3084024ejz.99.1597930376417; Thu, 20 Aug 2020 06:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597930376; cv=none; d=google.com; s=arc-20160816; b=PSRHM8rSjlOREPgOhkTYc+MY/qRPJxogIbaPOsrtXza7f3hhhWeH7qx63fcxxlfqBY SE/6iNzZ3bC2vCXGC5d744yrVVm8HLHfgwjqBp0mcVru9n1bjh2Uf2gRe50bRwRqLZUb B1nYk7+3ny5lUP8sEG80YX/Aefl6CnZNtdj4aRaZ28g3QGJgB0zjxc/rQoHD++e74DH+ iuMJOHmXNT6XUYVKurNCFm2+AZJeJhFUfFexc4eHj/EotAzqDW8pM/ypubEFdcGvtXoE 22MAFrBWLHFbuzCAvhYQWsmnqfKVdblNO/pygMRUTgJvuA0CY0x0DO5XmauYuYmuflq9 A8Iw== 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=jgXaBDoQjr774FhW/f5w7bc6T1FqVyWsIG9M9E2tWRo=; b=seUz3/cGTzBG3LShzcOtOWjlmTzaibNH0M0FJZGAUTdkpua3URUyK+Z7XqS/1eeQXv p+sFjr9r3u74UJLpT6I/PP6H6S7exjzU9UKlQgLM/0nsoob0w2sfhqF/Wr1udm47bv6E M+Dp7yGYeB2MtqLK9bIKqJbGIVRb0PQHSxN8/LTyrsPmtEsAJsY7sP1iLudkrFic2Z5U +uJQO3EuJuPVM1TVKM8G5htO5DULbdJVCb09wEzmIENzFjyimTxqJw1xsLfW79cWtr8r 55ua/mhASnv6H9sBrUMrJadk1RvFc4d2qW26j0ORWIdh37z9sR7aD6cSX8IbYaHiLDlZ nuXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WmNOoKFp; 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 r17si1734978eda.525.2020.08.20.06.32.31; Thu, 20 Aug 2020 06:32:56 -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=WmNOoKFp; 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 S1727813AbgHTNbn (ORCPT + 99 others); Thu, 20 Aug 2020 09:31:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:44964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728271AbgHTJcc (ORCPT ); Thu, 20 Aug 2020 05:32:32 -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 7D90A22BED; Thu, 20 Aug 2020 09:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915952; bh=yNimt8oteiua9Ywn8PfbraGv1Dkc6uXM8n1oYGvyJHM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WmNOoKFp8KkD3okx9IZeH+71Tn+0LGrIQttC1uh+9WQTssb2We8cSz170rKuRPPYc uBpJInrK+3heo9oquJRMFyIjrp+rOK+8Wd7m81TAFbIxQjrIeEQcTwkAf8lGFiBTZw Sk7G6qaihw91ZJTBPsUhS4q44HLzsMao+e7EYafs= 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.8 162/232] i2c: rcar: slave: only send STOP event when we have been addressed Date: Thu, 20 Aug 2020 11:20:13 +0200 Message-Id: <20200820091620.658340785@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@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 314139f9f0abdba61ed9a8463bbcb0bf900ac5a2 ] When the SSR interrupt is activated, it will detect every STOP condition on the bus, not only the ones after we have been addressed. So, enable this interrupt only after we have been addressed, and disable it otherwise. 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index 2e3e1bb750134..76c615be5acae 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c @@ -583,13 +583,14 @@ static bool rcar_i2c_slave_irq(struct rcar_i2c_priv *priv) rcar_i2c_write(priv, ICSIER, SDR | SSR | SAR); } - rcar_i2c_write(priv, ICSSR, ~SAR & 0xff); + /* Clear SSR, too, because of old STOPs to other clients than us */ + rcar_i2c_write(priv, ICSSR, ~(SAR | SSR) & 0xff); } /* master sent stop */ if (ssr_filtered & SSR) { i2c_slave_event(priv->slave, I2C_SLAVE_STOP, &value); - rcar_i2c_write(priv, ICSIER, SAR | SSR); + rcar_i2c_write(priv, ICSIER, SAR); rcar_i2c_write(priv, ICSSR, ~SSR & 0xff); } @@ -853,7 +854,7 @@ static int rcar_reg_slave(struct i2c_client *slave) priv->slave = slave; rcar_i2c_write(priv, ICSAR, slave->addr); rcar_i2c_write(priv, ICSSR, 0); - rcar_i2c_write(priv, ICSIER, SAR | SSR); + rcar_i2c_write(priv, ICSIER, SAR); rcar_i2c_write(priv, ICSCR, SIE | SDBS); return 0; -- 2.25.1