Netdev List
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: Richard Cochran <richardcochran@gmail.com>,
	John Stultz <john.stultz@linaro.org>,
	Josh Triplett <josh@joshtriplett.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 0/2] make POSIX timers optional
Date: Tue, 20 Sep 2016 23:09:52 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1609202300140.5476@nanos> (raw)
In-Reply-To: <alpine.LFD.2.20.1609201655200.9311@knanqh.ubzr>

On Tue, 20 Sep 2016, Nicolas Pitre wrote:
> On Tue, 20 Sep 2016, Richard Cochran wrote:
> 
> > On Tue, Sep 20, 2016 at 10:25:56PM +0200, Richard Cochran wrote:
> > > After this series, if I don't pay enough attention to dmesg, then I
> > > have lost functionality that I had in step #1.  That sucks, and it has
> > > nothing to do with the tinification option at all.  It will bite even
> > > if I have no knowledge of it.  That isn't acceptable to me.
> > 
> > Can't you leave all the "select PTP_1588_CLOCK" alone and simply add
> > 
> > #ifdef CONFIG_POSIX_TIMERS
> > 	// global declarations
> > #else
> > 	// static inlines
> > #endif

Eew. No! That's an even more blantant layering violation.
 
> > to ptp_clock_kernel.h, and then sandwich ptp_clock.c in
> > #ifdef CONFIG_POSIX_TIMERS ... #endif ?
> 
> Sure I could... but I'm sure I'll be flamed by others for making things 
> even more obscure and hackish than they are right now.

I think the whole approach is wrong because it makes the PTP split at the
wrong level.

Currently we have:

	  DRIVER_X
	  tristate "Driver X"
	  select PTP

In order to make POSIX_CLOCK configurable we should have

       	  PTP
	  tristate "PTP"
	  select POSIX_CLOCK

Now if you want to distangle PTP from a driver then you split it at the
driver level and not at the PTP level:

      	  DRIVER_X
	  tristate "Driver X"

	  DRIVER_X_PTP
	  bool "Enable PTP support"
	  default y if !MAKE_IT_TINY
	  depends on DRIVER_X
	  select PTP

We have already drivers following that scheme. That way you make the PTP
support in the driver conditional on DRIVER_X_PTP and have no hassle with
modules and dependencies.

Your tiny config can simply disable all the PTP extra bits and then you can
disable PTP and finally POSIX_TIMERS.

Thanks,

	tglx

  reply	other threads:[~2016-09-20 21:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-20 19:56 [PATCH v2 0/2] make POSIX timers optional Nicolas Pitre
2016-09-20 19:56 ` [PATCH 1/2] ptp_clock: allow for it to be optional Nicolas Pitre
2016-09-20 19:56 ` [PATCH 2/2] posix-timers: make it configurable Nicolas Pitre
2016-09-20 20:25 ` [PATCH v2 0/2] make POSIX timers optional Richard Cochran
2016-09-20 20:45   ` Richard Cochran
2016-09-20 20:58     ` Nicolas Pitre
2016-09-20 21:09       ` Thomas Gleixner [this message]
2016-09-20 22:47         ` Nicolas Pitre
2016-09-21  8:38           ` Richard Cochran
2016-09-21 10:27             ` Jiri Benc
2016-09-21  9:09           ` Thomas Gleixner
2016-09-21 10:20         ` Jiri Benc
2016-09-20 20:52   ` Nicolas Pitre
2016-09-22  6:09 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1609202300140.5476@nanos \
    --to=tglx@linutronix.de \
    --cc=john.stultz@linaro.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.pitre@linaro.org \
    --cc=richardcochran@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox