From mboxrd@z Thu Jan 1 00:00:00 1970 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 1D92EC52D6F for ; Wed, 21 Aug 2024 15:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=on58eBktu8//MnphFE6QbfO4BlqhK86yb9Y44C2uYzo=; b=06nP2RnzTbs0afbXejxT4TFdwK lHebcNyGo8bs9J/CsUI4BEomMCgoIe60ureMfdooF3Ai4FY1mLN3bKiIE7U9bQHJDMUl+8PoNURof PffW9idz1uP/E4yEG6wtF392dcD5GFayaeodz5Mp+TRod/NQJmKUcfe3UEy/qe7e6yUuNCUVGEc9+ Wbv3XZ7y6ftLBe223A1cz4t8GQq8gbxkanrWs9bau9rdNfsimlNJj3hH+mOsuzvIGEXlcQEP5jesX Hg8+b4vw72/kMdvdo+VYN6VIDRJuwajLGAYk8EUu8U4OSGnK9L4JLYDi4BVAFQeP3KMxTwvX/OCXM uzOFgVng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgnCP-00000009U8j-1tn7; Wed, 21 Aug 2024 15:24:37 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgnBJ-00000009TqH-1Y6g for linux-arm-kernel@lists.infradead.org; Wed, 21 Aug 2024 15:23:30 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-42ab99fb45dso20577965e9.1 for ; Wed, 21 Aug 2024 08:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724253807; x=1724858607; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=on58eBktu8//MnphFE6QbfO4BlqhK86yb9Y44C2uYzo=; b=RFJkjfKiPYi/py4BhDzlnD1a0Aj+9opscjiR4AHZrLomMklUZ+jRiXtNZABSLHOPE3 DD4+EJlr3ZmLxofBIJPlpXQGd6E6wCiUGCFZUw3S9OUINqhysHRet9uXzfvTnsrexLAn VcLD1C5zJH+lVAqJ2IEvBhpLStI5xI497yBQRH/TrCxz4vsgnEuTGk/q/nFyhRWJcuWO 2DXXBk0RkE/QvYrrfJafhqQ1P9gz81FB0lb9b3qGnmYoZBKvuOp6Artvshcj+19PF9V3 QGAlwttx7Ug+7r8mDNtWoWfXVN9iGWaMx5S8J1XeelShJZV+munqLcXdne1Xm0RAxM4+ FlPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724253807; x=1724858607; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=on58eBktu8//MnphFE6QbfO4BlqhK86yb9Y44C2uYzo=; b=gXivY4FrlKbKPRw0Y2fbR0MpZT53d27NkMz9uvJAsi57TCth03JNAoCHsjT9Wtb5iB DiaFdhLbfbJsggKgCKwBFbqPXQUeTexZ07XtcKLrdZvPS50uAlpLhpi/XUU95MdzbYof vNDYxYdTXNuLNn42uh5soiXYWmhKiz5laDQMvMkTq8fQU2weY/YwMRKR/cd89VKLRhoK lsEttj9cdbUINO+cdEz4dFqUqobOf5AIOrXcEu2L6wSSibGdU90S+AdmR2c2WLmuyLzM bPX4RO31MsM8OC2TixnXszWcqurDL2+S6dNQQoSdakE6jECDPOijObDyumBUm2nci9T4 O90w== X-Forwarded-Encrypted: i=1; AJvYcCW+s/n4esNSP/13vLnbuMF+KzSQsAH8wjVnu1YVSpSuMOMsf4K/pcWG4Rb31EuO0sPhM5AUE+44xch71myp3y0C@lists.infradead.org X-Gm-Message-State: AOJu0YxXcrorBM56P5D6eek2WpbUhu022NRvPJfI3CtLF0wVrue0JuG6 2cECeAC5dfASJ+1iQPS2hkmSsMAHp62yO+s7zUpH9FRsmMYy8mekJEpCpp27 X-Google-Smtp-Source: AGHT+IG1ZzxG35cV4xa41v9iY/LRo3Z2DG4I6ZnhNmHSYUOwELUQafq8+lrzs83TZ5LK5Kr+B1jzwg== X-Received: by 2002:a05:600c:4444:b0:428:f0a:3f92 with SMTP id 5b1f17b1804b1-42abd2265f5mr24916965e9.21.1724253806602; Wed, 21 Aug 2024 08:23:26 -0700 (PDT) Received: from eichest-laptop ([2a02:168:af72:0:ce3a:abb4:426f:fe4a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42abef9f5b9sm29583395e9.29.2024.08.21.08.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2024 08:23:26 -0700 (PDT) Date: Wed, 21 Aug 2024 17:23:24 +0200 From: Stefan Eichenberger To: Oleksij Rempel Cc: Fabio Estevam , kernel@pengutronix.de, andi.shyti@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, Frank.Li@nxp.com, francesco.dolcini@toradex.com, linux-i2c@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Eichenberger Subject: Re: [PATCH v2 1/4] i2c: imx: only poll for bus busy in multi master mode Message-ID: References: <20240819072052.8722-1-eichest@gmail.com> <20240819072052.8722-2-eichest@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_082329_432373_E25613EF X-CRM114-Status: GOOD ( 31.52 ) 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 Hi Fabio, Oleksij, On Wed, Aug 21, 2024 at 04:39:39PM +0200, Oleksij Rempel wrote: > Hi Fabio, Stefan, > > On Wed, Aug 21, 2024 at 08:01:20AM -0300, Fabio Estevam wrote: > > Hi Stefan, > > > > On Mon, Aug 19, 2024 at 4:20 AM Stefan Eichenberger wrote: > > > > > > From: Stefan Eichenberger > > > > > > According to the i.MX8M Mini reference manual chapter "16.1.4.2 > > > Generation of Start" it is only necessary to poll for bus busy and > > > arbitration lost in multi master mode. This helps to avoid rescheduling > > > while the i2c bus is busy and avoids SMBus devices to timeout. > > > > > > Signed-off-by: Stefan Eichenberger > > > Reviewed-by: Frank Li > > > > This fixes a pca953x probe error on an imx8mp board running linux-stable 6.6: > > > > [ 1.893260] pca953x 2-0020: failed writing register > > [ 1.898258] pca953x 2-0020: probe with driver pca953x failed with error -11 > > > > Could you please add a Fixes tag and Cc stable so that this can reach > > the stable kernels? > > > > Tested-by: Fabio Estevam Thanks a lot for testing. Are the other patches required as well or did only introducing the master mode flag solve the issue? > > > > Thanks a lot, > > It looks like with this patch, the I2SR_IAL interrupt is not cleared. > I would expect some kind of interrupt storm. Can you confirm it? This is a good question. i2c_imx_trx_complete was never called in the interrupt handler. So that would mean the storm would already be there before just for a shorter time. We only clear the IFF flag in the isr. > This causes a processor interrupt request (if the interrupt enable is > asserted [IIEN = 1]). The interrupt is set when one of the following > occurs: > - One byte transfer is completed (the interrupt is set at the falling > edge of the ninth clock). > - An address is received that matches its own specific address in > Slave Receive mode. > - Arbitration is lost. Unfortunately, I don't have a device that uses multi master mode and we would only see it on such a device. However, also from the reference manual: > IAL must be cleared by software by writing a "0" to it at the start of > the interrupt service routine So most likely it was wrong the whole the time we just didn't see it before, could that be? I think a fix would be relatively easy we have to clear it at the beginning of the isr but after we read the status. I could add this to the series if you agree. Regards, Stefan