From patchwork Sun Oct 11 18:22:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rayagonda Kokatanur X-Patchwork-Id: 11831027 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 9605714D5 for ; Sun, 11 Oct 2020 18:25:44 +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 5C8E72222E for ; Sun, 11 Oct 2020 18:25:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ki0ZY8Y5"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="cuKFKb8w" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C8E72222E 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=CuXC+a3FLvoeTH/jZq9ZK0jUZT7r/hNyRx3NzumMkgY=; b=Ki0ZY8Y5EwSLt7RJPox8P69vc 2MDkcljcph9AfJ0IlISYHIB/k9axlojZ97B0+GZQgCtvMFYNTP0f9KEgKHhOhGUQ0g7MEipwmrF/B MBgCWNNvTJgeYYx45YdWfdxgCOJx8GCKoSk4Mey24RbPMNnoXYLe1gTr0q3haQKoS5SN5v08d7KFE 8l3N+HHTN149Cr4uB50UESzGChuOzzHEXU39ufZXH1WagkBSFDitTagVF5u/e60LaU6fws1yxVJeF BocM2/cnWAFeS8wiXwyAdZ5pXjhYUq1zBZHaYnyR4rMJ7Be1J8YhJXuzAsXClPOGUS2D+lf4xG9fJ TzW7V2ZNg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kRg0X-0002OH-MM; Sun, 11 Oct 2020 18:23:45 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kRg0U-0002NZ-Jw for linux-arm-kernel@lists.infradead.org; Sun, 11 Oct 2020 18:23:43 +0000 Received: by mail-pl1-x641.google.com with SMTP id 1so1376623ple.2 for ; Sun, 11 Oct 2020 11:23:42 -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=PXqK9s3Pkw0ayTt6c3ZcdHkggy4LY4tBi4rUJXN76+s=; b=cuKFKb8w4iRuZbfEpg3IYjw9rtcDZ7t+i9LYO3pHeopIr+Z4d/WcJ27Yin5g3Jjgt8 dNFOwCcf57wQNKrS7swonpLlJ2A6UJ2WYEAPRr22WuRbINkdMe7Ll36yZS7BrPKgpqXR P4d9UTBqdt5iRXxkcPU7iBAcgM9gsHlpB01Mk= 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=PXqK9s3Pkw0ayTt6c3ZcdHkggy4LY4tBi4rUJXN76+s=; b=duu4HvK6L9lW4zAhW2pLyUdSN47PX5Yx+/XuRGWFvzpwkxVGr9JPgiWrVxe28fQTfP /oMaWTcU5nV8Rz45o3DjUEi3XEs3NlCZCCCyM+NFj2aLooudGaMSCXsaVEElQTZadFQZ G0kaJjCh3xiV1J/PIW1Kir8X1XivKhaeZ4IwVBnnEq87fhsBGUv4K99BzjWlwPUjA+Ko rmcw1uA9RTX2OFHng445LEJqxtSq8hUI67yAxaZFELSTrrkYRKOen9yXYbJWatcLY7Bc KPqRmcFpqVioVXwc/ieuZkxxo8xN/TvEpOWcLe2JAWcOBD4sbMHZig073yKgSAIQPjwR hHvA== X-Gm-Message-State: AOAM533R79KcieK3c7yNlIQ+Yk/344WOmU8OcphoYKZ7P3JTNikg6PTj L/zim7aD03cR+NJfnZT3SutHpg== X-Google-Smtp-Source: ABdhPJxMBQzowyKsqa5x0XQAU5YRJlVZz1iZPLBq8Z/W9vfqUuurM4WgSyvQMaH2xkPO9BDf22JOBg== X-Received: by 2002:a17:902:7d97:b029:d3:c8b0:503f with SMTP id a23-20020a1709027d97b02900d3c8b0503fmr20901418plm.2.1602440620244; Sun, 11 Oct 2020 11:23:40 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 11:23:39 -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 1/6] i2c: iproc: handle Master aborted error Date: Sun, 11 Oct 2020 23:52:49 +0530 Message-Id: <20201011182254.17776-2-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_142342_674618_8875B933 X-CRM114-Status: GOOD ( 12.16 ) 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:641 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 Master aborted error by flushing tx and rx fifo and reinitializing the hw. Signed-off-by: Rayagonda Kokatanur Acked-by: Ray Jui --- 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);