From patchwork Fri Oct 30 06:53:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rayagonda Kokatanur X-Patchwork-Id: 11868593 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,T_TVD_MIME_NO_HEADERS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12C22C56202 for ; Fri, 30 Oct 2020 06:55: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 6C55922202 for ; Fri, 30 Oct 2020 06:55:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="N5Gux1fX"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="DgZFc7kr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C55922202 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+linux-arm-kernel=archiver.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=kaU975Umu5P5qsABJPfToaw/gdGe1bfT6ZZ7A+uXCBQ=; b=N5Gux1fXkfnAUWzGBUToXsOeG 3fNlmYCdB7kzF1VjyvF5e3KZlYoK1KA5XuKz3O3o8tsInCWpeNAykHxOgxQY3SQYaHRHgSOjTo99a egbGj721M9tnMaZRViO3aLvc+w1+8cHE9JWD2PN2AGgUrT0FmNovE1uP6UMjxyQkYKbqpX0H8Ky0b +iyNIBbXC/fBYbBbhukMWcQw3z92FcVuUYDeIMImXC7Hvro1ztocOGSulUjDduaihGIQcaOQaBZ4+ rpumfiOZQBmjZh1o2Xb0wj7UNn3IVlkFFVNtXSZKJRLklOEgUKMTZtRpJzhqDM4R0mE7wx3thPRTl pX8Hv/02g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYOIb-0000Ym-Sq; Fri, 30 Oct 2020 06:54:10 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYOIY-0000Xx-37 for linux-arm-kernel@lists.infradead.org; Fri, 30 Oct 2020 06:54:07 +0000 Received: by mail-pg1-x541.google.com with SMTP id o3so4383115pgr.11 for ; Thu, 29 Oct 2020 23:54:05 -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=1xgWt15B22a0X2SwQv0PvxCZCGunWaPkWKgQMa7nb0I=; b=DgZFc7krpAl5sEY4k9hgXpwqk6zzC1rt/m2t12TP210Gfe9pFCZc4Ntsb8N08FKrHv 4F3gRtn+YceSAaSGjO96PK1ly/c964j32fWIxkmT+M3T+kX03xFCaATAlsU4i9ZQ3ou3 vFtbBTb916LcGiu6RStXAZ4av5RaTozMNZSCM= 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=1xgWt15B22a0X2SwQv0PvxCZCGunWaPkWKgQMa7nb0I=; b=nHpSqUFCmWv/fjnfKQ94py/fEaNJ5kUCPwDm434/pp2zO8uWEZHp8IVEG9LZcV4FHx +SmltMrO/f+Z6dRY434kkz677cnZ/gXeha3WcWmWCk9pazhIu0bT8LgMUea5EUlsrXiy YXgZoNswqqJIoSJNTrV3ZFSJ4kH+9WKpBoe16swkWLN1K0CUs8+FIkTnAO1z+xuMcbnm G3+qK98GiXyCOH07JNbeFeeLDGyQLKpdv5W6mLohASm2lX174dluRJeHULavoPafS8Az u8Oy35MthWMhDqZQXUglStK9Xddi07QFWqnj/3IpRlCTrB/4EPRRYDChQ1laFocJ3MiO LcCQ== X-Gm-Message-State: AOAM5319LnCIwBY93viSvh3w3srvRpBk0R1EnqkXnFESIrJJmFdNQSIz cPkfIau6GgVX3PvWMzAldIuObQ== X-Google-Smtp-Source: ABdhPJxdS9/aIeQB6jOaeDfbVW+kXRz6W/Etxf4U+vB7XrHdtQgqNyPLHBURISVDPSqz9FtqzyirNA== X-Received: by 2002:a17:90a:a48c:: with SMTP id z12mr1133870pjp.108.1604040843875; Thu, 29 Oct 2020 23:54:03 -0700 (PDT) Received: from rayagonda.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id n1sm4561547pgl.31.2020.10.29.23.53.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 23:54:02 -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 v2 1/6] i2c: iproc: handle Master aborted error Date: Fri, 30 Oct 2020 12:23:34 +0530 Message-Id: <20201030065339.955-2-rayagonda.kokatanur@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201030065339.955-1-rayagonda.kokatanur@broadcom.com> References: <20201030065339.955-1-rayagonda.kokatanur@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201030_025406_270422_8B2907CD X-CRM114-Status: GOOD ( 12.00 ) 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+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Handle Master aborted error by flushing tx and rx fifo and reinitializing the hw. Signed-off-by: Rayagonda Kokatanur --- drivers/i2c/busses/i2c-bcm-iproc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c index d8295b1c379d..834a98caeada 100644 --- a/drivers/i2c/busses/i2c-bcm-iproc.c +++ b/drivers/i2c/busses/i2c-bcm-iproc.c @@ -93,6 +93,7 @@ #define S_CMD_STATUS_MASK 0x07 #define S_CMD_STATUS_SUCCESS 0x0 #define S_CMD_STATUS_TIMEOUT 0x5 +#define S_CMD_STATUS_MASTER_ABORT 0x7 #define IE_OFFSET 0x38 #define IE_M_RX_FIFO_FULL_SHIFT 31 @@ -311,9 +312,10 @@ static void bcm_iproc_i2c_check_slave_status( return; val = (val >> S_CMD_STATUS_SHIFT) & S_CMD_STATUS_MASK; - if (val == S_CMD_STATUS_TIMEOUT) { - dev_err(iproc_i2c->device, "slave random stretch time timeout\n"); - + if (val == S_CMD_STATUS_TIMEOUT || val == S_CMD_STATUS_MASTER_ABORT) { + dev_err(iproc_i2c->device, (val == S_CMD_STATUS_TIMEOUT) ? + "slave random stretch time timeout\n" : + "Master aborted read transaction\n"); /* re-initialize i2c for recovery */ bcm_iproc_i2c_enable_disable(iproc_i2c, false); bcm_iproc_i2c_slave_init(iproc_i2c, true); From patchwork Fri Oct 30 06:53:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rayagonda Kokatanur X-Patchwork-Id: 11868601 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,T_TVD_MIME_NO_HEADERS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 789DEC56201 for ; Fri, 30 Oct 2020 06:55:42 +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 CDE1422202 for ; Fri, 30 Oct 2020 06:55:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="d7ixaVRe"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="NfrFaBPY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDE1422202 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+linux-arm-kernel=archiver.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=MJaCi30fCn8Sjly7PDBtdK25fdrUFFiM7cqYDObYMbY=; b=d7ixaVRetVcMfi3iKgL/K1vIa A7znVHduKn7d1fGhDRiHseObX54e8gvSwPEgpCz0hcea6Nl/NSFoI44hoVn49IVUbmVrXQpcdGFDC INL18GNwbnlT4UNRVL8J9sVhtgACZ79vgyzUYN2R7j0JzFxm3zu7eJdIKkoHKHEyucSWqsnjeS/pr WLrnGygfAOTT5pOfogMmkRQahY0gbX4Mfz+C87JG52ZFg06QCYHC5Nbx2IbgSlW0rEIoFNhSOGGRS RXVwmtlXT30PG9QgaIfSeI7tpzTKVpgWUZY93YiB221BctHdNXZZBueN57V536ZaFhOAXBYpuc5YL AFTQWgCNw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYOIi-0000as-0r; Fri, 30 Oct 2020 06:54:16 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYOId-0000ZJ-QR for linux-arm-kernel@lists.infradead.org; Fri, 30 Oct 2020 06:54:13 +0000 Received: by mail-pf1-x442.google.com with SMTP id c20so4429661pfr.8 for ; Thu, 29 Oct 2020 23:54:11 -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=udAGh6cz86p5DhNevzM5M6XRNxRpeBaRm4O3FxrSPj8=; b=NfrFaBPYIZK1/kyf3bxnv0z+t/NvxvR+3RdcSOj1QMClwqvL3G7Okqc4QMuExn+vEE gC+sk18mTlWGb513rNHOkLS/dLr5R22miD1CZNKn/dCwZzQU5mTjO5DBfqGjV6ptQy2f XRXqdStZE+G7ogPhsQxBW6i19ZNINAAajHT/A= 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=udAGh6cz86p5DhNevzM5M6XRNxRpeBaRm4O3FxrSPj8=; b=OiI1e5QlAhF4F3Od8OIkHwrrAqYaYXmgNHDuxrMxJRealv1agBG7wXh9Vqg34IaZJu wC/0OHWuJ0OnjpOpc3zyE2ALGe0ZdULOh8//D4KMArON4Z2DJ20k8oDCFjk7vHGabQBC n8aJRhP53hrCET9xoEP29YsvGLmL6IOPILWAKDAuf2BfDHZ+SL4JmjKXngyexkW5XrbS F0iaDyAauoBWF0yXrww31EyajHWHREYVul7DtNf/QIR16Gaiuwq6Da5Q2QUOw33XGN3b Yf5tX9+SfUmxlQB7sX+O+UHAR8Dtr1sMI/5iUnvycclvZ83LyNFojGOX15edavlkQtRf nN1A== X-Gm-Message-State: AOAM530O2MW7ggE7qatGPEunVQYJaLdl9dDvTeYth6EoWdpO16SKlb+I EZaGc9eQ1Pl4RT7Pgz8BHFs21g== X-Google-Smtp-Source: ABdhPJx9Pl0YKzvpetBQyxAqlLKMo4hM1UpQz91kf1g4mlUh9rKjlsELeCiB2D4Z2eYYm7+ge6y0WQ== X-Received: by 2002:a17:90a:318d:: with SMTP id j13mr1119830pjb.209.1604040849906; Thu, 29 Oct 2020 23:54:09 -0700 (PDT) Received: from rayagonda.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id n1sm4561547pgl.31.2020.10.29.23.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 23:54:09 -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 v2 2/6] i2c: iproc: handle only slave interrupts which are enabled Date: Fri, 30 Oct 2020 12:23:35 +0530 Message-Id: <20201030065339.955-3-rayagonda.kokatanur@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201030065339.955-1-rayagonda.kokatanur@broadcom.com> References: <20201030065339.955-1-rayagonda.kokatanur@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201030_025411_917812_2A17090C X-CRM114-Status: GOOD ( 11.76 ) 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+linux-arm-kernel=archiver.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 --- 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 From patchwork Fri Oct 30 06:53:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rayagonda Kokatanur X-Patchwork-Id: 11868595 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,T_TVD_MIME_NO_HEADERS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E592DC00A89 for ; Fri, 30 Oct 2020 06:55:45 +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 5D72722203 for ; Fri, 30 Oct 2020 06:55:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DL14s43z"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="gizKqR7Y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D72722203 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+linux-arm-kernel=archiver.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=DW/EmK0CWrJuBvr4BR/mZlm7EeRtJ1hrMalPVEURR5I=; b=DL14s43z9Gc/yiDEJFRfYTO7r at4Q5mAYFkxREXcTp6sQs6xw9r6Vaa6oVIhZko+F/49I0VH5NKDfdRwStCLjfokoHc+AnzCFHDjdV dXGR2/MJnsb5I6frqFiuN6Wv2HhDEQsoYc1ufwbEakyY62BeAb0dQoXAJcmkhtxMddrQEAKYpqgBy R86ep7iBlwFxBtCr2rjXYQLcoPbtv2APQo9wzx8tgbI2UMsZJIWPHR7SK8YTw3Vv9DgwqXvgAaYQD VurKxt2hqzbWSkRbmttxBr9lZ5H59jJk+eWAy5hUyO7fkuD4+vWpy8bUtah+02wUV6evGxUIh6ISU bNhmBkA0Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYOIo-0000cd-KM; Fri, 30 Oct 2020 06:54:22 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYOIj-0000b9-PF for linux-arm-kernel@lists.infradead.org; Fri, 30 Oct 2020 06:54:19 +0000 Received: by mail-pg1-x541.google.com with SMTP id n16so4385788pgv.13 for ; Thu, 29 Oct 2020 23:54:17 -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=eeJ9An+0OH9CRKavwrv+IIgYGJFfmTWrCGWlt9/Lx+Q=; b=gizKqR7Y/FiyB4KoZ9ktHrIpRTvm9Aqjw4A0FjgyESMolRq5Swb9EzE5V57v+M8udH W+4S24a8iyYGXkHjft1ympzLi771Sp2vqyt7OY6/Kpq9yzcZNDmzzyfvKP+5gV1fqHEz qE0sD2C/8jWoTUUDPJu0PhjoKYZmOHPpHD9kg= 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=eeJ9An+0OH9CRKavwrv+IIgYGJFfmTWrCGWlt9/Lx+Q=; b=Fs5RFaebTRheWKZsBfKp1QKeGLwQ38lpLde1Ng8110wvd8AsPayzfxfFzmLaGRTwxW U2T1b5cH/Nv00W/2Z+yEogkjegsg3LHclc2fqOLFpQHDHikDZnCl3aIo9P+PDIjcS9Pe xzhzAwuE6WgiB1irrG4isDxOpOcIMppOkHWc4U2cCWprJJaJAuqnIH1qNaDduq54ltx2 9P1OYNsdl+sQQFVH6DQwOoWfTphDbtNdgFrhlRzLwlKZHJeeuTKOtJxtvK8QldaLp8Mf agJgM8W2Y9/GyIHkx8uTyUTfJBIR1MPW+KtxjgN+gtg1HfcW161IDzCJCld4hcPa3bcN nqRg== X-Gm-Message-State: AOAM531lOL9gy5fvOj43vjKlXKFzGIuG/Td1yVefWh7c9Ib5bpHcghJm GLiO5qSx5kO0tWX38p0r+bPtwA== X-Google-Smtp-Source: ABdhPJwhpXMG+ZMd6b0Zowiw9iHoUNYR3WFJPjIueYSku0pEqPe6igYz08wuJPo62F0FR3UUYYUyZA== X-Received: by 2002:a17:90a:f683:: with SMTP id cl3mr1160637pjb.84.1604040855688; Thu, 29 Oct 2020 23:54:15 -0700 (PDT) Received: from rayagonda.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id n1sm4561547pgl.31.2020.10.29.23.54.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 23:54:14 -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 v2 3/6] i2c: iproc: update slave isr mask (ISR_MASK_SLAVE) Date: Fri, 30 Oct 2020 12:23:36 +0530 Message-Id: <20201030065339.955-4-rayagonda.kokatanur@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201030065339.955-1-rayagonda.kokatanur@broadcom.com> References: <20201030065339.955-1-rayagonda.kokatanur@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201030_025417_885584_1A5F4519 X-CRM114-Status: GOOD ( 11.51 ) 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+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Update slave isr mask (ISR_MASK_SLAVE) to include remaining two slave interrupts. Fixes: c245d94ed106 ("i2c: iproc: Add multi byte read-write support for slave mode") Signed-off-by: Rayagonda Kokatanur --- drivers/i2c/busses/i2c-bcm-iproc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c index b54f5130d246..cd687696bf0b 100644 --- a/drivers/i2c/busses/i2c-bcm-iproc.c +++ b/drivers/i2c/busses/i2c-bcm-iproc.c @@ -216,7 +216,8 @@ struct bcm_iproc_i2c_dev { #define ISR_MASK_SLAVE (BIT(IS_S_START_BUSY_SHIFT)\ | BIT(IS_S_RX_EVENT_SHIFT) | BIT(IS_S_RD_EVENT_SHIFT)\ - | BIT(IS_S_TX_UNDERRUN_SHIFT)) + | BIT(IS_S_TX_UNDERRUN_SHIFT) | BIT(IS_S_RX_FIFO_FULL_SHIFT)\ + | BIT(IS_S_RX_THLD_SHIFT)) static int bcm_iproc_i2c_reg_slave(struct i2c_client *slave); static int bcm_iproc_i2c_unreg_slave(struct i2c_client *slave); From patchwork Fri Oct 30 06:53:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rayagonda Kokatanur X-Patchwork-Id: 11868597 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,T_TVD_MIME_NO_HEADERS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B259FC4741F for ; Fri, 30 Oct 2020 06:55:55 +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 297D322202 for ; Fri, 30 Oct 2020 06:55:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="elk4dIE7"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="Z4Mt81Lg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 297D322202 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+linux-arm-kernel=archiver.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=xZx0XtfB8dPhZLQit90UmIhN6MjhSytcE+lsoX1P73g=; b=elk4dIE76X0biq5DvZiL6/oZQ MvUORfqpHML8UgxKyIWE8/Gu3zIEKMim/3ArOFVB0QjpCvaYCqNeKOmgfk82Ay0gY/wXCtJh4x5Rn Nmo0Bx4Ejg3JQ4g5FVMndfqpR5YfMxbBE1RROObfpeH7pKM/7WmOsrw7lDRWcoHVALnHAf754WD7A O0cEM/hsj499Ld8WnvDxihuJsMvMkc8eOMvEvtwT4XyR4LYJ7IKgo9wvVR1k6GfAjmGRGmtX5lUn+ ddsT2mFFOL9I/XqDRe2YICByv+eFOS8/ltVkl/Wt6g8OKHcVZyEPAoQ87CHO0sPyTGdOXJEI2O+dL qmAIWxAZQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYOIz-0000gI-Bf; Fri, 30 Oct 2020 06:54:33 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYOIp-0000cc-Dr for linux-arm-kernel@lists.infradead.org; Fri, 30 Oct 2020 06:54:24 +0000 Received: by mail-pf1-x442.google.com with SMTP id x13so4428252pfa.9 for ; Thu, 29 Oct 2020 23:54:23 -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=EV16prdVz/iZnTdqIFrtqfSvbcE++N6hVEU3xL90ERE=; b=Z4Mt81LgayER+CtyauB7F37XFWIwaTecib9H6QgybVV0oJpgSQMkQEQV8Tq4A+Jq5k /+kbqaXTbVjXGgjwmaCNTzdsvMv6bUSedb2lHnNyZPrlKdKQUj55ZsRifYC8r3BAD9Sq aUH3sv+hCjGbPP0G1MxnbQ/BTD3pfnWaJjnHY= 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=EV16prdVz/iZnTdqIFrtqfSvbcE++N6hVEU3xL90ERE=; b=c2l9db4lYglKo3BtpJ65lmOBbp8K8mLO1mKqFwtKd0Ws9Ou08j2SxY64d5fbInWGh5 ybfBACA/cYEyDRlz5BrkvkRuQQW9S2TrfGE85VWeHhgvnFVeshTtBvSkbZbRFp/4PAyj BVuf+H/w6vfIibVjfm1drX9t2OU2/churd6vgVvB8Gx8amm2sBTxHCD3d6+4UaEMIwwk 1jnNepXyvqq0cYxQWjJN85FDF6sl2rngoXTyiLbk4egqnt1F33EiSos396N0BOnOu0wI Dmgn3weCUK1QycC+QqQOMqFWKF6F76Wg8FtwGB0KD8RJiOsBDm5TmKfKNHXBqb0oOHka z2Fw== X-Gm-Message-State: AOAM531rnzJCGLIoAWg+/L2Sz/yQ2Q1CH/M5Li/wwJvgaG0/pF9m7ezQ d/ToBM85huTJyktGf9oNYmYioQ== X-Google-Smtp-Source: ABdhPJw225lXiqM4O4rc2SfUSAyTbHA3H4GwvuNPjsGHqi0ME4UpprpURa4N2F8Zy2EK0+xekIda2Q== X-Received: by 2002:a63:7d49:: with SMTP id m9mr1013912pgn.60.1604040861352; Thu, 29 Oct 2020 23:54:21 -0700 (PDT) Received: from rayagonda.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id n1sm4561547pgl.31.2020.10.29.23.54.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 23:54:20 -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 v2 4/6] i2c: iproc: fix typo in slave_isr function Date: Fri, 30 Oct 2020 12:23:37 +0530 Message-Id: <20201030065339.955-5-rayagonda.kokatanur@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201030065339.955-1-rayagonda.kokatanur@broadcom.com> References: <20201030065339.955-1-rayagonda.kokatanur@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201030_025423_550206_358717EB X-CRM114-Status: GOOD ( 13.39 ) 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+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix typo in bcm_iproc_i2c_slave_isr(). Signed-off-by: Rayagonda Kokatanur --- drivers/i2c/busses/i2c-bcm-iproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c index cd687696bf0b..7a235f9f5884 100644 --- a/drivers/i2c/busses/i2c-bcm-iproc.c +++ b/drivers/i2c/busses/i2c-bcm-iproc.c @@ -382,7 +382,7 @@ static bool bcm_iproc_i2c_slave_isr(struct bcm_iproc_i2c_dev *iproc_i2c, if (status & BIT(IS_S_START_BUSY_SHIFT)) { i2c_slave_event(iproc_i2c->slave, I2C_SLAVE_STOP, &value); /* - * Enable interrupt for TX FIFO becomes empty and + * Disable interrupt for TX FIFO becomes empty and * less than PKT_LENGTH bytes were output on the SMBUS */ val = iproc_i2c_rd_reg(iproc_i2c, IE_OFFSET); From patchwork Fri Oct 30 06:53:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rayagonda Kokatanur X-Patchwork-Id: 11868605 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,T_TVD_MIME_NO_HEADERS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1CA9C00A89 for ; Fri, 30 Oct 2020 06:56:17 +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 4D61122203 for ; Fri, 30 Oct 2020 06:56:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="z4Gy6OGV"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="EgiThpzm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D61122203 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+linux-arm-kernel=archiver.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=uBlQ+iz9Y5MvnOrIuAeWa1fSNimqQP0zkev+ogtX6/Y=; b=z4Gy6OGVbWNx0h2LBVStgOIja XKJjFOgk1AQ1G1MQJuXRVxqERUopaU1bOKjTcXgZk4C60/p/ptTKQKW3I6Grc/kZVVhnu7WF/U1Eq Mj9jcfjr1YiJ2Bp/0jHsCrvZ0eWDluBMi6fu22hxa+PMWWOvAGkhl8Frp3qGRiMlmtqTsy6vmGSPN 03LYRqvOJRjudUYFPKAFux0EM+8NFfhQfKD1XyN0fDy79BECZRjTZtlLGJEXh93qQTZfGirbAwFM2 RQzhD3rD1wYLPnLepG97hBjLX9lQQ/47duy0DHQnyLfB0E+bU5iItCmIkxAk2Sum9xD3augGSyGtN KFYiDXalQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYOJD-0000kT-R7; Fri, 30 Oct 2020 06:54:47 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYOIv-0000eg-8O for linux-arm-kernel@lists.infradead.org; Fri, 30 Oct 2020 06:54:31 +0000 Received: by mail-pg1-x542.google.com with SMTP id i7so2473269pgh.6 for ; Thu, 29 Oct 2020 23:54:28 -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=4v+rccxgFbDh9J0Av9dhlm4mn7m7szaUzGMvUrk+XWI=; b=EgiThpzmDqrZAt8yaocWwVjH8GKCfdsub0lPNqHhKW+E5dcEnFSTTO0VWkNglt+7Lr zAsBKjGgPlXxUPvyQYbWdhIy5rG/WePPIDZaTqE3M5lQ+BAM1FOxY5RUqp2XK358ziSM 2106reUB/sR90zvikkiIqVlYgKzHWVOXsvB68= 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=4v+rccxgFbDh9J0Av9dhlm4mn7m7szaUzGMvUrk+XWI=; b=siQ1xdrpqjzQ9OejNYxCJ9UQrUPKpYU5fJahhHX2ulA5tDIt+SCnvxEN61k2ZWkvHq ssP5HRr4MGbtuHer675TcV0V2PXyJ7zjQXTq9WBAzQAWqxavH+g0fdkS4vU+xDPKLnWR o0RO3+s87evhuDoD9lONt2szb0OH2LxoXf0cP5fCizSwksn9DF7gJfjG9Q1CULUn2b9D V6AKNoqKPaCu2WE2BSbq6chX+I7foa16aMWbE4cOHpViEWlYCWW74jKXndsOtcRLfOzO 71m2ocR0evbdN8FLr9GRgP6HhxcxQy3Yt4Kzp6Fln7H8t7An0a3UQbBAMu39HtUdyrzN B0sg== X-Gm-Message-State: AOAM530Wjgjn4HZQa+cjK18wMkutZ6cre2YXelEVpTKdMWp+eqICX979 cYZUrG7WXUm3bQUV2X30IXxrVA== X-Google-Smtp-Source: ABdhPJwrNfJRhvZnxGWm/DbUs97GQAMkF5JXyTG3+yfjlIvVv6cGs1tnb8ZU5EZZ1gEqY/Vbdb7VDA== X-Received: by 2002:a65:57ce:: with SMTP id q14mr939908pgr.55.1604040866806; Thu, 29 Oct 2020 23:54:26 -0700 (PDT) Received: from rayagonda.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id n1sm4561547pgl.31.2020.10.29.23.54.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 23:54:26 -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 v2 5/6] i2c: iproc: handle master read request Date: Fri, 30 Oct 2020 12:23:38 +0530 Message-Id: <20201030065339.955-6-rayagonda.kokatanur@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201030065339.955-1-rayagonda.kokatanur@broadcom.com> References: <20201030065339.955-1-rayagonda.kokatanur@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201030_025429_485760_B4DBB197 X-CRM114-Status: GOOD ( 22.27 ) 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+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Handle single or multi byte master read request with or without repeated start. Fixes: c245d94ed106 ("i2c: iproc: Add multi byte read-write support for slave mode") Signed-off-by: Rayagonda Kokatanur --- drivers/i2c/busses/i2c-bcm-iproc.c | 215 +++++++++++++++++++++++------ 1 file changed, 170 insertions(+), 45 deletions(-) diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c index 7a235f9f5884..22e04055b447 100644 --- a/drivers/i2c/busses/i2c-bcm-iproc.c +++ b/drivers/i2c/busses/i2c-bcm-iproc.c @@ -160,6 +160,11 @@ #define IE_S_ALL_INTERRUPT_SHIFT 21 #define IE_S_ALL_INTERRUPT_MASK 0x3f +/* + * It takes ~18us to reading 10bytes of data, hence to keep tasklet + * running for less time, max slave read per tasklet is set to 10 bytes. + */ +#define MAX_SLAVE_RX_PER_INT 10 enum i2c_slave_read_status { I2C_SLAVE_RX_FIFO_EMPTY = 0, @@ -206,8 +211,18 @@ struct bcm_iproc_i2c_dev { /* bytes that have been read */ unsigned int rx_bytes; unsigned int thld_bytes; + + bool slave_rx_only; + bool rx_start_rcvd; + bool slave_read_complete; + u32 tx_underrun; + u32 slave_int_mask; + struct tasklet_struct slave_rx_tasklet; }; +/* tasklet to process slave rx data */ +static void slave_rx_tasklet_fn(unsigned long); + /* * Can be expanded in the future if more interrupt status bits are utilized */ @@ -261,6 +276,7 @@ static void bcm_iproc_i2c_slave_init( { u32 val; + iproc_i2c->tx_underrun = 0; if (need_reset) { /* put controller in reset */ val = iproc_i2c_rd_reg(iproc_i2c, CFG_OFFSET); @@ -297,8 +313,11 @@ static void bcm_iproc_i2c_slave_init( /* Enable interrupt register to indicate a valid byte in receive fifo */ val = BIT(IE_S_RX_EVENT_SHIFT); + /* Enable interrupt register to indicate a Master read transaction */ + val |= BIT(IE_S_RD_EVENT_SHIFT); /* Enable interrupt register for the Slave BUSY command */ val |= BIT(IE_S_START_BUSY_SHIFT); + iproc_i2c->slave_int_mask = val; iproc_i2c_wr_reg(iproc_i2c, IE_OFFSET, val); } @@ -324,76 +343,176 @@ static void bcm_iproc_i2c_check_slave_status( } } -static bool bcm_iproc_i2c_slave_isr(struct bcm_iproc_i2c_dev *iproc_i2c, - u32 status) +static void bcm_iproc_i2c_slave_read(struct bcm_iproc_i2c_dev *iproc_i2c) { + u8 rx_data, rx_status; + u32 rx_bytes = 0; u32 val; - u8 value, rx_status; - /* Slave RX byte receive */ - if (status & BIT(IS_S_RX_EVENT_SHIFT)) { + while (rx_bytes < MAX_SLAVE_RX_PER_INT) { val = iproc_i2c_rd_reg(iproc_i2c, S_RX_OFFSET); rx_status = (val >> S_RX_STATUS_SHIFT) & S_RX_STATUS_MASK; - if (rx_status == I2C_SLAVE_RX_START) { - /* Start of SMBUS for Master write */ - i2c_slave_event(iproc_i2c->slave, - I2C_SLAVE_WRITE_REQUESTED, &value); + rx_data = ((val >> S_RX_DATA_SHIFT) & S_RX_DATA_MASK); - val = iproc_i2c_rd_reg(iproc_i2c, S_RX_OFFSET); - value = (u8)((val >> S_RX_DATA_SHIFT) & S_RX_DATA_MASK); + if (rx_status == I2C_SLAVE_RX_START) { + /* Start of SMBUS Master write */ i2c_slave_event(iproc_i2c->slave, - I2C_SLAVE_WRITE_RECEIVED, &value); - } else if (status & BIT(IS_S_RD_EVENT_SHIFT)) { - /* Start of SMBUS for Master Read */ + I2C_SLAVE_WRITE_REQUESTED, &rx_data); + iproc_i2c->rx_start_rcvd = true; + iproc_i2c->slave_read_complete = false; + } else if (rx_status == I2C_SLAVE_RX_DATA && + iproc_i2c->rx_start_rcvd) { + /* Middle of SMBUS Master write */ i2c_slave_event(iproc_i2c->slave, - I2C_SLAVE_READ_REQUESTED, &value); - iproc_i2c_wr_reg(iproc_i2c, S_TX_OFFSET, value); + I2C_SLAVE_WRITE_RECEIVED, &rx_data); + } else if (rx_status == I2C_SLAVE_RX_END && + iproc_i2c->rx_start_rcvd) { + /* End of SMBUS Master write */ + if (iproc_i2c->slave_rx_only) + i2c_slave_event(iproc_i2c->slave, + I2C_SLAVE_WRITE_RECEIVED, + &rx_data); + + i2c_slave_event(iproc_i2c->slave, I2C_SLAVE_STOP, + &rx_data); + } else if (rx_status == I2C_SLAVE_RX_FIFO_EMPTY) { + iproc_i2c->rx_start_rcvd = false; + iproc_i2c->slave_read_complete = true; + break; + } - val = BIT(S_CMD_START_BUSY_SHIFT); - iproc_i2c_wr_reg(iproc_i2c, S_CMD_OFFSET, val); + rx_bytes++; + } +} - /* - * Enable interrupt for TX FIFO becomes empty and - * less than PKT_LENGTH bytes were output on the SMBUS - */ - val = iproc_i2c_rd_reg(iproc_i2c, IE_OFFSET); - val |= BIT(IE_S_TX_UNDERRUN_SHIFT); - iproc_i2c_wr_reg(iproc_i2c, IE_OFFSET, val); - } else { - /* Master write other than start */ - value = (u8)((val >> S_RX_DATA_SHIFT) & S_RX_DATA_MASK); +static void slave_rx_tasklet_fn(unsigned long data) +{ + struct bcm_iproc_i2c_dev *iproc_i2c = (struct bcm_iproc_i2c_dev *)data; + u32 int_clr; + + bcm_iproc_i2c_slave_read(iproc_i2c); + + /* clear pending IS_S_RX_EVENT_SHIFT interrupt */ + int_clr = BIT(IS_S_RX_EVENT_SHIFT); + + if (!iproc_i2c->slave_rx_only && iproc_i2c->slave_read_complete) { + /* + * In case of single byte master-read request, + * IS_S_TX_UNDERRUN_SHIFT event is generated before + * IS_S_START_BUSY_SHIFT event. Hence start slave data send + * from first IS_S_TX_UNDERRUN_SHIFT event. + * + * This means don't send any data from slave when + * IS_S_RD_EVENT_SHIFT event is generated else it will increment + * eeprom or other backend slave driver read pointer twice. + */ + iproc_i2c->tx_underrun = 0; + iproc_i2c->slave_int_mask |= BIT(IE_S_TX_UNDERRUN_SHIFT); + + /* clear IS_S_RD_EVENT_SHIFT interrupt */ + int_clr |= BIT(IS_S_RD_EVENT_SHIFT); + } + + /* clear slave interrupt */ + iproc_i2c_wr_reg(iproc_i2c, IS_OFFSET, int_clr); + /* enable slave interrupts */ + iproc_i2c_wr_reg(iproc_i2c, IE_OFFSET, iproc_i2c->slave_int_mask); +} + +static bool bcm_iproc_i2c_slave_isr(struct bcm_iproc_i2c_dev *iproc_i2c, + u32 status) +{ + u32 val; + u8 value; + + /* + * Slave events in case of master-write, master-write-read and, + * master-read + * + * Master-write : only IS_S_RX_EVENT_SHIFT event + * Master-write-read: both IS_S_RX_EVENT_SHIFT and IS_S_RD_EVENT_SHIFT + * events + * Master-read : both IS_S_RX_EVENT_SHIFT and IS_S_RD_EVENT_SHIFT + * events or only IS_S_RD_EVENT_SHIFT + */ + if (status & BIT(IS_S_RX_EVENT_SHIFT) || + status & BIT(IS_S_RD_EVENT_SHIFT)) { + /* disable slave interrupts */ + val = iproc_i2c_rd_reg(iproc_i2c, IE_OFFSET); + val &= ~iproc_i2c->slave_int_mask; + iproc_i2c_wr_reg(iproc_i2c, IE_OFFSET, val); + + if (status & BIT(IS_S_RD_EVENT_SHIFT)) + /* Master-write-read request */ + iproc_i2c->slave_rx_only = false; + else + /* Master-write request only */ + iproc_i2c->slave_rx_only = true; + + /* schedule tasklet to read data later */ + tasklet_schedule(&iproc_i2c->slave_rx_tasklet); + + /* clear only IS_S_RX_EVENT_SHIFT interrupt */ + iproc_i2c_wr_reg(iproc_i2c, IS_OFFSET, + BIT(IS_S_RX_EVENT_SHIFT)); + } + + if (status & BIT(IS_S_TX_UNDERRUN_SHIFT)) { + iproc_i2c->tx_underrun++; + if (iproc_i2c->tx_underrun == 1) + /* Start of SMBUS for Master Read */ i2c_slave_event(iproc_i2c->slave, - I2C_SLAVE_WRITE_RECEIVED, &value); - if (rx_status == I2C_SLAVE_RX_END) - i2c_slave_event(iproc_i2c->slave, - I2C_SLAVE_STOP, &value); - } - } else if (status & BIT(IS_S_TX_UNDERRUN_SHIFT)) { - /* Master read other than start */ - i2c_slave_event(iproc_i2c->slave, - I2C_SLAVE_READ_PROCESSED, &value); + I2C_SLAVE_READ_REQUESTED, + &value); + else + /* Master read other than start */ + i2c_slave_event(iproc_i2c->slave, + I2C_SLAVE_READ_PROCESSED, + &value); iproc_i2c_wr_reg(iproc_i2c, S_TX_OFFSET, value); + /* start transfer */ val = BIT(S_CMD_START_BUSY_SHIFT); iproc_i2c_wr_reg(iproc_i2c, S_CMD_OFFSET, val); + + /* clear interrupt */ + iproc_i2c_wr_reg(iproc_i2c, IS_OFFSET, + BIT(IS_S_TX_UNDERRUN_SHIFT)); } - /* Stop */ + /* Stop received from master in case of master read transaction */ if (status & BIT(IS_S_START_BUSY_SHIFT)) { - i2c_slave_event(iproc_i2c->slave, I2C_SLAVE_STOP, &value); /* * Disable interrupt for TX FIFO becomes empty and * less than PKT_LENGTH bytes were output on the SMBUS */ - val = iproc_i2c_rd_reg(iproc_i2c, IE_OFFSET); - val &= ~BIT(IE_S_TX_UNDERRUN_SHIFT); - iproc_i2c_wr_reg(iproc_i2c, IE_OFFSET, val); + iproc_i2c->slave_int_mask &= ~BIT(IE_S_TX_UNDERRUN_SHIFT); + iproc_i2c_wr_reg(iproc_i2c, IE_OFFSET, + iproc_i2c->slave_int_mask); + + /* End of SMBUS for Master Read */ + val = BIT(S_TX_WR_STATUS_SHIFT); + iproc_i2c_wr_reg(iproc_i2c, S_TX_OFFSET, val); + + val = BIT(S_CMD_START_BUSY_SHIFT); + iproc_i2c_wr_reg(iproc_i2c, S_CMD_OFFSET, val); + + /* flush TX FIFOs */ + val = iproc_i2c_rd_reg(iproc_i2c, S_FIFO_CTRL_OFFSET); + val |= (BIT(S_FIFO_TX_FLUSH_SHIFT)); + iproc_i2c_wr_reg(iproc_i2c, S_FIFO_CTRL_OFFSET, val); + + i2c_slave_event(iproc_i2c->slave, I2C_SLAVE_STOP, &value); + + /* clear interrupt */ + iproc_i2c_wr_reg(iproc_i2c, IS_OFFSET, + BIT(IS_S_START_BUSY_SHIFT)); } - /* clear interrupt status */ - iproc_i2c_wr_reg(iproc_i2c, IS_OFFSET, status); + /* check slave transmit status only if slave is transmitting */ + if (!iproc_i2c->slave_rx_only) + bcm_iproc_i2c_check_slave_status(iproc_i2c); - bcm_iproc_i2c_check_slave_status(iproc_i2c); return true; } @@ -1074,6 +1193,10 @@ static int bcm_iproc_i2c_reg_slave(struct i2c_client *slave) return -EAFNOSUPPORT; iproc_i2c->slave = slave; + + tasklet_init(&iproc_i2c->slave_rx_tasklet, slave_rx_tasklet_fn, + (unsigned long)iproc_i2c); + bcm_iproc_i2c_slave_init(iproc_i2c, false); return 0; } @@ -1094,6 +1217,8 @@ static int bcm_iproc_i2c_unreg_slave(struct i2c_client *slave) IE_S_ALL_INTERRUPT_SHIFT); iproc_i2c_wr_reg(iproc_i2c, IE_OFFSET, tmp); + tasklet_kill(&iproc_i2c->slave_rx_tasklet); + /* Erase the slave address programmed */ tmp = iproc_i2c_rd_reg(iproc_i2c, S_CFG_SMBUS_ADDR_OFFSET); tmp &= ~BIT(S_CFG_EN_NIC_SMB_ADDR3_SHIFT); From patchwork Fri Oct 30 06:53:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rayagonda Kokatanur X-Patchwork-Id: 11868603 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,T_TVD_MIME_NO_HEADERS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8646EC56201 for ; Fri, 30 Oct 2020 06:56:18 +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 E333822206 for ; Fri, 30 Oct 2020 06:56:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tbCiZ3Ue"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="eExcwKQ7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E333822206 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+linux-arm-kernel=archiver.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=IkwyKLFPItQIX9x6J5UFNUun2iAsBZjF0kMA18HdbbY=; b=tbCiZ3Ue+ON17qafX8JOtLZ42 t9HKsIqqrPlBR2qv+qW7FCqGhVpNqhHsv3yA0U4mRitV3xoAucTb5p8Vyw9zUouSajfsnH2hxwV9B O1oM3fj/HbfNerFUlIlOxNp1qxZp8jIp5xX2d7VyTx9ovW3AqcSB6tDMAFIqx3LDnzJ2HOEsiiqGo oCkw6bZWwVMK7hUVjOFeUJximSwNKjPfS5Gxib9ohvpPdtdhmrHcY3vPfra7ndKwvxfybbRQ4z5pf oCIj91KOdUV7pSrylUaGptRmgzAmZAJnOnu87OCcQ8qSWTrfeWB2qncwDRy2bt+DPaOs9sIe9d5hO sFWYnQ9Yw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYOJO-0000oT-3S; Fri, 30 Oct 2020 06:54:58 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYOJ1-0000gg-4c for linux-arm-kernel@lists.infradead.org; Fri, 30 Oct 2020 06:54:38 +0000 Received: by mail-pf1-x441.google.com with SMTP id y14so4416912pfp.13 for ; Thu, 29 Oct 2020 23:54:34 -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=544BkrA2tw5mSbsPxnpiOpQGN5USu50ZfT6Cm3fC9L8=; b=eExcwKQ7tCPuL3P2YcPAjbdeE3zU5bGmdHwSu2IQh8Km4EmmEdLsv44LIeXKIDvW7B Y6Kls8pdn+MdzE8qTF4PvBtGfhITz3fWwCrJTCE3ruzKZot+XlNUSbong8QqVuVX14tv Z64X2K4RaKEGLg8un9J7VK/V3pnIp/64sPBjE= 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=544BkrA2tw5mSbsPxnpiOpQGN5USu50ZfT6Cm3fC9L8=; b=hLTUGeAaqjR7Vwiccc2aBdSdnrQ79qGL7KJfXvG389LVYCvV05r3jwcbSQZExgAPtT eVtgw+PL8JavxhBkna/5UTpernDrZQVgwWyF1UNYL2lA+TkwA4pJzBbSJwgnutk4fUoi wijRYGS865sWsUAo0iaPcR1Pm++K0lNRlhinBGMYCefo/eAssjovprpBBRiGH30/8ftD f46AOLOCoqP6h5kyF0+rn1XWfwWuQ4fgMeEanqqvup1M1Yn0tisCNFsm6icBoWh7+qmk mWxjE2bOc282w7lwgKHwzbX+j7ubjDoSIdsWOm4WM6lR2KVEMZcmxYTndmE50imvvhcu ecjA== X-Gm-Message-State: AOAM531+a/MWLJCZ3wVGGuI9lST1vdI16DD9jKJuDV0hDLPmMde1VXx4 F3LT3DLrzApZktXF59Xu5+oK6w== X-Google-Smtp-Source: ABdhPJzaIu3OkESj/yQJWhblNi1Jb0rEwSB5EUvRmykTXyzr7HNBLTaVoZC4cYuL5E7appUVFRvlsw== X-Received: by 2002:a62:36c3:0:b029:18a:6031:ac50 with SMTP id d186-20020a6236c30000b029018a6031ac50mr215599pfa.61.1604040872805; Thu, 29 Oct 2020 23:54:32 -0700 (PDT) Received: from rayagonda.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id n1sm4561547pgl.31.2020.10.29.23.54.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 23:54:32 -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 v2 6/6] i2c: iproc: handle rx fifo full interrupt Date: Fri, 30 Oct 2020 12:23:39 +0530 Message-Id: <20201030065339.955-7-rayagonda.kokatanur@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201030065339.955-1-rayagonda.kokatanur@broadcom.com> References: <20201030065339.955-1-rayagonda.kokatanur@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201030_025435_261650_5DEA23F3 X-CRM114-Status: GOOD ( 13.21 ) 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+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add code to handle IS_S_RX_FIFO_FULL_SHIFT interrupt to support master write request with >= 64 bytes. Iproc has a slave rx fifo size of 64 bytes. Rx fifo full interrupt (IS_S_RX_FIFO_FULL_SHIFT) will be generated when RX fifo becomes full. This can happen if master issues write request of more than 64 bytes. Signed-off-by: Rayagonda Kokatanur --- drivers/i2c/busses/i2c-bcm-iproc.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c index 22e04055b447..cceaf69279a9 100644 --- a/drivers/i2c/busses/i2c-bcm-iproc.c +++ b/drivers/i2c/busses/i2c-bcm-iproc.c @@ -313,6 +313,8 @@ static void bcm_iproc_i2c_slave_init( /* Enable interrupt register to indicate a valid byte in receive fifo */ val = BIT(IE_S_RX_EVENT_SHIFT); + /* Enable interrupt register to indicate Slave Rx FIFO Full */ + val |= BIT(IE_S_RX_FIFO_FULL_SHIFT); /* Enable interrupt register to indicate a Master read transaction */ val |= BIT(IE_S_RD_EVENT_SHIFT); /* Enable interrupt register for the Slave BUSY command */ @@ -434,9 +436,15 @@ static bool bcm_iproc_i2c_slave_isr(struct bcm_iproc_i2c_dev *iproc_i2c, * events * Master-read : both IS_S_RX_EVENT_SHIFT and IS_S_RD_EVENT_SHIFT * events or only IS_S_RD_EVENT_SHIFT + * + * iproc has a slave rx fifo size of 64 bytes. Rx fifo full interrupt + * (IS_S_RX_FIFO_FULL_SHIFT) will be generated when RX fifo becomes + * full. This can happen if Master issues write requests of more than + * 64 bytes. */ if (status & BIT(IS_S_RX_EVENT_SHIFT) || - status & BIT(IS_S_RD_EVENT_SHIFT)) { + status & BIT(IS_S_RD_EVENT_SHIFT) || + status & BIT(IS_S_RX_FIFO_FULL_SHIFT)) { /* disable slave interrupts */ val = iproc_i2c_rd_reg(iproc_i2c, IE_OFFSET); val &= ~iproc_i2c->slave_int_mask; @@ -452,9 +460,14 @@ static bool bcm_iproc_i2c_slave_isr(struct bcm_iproc_i2c_dev *iproc_i2c, /* schedule tasklet to read data later */ tasklet_schedule(&iproc_i2c->slave_rx_tasklet); - /* clear only IS_S_RX_EVENT_SHIFT interrupt */ - iproc_i2c_wr_reg(iproc_i2c, IS_OFFSET, - BIT(IS_S_RX_EVENT_SHIFT)); + /* + * clear only IS_S_RX_EVENT_SHIFT and + * IS_S_RX_FIFO_FULL_SHIFT interrupt. + */ + val = BIT(IS_S_RX_EVENT_SHIFT); + if (status & BIT(IS_S_RX_FIFO_FULL_SHIFT)) + val |= BIT(IS_S_RX_FIFO_FULL_SHIFT); + iproc_i2c_wr_reg(iproc_i2c, IS_OFFSET, val); } if (status & BIT(IS_S_TX_UNDERRUN_SHIFT)) {