linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: mark.rutland@arm.com, linux-pwm@vger.kernel.org,
	devicetree@vger.kernel.org, Palmer Dabbelt <palmer@sifive.com>,
	linux-kernel@vger.kernel.org,
	Sachin Ghadi <sachin.ghadi@sifive.com>,
	Yash Shah <yash.shah@sifive.com>,
	robh+dt@kernel.org, Paul Walmsley <paul.walmsley@sifive.com>,
	linux-riscv@lists.infradead.org
Subject: Re: [PATCH 2/2] pwm: sifive: Add a driver for SiFive SoC PWM
Date: Mon, 21 Jan 2019 12:54:55 +0100	[thread overview]
Message-ID: <20190121115455.GJ16756@ulmo> (raw)
In-Reply-To: <20190117081956.hpj4ewdihpwuoonz@pengutronix.de>


[-- Attachment #1.1: Type: text/plain, Size: 5188 bytes --]

On Thu, Jan 17, 2019 at 09:19:56AM +0100, Uwe Kleine-König wrote:
> Hello Paul,
> 
> On Wed, Jan 16, 2019 at 11:29:35AM -0800, Paul Walmsley wrote:
> > COMPILE_TEST made slightly more sense before the broad availability of 
> > open-source soft cores, SoC integration, and IP; and before powerful, 
> > inexpensive FPGAs and SoCs with FPGA fabrics were common.
> > 
> > Even back then, COMPILE_TEST was starting to look questionable.  IP blocks 
> > from CPU- and SoC vendor-independent libraries, like DesignWare and the 
> > Cadence IP libraries, were integrated on SoCs across varying CPU 
> > architectures.  (Fortunately, looking at the tree, subsystem maintainers 
> > with DesignWare drivers seem to have largely avoided adding architecture 
> > or SoC-specific Kconfig restrictions there - and thus have also avoided 
> > the need for COMPILE_TEST.)  If an unnecessary architecture Kconfig 
> > dependency was added for a leaf driver, that Kconfig line would either 
> > need to be patched out by hand, or if present, COMPILE_TEST would need to 
> > be enabled.
> > 
> > This was less of a problem then.  There were very few FPGA Linux users, 
> > and they were mostly working on internal proprietary projects. FPGAs that 
> > could run Linux at a reasonable speed, including MMUs and FPUs, were 
> > expensive or were missing good tool support.  So most FPGA Linux 
> > development was restricted to ASIC vendors - the Samsungs, Qualcomms, 
> > NVIDIAs of the world - for prototyping, and those FPGA platforms never 
> > made it outside those companies.
> > 
> > The situation is different now.  The major FPGA vendors have inexpensive 
> > FPGA SoCs with full-featured CPU hard macros.  The development boards can 
> > be quite affordable (< USD 300 for the Xilinx Ultra96).  There are also 
> > now open-source SoC HDL implementations - including MMUs, FPUs, and 
> > peripherals like PWM and UART - for the conventional FPGA market.  These 
> > can run at mid-1990's clock rates - slow by modern standards but still 
> > quite usable.
> 
> In my eyes it's better to make a driver not possible to enable out of
> the box than offering to enable it while it most probably won't be used.

This might sound like a good idea in general, but it's also something
that is pretty much impossible to do. There's just no heuristic that
would allow you to determine with a sufficient degree of probability
that a driver won't be needed. Most of the PCI drivers that are
installed on my workstation aren't used, and I would venture to say
there are a lot of drivers that aren't used in, say, 95% of
installations. That doesn't mean that we should somehow make these
drivers difficult to install, or require someone to patch the kernel
to build them.

> People who configure their own kernel and distribution kernel
> maintainers will thank you. (Well ok, they won't notice, so they won't
> actually tell you, but anyhow.) I'm a member of the Debian kernel team
> and I see how many config items there are that are not explicitly
> handled for the various different kernel images. If they were restricted
> using COMPILE_TEST to just be possible to enable on machines where it is
> known (or at least likely) to make sense that would help. Also when I do
> a kernel version bump for a machine with a tailored kernel running (say)
> on an ARM/i.MX SoC, I could more easily be careful about the relevant
> changes when doing oldconfig if I were not asked about a whole bunch of
> drivers that are sure to be irrelevant.

I think the important thing here is that the driver is "default n". If
you're a developer and build your own kernels, you're pretty likely to
know already if a new kernel that you're installing contains that new
driver that you've been working on or waiting for. In that case you can
easily just enable it manually rather than go through make oldconfig and
wait for it to show up.

As for distribution kernel maintainers, are they really still building a
lot of different kernels? If so, it sounds like most of the multi-
platform efforts have been in vain. I would imagine that if, as a
distribution kernel team, you'd want to carefully evaluate for every
driver whether or not you'd want to include it. I would also imagine
that you'd want to provide your users with the most flexible kernel
possible, so that if they do have a system with an FPGA that you'd make
it possible for them to use pwm-sifive if they choose to synthesize it.

If you really want to create custom builds tailored to a single chip or
board, it's going to be a fair amount of work anyway. I've occasionally
done that in the past and usually just resorted to starting from an
allnoconfig configuration and then working my way up from there.

As for daily work as a developer, when I transition between kernel
versions, or from one linux-next to another, I typically end up doing
the manual equivalent of:

	$ yes '' | make oldconfig

if I know that I'm not interested in any new features. But I also often
just look at what's new because it's interesting to see what's been
going on elsewhere.

Thierry

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2019-01-21 11:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11  8:22 [PATCH 0/2] PWM support for HiFive Unleashed Yash Shah
2019-01-11  8:22 ` [PATCH 1/2] pwm: sifive: Add DT documentation for SiFive PWM Controller Yash Shah
2019-01-15 20:11   ` Uwe Kleine-König
2019-01-16  9:21     ` Yash Shah
2019-01-21 11:20       ` Thierry Reding
2019-01-11  8:22 ` [PATCH 2/2] pwm: sifive: Add a driver for SiFive SoC PWM Yash Shah
2019-01-15 15:27   ` Christoph Hellwig
2019-01-15 22:00   ` Uwe Kleine-König
2019-01-16 11:10     ` Yash Shah
2019-01-16 16:46       ` Uwe Kleine-König
2019-01-16 17:18         ` Paul Walmsley
2019-01-16 17:28           ` Uwe Kleine-König
2019-01-16 19:29             ` Paul Walmsley
2019-01-17  8:19               ` Uwe Kleine-König
2019-01-21 11:54                 ` Thierry Reding [this message]
2019-01-21 15:11                   ` Uwe Kleine-König
2019-01-17  6:45         ` Yash Shah
2019-01-17  7:28           ` Uwe Kleine-König
2019-01-21 11:30     ` Thierry Reding
2019-01-21 13:23       ` Uwe Kleine-König

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=20190121115455.GJ16756@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=palmer@sifive.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh+dt@kernel.org \
    --cc=sachin.ghadi@sifive.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=yash.shah@sifive.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;
as well as URLs for NNTP newsgroup(s).