Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4342318pxu; Mon, 12 Oct 2020 16:53:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPj+Oi/De1LR6ah9m3Fsd+ysRdOy+IsPH4lUouskP5ZvE15i6cyMhoZy4NBqakXKZCvCwH X-Received: by 2002:a17:906:28db:: with SMTP id p27mr31284110ejd.424.1602546825549; Mon, 12 Oct 2020 16:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602546825; cv=none; d=google.com; s=arc-20160816; b=udzk7hSsVTjQXgvYc/I5ZM8AIVHwTvXBO3uVgYaocqNaCWDc/YiFxISTUb6BHs+6SL k/i0aa1dVX6E+c8dr+rhDlMb7oaRUfMjMojac8bM61bsrLB5Ib/NJd6P2xeukzd+eoGs bM81V6zqu2C0s18ZVWTnbNJ5Ao96NH8CSRFRsLXv/Jks7Boa3OOzPlqOY8FTEIZgY20k imQYjVMvcaAzttbEo9NlJJgiv+BnvKGH2TOHTR3rzRiQEHhUpSYKXxyOF7t0SVjy4IQJ miVmfWJjBlNFHMPmHYKGar2+pAJPtXgBT+wDG4tmUhqk4F+B1w24jEnfPJxlgtwc7zB+ X4Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jsdWO+mGPE9taWKc43Yik/KgZ54gGNJ9A95esN6jBa0=; b=IAYnhDNKVJi3n9xpycvXivTuDoRAVTboSxE8DiRDTgWeOCIp8oBv4bGGJ/pHWXFTgt nHXmngwOE0OzdZJ74hsVtPeQzaCm1eR8LBpdFatMo8cc/uTVHt+CugQqXg5+gzY19ShK evgKoPcLYmS5zoJnLvrGZ9VQVx2vP9xpbe87/b8O+1VF9gZBSl8IdQrkAvtm3+poP8Om DG6DNSkcFZwzypN6khQZ45Y/6IRrfcyDLXG/wEg6ssqfkdhjyeZs3gpWeUNEJ33b+oGF /d8uDnD3HLyu3J9vzD1egsmOfp07Tg9s1o1lVjCAeWOfXvnLYQhBDxGcjBitOEKj33cw o5aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=veoBqIYy; 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 gz18si13204672ejb.408.2020.10.12.16.53.23; Mon, 12 Oct 2020 16:53:45 -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=veoBqIYy; 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 S2390390AbgJLNyY (ORCPT + 99 others); Mon, 12 Oct 2020 09:54:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:46202 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389744AbgJLNpy (ORCPT ); Mon, 12 Oct 2020 09:45:54 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 8B9FE222C8; Mon, 12 Oct 2020 13:45:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510301; bh=4yqm3u7dHPwx1jhFIJHj4Viy3hldLcsnKvyL4rvwAKU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=veoBqIYyS7ibut0blbZCoUobO79ThaZefhZdHrxqXdHMvglqk69P9I/VxPj4JLm6V k3bjwj38mJXJDHGs7w4TTG3/eHN1pOmQmCa57FCOFJkjDB81e/YDWSkH6fifYcEgrt /8+vbcRjAXhApK49cUWBGrmudfBDnEW7sN08IH+w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manivannan Sadhasivam , Cristian Ciocaltea , Wolfram Sang Subject: [PATCH 5.8 040/124] i2c: owl: Clear NACK and BUS error bits Date: Mon, 12 Oct 2020 15:30:44 +0200 Message-Id: <20201012133148.793675088@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012133146.834528783@linuxfoundation.org> References: <20201012133146.834528783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Cristian Ciocaltea commit f5b3f433641c543ebe5171285a42aa6adcdb2d22 upstream. When the NACK and BUS error bits are set by the hardware, the driver is responsible for clearing them by writing "1" into the corresponding status registers. Hence perform the necessary operations in owl_i2c_interrupt(). Fixes: d211e62af466 ("i2c: Add Actions Semiconductor Owl family S900 I2C driver") Reported-by: Manivannan Sadhasivam Signed-off-by: Cristian Ciocaltea Signed-off-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-owl.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/i2c/busses/i2c-owl.c +++ b/drivers/i2c/busses/i2c-owl.c @@ -176,6 +176,9 @@ static irqreturn_t owl_i2c_interrupt(int fifostat = readl(i2c_dev->base + OWL_I2C_REG_FIFOSTAT); if (fifostat & OWL_I2C_FIFOSTAT_RNB) { i2c_dev->err = -ENXIO; + /* Clear NACK error bit by writing "1" */ + owl_i2c_update_reg(i2c_dev->base + OWL_I2C_REG_FIFOSTAT, + OWL_I2C_FIFOSTAT_RNB, true); goto stop; } @@ -183,6 +186,9 @@ static irqreturn_t owl_i2c_interrupt(int stat = readl(i2c_dev->base + OWL_I2C_REG_STAT); if (stat & OWL_I2C_STAT_BEB) { i2c_dev->err = -EIO; + /* Clear BUS error bit by writing "1" */ + owl_i2c_update_reg(i2c_dev->base + OWL_I2C_REG_STAT, + OWL_I2C_STAT_BEB, true); goto stop; }