Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp826752ybv; Fri, 7 Feb 2020 09:12:08 -0800 (PST) X-Google-Smtp-Source: APXvYqxyR8gXGH1IgsJiJGpG+iVVT3kelvJgpWOR13JFjuq+qEZKtdTaYYh/ll2J06iXOz1D4Lpk X-Received: by 2002:a9d:6181:: with SMTP id g1mr320495otk.104.1581095528074; Fri, 07 Feb 2020 09:12:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581095528; cv=none; d=google.com; s=arc-20160816; b=An4f8/co9dYbSBUJEJSNNq+GnjmXL49YjzoHIR4uDPRW1xUOcY8DiL4jKm96VbvXn8 wIfGv/P+7ID2RlGXXQR9oXy+oH9m27o1y+Jz6paGb/HCagMmbGjfciaPIVZzJpkTXfvd q4t9QK1T2Timp7qq2Phs78HYOmKFb8TcJERbg3JZHk5Kqa6NmvfiRDs9ZJthFou0W3tk LQdmrvK/rfdmit/4dGDSr2iLA6H2SYB1uiUs07e7BORWLuUozr4SAb9GzI9i3fcAaCWa mEdvjrwlG4Lo8v8o5agYsPERNz5Erh0m2kdDlUvqHFyVnrjwo90MzLAo2VM7z+6Z9KnW VSFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=kHZ6O3yZLVjr/z8fh4b0NIHRATY9dkwE1ZXn4+1qxmE=; b=P5l0Dh5QFsH80z20qDS5ab9IpsiNeBEufL2LxqLBVd9W+uX5BGGI+ucqUSvQVeilFk P22YSd4n4dCgjbb+BCgVqlf1iWSGmjQyk8XQb9j8uz6tj+w4ha2easH+3m0YTsCE0yUE QKBnm/sZwSosTNdLxWQf2LCbOmvnj1c2iV1VtI5twYGrmF4kiS39vnENJN/31LkhOoCm VmKYnuh7MHDSdZ3Kt3NV8PZ4lvRUGwjB/P7cGkAocD61vWx+Fd0t0fqwlHW2xqVfk1O7 n/5YzaSW7sMnf4GGWhUYR7skQkg5eWcDYFIctgnpvN5cSFvFXQ8aIY7Yp26xs1nUlyrA KrCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DSrPBFU8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j70si4403097oib.219.2020.02.07.09.11.54; Fri, 07 Feb 2020 09:12:08 -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; dkim=pass header.i=@linaro.org header.s=google header.b=DSrPBFU8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727075AbgBGRK7 (ORCPT + 99 others); Fri, 7 Feb 2020 12:10:59 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:43592 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726867AbgBGRK7 (ORCPT ); Fri, 7 Feb 2020 12:10:59 -0500 Received: by mail-lj1-f194.google.com with SMTP id a13so46050ljm.10 for ; Fri, 07 Feb 2020 09:10:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kHZ6O3yZLVjr/z8fh4b0NIHRATY9dkwE1ZXn4+1qxmE=; b=DSrPBFU89WipvBFWDiBmx1WEfiNz+QcRasIkw0wuHAcsdY2yl/E8Va/dvrOsEis6nU ll7iO7+BXahC5Wo35n+CMC/ZJB0BzkIBDQ6bz2oNfA/FfNyePShEo2IjGJMgHw34we6c 5ENqo4hbOu356FJCONM9PE3UF4X0c5eevOtFWuYJXogW+JEC2BZHyd0R3ME22fbUS4wT +sb9wAS2ouuVh7BYly3TCt/391WbB/K3G6bQ90SeHhqyV0gFMGdZpz9qdnibj2WOgQu0 SPXFPFM3/TPol8Ju+QZsxciJrkYc66/7jrqn/cig1FoJoN7DwxG4mD5ex1K+QSUtP3a9 DjCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kHZ6O3yZLVjr/z8fh4b0NIHRATY9dkwE1ZXn4+1qxmE=; b=r5wrrRqUNvWI2n8YAl/m1FTHV3BsF3a6HU8SeEICruqgvmAxV1BWh0J/+HRWrPZNp2 yyi+gMs+XDMzCAwSxtuay66wxhZjyHaEeWAJKHFFhAetGz+v8xn2tJ7xNvlBaNMcTQL5 iJzNq6VpJwx/StnqjTgvVqlhQ+PGJ6SA/k5+HUpPIwI5+2sHWeUBrNBV4+NRuicGJttx b3BtwwlPylJr5fpYJ5RodzoX2gzn4NXLEV7I+NzWpn82er2jCz2pRg47Mcepmj97sW/R mg/VNFLaUUp6UO+eGq8SXu7xqY1qK9XcrJljm4rNIZUmUdwCMY/lBaPc1tf/bytVpQKx +0BQ== X-Gm-Message-State: APjAAAXGNatfJ4l17WCwZSRvGtboUkY7kSz/SFTavvu36x8MZWxhjp1A 9JNkAGj1mTefXWmHlZIBc9neEiQp3SpT/+SIvgFtLA== X-Received: by 2002:a2e:81c3:: with SMTP id s3mr147514ljg.168.1581095457580; Fri, 07 Feb 2020 09:10:57 -0800 (PST) MIME-Version: 1.0 References: <20191211214852.26317-1-christopher.s.hall@intel.com> <20191211214852.26317-6-christopher.s.hall@intel.com> In-Reply-To: <20191211214852.26317-6-christopher.s.hall@intel.com> From: Linus Walleij Date: Fri, 7 Feb 2020 18:10:46 +0100 Message-ID: Subject: Re: [Intel PMC TGPIO Driver 5/5] drivers/ptp: Add PMC Time-Aware GPIO Driver To: christopher.s.hall@intel.com, Mika Westerberg , Andy Shevchenko Cc: 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christopher, thanks for your patch! On Fri, Jan 31, 2020 at 7:41 AM wrote: > From: Christopher Hall > > Add support for PMC Time-Aware GPIO (TGPIO) hardware that is present on > upcoming Intel platforms. The hardware logic is driven by the ART clock. > The current hardware has two GPIO pins. Input interrupts are not > implemented in hardware. > > 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... > +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? > +/* 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? 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 rather, so this confusion needs to be explained in the commit message and possibly in the code as well. What is it for really? Yours, Linus Walleij