Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1720923rwb; Thu, 8 Dec 2022 14:31:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Gl2PFCPiSNWsIdwzwVvAjJ3ZiklXivLcUYjYxa2u2ILtJYbJhHI8edcl5cEvrHTWNV2Nj X-Received: by 2002:a05:6402:248e:b0:464:1b51:f85c with SMTP id q14-20020a056402248e00b004641b51f85cmr1766252eda.25.1670538684087; Thu, 08 Dec 2022 14:31:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670538684; cv=none; d=google.com; s=arc-20160816; b=dNQ0GFSUmeAm9M0ZxWZQU3ET+dSeXycJ9vRfW3NqqvBl3BI4dSCx+UPxd1yEBA11TB Q8wBgpXRlvHw/eulkHIxEPrxEZ8zDoCCgNly+5q05eE91r7CEPkY8PonYlwdYYdNwI9Y 2Za1I1N1LqaLoeX2mrwWLgAyCzvthckgTTKwXbwzF8QfVC3LoBa19abnPL3eJjbFqtUN GH4HvdMG92JQPHq0MHN1Se1kOcNcT6m9fe3v7Mk/dZSZC7zGvF6TkhgUfks8jS4WDnQ8 e3nWWkRTumRr9zCBI2UB9sG4BqWDQW1oyq8fS3zRX8mjffQQOh1M/XsOESiGlX9+qrzn BgIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=GlnKwCM+RiupdXA6cs5QqgrNaf48G0/GZTk3jwIRsLA=; b=qCywh7KEfYapfruo6Et7yy6GOV/GaouxLuTfdVQhxzKutOQyIC1TTxLEbL+YK+tcyn PYFGenwmiCZ4xepSiRe1dT1+ohmCniTJN54VZIfXWSi1hB2oBdEDaqMtuk3pjL8iexX9 vqjbfVazkkijRExegs0ua3zS83c6TfbbK7YgizWPACl2MguXbaBkpyxQZdWarbj7y3qp 2pkNq5gpBjOpGHMlSjpqWUwvYd7HmvHwOcKMfyIGTGresjTEu51aCSU9lphECDDLN2+9 4JaHWLhCTjD4s/+OiUr0I5JgKejLNCpk0zOnywFOb3fFRXHO98LeCLjwROEqIPtY1+5K 9LwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u1UXoQ4Q; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m17-20020a056402431100b00461d9b36740si6463198edc.240.2022.12.08.14.30.55; Thu, 08 Dec 2022 14:31:24 -0800 (PST) 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=@linaro.org header.s=google header.b=u1UXoQ4Q; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229530AbiLHWKy (ORCPT + 73 others); Thu, 8 Dec 2022 17:10:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbiLHWKw (ORCPT ); Thu, 8 Dec 2022 17:10:52 -0500 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5596227DE5 for ; Thu, 8 Dec 2022 14:10:51 -0800 (PST) Received: by mail-yb1-xb2e.google.com with SMTP id f139so3126827yba.8 for ; Thu, 08 Dec 2022 14:10:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GlnKwCM+RiupdXA6cs5QqgrNaf48G0/GZTk3jwIRsLA=; b=u1UXoQ4QFd/pYaY44ys8dwVAgJjH5SG22JiE6WI3T/vEjgqMG2avck3clvDZgLXwzY Lk8VuODv9nrMVfUhXnt1lsXBildi2l5O3Sdh7sqD7K0B59iKU1K8ihQ4q1+ZWCegceW7 Tf+oGNKiZVNtpMGmBEON+HWRpvnPf1SCqr5MBDg+7bEf9slkj3FBCG+MrKnI0uAWuvBO KCCyWreBS8V9vPiGlGSwqpjeRYl1ulnfeMEz+hUiXxMZ7j25+Udwwoy3EF1ADv8WP/iA c3KPbJ8kcJcxKwmYwyBHAbwWI1hno9KTV/itHodzTF6k8K0DZRJZOHWlFgAvLM+0tdoK nYMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GlnKwCM+RiupdXA6cs5QqgrNaf48G0/GZTk3jwIRsLA=; b=IdOkljTODggppDPuReLYOvnH5ooT4jiQ6AY3+0XETcMMl0Ng73srXXzy1lk4kSk7rm h2/PQbY4P4y4NxZbqtjdkUVCt/Q73igWYItfMwzXKN37Hd2woLFCMGdOrhRkj4+n0uQX 3aN6rHFto7FUCaWbVxE+1Fed5T/O0muub8VOMYNFfrjTY5vlBS7fi2eFJDPGh8IvE8Jf W/BST+Ff12ovWu8w8Xov5tO/ZWiCzmTaHewUr8b6dK84xiXFpK+HAaA7zbkKsxVVNDcn 6rEQkz/VvUcNobA+98q2THqhJNHfOtIKmfl0qjCZXFLdU5RNUiBakBBZNMsdS+bHJKm/ O63Q== X-Gm-Message-State: ANoB5pnmZBXgDe/XoxJElrV2zR6fYCSE3+CZZWJdDWUjQAu9gKogKVSY We2ONED6T/fKOipyPXGm4a5lvg3uAOM2GZ57hMw+JQ== X-Received: by 2002:a25:8e82:0:b0:6d2:70d5:3ed0 with SMTP id q2-20020a258e82000000b006d270d53ed0mr94181732ybl.457.1670537450502; Thu, 08 Dec 2022 14:10:50 -0800 (PST) MIME-Version: 1.0 References: <7de35859-97ab-8e88-f590-d5851b81773b@nvidia.com> <34baa0b1-72c3-e4b3-3eaf-9b07fe86c3df@nvidia.com> In-Reply-To: From: Linus Walleij Date: Thu, 8 Dec 2022 23:10:38 +0100 Message-ID: Subject: Re: Intel timed i/o driver in HTE To: "Hall, Christopher S" Cc: "N, Pandith" , Johan Hovold , Dipen Patel , "linux-kernel@vger.kernel.org" , "Gross, Mark" , "Sangannavar, Mallikarjunappa" , "D, Lakshmi Sowjanya" , "T R, Thejesh Reddy" , "andriy.shevchenko@linux.intel.com" , "timestamp@lists.linux.dev" , Arnd Bergmann Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 Hi Christopher! thanks for the lengthy explanation, I think I get it now. As usual I have now a slight impostor syndrome for now knowing what PPS is and what it is for despite it has its own subsystem and all. On Thu, Dec 8, 2022 at 5:52 AM Hall, Christopher S wrote: > For PPS input, we plan to use the PPS subsystem. Why are you not planning to use the PPS "generators" for output? > The application configures the pin for PPS input > A device in created /dev/ppsX > while 1: > The timed I/O device captures / timestamps a pulse from an > external PPS provider > The timestamp is translated to system time(TN) > A PPS event is generated using pps_event(TN > > Another application like PHC2SYS or Chrony consumes the timestamps from > the PPS device and disciplines the system clock. This is great and to the point. > Currently, most - maybe all - PPS clients (drivers/pps/clients) capture > timestamps in software (pps_get_ts()). We can do at least 50x better > timestamping using hardware. The timestamp accuracy is in the range of > a few 10s of nanoseconds. I think this is a good thing. So the plan is to let a driver in drivers/pps obtain a timed IO input from the HTE subsystem with high resution, which is great. > Again we provided an example application. Let's not get "hung up" on GPS. > There are many GPS receivers that produce a PPS output. OK I'm sorry for being so stubborn with that example. > If I may, I would like to re-focus the discussion. The question we want > to answer in this thread is whether it makes sense to modify the HTE > subsystem to accommodate our device and whether it "belongs" there. Yeah I agree. > To summarize this and previous threads the Timed IO use case is > importing and exporting system time with about nanosecond precision. Yeah I think that point has not been the main focus actually: maybe I'm especially dumb but it looked to me as posed for "random events" in and "random pulsetrains" out. But in this context it makes much more sense. > We also want to be able to timestamp / generate single events. > Existing HTE already do the first. > > Are these use cases that you are willing to support in the HTE > subsystem? We seem to be unable to dig into the implementation > without circling back to the use cases which I believe are > clearly defined. Sorry for the misunderstandings. This is really Dipen's decision. If you ask me, it seems like you should begin with making a PPS input using the HTE as back-end, then think about the next thing. If this *makes* *sense*, and is not over-generalizing the timed input. I.e. if you expect people to be using it for some random other line sampling unrelated to PPS. There is no point in putting it into drivers/hte for random abstraction. Otherwise by all means put the whole thing into drivers/pps why not? If that is what it is for? This *could* be one of those cases where the subsystem is not a clear cut, and that does not matter because we are not especially OCD about pigeon-holeing hardware into one subsystem and one subsystem only. Perhaps the output mode should just go into drivers/pps/generators without any HTE back-end while the input mode uses HTE? The fact that this is one single HW block doesn't really matter as long as you can share the hw access using something like MFD or regmap in worst case. Yours, Linus Walleij