From: Marc Zyngier <marc.zyngier@arm.com>
To: Qais Yousef <qais.yousef@imgtec.com>,
Thomas Gleixner <tglx@linutronix.de>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
Jason Cooper <jason@lakedaemon.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
Mark Rutland <Mark.Rutland@arm.com>
Subject: Re: [PATCH 01/10] irqchip: irq-mips-gic: export gic_send_ipi
Date: Mon, 24 Aug 2015 18:17:17 +0100 [thread overview]
Message-ID: <55DB519D.2090203@arm.com> (raw)
In-Reply-To: <55DB48C9.7010508@imgtec.com>
[adding Mark Rutland, as this is heading straight into uncharted DT
territory]
On 24/08/15 17:39, Qais Yousef wrote:
> On 08/24/2015 04:07 PM, Thomas Gleixner wrote:
>> On Mon, 24 Aug 2015, Qais Yousef wrote:
>>> On 08/24/2015 02:32 PM, Marc Zyngier wrote:
>>>> I'd rather see something more "architected" than this blind export, or
>>>> at least some level of filtering (the idea random drivers can access
>>>> such a low-level function doesn't make me feel very good).
>>> I don't know how to architect this better or how to perform the filtering,
>>> but I'm happy to hear suggestions and try them out.
>>> Keep in mind that detecting GIC and writing your own gic_send_ipi() is very
>>> simple. I have done this when the driver was out of tree. So restricting it by
>>> not exporting it will not prevent someone from really accessing the
>>> functionality, it's just they have to do it their own way.
>> Keep in mind that we are not talking about out of tree hackery. We
>> talk about a kernel code submission and I doubt, that you will get
>> away with a GIC detection/fiddling burried in your driver code.
>>
>> Keep in mind that just slapping an export to some random function is
>> not much better than doing a GIC hack in the driver.
>>
>> Marcs concerns about blindly exposing IPI functionality to drivers is
>> well justified and that kind of coprocessor stuff is not unique to
>> your particular SoC. We're going to see such things more frequently in
>> the not so distant future, so we better think now about proper
>> solutions to that problem.
>
> Sure I'm not trying to argue against that.
>
>>
>> There are a couple of issues to solve:
>>
>> 1) How is the IPI which is received by the coprocessor reserved in the
>> system?
>>
>> 2) How is it associated to a particular driver?
>
> Shouldn't 'interrupts' property in DT take care of these 2 questions?
> Maybe we can give it an alias name to make it more readable that this
> interrupt is requested for external IPI.
The "interrupts" property has a rather different meaning, and isn't
designed to hardcode IPIs. Also, this property describes an interrupt
from a device to the CPU, not the other way around (I imagine you also
have an interrupt coming from the AXD to the CPU, possibly using an IPI
too).
We can deal with these issues, but that's not something we can improvise.
What I had in mind was something fairly generic:
- interrupt-source: something generating an interrupt
- interrupt-sink: something being targeted by an interrupt
You could then express things like:
intc: interrupt-controller@1000 {
interrupt-controller;
};
mydevice@f0000000 {
interrupt-source = <&intc INT_SPEC 2 &inttarg1 &inttarg1>;
};
inttarg1: mydevice@f1000000 {
interrupt-sink = <&intc HWAFFINITY1>;
};
inttarg2: cpu@1 {
interrupt-sink = <&intc HWAFFINITY2>;
};
You could also imagine having CPUs being both source and sink.
>>
>> 3) How do we ensure that a driver cannot issue random IPIs and can
>> only send the associated ones?
>
> If we get the irq number from DT then I'm not sure how feasible it is to
> implement a generic_send_ipi() function that takes this number to
> generate an IPI.
>
> Do you think this approach would work?
If you follow the above approach, it should be pretty easy to derive a
source identifier and a sink identifier from the DT, and have the core
code to route one to the other and do the right thing.
The source identifier could also be used to describe an IPI in a fairly
safe way (the target being fixed by DT, but the actual number used
dynamically allocated by the kernel).
This is just a 10 minutes braindump, so feel free to throw rocks at it
and to come up with a better solution! :-)
Thanks,
M.
--
Jazz is not dead. It just smells funny...
next prev parent reply other threads:[~2015-08-24 17:17 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-24 12:39 [PATCH 00/10] Add support for img AXD audio hardware decoder Qais Yousef
2015-08-24 12:39 ` [PATCH 01/10] irqchip: irq-mips-gic: export gic_send_ipi Qais Yousef
2015-08-24 12:49 ` Thomas Gleixner
2015-08-24 13:02 ` Qais Yousef
2015-08-24 13:32 ` Marc Zyngier
2015-08-24 14:27 ` Qais Yousef
2015-08-24 15:07 ` Thomas Gleixner
2015-08-24 16:39 ` Qais Yousef
2015-08-24 17:17 ` Marc Zyngier [this message]
2015-08-26 11:23 ` Qais Yousef
2015-08-26 13:19 ` Thomas Gleixner
2015-08-26 14:57 ` Qais Yousef
2015-08-26 15:08 ` Thomas Gleixner
2015-08-26 15:41 ` Qais Yousef
2015-08-26 21:40 ` Thomas Gleixner
2015-08-27 2:22 ` Jiang Liu
2015-08-28 10:38 ` Qais Yousef
2015-08-28 14:22 ` Thomas Gleixner
2015-08-28 15:12 ` Qais Yousef
2015-09-02 9:33 ` Qais Yousef
2015-09-02 9:55 ` Marc Zyngier
2015-09-02 10:48 ` Qais Yousef
2015-09-02 11:53 ` Marc Zyngier
2015-09-02 13:25 ` Qais Yousef
2015-09-02 14:14 ` Marc Zyngier
2015-09-02 12:12 ` Jason Cooper
2015-08-24 14:55 ` Thomas Gleixner
2015-08-24 15:11 ` Qais Yousef
2015-08-24 12:39 ` [PATCH 02/10] dt: add img,axd.txt device tree binding document Qais Yousef
2015-08-24 13:26 ` Mark Rutland
2015-08-24 13:49 ` Qais Yousef
2015-08-24 12:39 ` [PATCH 03/10] ALSA: add AXD Audio Processing IP alsa driver Qais Yousef
2015-08-26 18:37 ` Mark Brown
2015-08-27 12:15 ` Qais Yousef
2015-08-27 15:32 ` Mark Brown
2015-08-28 9:22 ` Qais Yousef
2015-09-03 12:46 ` Mark Brown
2015-08-24 12:39 ` [PATCH 04/10] ALSA: axd: add fw binary header manipulation files Qais Yousef
2015-08-24 12:39 ` [PATCH 05/10] ALSA: axd: add buffers " Qais Yousef
2015-08-26 18:43 ` Mark Brown
2015-08-27 14:21 ` Qais Yousef
2015-08-29 9:47 ` Mark Brown
2015-09-01 10:00 ` Qais Yousef
2015-09-03 12:32 ` Mark Brown
2015-09-14 9:11 ` Qais Yousef
2015-09-14 18:50 ` Mark Brown
2015-08-24 12:39 ` [PATCH 06/10] ALSA: axd: add basic files for sending/receiving axd cmds Qais Yousef
2015-08-26 19:16 ` Mark Brown
2015-08-27 15:40 ` Qais Yousef
2015-08-29 10:18 ` Mark Brown
2015-09-01 10:46 ` Qais Yousef
2015-09-03 12:40 ` Mark Brown
2015-08-24 12:39 ` [PATCH 07/10] ALSA: axd: add cmd interface helper functions Qais Yousef
2015-08-24 12:39 ` [PATCH 08/10] ALSA: axd: add low level AXD platform setup files Qais Yousef
2015-08-24 12:39 ` [PATCH 09/10] ALSA: axd: add alsa compress offload operations Qais Yousef
2015-08-24 12:39 ` [PATCH 10/10] ALSA: axd: add Makefile Qais Yousef
2015-08-26 18:04 ` [PATCH 00/10] Add support for img AXD audio hardware decoder Mark Brown
2015-08-27 9:07 ` Qais Yousef
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=55DB519D.2090203@arm.com \
--to=marc.zyngier@arm.com \
--cc=Mark.Rutland@arm.com \
--cc=alsa-devel@alsa-project.org \
--cc=jason@lakedaemon.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=qais.yousef@imgtec.com \
--cc=tglx@linutronix.de \
/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