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 A8DE3C3DA4A for ; Thu, 22 Aug 2024 11:51: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: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=K08JVc0Hn+S+yk8ZDM9GspDTZHjWKjn6EOcLVOcvC/A=; b=KQq1AXoc/E9f8e0xCY2Fx0Uz/w zDo+MISUyWNppvjOuXIUgFEYmRGVecQAKgiLoEZ1wDT7IVL/x0EmbmSRSR/cchjJyFjW66I6V76te WpLDKs/JknTp59890JbvUZrlntkEGXr6jQLOHGMY3D8I+EU3BajHkPDHRIECGep2mxSGx86qwChXg gtyLzaZC/xjIHy7TZxiwhmNvP0NwyjC1b7TEkDiVRhUBAKaQjWhOK9ONmc3GtXyrYXq3svAEdXIKs Vzg5ejoht+75vPJaIfSlboKU7/akox5I4PovET+R+v3SznP/QcpGSJ5tdian+rD1ACUdPA5JBFLpW yd9DOXzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh6Le-0000000Ce5W-2ZNO; Thu, 22 Aug 2024 11:51:26 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh6Ka-0000000CdnN-0l6X for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2024 11:50:21 +0000 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a86984e035aso33908766b.2 for ; Thu, 22 Aug 2024 04:50:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724327418; x=1724932218; 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=K08JVc0Hn+S+yk8ZDM9GspDTZHjWKjn6EOcLVOcvC/A=; b=K8mMz7CVBSVi8Cmuy3b90y4p/exw9la5wIHHul9RUHH33ce7dd/FCZ1BUXvI1Q5QE4 wiAwp5wsD7jZOZbu/RpJwekqC1PtKQ7l2E3Ve5j/Or9gwAZPbftA6Xf6KrRunQVj729U pw/wno5kJobPnpQvTPaXmHRCsc/We9vhcYdb9iSrqKxJeq/ebee1D6uUSt1F8IQ0hrRy Aa09hCFJDeI68KuE9TpJisqRPWhFnbjaI71Q7WEPrtOmt90rVVfY7JlRusBXOfPwu7ST dtTMMuMSSX12jjfxq4wLubcb1HSsKFfwiOlIuAjCQhz/N8rlQqXpP8XfKE4+Wy9nRw/T 957A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724327418; x=1724932218; 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=K08JVc0Hn+S+yk8ZDM9GspDTZHjWKjn6EOcLVOcvC/A=; b=MbR44HiLM1w82C1jufmHVcPFq3KERiJmJtS8m0LusomLpnxQdHq6Dl7E2jwnSiYIh3 1Fj7KU5jScPBy0+1bHQ6xMzLaJpe0nrP41zU4ppBh9rJctKpqTZRbN+OiYbmkbgCdtNF 1orhgR5ffafIvbqJMLwnu4MqGlhbQrGq1xUyRqO5cNhUT8zj64rdJ2ntrAA9wOWwQUSt 9V6NLurW/0YgFIzwoSIUOQJbCnpSHdvbL3W9Yv6W0ti6R+ed63IfPqtG+2IUV0Ezvlih Lv+G6vou/VjC2bFC4lSv1dO7rJTTgSDs3GtitQziKM1h12xunNnuBoI6N//E9mdOaK3I TMXA== X-Forwarded-Encrypted: i=1; AJvYcCXq32v1LpsoeiQRJP4m7pSXBBLqal9pgWBktTH8+4tGZ7xaD6fXyoiYaOriW25Tfp+bQf8PHkQM7qWI0KZGv8g7@lists.infradead.org X-Gm-Message-State: AOJu0Yy6GoJjOXFwxwgTTBFQSIBww3A8NEc1GkgvQxh8A5zYCnk/tVJV u/JNZO2HP4r/6bbSbTVGFBYl9w/+GG1yACNw9vI3umXquC2fd4SH X-Google-Smtp-Source: AGHT+IGwqD+8gzMCJdo8LLwoHsX3EVXJqes6Nv6AKEZPfuRZLAr97yDLTDQ4c6GPXBlh2PjBTNid6Q== X-Received: by 2002:a17:907:97ce:b0:a86:7924:11c0 with SMTP id a640c23a62f3a-a867924134amr432391866b.55.1724327417556; Thu, 22 Aug 2024 04:50:17 -0700 (PDT) Received: from eichest-laptop ([2a02:168:af72:0:daa9:644d:3c2:44bb]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a868f47d31fsm109533566b.151.2024.08.22.04.50.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2024 04:50:17 -0700 (PDT) Date: Thu, 22 Aug 2024 13:50:15 +0200 From: Stefan Eichenberger To: Fabio Estevam Cc: o.rempel@pengutronix.de, 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-20240822_045020_245497_058CBF61 X-CRM114-Status: GOOD ( 30.23 ) 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, On Thu, Aug 22, 2024 at 08:07:44AM -0300, Fabio Estevam wrote: > Hi Stefan and Oleksij, > > On Wed, Aug 21, 2024 at 8:01 AM Fabio Estevam wrote: > > > 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 > > I am sorry, but I have to withdraw my Tested-by tag. > > For debugging purposes, I kept 'fw_devlink=off' in the kernel command > line and that's what made it work. > > Removing 'fw_devlink=off' I still get the probe failure, even with all > the series from Stefan applied: > > [ 1.849097] pca953x 2-0020: supply vcc not found, using dummy regulator > [ 1.855857] pca953x 2-0020: using no AI > [ 1.859965] i2c i2c-2: write failed with -6 > [ 1.865578] pca953x 2-0020: failed writing register: -6 > > In my case, I can get the pca953x driver to probe successfully in one > of the following cases: > > 1. Select pca953x as a module instead of built-in > > or > > 2. Pass 'fw_devlink=off' in the kernel command line > > or > > 3. Register the i2c-imx driver as module_platform_driver(): > > --- a/drivers/i2c/busses/i2c-imx.c > +++ b/drivers/i2c/busses/i2c-imx.c > @@ -1586,17 +1586,7 @@ static struct platform_driver i2c_imx_driver = { > .id_table = imx_i2c_devtype, > }; > > -static int __init i2c_adap_imx_init(void) > -{ > - return platform_driver_register(&i2c_imx_driver); > -} > -subsys_initcall(i2c_adap_imx_init); > - > -static void __exit i2c_adap_imx_exit(void) > -{ > - platform_driver_unregister(&i2c_imx_driver); > -} > -module_exit(i2c_adap_imx_exit); > +module_platform_driver(i2c_imx_driver); > > or > > 4. Use the NXP vendor kernel imx_6.1.22_2.0.0 kernel > > Stefan, do you get the arbitration errors if you try methods 2 or 3 above? I will try to test this on my end tomorrow. In our test case however one problem was that when the schedule was called the ADC (TI ADS1015) may timeout if it is not processed within 25ms which sometimes happened. However, it also requires the other change because even if we have not set multi-master, the wakeup of the sender/receiver thread can take too much time, so we still end up in this 25ms timeout. This only happens when the system is under heavy load. In your setup, do you know what mode (atomic, interrupt, dma) the driver uses when it works and when it fails?