Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp983302ybt; Wed, 17 Jun 2020 19:54:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGeDU7KCapQo/yeqtP0JERj00JzfDujNOViHCOBRI3V8FKHSRKUp0QAz7aKGVQl+8FR3zY X-Received: by 2002:a17:906:118b:: with SMTP id n11mr2045075eja.328.1592448893519; Wed, 17 Jun 2020 19:54:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592448893; cv=none; d=google.com; s=arc-20160816; b=Vgig3lOeQjsDH0SHdxkm5aH2ztq3dPUW0XF/ZelEF0OTqpv76K4mGnoxlm8OhsKZQi ZUP5qmf+y/OxQhlz53PE/aZbk356uvIYHGAgT4FZ6431AJRgrq/cjDz7ibvUgKL/q6Kr RAVsamDxuHmmfIHQjKkl6aeydi55dpLFjK5Oe6d6s1RIo2LBWRESaQNFgKWNyxRBUnPL vudhdHnh0YclKo1PDhWf11bWrUxUcPndUyiNpLUJIK1pqKYuEDeOhfx/asX5Zrg0gocE fR1fFCpSUagBDBSt3Nsu2pqUMLV2EBUwWC0AkVgXT5MsGxUdOKUke/7b+l1n13jq6ryZ 1PbQ== 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 :dkim-signature; bh=9uw+uDNtq+PniYv+xFICS/x6vOlxEU24Hl3U7bP/GBk=; b=D4A+K7oPmJh2YuQISbr+Kdyd9WQ26hgiH58qkc1PLreZILHMjrqiLNcw8EbcH3jSNJ B3vgkHWzIjp83+cStL06kBGKi8Yzt0dXr4FN2E1x7CgyGda0cydOXrwNWU1otzqmEiFW +NodVQ5TBmDS04yadMTfmH2TJpQFAp5rEf+35srV6DwtkO4A0NdU2qWiEAcyp8zWeA6t AzfaxMf7zVSlla53hy4pqZOBgXM4kyCkjQYabGttumiBWyrRvzRwSJhXnZGGUjnpxMZ0 tlpSjm2odpgyAzzRSRmStsgZ63vJt8xn4O3N+7iW6Ii/1xD6abcQPVDlijXYWGyEXdOw L3mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ivBDjBDb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n22si1062353edy.377.2020.06.17.19.54.31; Wed, 17 Jun 2020 19:54:53 -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=ivBDjBDb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726912AbgFRBJI (ORCPT + 99 others); Wed, 17 Jun 2020 21:09:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:34928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727968AbgFRBIz (ORCPT ); Wed, 17 Jun 2020 21:08:55 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A29021D7E; Thu, 18 Jun 2020 01:08:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592442534; bh=rs5tw5dIQlpsvjlC1Io34WSHTvkyHWjgZTfHxcbFBhc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ivBDjBDbqy+4HGP/VbhO1Q95cGYsdVft8QnLO5zXVVvcLX8JnXQ3p29FwdP1o/Dcj KSuIdwYwFuJG7VD2OyOyj4aw93V3Vz2Nx4uN5sdxSryzbLiL1w/NUcZHbWlnDMv4te KOocuDFeUtpW1zqW0c6PO/8612N0dAyZIFIVXdSg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Russell King , Wolfram Sang , Sasha Levin , linux-i2c@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 037/388] i2c: pxa: clear all master action bits in i2c_pxa_stop_message() Date: Wed, 17 Jun 2020 21:02:14 -0400 Message-Id: <20200618010805.600873-37-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618010805.600873-1-sashal@kernel.org> References: <20200618010805.600873-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Russell King [ Upstream commit e81c979f4e071d516aa27cf5a0c3939da00dc1ca ] If we timeout during a message transfer, the control register may contain bits that cause an action to be set. Read-modify-writing the register leaving these bits set may trigger the hardware to attempt one of these actions unintentionally. Always clear these bits when cleaning up after a message or after a timeout. Signed-off-by: Russell King Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-pxa.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 466e4f681d7a..30a6e07212a4 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -747,11 +747,9 @@ static inline void i2c_pxa_stop_message(struct pxa_i2c *i2c) { u32 icr; - /* - * Clear the STOP and ACK flags - */ + /* Clear the START, STOP, ACK, TB and MA flags */ icr = readl(_ICR(i2c)); - icr &= ~(ICR_STOP | ICR_ACKNAK); + icr &= ~(ICR_START | ICR_STOP | ICR_ACKNAK | ICR_TB | ICR_MA); writel(icr, _ICR(i2c)); } -- 2.25.1