Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2756096rdb; Mon, 4 Dec 2023 06:49:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHaGrJEUTFMoCHfRusNUpPAxCmFDhNxMmSsHjEq0AdRNyWr+Q5zwetvps1Ffrq7S1mHQRsp X-Received: by 2002:a17:902:d889:b0:1d0:c0d3:5c1 with SMTP id b9-20020a170902d88900b001d0c0d305c1mr65641plz.102.1701701393473; Mon, 04 Dec 2023 06:49:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701701393; cv=none; d=google.com; s=arc-20160816; b=IaYLOFyG1wG/In7cjqSGgq9ivWOHxzb/K5GM00K+V3NppXndSYoB009YteDnGqoVFz I0ZCEN32zbVg6MHqtouabe0uzDAZ4OwM7LWyE9ugwRfNRDVxMM7AgHtLD7ssLPQJc/vE Be+8M/A5UwhQSyTPvtR1tFchEl0WnwG5vfYsD45KWivMShlLjeEW9qa3GzSrKvzrfn7n V0FffovUqFp/JSYiDM2R5r6/6VSlGgCdqwXs5zpauTcNyyeXxXDeJakDu5zKu1UIg27/ EfhJ1MiJl/xxQpEnYpdGgc0G50mroh+Gu/g7RzEIKJKbXN+XGevJdqFw4+fMxt2afX3u d84A== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=UrzoxVo928jPRfwGCM3LP2gdek5cik9W9dklO5a/1ho=; fh=69TVRZ2Qs0pyBrKwgRuS9pR2Le38GuJyqEMBCnuaTKc=; b=S3p6XFClNGyfV8KYOYC3yWVzdzhed05YRQG2XJu8tF3y9OPGX0wjRKnaTSic24lSGA rOvHbx3qjgnDl5KMw/pQ8IW2z56/8hEhJdjIDT/ge2sB2h44p/SOHQhnTrKcR6OKfv0U z4seGFrO/kQ7ldKD30FGtVEet4H6qPbJh3trD2IjYT2Yt5+UGx1WVe08R/j+tR/dK1lf l7w7nok0TQGqWTyXbCZHT70vVs5UZWsxTTQaN6dU6+RotQ25DB0ZX53cmj8tIbSr52ja pUufSOqS7CtMdswDAZEqKzP33m0ubSITzh+Nuo6drX3VKbcHU7mCKZE9WkPmYX5aKspZ ThPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mP1NKR8W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id n15-20020a170902d2cf00b001cf8e4e84bbsi4014834plc.471.2023.12.04.06.49.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 06:49:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mP1NKR8W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id AE2F880545BA; Mon, 4 Dec 2023 06:49:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234387AbjLDOta (ORCPT + 99 others); Mon, 4 Dec 2023 09:49:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233871AbjLDOta (ORCPT ); Mon, 4 Dec 2023 09:49:30 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E0CFB3 for ; Mon, 4 Dec 2023 06:49:36 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DD35C433C7; Mon, 4 Dec 2023 14:49:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701701376; bh=+rfhQvthjBio9vKPuOuZeZLKHbgV1eAS2Q4KP5aiGdw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mP1NKR8WcwA+hcZQ6uKxxCQEnsh3wuXEAjUr52iqagkAxstbdi8MnYIviiDX0Y+tN FAPnWwLPDVJE6/0x0dRz9DUEl35GqLq3/BvMWTQVFeh5qzzKYvLbxBF1R3JMlUe3PU 2nsB5bDfcVu21DcHS+eV/VKlsW8o0uV1iBc/aGRlav7o8NTlluBw0MSsCZ74fa77KM jKEZtDLPH05I7H0Ftn58M5hS95djYVZyJDt2jHdD9ys8e/JZKNf9iruGYWzWGKItg2 UwGjVHVbq8TkFWccMc1HBnxtFvIjF8+yWhL4VHfjn7w2d/XNpAv+2Uq6QSFtYlBOZZ AQ5/hYhWUpxiQ== Date: Mon, 4 Dec 2023 14:49:25 +0000 From: Jonathan Cameron To: David Lechner Cc: Nuno =?UTF-8?B?U8Oh?= , nuno.sa@analog.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Olivier MOYSAN , Greg Kroah-Hartman , "Rafael J. Wysocki" , Rob Herring , Frank Rowand , Lars-Peter Clausen , Michael Hennerich Subject: Re: [PATCH 00/12] iio: add new backend framework Message-ID: <20231204144925.4fe9922f@jic23-huawei> In-Reply-To: References: <20231121-dev-iio-backend-v1-0-6a3d542eba35@analog.com> <369a72dd34c0bc457620b88594a975d96aa85a22.camel@gmail.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 04 Dec 2023 06:49:47 -0800 (PST) On Sat, 2 Dec 2023 10:16:52 -0600 David Lechner wrote: > On Sat, Dec 2, 2023 at 3:37=E2=80=AFAM Nuno S=C3=A1 wrote: > > > > On Fri, 2023-12-01 at 21:53 -0600, David Lechner wrote: =20 > > > On Thu, Nov 30, 2023 at 5:54=E2=80=AFPM David Lechner wrote: =20 > > > > > > > > On Tue, Nov 21, 2023 at 4:17=E2=80=AFAM Nuno Sa via B4 Relay > > > > wrote: =20 > > > > > > > > > > Hi all, > > > > > > > > > > This is a Framework to handle complex IIO aggregate devices. > > > > > > > > > > The typical architecture is to have one device as the frontend de= vice which > > > > > can be "linked" against one or multiple backend devices. All the = IIO and > > > > > userspace interface is expected to be registers/managed by the fr= ontend > > > > > device which will callback into the backends when needed (to get/= set > > > > > some configuration that it does not directly control). > > > > > > > > > > The basic framework interface is pretty simple: > > > > > - Backends should register themselves with @devm_iio_backend_reg= ister() > > > > > - Frontend devices should get backends with @devm_iio_backend_ge= t() > > > > > > > > > > (typical provider - consumer stuff) > > > > > =20 > > > > > > > > The "typical provider - consumer stuff" seems pretty straight forwa= rd > > > > for finding and connecting two different devices, but the definition > > > > of what is a frontend and what is a backend seems a bit nebulous. It > > > > would be nice to seem some example devicetree to be able to get a > > > > better picture of how this will be used in practices (links to the = the > > > > hardware docs for those examples would be nice too). > > > > =20 > > > > > > Fulfilling my own request here... > > > > > > Since AD9467 is being use as the example first user of the IIO offloa= d framework > > > I did a deep dive into how it is actually being used. It looks like t= his: > > > =20 > > > > This is not an offload framework... I think somehow you're connecting t= his to the > > spi_engine offload and these are two completely different things. Maybe= they can > > intersect at some point but as of now, I don't see any benefit in doing= it. The goal > > of this patchseries is to have a simple and generic framework so we can= connect IIO > > devices (frontends) to a backend device having kind of an IIO aggregate= device so to > > say. Moreover, we just want to have the ad9467 driver in the same state= it was before > > to keep things simple. I'm already fixing some things but I don't want = extend that > > too much as the primary goal is to have the framework in. Cleanups can = come > > afterwards. > > > > That said, is fine to have this kind of discussion but I honestly think= you're over > > engineering the whole thing. Maybe you're already too ahead of me :), b= ut where we > > stand right now, I don't see any reason for anything so complicated as = the below. > > Also note this should be simple and generic. As I already said, this is= not supposed > > to be an ADI only thing and STM also wants to make use of this infrastr= ucture. But > > see below some of my comments on why I think it's too much... =20 >=20 > This is a very fair point. I do have a tendency to overthink things. :-) >=20 > At the very least, being able to see the schematic of how it all fits > together filled in the holes of my understanding and now everything > you are doing in this series makes sense to me. And I totally agree > with keeping it simpler is better. Interesting discussion. One key thing it has highlighted for me is that even the simpler proposal that Nuno has put forward deserves some more documentation! Preferably with some asci art - though maybe not as co= mplex as David's pretty picture. I keep forgetting which is the backend and which is the front end for this discussion which isn't helping me get my head around it. Jonathan