Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3464221rdh; Thu, 28 Sep 2023 12:24:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEevdzE8cbbZjy1NcO3G0opp8mlRni0/UtMoB8AKzBwRvTC6qGsggmxGdZIGtXP6+2EKHhl X-Received: by 2002:a17:903:2283:b0:1c5:befa:d81d with SMTP id b3-20020a170903228300b001c5befad81dmr2454424plh.10.1695929095260; Thu, 28 Sep 2023 12:24:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695929095; cv=none; d=google.com; s=arc-20160816; b=PJd96j+lF5q/YHw6neyKheeZs6wEBxKRfqM+ToGUkKk3M+oq5ksbNX60gVRRSibf+D tBCfKhT1TdAuYIBKe7z7+jZVjgiy5uRAk6iKFbQgHdQvgyrWFu6/1wmnnlPwZdfypDc+ IYmlUkU8YDx26PTHv6DRVsw3Qr+WqseBOCbw2ViqddwOs0nSwqDneJUdTRti8K1cGjCW sKN6JZflKFl0a/NsGLOoAdTwBgqYaYoIxXe9u+gvHb45CDUeYWobZe6EmBo0PfdvEyCQ 5EKEepT19ZbuuLTVuRm1K+745oXvdQOvkXAV4dMEvt4/068sD6WZ1G7WMoVrzABl7P+x TpDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=LTjY8R1KsCPH5v7l6L2qHRvoQTAX3pDp6IhjNv9gzM4=; fh=kitioXIZMyOaeDtnS8qW/+zzJGsKFVLhVCUP8JPOWMU=; b=p6ZAHjOJ7IlIpN2m3d/BflCl/4cE7y9YxrPYIRQ9gzXGxTPG1gmi/gfzhnQGfTA6aS n/yC2/6GzKMgYug00VFXIxDsj0DdLT/4QJHT5/6YadmLNtQ/FO4fFRJyMuOqNCVzAUyg xkcSembwnJKpHbCynS23tiyPQIkjqwI9NDFLArhx9RPXC8oa+JMFRmzLWRc2Aakd4hpD ZDuJGiVkXDUADVt7C2lI4614iTj41v84vXjC7xWP9/lIIgnhHeYA1et1upj2F0wV+XlN 5rkhuk6VZaX9syIXXQyoFMUesxVGAmSWJboj0+pcIy4Ghp8DobNHG+K88ZeOoznC66Gz Gkiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=dUXAl7ju; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=HlTxOEOn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id n12-20020a170902d2cc00b001b829a32f2dsi20895626plc.457.2023.09.28.12.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 12:24:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=dUXAl7ju; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=HlTxOEOn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 2739D801B82D; Thu, 28 Sep 2023 07:20:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232143AbjI1OUE (ORCPT + 99 others); Thu, 28 Sep 2023 10:20:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231810AbjI1OUC (ORCPT ); Thu, 28 Sep 2023 10:20:02 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0828136; Thu, 28 Sep 2023 07:20:00 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 180EB5C264B; Thu, 28 Sep 2023 10:20:00 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Thu, 28 Sep 2023 10:20:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1695910800; x=1695997200; bh=LT jY8R1KsCPH5v7l6L2qHRvoQTAX3pDp6IhjNv9gzM4=; b=dUXAl7juNQlKwrOADW zYzEhPHyVPkkZHnHghOe4DNYw8cXbbNx1dOAKAN/FCWU8xjI4kbLZHFHSD5kRdbC xKZvA9urr345a4dUpzirwiy7OSNIqbq7l1EG3nveyhWVenI5yZVBESeDizY3q8AB c5Q2lg0Iuokzq8fYqnUKWng2Doe5Y+XE7VtKnLEhwzwxXyYS8Yf1GVTZjAu7p4fY UtuRPpBrT9sWUjv0sNRwrWJmwJlhDPESk2rJBinpVjhpsDC9c7vjlM687Retmfyc UuOnFTKgtk7T3bmaQ78meTOjP4IgBDuPLVtv1Z5AbvuNYJd1o8sLPR5mMPTETELy /21A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1695910800; x=1695997200; bh=LTjY8R1KsCPH5 v7l6L2qHRvoQTAX3pDp6IhjNv9gzM4=; b=HlTxOEOnVFZqd1tvjp5dkyx9z7Zhk 3KpMpj3KnNVZsMcEaZvh4lRoW/SKriv5ZihGUcs+3u8Hw7tvvoHGe/DyGgC5pAL4 /JOnVeP9x2grSYbQiPzPumrdHxyBV4OcAe5o72HCEqRXAZxQhhqwqMs+bk9T/cVp TcsB7bW4CNmLXEl2AtDiu5yvjQDd3XIW0DqyNCJ5SEQoMy8xz+Srx9kjz1hsQmDY jT1shxhtQ596SwnCijQL8fan0kjr8Xrajk6ugkjR8rzqIScXGoHIOBanrAoUxRvK uzDb/LkSEUR6Zv+e2Xuzw7hVx44FQIWv2gU2mREnDID1hkaZ53Z2+BqIQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrtddtgdeghecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeejvddvvdduleduheejiedtheehiedvjefgleelffeigfevhffhueduhfegfeef heenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprghrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id C492BB60089; Thu, 28 Sep 2023 10:19:59 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-958-g1b1b911df8-fm-20230927.002-g1b1b911d MIME-Version: 1.0 Message-Id: <94110af1-2b32-4eb2-81be-2a79fc6973d8@app.fastmail.com> In-Reply-To: References: <20230928092804.22612-1-eliza.balas@analog.com> <20230928092804.22612-3-eliza.balas@analog.com> <839638d2-7502-4925-8b7f-6b15779a6840@app.fastmail.com> Date: Thu, 28 Sep 2023 10:19:38 -0400 From: "Arnd Bergmann" To: "Eliza Balas" Cc: "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "derek.kiernan@amd.com" , "dragan.cvetic@amd.com" , "Greg Kroah-Hartman" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" Subject: Re: [PATCH v2 2/2] drivers: misc: adi-axi-tdd: Add TDD engine Content-Type: text/plain X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Thu, 28 Sep 2023 07:20:17 -0700 (PDT) On Thu, Sep 28, 2023, at 06:54, Balas, Eliza wrote: >> ; derek.kiernan@amd.com; dragan.cvetic@amd.com; Greg Kroah-Hartman ; >> linux-kernel@vger.kernel.org; devicetree@vger.kernel.org >> Subject: Re: [PATCH v2 2/2] drivers: misc: adi-axi-tdd: Add TDD engine >> >> [External] >> >> On Thu, Sep 28, 2023, at 11:28, Eliza Balas wrote: >> > This patch introduces the driver for the new ADI TDD engine HDL. >> > The generic TDD controller is in essence a waveform generator >> > capable of addressing RF applications which require Time Division >> > Duplexing, as well as controlling other modules of general >> > applications through its dedicated 32 channel outputs. >> > >> > The reason of creating the generic TDD controller was to reduce >> > the naming confusion around the existing repurposed TDD core >> > built for AD9361, as well as expanding its number of output >> > channels for systems which require more than six controlling signals. >> > >> > Signed-off-by: Eliza Balas >> >> Thanks for your submission, I've had a first look at the driver >> and the implementation of the interface you have chosen looks >> all good to me, so I have no detailed comments on that. >> >> It would however help to explain the ideas you had for the >> user-space interface design and summarize them in the changelog >> text. >> >> You have chosen a low-level interface that wraps the individual >> device registers and gives user space direct control over them. >> The risk here is to lock yourself into the first design, >> giving you less flexibility for future extensions, so it would >> help to understand what the usage model is here. >> >> One risk is that there may be an in-kernel user in the future >> when the TDD engine interacts with another device, so you >> need a driver level interface, which would in turn break >> if any user pokes the registers directly. >> >> Another possible problem I see is that an application written >> for this driver would be incompatible with similar hardware >> that has the same functionality but a different register-level >> interface, or even a minor revision of the device that ends up >> breaking one of the assumptions about the hardware design. >> >> In both cases, the likely answer is to have a higher-level >> interface of some sort, but the downside of that would be >> that it is much harder to come up with a good interface that >> covers all possible use cases. >> >> Another question is whether you could fit into some >> existing subsystem instead of creating a single-driver >> interface. drivers/iio/ might be a good choice, as >> it already handles both in-kernel and userspace users, >> and provides a common abstraction for multiple classes >> of devices that (without any domain knowledge in my case) >> look similar enough that this could be added there. >> > > We are using this driver with an iio-fake device > https://github.com/analogdevicesinc/linux/blob/master/Documentation/devicetree/bindings/iio/jesd204/adi%2Ciio-fakedev.yaml > so we can take advantage of the iio user-space interface. I don't understand how that works yet: Do you mean that there is user-space application that uses the tdd sysfs interface to export an IIO device back into the kernel, or do you mean there is a regular IIO device in with a kernel driver that is used as the back-end for the tdd device, or something else? > We talked in the previous v1 patch emails about adding this driver to > an existing subsystem, and I raised the question if we should add it to > the iio subsystem, but the driver is not registered into the IIO device > tree, and does not rely on IIO kernel APIs, so I concluded that misc is > a better choice. > What do you think? My feeling is that if you can make it fit into IIO, then this is likely the better choice, unless you can guarantee that this is a one-off driver with a single hardware implementation and a single userspace. If you need the flexibility later to do more things, the risk is that you end up duplicating a lot of functionality that already exists in IIO. This would of course mean using the interfaces provided by the IIO core, with the addition of a tdd device type rather than just having a standalone driver with just the sysfs interface you have here. Arnd