Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1978398imn; Mon, 1 Aug 2022 06:59:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sRGC3w8PICi3pRKbQuI/aBXGgxmr6rJbQksblMtLmpZKVbznDFWvF3ChajPuVQ7fhpKeba X-Received: by 2002:a17:907:970b:b0:72b:5919:506c with SMTP id jg11-20020a170907970b00b0072b5919506cmr12265185ejc.241.1659362365765; Mon, 01 Aug 2022 06:59:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659362365; cv=none; d=google.com; s=arc-20160816; b=cj2UYGeQwKDXMQpGlWPWTfhJ0Au4kov9x6xKsrvOIpIi2/8OXK4/bdvakvFi4M6L00 SqZWO4Ti8X6J2Ycgkg5Ckmdf1ll2CUoghViVdJZs8Eap+Qrmke8r2P3PA2L510RYizwZ 3Ik1qu532EaMVaepa6jleJepR/1LjBzC3xBeCuauOONCKCKmqWQ+kmePT/bNiDDzIQGA mcevKD9FoyFNwsCujokJ+asOUqbnwSlk6oKc30OHwhBWv5472ePgiGMWc7vdwn+eRRgG BaLkcQsMDRQ8OEtPrDXuj+CBAYx4cEDaw1gk8dj5s1G8pY8j3LzMCEtCbf5jPqYWhWuh LBIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=ltfa8vCGViX0X05znzT7k8Dpx3ILLRGYQ6OuPvZNc/E=; b=jq7Cm9SvjrVDCGyzfUk/IRNWO1Tbj6SYl9cOaP2RD/SSRjr8Z3WWJe5Q8f3Z8IElBl nhjOHiDE/iLAGvvBmJ4EQDLt1pK/5DG6nx2STtVhsDj1/TfqTNNmSRWKtJEqgUDGVifm xMv2Wi9zwff7q6D7K6Aio3t6ZjLrD4mrgPA9auH5uG+yc19ImpgDSHwk5W+dBv4vje8A pJOZcici/5VuVIdXzdMjdIGdfm67sQb5ix+vrqbiVZOpVFBpqkliDXj7FO1vM9RtYbbv vluD9sA5uF/anBsP+5a+Z1Y7i6yOKtBJuOtYSey6VzpHA4YzghCSDyz6+aUgpYK5NmfG ZstA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=GPi38vX0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt14-20020a170907728e00b0072b7c6a0260si8715318ejc.58.2022.08.01.06.59.00; Mon, 01 Aug 2022 06:59:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=GPi38vX0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234977AbiHANCq (ORCPT + 99 others); Mon, 1 Aug 2022 09:02:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231950AbiHANCl (ORCPT ); Mon, 1 Aug 2022 09:02:41 -0400 Received: from mail.sberdevices.ru (mail.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4A34205D6; Mon, 1 Aug 2022 06:02:38 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mail.sberdevices.ru (Postfix) with ESMTP id 9E84F5FD18; Mon, 1 Aug 2022 16:02:35 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1659358955; bh=ltfa8vCGViX0X05znzT7k8Dpx3ILLRGYQ6OuPvZNc/E=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=GPi38vX0eAJ70L+h70wKbHM+TChQmTTkwVdr6y0h9GSlZtBiAMPwzMZUfpwYSIT/u rc5Qa/qS/9Xm2bkS18z+1YRaeZ1gEXuMvKWjyKyafRwtffokj7FFcBbFHikRqurREA dFiapTaSnIgABvTPFZ6vY0/SEi+9b6QWCwOLiN6dk6lD83jXgOe/ltnRu+6rofxKlg slCTtJl28I3x03pZg7Oh22F4BTvSvZOU8PDV9IDFC6kRxc38qG7prCAb8EkQx3ms/H Ii2P66M/NINl9PR48rVasvExku0tMskC+zvG4w4Bwr0405egMS7sUOOPDuMAwA8gFr 8a22AsCfyPTVg== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mail.sberdevices.ru (Postfix) with ESMTP; Mon, 1 Aug 2022 16:02:31 +0300 (MSK) From: Dmitry Rokosov To: Jonathan Cameron CC: Andy Shevchenko , "akpm@linux-foundation.org" , "andriy.shevchenko@linux.intel.com" , "daniel.lezcano@linaro.org" , "wsa@kernel.org" , "lars@metafoo.de" , "Michael.Hennerich@analog.com" , "jbhayana@google.com" , "linux-iio@vger.kernel.org" , kernel , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 1/3] units: complement the set of Hz units Thread-Topic: [PATCH v2 1/3] units: complement the set of Hz units Thread-Index: AQHYo2/exMPEjcXGek6GXlZKNuELJ62VcaEAgAK6RYCAAajVgA== Date: Mon, 1 Aug 2022 13:01:40 +0000 Message-ID: <20220801130227.htocnkpkwiscpxur@CAB-WSD-L081021.sigma.sbrf.ru> References: <20220729172332.19118-1-ddrokosov@sberdevices.ru> <20220729172332.19118-2-ddrokosov@sberdevices.ru> <20220731124140.777ddd05@jic23-huawei> In-Reply-To: <20220731124140.777ddd05@jic23-huawei> Accept-Language: ru-RU, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.1.12] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2022/08/01 10:27:00 #20025860 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Hello Jonathan, Thank you for the review. Please find my comments below. On Sun, Jul 31, 2022 at 12:41:55PM +0100, Jonathan Cameron wrote: > On Fri, 29 Jul 2022 20:02:42 +0200 > Andy Shevchenko wrote: >=20 > > On Fri, Jul 29, 2022 at 7:23 PM Dmitry Rokosov wrote: > > > > > > Currently, Hz units do not have milli, micro and nano Hz coefficients= . > > > Some drivers (IIO especially) use their analogues to calculate > > > appropriate Hz values. This patch includes them to units.h definition= s, > > > so they can be used from different kernel places. =20 > >=20 > > ... > >=20 > > > +#define NHZ_PER_HZ 1000000000UL > > > +#define UHZ_PER_HZ 1000000UL > > > +#define MILLIHZ_PER_HZ 1000UL =20 > >=20 > > Oh, but then a bit of consistency? > >=20 > > MICRO > > NANO > Tricky given existing items, but I agree we shouldn't make > it worse. Okay, agree. I'll change them to MILLI/MICRO/NANO in the next version. >=20 > However, I'm not 100% sold on why we need these conversions relative to H= Z. > What's wrong with using MILLI / NANO etc as already defined? I guess > there is a 'documentation' like effect of making it clear these are frequ= ency > unit conversions, but I don't think it makes sense to add it for all the = other > types of unit, so why is Hz special? Yes, you are totally right, it has some 'documenation' effect from a physics theory perspective. Kernel already has some units for HZ, so I think it's a bad idea when sometimes we have to use *HZ for KILO and MEGA units, but sometimes we have to use abstract MILLI/MICRO/NANO coefficients. In other words, I suppose the right way is to choose one option from the following list: - remove all *HZ units and use abstract units instead - complement *HZ units and use them In my opinion, the second one is better, because *HZ units are good opposite to *SEC units (from time64.h). >=20 > I'm not sure why we have the existing ones for HZ with the > exception of KHZ_PER_MEGAHZ. >=20 > Jonathan >=20 > >=20 >=20 --=20 Thank you, Dmitry=