All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Rich Felker <dalias@libc.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-sh@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Marc Zyngier <Marc.Zyngier@arm.com>
Subject: Re: [PATCH v6 2/2] clocksource: add J-Core timer/clocksource driver
Date: Thu, 25 Aug 2016 08:07:08 +0000	[thread overview]
Message-ID: <alpine.DEB.2.20.1608250947120.5714@nanos> (raw)
In-Reply-To: <20160824174001.GW15995@brightrain.aerifal.cx>

Rich,

On Wed, 24 Aug 2016, Rich Felker wrote:
> I don't think that's a correct characterization. Rather the percpu
> infrastructure just means something completely different from what you
> would expect it to mean. It has nothing to do with the hardware but
> rather with kernel-internal choice of whether to do percpu devid
> mapping inside the irq infrastructure, and the choice at the
> irq-requester side of whether to do this is required to match the
> irqchip driver's choice. I explained this better in another email
> which I could dig up if necessary, but the essence is that
> request_percpu_irq is a misnamed and unusably broken API.

I slowly get tired about your permanent ranting about misnamed, misdesigned
and unusable code in the kernel.

The percpu infrastructure was designed explicitely to reflect the hardware and
is not a random kernel internal choice. It's there to handle the situation
where a single interrupt number is actually available on each CPU.

ARM has a very clear distinction between PPI (per processor interrutps) and
SPI (shared peripheral interrupts). So we end up with the following interrupt
space:

IRQ	CPU0	CPU1
0	PPI	PPI
...	...	...
15	PPI	PPI

16	SPI	SPI
...
N	SPI	SPI

The fundamental difference between PPI and SPI is that PPIs originate from the
CPU itself or are injected as IPIs targeted to a particular CPU. Each CPU has
its own interrupt controller to mask/ack/... PPIs.

The SPIs have a shared interrupt controller and therefor are globally shared
between all cpus.

The percpu infrastructure reflects exaclty this scenario and allows us to
handle PPIs with the same irq number (which makes a lot of sense) seperately
on each CPU.

So how does this not reflect the hardware?

If your particular hardware has the old scheme of seperate interrupt numbers
for per cpu interrupts, then you can simply use the normal interrupt scheme
and request a seperate interrupt per cpu.

Just because something does not fit your needs and does not match your SH
blinkered worldview does not make it misnamed, misdesigned and unusable.

If you want to work with this community you really should start to talk
constructive with us and stop this unjustified ranting attitude.

Thanks,

	tglx





WARNING: multiple messages have this Message-ID (diff)
From: Thomas Gleixner <tglx@linutronix.de>
To: Rich Felker <dalias@libc.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-sh@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Marc Zyngier <Marc.Zyngier@arm.com>
Subject: Re: [PATCH v6 2/2] clocksource: add J-Core timer/clocksource driver
Date: Thu, 25 Aug 2016 10:07:08 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1608250947120.5714@nanos> (raw)
In-Reply-To: <20160824174001.GW15995@brightrain.aerifal.cx>

Rich,

On Wed, 24 Aug 2016, Rich Felker wrote:
> I don't think that's a correct characterization. Rather the percpu
> infrastructure just means something completely different from what you
> would expect it to mean. It has nothing to do with the hardware but
> rather with kernel-internal choice of whether to do percpu devid
> mapping inside the irq infrastructure, and the choice at the
> irq-requester side of whether to do this is required to match the
> irqchip driver's choice. I explained this better in another email
> which I could dig up if necessary, but the essence is that
> request_percpu_irq is a misnamed and unusably broken API.

I slowly get tired about your permanent ranting about misnamed, misdesigned
and unusable code in the kernel.

The percpu infrastructure was designed explicitely to reflect the hardware and
is not a random kernel internal choice. It's there to handle the situation
where a single interrupt number is actually available on each CPU.

ARM has a very clear distinction between PPI (per processor interrutps) and
SPI (shared peripheral interrupts). So we end up with the following interrupt
space:

IRQ	CPU0	CPU1
0	PPI	PPI
...	...	...
15	PPI	PPI

16	SPI	SPI
...
N	SPI	SPI

The fundamental difference between PPI and SPI is that PPIs originate from the
CPU itself or are injected as IPIs targeted to a particular CPU. Each CPU has
its own interrupt controller to mask/ack/... PPIs.

The SPIs have a shared interrupt controller and therefor are globally shared
between all cpus.

The percpu infrastructure reflects exaclty this scenario and allows us to
handle PPIs with the same irq number (which makes a lot of sense) seperately
on each CPU.

So how does this not reflect the hardware?

If your particular hardware has the old scheme of seperate interrupt numbers
for per cpu interrupts, then you can simply use the normal interrupt scheme
and request a seperate interrupt per cpu.

Just because something does not fit your needs and does not match your SH
blinkered worldview does not make it misnamed, misdesigned and unusable.

If you want to work with this community you really should start to talk
constructive with us and stop this unjustified ranting attitude.

Thanks,

	tglx

  parent reply	other threads:[~2016-08-25  8:07 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-03  0:18 [PATCH v6 0/2] J-Core timer support Rich Felker
2016-08-03  0:18 ` Rich Felker
     [not found] ` <cover.1470183518.git.dalias-8zAoT0mYgF4@public.gmane.org>
2016-03-17 23:12   ` [PATCH v6 2/2] clocksource: add J-Core timer/clocksource driver Rich Felker
2016-03-17 23:12     ` Rich Felker
2016-03-17 23:12     ` Rich Felker
2016-05-17 23:18 ` [PATCH v6 1/2] of: add J-Core timer bindings Rich Felker
2016-08-04  4:30 ` [PATCH v6 0/2] J-Core timer support Rich Felker
2016-08-04  4:30   ` Rich Felker
2016-08-04  4:30   ` Rich Felker
     [not found]   ` <cover.147018b3518.git.dalias-8zAoT0mYgF4@public.gmane.org>
2016-08-04  4:30     ` [PATCH v6 1/2] of: add J-Core timer bindings Rich Felker
2016-08-04  4:30       ` Rich Felker
2016-08-04  4:30       ` Rich Felker
     [not found]       ` <5e1d4f3346f69bdd9d840c8b5a855c1f93ff93f6.147018b3518.git.dalias-8zAoT0mYgF4@public.gmane.org>
2016-08-04 18:16         ` Rob Herring
2016-08-04 18:16           ` Rob Herring
2016-08-04 18:16           ` Rob Herring
2016-08-04  4:30     ` [PATCH v6 2/2] clocksource: add J-Core timer/clocksource driver Rich Felker
2016-08-04  4:30       ` Rich Felker
2016-08-04  4:30       ` Rich Felker
2016-08-04  8:24       ` Alexnader Kuleshov
2016-08-04  8:24         ` Alexnader Kuleshov
2016-08-04 19:42         ` Rich Felker
2016-08-04 19:42           ` Rich Felker
2016-08-24 16:42       ` Daniel Lezcano
2016-08-24 16:42         ` Daniel Lezcano
2016-08-24 17:40         ` Rich Felker
2016-08-24 17:40           ` Rich Felker
     [not found]           ` <20160824174001.GW15995-C3MtFaGISjmo6RMmaWD+6Sb1p8zYI1N1@public.gmane.org>
2016-08-24 19:01             ` Marc Zyngier
2016-08-24 19:01               ` Marc Zyngier
2016-08-24 19:01               ` Marc Zyngier
2016-08-24 19:20               ` Rich Felker
2016-08-24 19:20                 ` Rich Felker
     [not found]                 ` <20160824192009.GX15995-C3MtFaGISjmo6RMmaWD+6Sb1p8zYI1N1@public.gmane.org>
2016-08-24 22:21                   ` Mark Rutland
2016-08-24 22:21                     ` Mark Rutland
2016-08-24 22:21                     ` Mark Rutland
2016-08-24 20:01           ` Arnd Bergmann
2016-08-24 20:01             ` Arnd Bergmann
2016-08-24 20:52             ` Rich Felker
2016-08-24 20:52               ` Rich Felker
2016-08-24 21:22               ` Mark Rutland
2016-08-24 21:22                 ` Mark Rutland
2016-08-24 21:44                 ` Rich Felker
2016-08-24 21:44                   ` Rich Felker
2016-08-24 21:44                   ` Rich Felker
2016-08-24 21:57                   ` Arnd Bergmann
2016-08-24 21:57                     ` Arnd Bergmann
2016-08-25 10:23                     ` Arnd Bergmann
2016-08-25 10:23                       ` Arnd Bergmann
2016-08-24 22:54                   ` Mark Rutland
2016-08-24 22:54                     ` Mark Rutland
2016-08-25  8:07           ` Thomas Gleixner [this message]
2016-08-25  8:07             ` Thomas Gleixner
2016-08-25 14:56             ` Rich Felker
2016-08-25 14:56               ` Rich Felker
2016-08-25 14:56               ` Rich Felker
2016-08-25 15:41               ` Thomas Gleixner
2016-08-25 15:41                 ` Thomas Gleixner
2016-08-25 17:45                 ` Rich Felker
2016-08-25 17:45                   ` Rich Felker
2016-08-25 16:38               ` Mark Rutland
2016-08-25 16:38                 ` Mark Rutland
2016-08-25 17:51                 ` Rich Felker
2016-08-25 17:51                   ` Rich Felker
2016-08-25 18:21                   ` Mark Rutland
2016-08-25 18:21                     ` Mark Rutland
2016-08-25 19:20                     ` Rich Felker
2016-08-25 19:20                       ` Rich Felker
2016-08-26  9:04           ` Daniel Lezcano
2016-08-26  9:04             ` Daniel Lezcano

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.1608250947120.5714@nanos \
    --to=tglx@linutronix.de \
    --cc=Marc.Zyngier@arm.com \
    --cc=dalias@libc.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.