Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1205085rda; Mon, 23 Oct 2023 06:01:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEbMEdDXztaiXtbdDLBbVeT78hkvEgpmgkkqk0Ne5bFz1jHUHDFQ74oAx4w+jrJ7zzh7H3m X-Received: by 2002:a17:90a:5e:b0:27e:32ee:21e with SMTP id 30-20020a17090a005e00b0027e32ee021emr3166167pjb.5.1698066101768; Mon, 23 Oct 2023 06:01:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698066101; cv=none; d=google.com; s=arc-20160816; b=UVP4N1DxvrLLi42t8tif/TYUC6YtU4dkFL075mt3uwuyHhDBuQH8WHqqGnTJWcUOUS 8B2L3tIdBpiv0PAVXzGfoV2ENB0bAY+A6Xps4MI3WmJ79ZeqpwNDcIXxVtE3bZfBOAdQ CYcCz4HGmayyXtHh8kOV0QBXGTszZkva0Xa3KmqweMd0wZ9kVMZaYPYP6uRBceuOamRx m3HDO+yCInt+bkFADXoHzdTrg40o9aQvbOl/kzsPG/c00OBPI405fI8tWryI1TESYeon EG0mVWUozJz5ecCgpCA4/a3OlMIataagOMc0fK4LDrJ1YZjH30YeovPZnneLBlK61tR3 2kUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WPeDTHLB5LX8/5MLbzmkP0n3GkGZR+QfMUlImYzT3ME=; fh=zek7UAf/gC8HYYEjDRVWqmoEUKhvKoIxsqilaPFFvss=; b=rqWIFdsOAEN1ZyyigmThp52Ok53XOb0NwQM5N33rGJmoaYfapR5h+xgo3YeOCWTmbj Fl3bAlhViQepZ1UEngHVZb63EwiQb2EzISGSX0NaJF6VaYScdqA2zrgs4+ypK1uYrKUV zRslr7pX2c8jRo91DDE3T8mti7VRIvWe8E8LEJXsIRc4MZeZQrE77e/aTet9FpF3a/qF 3fW8EQ8Ec29Lq8Bh/Na5Dhdfmc2C4koB8H/J6jiuj+NActTytIuTIy/D1tKurXXq7fF9 eFY32yOkL7CBXgS1h14E1kbcDpxZAdyuyH849g5dPri5Aop43GkgOBImnPkZoyLJ0qw0 vG3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="xmhEzgs/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b2-20020a17090a990200b002777ce4c9e6si6462763pjp.72.2023.10.23.06.01.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 06:01:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="xmhEzgs/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id AAB7D807C855; Mon, 23 Oct 2023 06:00:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230358AbjJWNA3 (ORCPT + 99 others); Mon, 23 Oct 2023 09:00:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230356AbjJWNA0 (ORCPT ); Mon, 23 Oct 2023 09:00:26 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40DA9102 for ; Mon, 23 Oct 2023 06:00:24 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 524FFC433C8; Mon, 23 Oct 2023 13:00:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1698066023; bh=pQvhdbHVvsUbJtKT6sW4IR5pD/yK0HwxeWEyJADxP68=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xmhEzgs/DsrluSYaGT8zSh8/2nPhniKLwPAN0EktqnifjgOWrzjDk4Q5zXYEkph/X 0ejiuiAC4ia7XlypYpcbp/T1oEpInHZrdvNe27cCyzCwpTYH40Exdonbqk5sOhBXi6 fJb2PMlYh+zdk4ZvYq58gcx3S7Ily1lTIURlkB/w= Date: Mon, 23 Oct 2023 15:00:21 +0200 From: Greg Kroah-Hartman To: "Balas, Eliza" Cc: "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Derek Kiernan , Dragan Cvetic , Arnd Bergmann Subject: Re: [PATCH v3 2/2] drivers: misc: adi-axi-tdd: Add TDD engine Message-ID: <2023102339-outcast-scone-5a63@gregkh> References: <20231019125646.14236-1-eliza.balas@analog.com> <20231019125646.14236-3-eliza.balas@analog.com> <2023101917-cork-numeric-dab8@gregkh> <2023102030-resort-glance-57ef@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 23 Oct 2023 06:00:34 -0700 (PDT) On Mon, Oct 23, 2023 at 12:54:15PM +0000, Balas, Eliza wrote: > > -----Original Message----- > > From: Greg Kroah-Hartman > > Sent: Friday, October 20, 2023 17:32 > > To: Balas, Eliza > > Cc: linux-kernel@vger.kernel.org; devicetree@vger.kernel.org; Rob Herring ; Krzysztof Kozlowski > > ; Conor Dooley ; Derek Kiernan ; Dragan > > Cvetic ; Arnd Bergmann > > Subject: Re: [PATCH v3 2/2] drivers: misc: adi-axi-tdd: Add TDD engine > > > > [External] > > > > On Fri, Oct 20, 2023 at 11:18:44AM +0000, Balas, Eliza wrote: > > > > > +static int adi_axi_tdd_parse_ms(struct adi_axi_tdd_state *st, > > > > > + const char *buf, > > > > > + u64 *res) > > > > > +{ > > > > > + u64 clk_rate = READ_ONCE(st->clk.rate); > > > > > + char *orig_str, *modf_str, *int_part, frac_part[7]; > > > > > + long ival, frac; > > > > > + int ret; > > > > > + > > > > > + orig_str = kstrdup(buf, GFP_KERNEL); > > > > > + int_part = strsep(&orig_str, "."); > > > > > > > > Why are we parsing floating point in the kernel? Please just keep the > > > > api simple so that we don't have to try to do any type of parsing other > > > > than turning a single text number into a value. > > > > > > > > > > The adi_axi_tdd_parse_ms function does almost the same thing as the > > > iio_str_to_fixpoint() function which already exists in kernel. > > > > That does not mean that this is a valid api for your device as you are > > not an iio driver (why aren't you an iio driver?) > > > > > It parses a fixed-point number from a string. > > > > And as such, you shouldn't duplicate existing logic. > > > > > The __iio_str_to_fixpoint is used in a similar way, as I intend to use adi_axi_tdd_parse_ms. > > > It writes to a channel the corresponding scale (micro,nano) for a value. > > > > Why not just have the api accept values in nanoseconds and then no > > parsing is needed? > > I thought this would be easier for the user, to work with smaller values, > than using a lot of zeros for nanoseconds. I will make the changes > to accept values in nanoseconds.. Make the kernel simpler, it's easier to make more complex userspace, right? > > > Since the device is not an iio device, using an iio function would be confusing. > > > > Why isn't this an iio device? > > The device is not registered into the IIO device tree, > and does not rely on IIO kernel APIs. > Even though there are a few attributes that resemble the > ones from iio, and the sysfs structure is similar, > this is not an IIO device. > In the previous patch versions 1 and 2 we concluded > that this device fits better in the misc subsystem. Ok, can you point to that in the changelog where the IIO maintainer agreed that this doesn't fit into that subsystem? thanks, greg k-h