From patchwork Thu Oct 8 21:44:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 11824675 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 64B916CA for ; Thu, 8 Oct 2020 21:45:12 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 17D9222243 for ; Thu, 8 Oct 2020 21:45:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="zFtg5PN0"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YLjr/eUP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 17D9222243 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bgwJtrsjzbLMqRbSp+DfR95yNyztVz6YuNeb4jJw3R4=; b=zFtg5PN0fP3teT+LCPCjE69kU T/jzEkf0LTqy0pMw3T4jcBRtF+q+6p59XDRQNZCSHKjU6IbGx5VYrw1nGtDDiN5ROo3Ejoh2s+emf hWTeKPZqatFvzE3IgsHIQ2+qSuE3ak2UMTZ7dvkjB+7h7mfQ7VVOhqad8lvE25RRtIxch5gfeiidt Qlew+ENQGOlw8RiF/bdGAQDI1sWtDyLgs1C6v+H/xsVbt4zd0HmgwhVcRQWJNyGZZxklonmHBctao K5JJu16x9oE8U3kzlvqahBZG/GG7i8dTUKvFLoBES+Exq7TLW0uepUFVCF0DYSWaNpiJwyYHeW50b rer1GJTWw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQdie-0007Dp-Jo; Thu, 08 Oct 2020 21:45:00 +0000 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQdiQ-00077J-TV; Thu, 08 Oct 2020 21:44:48 +0000 Received: by mail-ej1-x644.google.com with SMTP id qp15so10221624ejb.3; Thu, 08 Oct 2020 14:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2lJmAI/upYsFIPxZmv2LOq2oKjZZBIP7CgRq2l2uWnA=; b=YLjr/eUPvLvbNteGaoQ39dXXAW9H+O+O7wrwKrEZx7lDx01lWKIHw6YjRexlY47AlD 8GSXNYPpd58zWP2VTaYfaAeA1XLIyR50ol8pI4HMUK8/4JPGAKaMZUI/2vw5NiY7EzPW 2jO0nzWk3Uc6NozrjqLR3CPGQMu/sj6vkN2Irjyw/nTiXQ9/3MiYFntwM3MrNxl0XqJr HfBYULSY6SmfaZDrXPW8oULsSJ754s2fj0npusK1hMw6opCN36nvI1lv7Jk2ZVmGfT2I 6pO/tnJ7yfokVEVBlkga2UhDrjqCBdjCXnHOX/TbKPSFszrtACbPTBcW1zGDQQr0H4Rc Qp6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2lJmAI/upYsFIPxZmv2LOq2oKjZZBIP7CgRq2l2uWnA=; b=EMFIDNEHQWmA8aqbSFS4fKGQV0RfVAdIVjl+Brd10JwWHbHi1kfCKGjHypRypBzLOP M7TNU6mlMou5fo+UxHFlNTus7Cacb2qgk2pre3WhN1RBO7jgu82AD3DAKypH2S6uOwVl baeAb6rTquS9xIYgavRVCMWPaCHFQjMBCuLOvyu7LdUCJEvuJIh4STb2KRWd55e3iCii 8CtjXEh5KPmNSNfK+1mHNuHTchkLIT1mdwcQXvpC3PxXsLvgTZYZcvkV0xOeiGvWCwUp qIMgNjoldfovzS28pCvVTcj3uOMcaNE6SpMZ+IfqLZZIngiwOBUkFRFgg5saMOaVQUji I+PQ== X-Gm-Message-State: AOAM530sJ+Xtf9YrBWjhGh/AHphwwdPhGASYvlj3tyLzNRIknuXSNOdC l7ty1UjMJhsrtU9jp3kbrd6aNuynUss= X-Google-Smtp-Source: ABdhPJwMvsJr4FPt7pcbDUQ71Qrdz+DQFBWSaqD+HdlVWu6RgLMBMJphJCAWbVs4Ln5cLsMVXLmA1w== X-Received: by 2002:a17:906:4bd7:: with SMTP id x23mr10525959ejv.92.1602193484064; Thu, 08 Oct 2020 14:44:44 -0700 (PDT) Received: from localhost.localdomain ([188.24.159.61]) by smtp.gmail.com with ESMTPSA id i8sm4831800ejg.84.2020.10.08.14.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 14:44:43 -0700 (PDT) From: Cristian Ciocaltea To: Manivannan Sadhasivam , =?utf-8?q?Andr?= =?utf-8?q?eas_F=C3=A4rber?= , Wolfram Sang , Peter Rosin Subject: [PATCH 1/3] i2c: owl: Clear NACK and BUS error bits Date: Fri, 9 Oct 2020 00:44:39 +0300 Message-Id: <6ee573f2904c001ab07e30b386815257c05f6308.1602190168.git.cristian.ciocaltea@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201008_174447_039248_6F48F4AE X-CRM114-Status: GOOD ( 12.23 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:644 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [cristian.ciocaltea[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-actions@lists.infradead.org, linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 Reviewed-by: Manivannan Sadhasivam --- drivers/i2c/busses/i2c-owl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/i2c/busses/i2c-owl.c b/drivers/i2c/busses/i2c-owl.c index 672f1f239bd6..a163b8f308c1 100644 --- 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 irq, void *_dev) 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 irq, void *_dev) 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; }