From patchwork Sun Oct 11 18:22:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rayagonda Kokatanur X-Patchwork-Id: 11831023 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 DB29B1744 for ; Sun, 11 Oct 2020 18:25:40 +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 9E8F32222E for ; Sun, 11 Oct 2020 18:25:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EKtCSdHN"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="d7OcHRgF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E8F32222E Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=broadcom.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-Type:MIME-Version: Cc:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=X+oEbbonyjIai1FLJ5Xep4FUDaPMB0UMsaQkoXmBcK0=; b=EKtCSdHNu2tWuUSnKaHBhmxEd zxFyNQUNxuVLue0tegjBLbW9CMan5RzDKUKf2LWLJAbEUvyvMp+aO/eP4zDQyzLxYD6WqmvkeM7ZR 4C8xD1J892YSWJIdB+7dVOPs2dDm8Fp4xVXoFq5RXtV0aAatFCTCaw6YLPXNfvyJ2S3XdQHakf+Kc qDoM+8COpnx1hi196U9lpMeZVB11zXCnyyB9T4thCiyiOEl3dysRvox42wwYSlMTCOzBfGuaMaaxt zXZb+aEj8Mm59DsSfowEF6VJtXJeqhCUl58SIkqcVuKi/ddeGPhsFzcg6/LM/lItniWSZnw+mF5Te ZzHJejFZQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kRg0e-0002Pn-UF; Sun, 11 Oct 2020 18:23:52 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kRg0c-0002Oh-C9 for linux-arm-kernel@lists.infradead.org; Sun, 11 Oct 2020 18:23:51 +0000 Received: by mail-pf1-x444.google.com with SMTP id b26so11356639pff.3 for ; Sun, 11 Oct 2020 11:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fqNxiMaJA4ZGnE1DsiCJMeVqJWoIiKtSmxYcfnXqp/M=; b=d7OcHRgFzXEJvVGenvSh/12c0GQHBKvBlZigGZY6/4/mTCF82TGkt0+p6EkjkY2005 tW8h5sX8LxLpk4OHCYXRiJLjdIXpfoyNuOVj7AxSXcfj0st5+ln+mDAF+GMj4MGHroEr UQlGD3EjbrTGzpTwWNRZ5zALP39IFYDfTkYfM= 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; bh=fqNxiMaJA4ZGnE1DsiCJMeVqJWoIiKtSmxYcfnXqp/M=; b=eV3ahGlAKnAGu7LYq3oXrw5lxIC1FSROwekTqUtcRfk832nCjNEOwVXvALrpBLXOki 7y5cwapJMKRrBALMeXzM1NrMQ89AK8KI76RenxxPHRMwTMqwE3JqY3FqqmPCdqAb4Pze TAChUndZtXgQ8486e5u6yfYS5Or4X6e5Ktp6jCkRN4LjNdAxYo971ehZXh1PkW1Tx3v7 WahNmBrMQmVKDszdgwNn/VrI40+kA6On0qDatC4R9IsAAUizOwOvWCD0A4U7w7MoY2L8 l/P3Qr8dPL4aElVIgwEqGAwtB/vI+w9Y3Pxs9bS+xanIjwEhstWtpQr8ad+h5Gi8lbXh Ixeg== X-Gm-Message-State: AOAM531U4DFrWpBHlUU9jZSwqatdy2tjrQD37IxJjDDUgnP2F6IL2Ghd APhEAcJXbIyBubBBE68UT8jX1A== X-Google-Smtp-Source: ABdhPJwiPkPIRutiD+wEZcKaT5iyTgQwGU99qofX02YE0IylWUiazA2+6/4CEU/kdq/c+uXJjI5d3Q== X-Received: by 2002:a17:90b:3882:: with SMTP id mu2mr16471333pjb.29.1602440626183; Sun, 11 Oct 2020 11:23:46 -0700 (PDT) Received: from rayagonda.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id g1sm21977807pjj.3.2020.10.11.11.23.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 11:23:45 -0700 (PDT) From: Rayagonda Kokatanur To: Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Wolfram Sang , Florian Fainelli , Brendan Higgins , Andy Shevchenko , Lori Hikichi , Dhananjay Phadke , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 2/6] i2c: iproc: handle only slave interrupts which are enabled Date: Sun, 11 Oct 2020 23:52:50 +0530 Message-Id: <20201011182254.17776-3-rayagonda.kokatanur@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201011182254.17776-1-rayagonda.kokatanur@broadcom.com> References: <20201011182254.17776-1-rayagonda.kokatanur@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201011_142350_430084_77DD47DE X-CRM114-Status: GOOD ( 13.30 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 T_TVD_MIME_NO_HEADERS BODY: No description available. 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 MIME_HEADER_CTYPE_ONLY 'Content-Type' found without required MIME headers -0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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: Rayagonda Kokatanur MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Handle only slave interrupts which are enabled. The IS_OFFSET register contains the interrupt status bits which will be set regardless of the enabling of the corresponding interrupt condition. One must therefore look at both IS_OFFSET and IE_OFFSET to determine whether an interrupt condition is set and enabled. Fixes: c245d94ed106 ("i2c: iproc: Add multi byte read-write support for slave mode") Signed-off-by: Rayagonda Kokatanur Acked-by: Ray Jui --- drivers/i2c/busses/i2c-bcm-iproc.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c index 834a98caeada..b54f5130d246 100644 --- a/drivers/i2c/busses/i2c-bcm-iproc.c +++ b/drivers/i2c/busses/i2c-bcm-iproc.c @@ -507,12 +507,17 @@ static void bcm_iproc_i2c_process_m_event(struct bcm_iproc_i2c_dev *iproc_i2c, static irqreturn_t bcm_iproc_i2c_isr(int irq, void *data) { struct bcm_iproc_i2c_dev *iproc_i2c = data; - u32 status = iproc_i2c_rd_reg(iproc_i2c, IS_OFFSET); + u32 slave_status; + u32 status; bool ret; - u32 sl_status = status & ISR_MASK_SLAVE; - if (sl_status) { - ret = bcm_iproc_i2c_slave_isr(iproc_i2c, sl_status); + status = iproc_i2c_rd_reg(iproc_i2c, IS_OFFSET); + /* process only slave interrupt which are enabled */ + slave_status = status & iproc_i2c_rd_reg(iproc_i2c, IE_OFFSET) & + ISR_MASK_SLAVE; + + if (slave_status) { + ret = bcm_iproc_i2c_slave_isr(iproc_i2c, slave_status); if (ret) return IRQ_HANDLED; else