Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2960252ybv; Mon, 24 Feb 2020 15:18:15 -0800 (PST) X-Google-Smtp-Source: APXvYqxnh/OhD1RcA5o7dGbFG1nlGImkbalRNmZu4z2Pu2J+4ot1cEoCKdbbjL5Zjz8rDiVltz/S X-Received: by 2002:a05:6830:10d5:: with SMTP id z21mr43762398oto.30.1582586295064; Mon, 24 Feb 2020 15:18:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582586295; cv=none; d=google.com; s=arc-20160816; b=vp72DK0Q06AI9792J49g+AFZRryxVhUoBZX4P3uf9fZvhO5KsxeRBCT4sSfER7rhFL cPH7qtutqm+2PYGCQPczTiUQXf+/3bbPqvy2FJYlTny22AZ5wp5vv/GHS5S32Uu7AHTQ yllo5DYimi8V47lOQcsnbUl/kz1Vfdv9vQa/N2FkfTn0oCDXd0NoRhm1mc+VYHNi8sDY 07dmlCTrvWXTWYZUuFPvpMUzk8UhEuxc0/Vi1Yhq8j26Kbde7hJu491YcjhnlYhDJSx8 EZL5e09J06YbElHtqhKLvg9D99Eu7la+OqI2dgn9JCL+KT+TyEWLvnC2loauz9KeuTiY w99w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=aJrVDqJIjOi1veOgqG0UtDIeu6ynMz/ADwwCLNDisNI=; b=UprFeKGh8RS7J/Pt8upIoUn2w4L7+1sqwbEI9SsEBisgpmQJU4MxE4kMhNn6FhRITT jamBfeFcjrAlJHT/T9Ph/pu6BnJfgShx0VAavYh3DCWHtNe7Qur0jSkHgj8KpoCu7nwk 7zsEV2ZVnbS9Xd8GDYAYU+K16DP15CFmT2FoaVKbCRxrHFPZ7jVfgBF6ea58oRrjI26w X6SlcU+//+NdwUiskN/fATvjk0NTudDIdhjxfMI4s8hPlliJ45nxULjHidOgNJ3ddYZ8 Xixb0mom+ko47A2babVBgysCELrfa3ofO+VTH2Rx4TI1c1Hq3HmQWILE1WVL/Lk/i/Pp Ivsg== 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 v21si1588749otp.189.2020.02.24.15.17.58; Mon, 24 Feb 2020 15:18:15 -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 S1728011AbgBXXRy (ORCPT + 99 others); Mon, 24 Feb 2020 18:17:54 -0500 Received: from mga07.intel.com ([134.134.136.100]:15611 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726651AbgBXXRy (ORCPT ); Mon, 24 Feb 2020 18:17:54 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2020 15:17:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,481,1574150400"; d="scan'208";a="410039160" Received: from wtczc53028gn.jf.intel.com (HELO skl-build) ([10.54.87.17]) by orsmga005.jf.intel.com with ESMTP; 24 Feb 2020 15:17:53 -0800 Date: Mon, 24 Feb 2020 15:17:42 -0800 From: "Christopher S. Hall" To: Linus Walleij Cc: Mika Westerberg , Andy Shevchenko , netdev , "linux-kernel@vger.kernel.org" , Thomas Gleixner , "H. Peter Anvin" , Ingo Molnar , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , jacob.e.keller@intel.com, Richard Cochran , "David S. Miller" , sean.v.kelley@intel.com Subject: Re: [Intel PMC TGPIO Driver 5/5] drivers/ptp: Add PMC Time-Aware GPIO Driver Message-ID: <20200224231742.GD1508@skl-build> References: <20191211214852.26317-1-christopher.s.hall@intel.com> <20191211214852.26317-6-christopher.s.hall@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Linus, Thanks for the review. On Fri, Feb 07, 2020 at 06:10:46PM +0100, Linus Walleij wrote: > Hi Christopher, > > thanks for your patch! > > On Fri, Jan 31, 2020 at 7:41 AM wrote: > > > From: Christopher Hall > > > > The driver implements to the expanded PHC interface. Input requires use of > > the user-polling interface. Also, since the ART clock can't be adjusted, > > modulating the output frequency uses the edge timestamp interface > > (EVENT_COUNT_TSTAMP2) and the PEROUT2 ioctl output frequency adjustment > > interface. > > > > Acknowledgment: Portions of the driver code were authored by Felipe > > Balbi > > > > Signed-off-by: Christopher Hall > This driver becomes a big confusion for the GPIO maintainer... I see your concern. TGPIO is Intel's internal name for the device, but there's no reason we can't use some other terminology in the context of the Linux kernel. How about removing the GP? We could refer to the device as "timed I/O". I think that is still fairly descriptive, but removes the confusion. Does this help the problem? > > +config PTP_INTEL_PMC_TGPIO > > + tristate "Intel PMC Timed GPIO" > > + depends on X86 > > + depends on ACPI > > + depends on PTP_1588_CLOCK > (...) > > +#include > > Don't use this header in new code, use > > But it looks like you should just drop it because there is no GPIO > of that generic type going on at all? Yes. You're correct. Removed. > > +/* Control Register */ > > +#define TGPIOCTL_EN BIT(0) > > +#define TGPIOCTL_DIR BIT(1) > > +#define TGPIOCTL_EP GENMASK(3, 2) > > +#define TGPIOCTL_EP_RISING_EDGE (0 << 2) > > +#define TGPIOCTL_EP_FALLING_EDGE (1 << 2) > > +#define TGPIOCTL_EP_TOGGLE_EDGE (2 << 2) > > +#define TGPIOCTL_PM BIT(4) > > OK this looks like some GPIO registers... > > Then there is a bunch of PTP stuff I don't understand I suppose > related to the precision time protocol. > > Could you explain to a simple soul like me what is going on? > Should I bother myself with this or is this "some other GPIO, > not what you work on" or could it be that it's something I should > review? The Timed GPIO device has some GPIO-like features, but is mostly used to import/export a clock signal. It doesn't implement PWM or some other "GP" features like reading/setting pin state. I think you can safely ignore the feature. > I get the impression that this so-called "general purpose I/O" > isn't very general purpose at all, it seems to be very PTP-purpose Yes. It is missing many of general purpose features. > rather, so this confusion needs to be explained in the commit > message and possibly in the code as well. > > What is it for really? For import/export system clock, primarily. > Yours, > Linus Walleij Thanks, Christopher