Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4034167ybl; Mon, 3 Feb 2020 11:14:36 -0800 (PST) X-Google-Smtp-Source: APXvYqySg12YGXd07ODkicaIYA86paxd07tgENGXkVznRDCUn8xl64onb+xnzdbtNkfAhHGpcYEt X-Received: by 2002:a9d:67cc:: with SMTP id c12mr12874509otn.319.1580757276178; Mon, 03 Feb 2020 11:14:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580757276; cv=none; d=google.com; s=arc-20160816; b=uV+BoOZ9oC66ig+2nLv9Lxv73yL19HxUX+sVxDOJ3ShCd9Bdg0BsRYJt69Y3TUEDho mAvDmc0p3BAG9bABLCs3NbxPQT26jMScWbRuqK7GihJZ9MdLc2FHUm1MxmUMR4Ii9tNN UdaP/LCCvE771YIrOhf23bQaqa7QKecjdrI9zYk6WaJtQBqT22Jxrfs9cHgaIN2KT77z ReNrVkMxgrU1gOpTzFUVPTeO8J+AgQvIu11P+/874g0vq7dTbb9omsYDGlLP7P5F9kKW 19axYt8SDm4YTdUZtLNzqm10/G+/ZHIHr6nKXLQwBb9BCZg04Adv0I7anLoNpJoN6mtD 6buQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=T+Popvg5eo8nkatxiVLw7FN5aYNZSXGY5IvHmtOlGVc=; b=p2wfuQbKzEdTSG1/OCIvQQ/khPdqpM+BeDYHaiSuYY6KdXolEHQbo4zQ9S1OqYobQ3 /dCyryIC2qypieCHjbmjSxvgXip5c+hYBTfsA37KJlxKgkDa743jUrfBCqlVoEg3t8O5 ceat99bNt6+k/AhnuthRPsrELk+dsbguPW/VEgma/FG5MUJE3g+dCrOO0tkayEmqT3eS rlstspEPh+kyipbj+NZzTgoVPhUmR4g8m8GExaszDlaZfbIDN30iQMQnsk/rGgEjx6rq QU0esI/uaV4nDg4VDNeB1CBW1VyUSuYaFFwb7xgpZyKZvh7a6JE9F9We4R7V7urnVBbn yRzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s15si7984335oih.252.2020.02.03.11.14.24; Mon, 03 Feb 2020 11:14:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729719AbgBCS1a (ORCPT + 98 others); Mon, 3 Feb 2020 13:27:30 -0500 Received: from mga02.intel.com ([134.134.136.20]:48173 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727124AbgBCS1a (ORCPT ); Mon, 3 Feb 2020 13:27:30 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Feb 2020 10:27:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,398,1574150400"; d="scan'208";a="278822787" Received: from jekeller-mobl1.amr.corp.intel.com (HELO [134.134.177.86]) ([134.134.177.86]) by FMSMGA003.fm.intel.com with ESMTP; 03 Feb 2020 10:27:28 -0800 Subject: Re: [Intel PMC TGPIO Driver 0/5] Add support for Intel PMC Time GPIO Driver with PHC interface changes to support additional H/W Features To: Richard Cochran , christopher.s.hall@intel.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, mingo@redhat.com, x86@kernel.org, davem@davemloft.net, sean.v.kelley@intel.com References: <20191211214852.26317-1-christopher.s.hall@intel.com> <20200203040838.GA5851@localhost> From: Jacob Keller Organization: Intel Corporation Message-ID: <85f42aa9-65fa-121b-a24d-017b56c61267@intel.com> Date: Mon, 3 Feb 2020 10:27:28 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200203040838.GA5851@localhost> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/2/2020 8:08 PM, Richard Cochran wrote: > On Wed, Dec 11, 2019 at 01:48:47PM -0800, christopher.s.hall@intel.com wrote: >> The ART frequency is not adjustable. In order, to implement output >> adjustments an additional edge-timestamp API is added, as well, as >> a periodic output frequency adjustment API. Togther, these implement >> equivalent functionality to the existing SYS_OFFSET_* and frequency >> adjustment APIs. > > I don't see a reason for a custom, new API just for this device. > > The TGPIO input clock, the ART, is a free running counter, but you > want to support frequency adjustments. Use a timecounter cyclecounter > pair. > > Let the user dial a periodic output signal in the normal way. > > Let the user change the frequency in the normal way, and during this > call, adjust the counter values accordingly. > To add: in order to program the pin output correctly, you may need to reverse the timecounter/cyclecounter calculations. I recall doing something similar in ixgbe for programming the correct output signal to match. It may actually be worth adding helper functions to the timecounter system for doing those kind of reverse calculations for converting from a time value back into cycles. > Thanks, > Richard >