Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4354530pxb; Thu, 14 Oct 2021 03:46:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmxbZkv0TZ4jZ27dg8WsqVpoxIuh2wpkw1p8sdOGsE0DXhpP75nHajE8XPCzyo5U4ggGkF X-Received: by 2002:a65:4209:: with SMTP id c9mr3522250pgq.399.1634208366129; Thu, 14 Oct 2021 03:46:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634208366; cv=none; d=google.com; s=arc-20160816; b=l51sN7t0gVsVoT19y6Kqa37t6m9Vm44pppDnkBg6KT1ynehOBjo6YSu3mU5YLWUSKu qJRJ8CDpV6HhqxeFcpMUeZpzDQkVixL57qkw5sDqXlsLss4R6JuZwCdgmx8HnAbePecl Ap0Ms40sq/Qiewoo7ze82gPArz9Iq/AsJ+XVm4ORuoz7m9WMKkZYJoNvSQLO+NaDFXnu jf4Nbr2BofAtz5Q6tuj6tGL1fDlR9FC40BGkRSYeh/F5bZr0/GU/WB3aPcGYg+AJh+qc 3J1P9HmLPMoaFM9lcU4u338y/pb0qsDf8scmym0gjmJr1atLsaRsGdG41Xfy3u2xhb0N dbnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:in-reply-to:date:sender:references:subject:cc:to:from :dkim-signature:dkim-filter; bh=wy76QmHD0Gdua8DnltaLzMFS+mHTmw/fUZaGxzMCgvg=; b=KAhsYnWerV4dmr0U7+O4QWaIIh6hodFv0ezX1Bv8IRxmSXPVMy2atliwf9qqQaKlZT zGpVuZ9An71pZSgd5tjLjnFt52BkVx1c0t7m0hgv1acLjhleNMyRVEDnW4DYpeD7L/xb +Zh4PZOakEdXZJK+IMvRmpE8CyXl+PqIlzeOC0eXILBGQ4supKhzv4viIA4Ky+rhaSj3 0SJgCVBvpYOlQUWhROWVgToTSdoj2Oxljjg0m0uM7VQeuypCjJoPswoMqsXVZJTvCH2H yysmHHrtQx9d327sFRXv7+4Dv8PZGHP6qAqVC24bSFes0B7eSiDCC+kYjZTyVBB3nTKe XcjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@piap.pl header.s=mail header.b=iGQFi0OH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=piap.pl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l19si3160638plg.251.2021.10.14.03.45.53; Thu, 14 Oct 2021 03:46:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@piap.pl header.s=mail header.b=iGQFi0OH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=piap.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230145AbhJNKpe (ORCPT + 99 others); Thu, 14 Oct 2021 06:45:34 -0400 Received: from ni.piap.pl ([195.187.100.5]:51270 "EHLO ni.piap.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230168AbhJNKpb (ORCPT ); Thu, 14 Oct 2021 06:45:31 -0400 Received: from t19.piap.pl (OSB1819.piap.pl [10.0.9.19]) by ni.piap.pl (Postfix) with ESMTPSA id E4F64C3F3EF6; Thu, 14 Oct 2021 12:43:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 ni.piap.pl E4F64C3F3EF6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=piap.pl; s=mail; t=1634208205; bh=wy76QmHD0Gdua8DnltaLzMFS+mHTmw/fUZaGxzMCgvg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=iGQFi0OHnl82CcXlETPZMtEB890a1wyFPdWyN1wR4aR8cNMP/ZcQENSMHYK/nRLrw SgiK2UmGjS3J/zrkVNx08QfC4fbJhxDjLBG2UV2v9pXYekRmlebXQ4zy7zEX4fMuLS Do/6gI7uAVDpoLWeoGC/KGW8Zdfw+R8EUQfzEqwI= From: =?utf-8?Q?Krzysztof_Ha=C5=82asa?= To: Jacopo Mondi Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Sakari Ailus , Matteo Lisi Subject: Re: [PATCH v5] Driver for ON Semi AR0521 camera sensor References: <20211009102446.jrvrdr7whtd2rv4z@uno.localdomain> <20211011143420.vm6ncl5gdv44nsn3@uno.localdomain> <20211013082634.53zh5j26gucddome@uno.localdomain> <20211013151400.i2s3gcshb3xvuy2e@uno.localdomain> <20211014075955.xxbv2bzrx73v45bo@uno.localdomain> Sender: khalasa@piap.pl Date: Thu, 14 Oct 2021 12:43:24 +0200 In-Reply-To: <20211014075955.xxbv2bzrx73v45bo@uno.localdomain> (Jacopo Mondi's message of "Thu, 14 Oct 2021 09:59:55 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-KLMS-Rule-ID: 3 X-KLMS-Message-Action: skipped X-KLMS-AntiSpam-Status: not scanned, whitelist X-KLMS-AntiPhishing: not scanned, whitelist X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, not scanned, whitelist Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jacopo Mondi writes: >> This is BTW completely orthogonal to the -EBUSY on set_fmt(). The >> effects will be exactly the same if the e.g. geometry changes come when >> the sensor is not streaming. >> > > No, this isn't true. Your s_fmt() implementation stops then restart the > stream. It has an undocumented side effect and will cause undefined > behaviour. It will cause *at*most* a corrupted frame. On a MIPI link. That's right. Such a corrupted frame will *at*most* cause some transient IO error - it must not cause anything serious, because corrupted frames on MIPI can happen for multiple reasons, some of which simply cannot be avoided. BTW I will see if it's actually the case - chances are, there is no corruption, but I tested it years ago and haven't yet checked my notes. In fact those set_fmt() in other drivers may - or may not - cause corrupted frames just the same. > If your s_fmt() has to stop and restart streaming to take effect, > it means userspace should instead stop the stream, change > the format where opportune in the pipeline, and then restart the > stream. Maybe. This is a sensor driver - not userspace. If the userspace uses it as a part of "frame grabber", it will certainly do exactly that (nothing else would make sense in practice). Unfortunately this all will have to wait a bit, so thanks for your help, expect a new patch in few weeks. --=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