From patchwork Fri Dec 16 08:45:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Primoz Fiser X-Patchwork-Id: 13074836 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A0E32C4332F for ; Fri, 16 Dec 2022 08:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=EDaWQjvhr7zLP4u3Pi6d6D/2GT/sdpwXab+i8Z19hQ8=; b=PtjKkivDRHr6aX QeuGRe+TUtzmRMPjsqpoUfrgUO1OiJqrK6DYls8IY5f4E7Z9tE/Se6ptC/TR85Dezas8tpA+CmwI2 KpHBLOVi4dGM9th41eFm70K3VeftWFq9QoQHIPd6iR+jC0YfHxLxbZQxmMaHuW7yMIm76rf/DlR+9 XO0hVQE6ajnUwXfMpc/e2lFS8qCF0r+PxrAzUVMTk4Rn8LA10r92sqdb2h89oNBpIJ7QZ11LiLquZ 5qNGVLKN7G8Kr+5OPSe5j3VT/WPZuMNQgZUGAmUvqI7l9A4vOlVu6WmnZ20C0BnDqrIyYeX1ILQih Nv4ZiyXIp9oe50mNBFUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p66LP-00DfdZ-K6; Fri, 16 Dec 2022 08:45:27 +0000 Received: from cpanel.siel.si ([46.19.9.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p66LM-00DfYQ-D3 for linux-arm-kernel@lists.infradead.org; Fri, 16 Dec 2022 08:45:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=norik.com; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=SrepTQUYC3p/BhSro147vpEd1UGiig9d/PvJMssI4IQ=; b=ZINQKYDVIRatBAb/YPUoZpKcNf MI0+cGB2veaSxlC+MSawASs0OCSkAhHncguoGN9RjM/x00UIORhgCMLvUE0zAFqTUY9yARD7SPEmd +p6ygVhh/q3DCF2iOE89G0tAP7otNmcLku45Viumj9Zje3fPiyHbSN61V0eJv6/UW6Mn4DAzTb4ue H4yc5ZbIVE8f1czj1CUyuDb9XJlaXVfZvhbN3NXyQ3U3ums6vkznOsQ+Uy3sys3/7MGPkw51bCIR/ MQltLGQHDWUHVYEbjePlSdcoVd9tjEr+S3tCUNXUNFyeEe3g3KVV/Q06BWXZ/qHkHTO3IVV8l1j1V C1NcqBAw==; Received: from 89-212-21-243.static.t-2.net ([89.212.21.243]:47806 helo=z840.regau.abatec.at) by cpanel.siel.si with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.95) (envelope-from ) id 1p66Kz-004ran-L2; Fri, 16 Dec 2022 09:45:09 +0100 From: Primoz Fiser To: Oleksij Rempel , Pengutronix Kernel Team , Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: upstream@lists.phytec.de Subject: [PATCH] i2c: imx: increase retries on arbitration loss Date: Fri, 16 Dec 2022 09:45:11 +0100 Message-Id: <20221216084511.2576786-1-primoz.fiser@norik.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel.siel.si X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - norik.com X-Get-Message-Sender-Via: cpanel.siel.si: authenticated_id: primoz.fiser@norik.com X-Authenticated-Sender: cpanel.siel.si: primoz.fiser@norik.com X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221216_004524_948937_A3759779 X-CRM114-Status: UNSURE ( 4.64 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org By default, retries value is set to 0 (no retries). Set retries to more sensible value of 3 to allow i2c core to re-attempt transfer in case of i2c arbitration loss (i2c-imx returns -EAGAIN errno is such case). Signed-off-by: Primoz Fiser --- drivers/i2c/busses/i2c-imx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index cf5bacf3a488..6a5694cfe1cc 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -1478,6 +1478,7 @@ static int i2c_imx_probe(struct platform_device *pdev) i2c_imx->adapter.dev.parent = &pdev->dev; i2c_imx->adapter.nr = pdev->id; i2c_imx->adapter.dev.of_node = pdev->dev.of_node; + i2c_imx->adapter.retries = 3; i2c_imx->base = base; ACPI_COMPANION_SET(&i2c_imx->adapter.dev, ACPI_COMPANION(&pdev->dev));