Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp741036rdg; Wed, 11 Oct 2023 04:26:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHb6aQn/mXvfhRCxlNEtGQDUKxAU5/1kcPCs9t2kQG+cXMv9pVDW89DRyhMidJ/PACrUEgU X-Received: by 2002:a92:c241:0:b0:34b:aebd:a512 with SMTP id k1-20020a92c241000000b0034baebda512mr24128341ilo.14.1697023578666; Wed, 11 Oct 2023 04:26:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697023578; cv=pass; d=google.com; s=arc-20160816; b=jBAUMH6VsDOv0+CDkumxaBawMZQiSJfyKRr9iN95l5a1NvAXTNSi3oktl9gAtHQhbi CAKbV5/OryWEjWkEvYGZGJipsZJKhOf26MFXt5WoIVSS+Wy8KiDyceVcPFa5fxsVPuYy IThjsPv5AzC4vJvqR+uf0EdSWbn7ZZThrYx0oVArQw7jjOISLZBlnTvLimE/wtLQaErv AG7j4LSII4ibEgmMyqxKAun6KyO1V2uPOVqxCoOZ0jaOWXqu4qgegBB9t2xDTs8g9iSW wurwFiZZyr3A0EXgRm/OWrA3dIrZHUXQh3XbGWT+iW0KuKt73hyLAMws/EdAgAliJTIf jwQg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:in-reply-to:date:references:subject:cc:to:from :dkim-signature; bh=ukLRF1HXskwIN+N/ohzWVbbOFwxa4A/S+jmFd6Lj+/E=; fh=MLuP885FwHGEtJ3H1LaZRfjaEuEWPBOvd4DP3EAVbh8=; b=X/+D/W/3Wa4l6xVp5rFG47GebQFY5JXcQUJwQtL74hYTXIbUQiafpLqVcFOqxPO2kb tj0rIAY2ByZhjwZYnNF8dbG/7GMmCgfJdqDODASuudHnQ3K05KzMmxkTJJgaNog4X8pO oe6S90B52zOU+KZfhwwzq+lyU8d7mOz09XrKPijlrbIGjpXVly/3SQjhuEoF74DgyJp7 V8lbTMP5AawnixLDSsCBCluhwLL1z4hA1OG+eh2cz3NqPN6BqKzunEimNAju3AkyxpzL /y8gJ1PZKusg57HCG+hWBiRUPnZ6gXbbtiDRxdW8Ijz/dB67S28baQUsGkODdnZ8Km1W ZlIQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lukasiewiczgov.onmicrosoft.com header.s=selector1-lukasiewiczgov-onmicrosoft-com header.b=Hxy8McxU; arc=pass (i=1 spf=pass spfdomain=piap.lukasiewicz.gov.pl dkim=pass dkdomain=piap.pl dmarc=pass fromdomain=piap.pl); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=piap.pl Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id p21-20020a63c155000000b00578d1b590b0si12344801pgi.699.2023.10.11.04.26.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 04:26:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@lukasiewiczgov.onmicrosoft.com header.s=selector1-lukasiewiczgov-onmicrosoft-com header.b=Hxy8McxU; arc=pass (i=1 spf=pass spfdomain=piap.lukasiewicz.gov.pl dkim=pass dkdomain=piap.pl dmarc=pass fromdomain=piap.pl); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=piap.pl Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 2846680F8F45; Wed, 11 Oct 2023 04:26:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234781AbjJKL0F (ORCPT + 99 others); Wed, 11 Oct 2023 07:26:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231312AbjJKL0E (ORCPT ); Wed, 11 Oct 2023 07:26:04 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2043.outbound.protection.outlook.com [40.107.104.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AA3C9D; Wed, 11 Oct 2023 04:25:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Eu0VaQzRisPu39LTzmDj2BR3cC1nuYDdTGIpayZZwM7W7J8lyhuIjAXBIzjPTR6EnGG3FaCfssp2acIxrd4jK11+Qh+VRXxV3WNgPe3kiVNPnl2cW3kQxsOX4fj0b4iI0aK2a80SwEi9TADYrmQQId0Y6bVrxSSqY7y6ySYWJ9aQMzNMnStpIJ7/PgFKvkINPT5UTrCO8K76NZINZ3HzsZVIGSwVt3snHkFdEw3ZBSmHTIHX/ajuGRPaak4t9txrNqM4UlaMM4xoqEYW8ul6rIPwr/w0p8IpniydsgreoeXRmv1v+3q8qSW2CJd0DI08BDE+BoqSlhX7zMzzCpF0YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ukLRF1HXskwIN+N/ohzWVbbOFwxa4A/S+jmFd6Lj+/E=; b=ciev8V4mB1ndQKTRDqepk56jmHsrq5uwx1bdZVfVBm2Fb40C3qCCtY/MzPLPY5hICfTvgkQa5Zt4Eu4Uo/SKu2UdF054dqT4Qu3Gw9Yzt4zw3aw4AaIgGaYTQktcpAt0GdM4+6Ti8EWbgYGFi+MZTJk4GrfDw6y0y30UtqSwyC9tVez9nZQxb4Le/NTp37FQ5mh3buhZexTVM+WAzERjsEDlKBM6paIvNaWcyUFYgEi2pGBrCq8Sf8HRej24QUP/kSQPsmr8JNe+VAJzaRNhT8bEz8iXsxBeGUFxBf03hJ4wL3gjPISQ93rVKlcwElaMaRkld8YRC2c+d2VavqzLEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=piap.lukasiewicz.gov.pl; dmarc=pass action=none header.from=piap.pl; dkim=pass header.d=piap.pl; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lukasiewiczgov.onmicrosoft.com; s=selector1-lukasiewiczgov-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ukLRF1HXskwIN+N/ohzWVbbOFwxa4A/S+jmFd6Lj+/E=; b=Hxy8McxU0/kPh76aLASs3V+tGxPlACPwYs1MVqLRCUWuFlZEj7HTUiJ7HqIHk2SJPANA8k0mTzepRIcwUQzxUPTaMMcv7Dc+/uwE2jkpMAeoSvdTrpRQDFGsX2BVwQDNln6zAABhRdVvUwPzvV7cBF1NdklBDaRT4aX9wsqfoR4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=piap.pl; Received: from VI1P193MB0685.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:155::18) by AS8P193MB1176.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:336::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.43; Wed, 11 Oct 2023 11:25:57 +0000 Received: from VI1P193MB0685.EURP193.PROD.OUTLOOK.COM ([fe80::1bd8:1a5d:e69:d1a7]) by VI1P193MB0685.EURP193.PROD.OUTLOOK.COM ([fe80::1bd8:1a5d:e69:d1a7%3]) with mapi id 15.20.6863.041; Wed, 11 Oct 2023 11:25:56 +0000 From: =?utf-8?Q?Krzysztof_Ha=C5=82asa?= To: Stefan Lengfeld Cc: linux-media , lkml , Dave Stevenson , Oleksij Rempel , Pengutronix Kernel Team , Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-i2c@vger.kernel.org Subject: Re: Sony IMX290/462 image sensors I2C xfer peculiarity References: <20231011101553.we3r73xejvqdql5j@porty> Date: Wed, 11 Oct 2023 13:25:55 +0200 In-Reply-To: <20231011101553.we3r73xejvqdql5j@porty> (Stefan Lengfeld's message of "Wed, 11 Oct 2023 12:15:53 +0200") Message-ID: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: WA1P291CA0017.POLP291.PROD.OUTLOOK.COM (2603:10a6:1d0:19::17) To VI1P193MB0685.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:155::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P193MB0685:EE_|AS8P193MB1176:EE_ X-MS-Office365-Filtering-Correlation-Id: 767bc278-32c3-48a3-00a4-08dbca4cd660 X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HFvfLQ68hN7dvg4n+/i6tZRrvhCtzwyJvEO/cF+4d9kWRne/lavag2zjyKEByiZPMdnHUe9mNT9bv7DzFBySWdubgDfto6QYYsjYNc9WKwnSGAbxGOBvEFd1MLv5U1isq9tW6OVvymAhUbznrzQyNl2mm/xnQ21OHIf9rnbLZct5/VivPCiNBrwLL9RGsjt5X8UoDFdeMdD1JnXFYtxBbKwGYS0CM5jtAB+kC/S50ZIlmvYlgq85+V+qBIH16JhSspduCMHViI36VUwyDhePfcpWXnGfqGjVmsMyI0lXrhi1KgDzwGe/35UDVaR6NTwU3IEDBtwbBdXr2gKhBOMxcHVAINBjS4WrZyB/vV/icq7V0ks2dPvt1jsupzZRGX/J7x1IAOR4xsWkfOag5t20y2h6d8DGNFc1MGGCsYPOBdbul9Iuf/ASYpd1NuEFPZKJeCKWcwEdurVKHDgbzqC1Fy31jzmMfH3U0O9AFscGfQisyYt+irN2PDGngZsXysAyfRgx5T2VWtoGVgyMPgM9myVm3X63yhyenhOcjHSAiU3PmueXPpbaCcytRw7tPZTrROsFlnBg9mnGdJx8RuJwiQHdXyaNuX2/9P8HpQZjiO8V7d549Mcvn1Bd9siJP9gH X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1P193MB0685.EURP193.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(396003)(376002)(136003)(346002)(39860400002)(366004)(64100799003)(186009)(451199024)(1800799009)(52116002)(6512007)(6506007)(478600001)(6486002)(38100700002)(38350700002)(83170400001)(2906002)(83380400001)(42882007)(26005)(66556008)(66476007)(54906003)(7416002)(66946007)(6916009)(786003)(316002)(5660300002)(41300700001)(8936002)(4326008)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OGxWZ1dsb0o2N3RkWEhvcjAvcEhkZEdkaFFlelRxdTd0WUZZZTc2YTVGMTg1?= =?utf-8?B?RGVDcC9CQVE1RGR1WndqalgwbWRpS0FJZXFqSFMvM2VNalhud3d0eGZMOXJI?= =?utf-8?B?N082ejI2dmlmQlVhMWgvZ2srdzdpUTV2VlFZYThuTWRUTUpoNnB6M2krSGRV?= =?utf-8?B?UTRHZVV3WjhKOUZib0RmTzgvTWx1dWx0Zm5UQXNGQjF1YUJjSWlYeHBlSkpt?= =?utf-8?B?cGFNU0JJZzJGTDg4WXJzcHYrRkRlUjB2OFVjR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?= =?utf-8?B?SmNtVmUxU1hzb3JpT2drY1V6cFlieVMzT21VOU5Kdis5Qmd3RkJ3SVpmV0FL?= =?utf-8?B?UEMzQzZuN01MYlVVdXNDMGJnZUNXMk5xQ2RTVGt4ZTdVd3ErMURBV3ZCenps?= =?utf-8?Q?E84cEhvjiJ/2Nz4s05C2t17KECzidcKsXwJuUbsr1k1l?= X-OriginatorOrg: piap.pl X-MS-Exchange-CrossTenant-Network-Message-Id: 767bc278-32c3-48a3-00a4-08dbca4cd660 X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0685.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 11:25:56.7257 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3e05b101-c6fe-47e5-82e1-c6a410bb95c0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: chnB0sWvtOyRTZwoU9Uktc5SyUybPPRewqPWbZhb6yBwjCVFEG+CtDOQ+DOxesrT5j9W+nrSm48R6oDjSwMiggttzd8Q3j/pPftK3FlttPkumIKWV6NXlH1fnzJj+LFeV2E4P82hnr5B59zaHSIU9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8P193MB1176 X-Spam-Status: No, score=2.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 11 Oct 2023 04:26:16 -0700 (PDT) X-Spam-Level: ** Stefan, > I cannot answer whether the delay is needed for atomic transfer or not. > But I can give a bit of context for I2C atomic transfers in general. > > These where only introduced for a very narrow and special uses shutting > down the device/power with external PMICs in the kernel's shutdown > handlers. Well, I guess I'm abusing this code a bit. The problem is I use Sony IMX290 and IMX462 image sensors, and they have an apparently hard-coded timeout of about 2^18 their master clock cycles (=3D ca. 7 ms with my setup). After the timeout they simply disconnect from the I2C bus. Of course, this isn't mentioned in the docs. Unfortunately, "normal" I2C accesses take frequently more than those 7 ms (mostly due to scheduling when all CPU cores are in use). So I hacked the IMX I2C driver a bit and now all accesses to the sensor use the atomic paths and local_irq_save() (inside the driver only). > My understand is that an ordinary I2C device would just use normal (and > sleepable) I2C transfers while the device is in use. You are spot-on here :-) Now I use IMX 290 and 462. OTOH I wonder if such issues are limited to those sensors only. Thanks for your immediate response, --=20 Krzysztof "Chris" Ha=C5=82asa Sie=C4=87 Badawcza =C5=81ukasiewicz Przemys=C5=82owy Instytut Automatyki i Pomiar=C3=B3w PIAP Al. Jerozolimskie 202, 02-486 Warszawa