aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/sysdev/ehv_pic.c
AgeCommit message (Collapse)AuthorFilesLines
2016-09-20powerpc: Remove all usages of NO_IRQMichael Ellerman1-2/+2
NO_IRQ has been == 0 on powerpc for just over ten years (since commit 0ebfff1491ef ("[POWERPC] Add new interrupt mapping core and change platforms to use it")). It's also 0 on most other arches. Although it's fairly harmless, every now and then it causes confusion when a driver is built on powerpc and another arch which doesn't define NO_IRQ. There's at least 6 definitions of NO_IRQ in drivers/, at least some of which are to work around that problem. So we'd like to remove it. This is fairly trivial in the arch code, we just convert: if (irq == NO_IRQ) to if (!irq) if (irq != NO_IRQ) to if (irq) irq = NO_IRQ; to irq = 0; return NO_IRQ; to return 0; And a few other odd cases as well. At least for now we keep the #define NO_IRQ, because there is driver code that uses NO_IRQ and the fixes to remove those will go via other trees. Note we also change some occurrences in PPC sound drivers, drivers/ps3, and drivers/macintosh. Signed-off-by: Michael Ellerman <[email protected]>
2015-10-13irqdomain: Use irq_domain_get_of_node() instead of direct field accessMarc Zyngier1-1/+2
The struct irq_domain contains a "struct device_node *" field (of_node) that is almost the only link between the irqdomain and the device tree infrastructure. In order to prepare for the removal of that field, convert all users to use irq_domain_get_of_node() instead. Signed-off-by: Marc Zyngier <[email protected]> Reviewed-and-tested-by: Hanjun Guo <[email protected]> Tested-by: Lorenzo Pieralisi <[email protected]> Cc: <[email protected]> Cc: Tomasz Nowicki <[email protected]> Cc: Suravee Suthikulpanit <[email protected]> Cc: Graeme Gregory <[email protected]> Cc: Jake Oshins <[email protected]> Cc: Jiang Liu <[email protected]> Cc: Jason Cooper <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-30genirq/irqdomain: Allow irq domain aliasingMarc Zyngier1-1/+2
It is not uncommon (at least with the ARM stuff) to have a piece of hardware that implements different flavours of "interrupts". A typical example of this is the GICv3 ITS, which implements standard PCI/MSI support, but also some form of "generic MSI". So far, the PCI/MSI domain is registered using the ITS device_node, so that irq_find_host can return it. On the contrary, the raw MSI domain is not registered with an device_node, making it impossible to be looked up by another subsystem (obviously, using the same device_node twice would only result in confusion, as it is not defined which one irq_find_host would return). A solution to this is to "type" domains that may be aliasing, and to be able to lookup an device_node that matches a given type. For this, we introduce irq_find_matching_host() as a superset of irq_find_host: struct irq_domain *irq_find_matching_host(struct device_node *node, enum irq_domain_bus_token bus_token); where bus_token is the "type" we want to match the domain against (so far, only DOMAIN_BUS_ANY is defined). This result in some moderately invasive changes on the PPC side (which is the only user of the .match method). This has otherwise no functionnal change. Reviewed-by: Hanjun Guo <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Cc: <[email protected]> Cc: Yijing Wang <[email protected]> Cc: Ma Jun <[email protected]> Cc: Lorenzo Pieralisi <[email protected]> Cc: Duc Dang <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Jiang Liu <[email protected]> Cc: Jason Cooper <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2014-03-04powerpc:eVh_pic: Kill irq_desc abuseThomas Gleixner1-8/+2
I'm really grumpy about this one. The line: #include "../../../kernel/irq/settings.h" should have been an alarm sign for all people who added their SOB to this trainwreck. When I cleaned up the mess people made with interrupt descriptors a few years ago, I warned that I'm going to hunt down new offenders and treat them with stinking trouts. In this case I'll use frozen shark for a better educational value. The whole idiocy which was done there could have been avoided with two lines of perfectly fine code. And do not complain about the lack of correct examples in tree. The solution is simple: Remove the brainfart and use the proper functions, which should have been used in the first place Signed-off-by: Thomas Gleixner <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Ashish Kalra <[email protected]> Cc: Timur Tabi <[email protected]> Cc: Kumar Gala <[email protected]> Cc: ppc <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2013-11-11powerpc: add missing explicit OF includes for ppcRob Herring1-0/+1
Commit b5b4bb3f6a11f9 (of: only include prom.h on sparc) removed implicit includes of of_*.h headers by powerpc's prom.h. Some components were missed in initial clean-up patch, so add the necessary includes to fix powerpc builds. Signed-off-by: Rob Herring <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Matt Mackall <[email protected]> Cc: Herbert Xu <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Vinod Koul <[email protected]> Cc: Dan Williams <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected]
2013-05-14powerpc: Fix irq_set_affinity() return valuesAlexander Gordeev1-1/+1
Signed-off-by: Alexander Gordeev <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2012-02-16irq_domain/powerpc: constify irq_domain_opsGrant Likely1-1/+1
Make all the irq_domain_ops structures in powerpc 'static const' Signed-off-by: Grant Likely <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Milton Miller <[email protected]> Tested-by: Olof Johansson <[email protected]>
2012-02-16irq_domain: Replace irq_alloc_host() with revmap-specific initializersGrant Likely1-4/+2
Each revmap type has different arguments for setting up the revmap. This patch splits up the generator functions so that each revmap type can do its own setup and the user doesn't need to keep track of how each revmap type handles the arguments. This patch also adds a host_data argument to the generators. There are cases where the host_data pointer will be needed before the function returns. ie. the legacy map calls the .map callback for each irq before returning. v2: - Add void *host_data argument to irq_domain_add_*() functions - fixed failure to compile - Moved IRQ_DOMAIN_MAP_* defines into irqdomain.c Signed-off-by: Grant Likely <[email protected]> Cc: Rob Herring <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Milton Miller <[email protected]> Tested-by: Olof Johansson <[email protected]>
2012-02-14irq_domain/powerpc: Use common irq_domain structure instead of irq_hostGrant Likely1-5/+5
This patch drops the powerpc-specific irq_host structures and uses the common irq_domain strucutres defined in linux/irqdomain.h. It also fixes all the users to use the new structure names. Renaming irq_host to irq_domain has been discussed for a long time, and this patch is a step in the process of generalizing the powerpc virq code to be usable by all architecture. An astute reader will notice that this patch actually removes the irq_host structure instead of renaming it. This is because the irq_domain structure already exists in include/linux/irqdomain.h and has the needed data members. Signed-off-by: Grant Likely <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Milton Miller <[email protected]> Tested-by: Olof Johansson <[email protected]>
2011-11-24arch/powerpc/sysdev/ehv_pic.c: add missing kfreeJulia Lawall1-0/+1
At this point, ehv_pic has been allocated but not stored anywhere, so it should be freed before leaving the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @exists@ local idexpression x; statement S,S1; expression E; identifier fl; expression *ptr != NULL; @@ x = \(kmalloc\|kzalloc\|kcalloc\)(...); ... if (x == NULL) S <... when != x when != if (...) { <+...kfree(x)...+> } when any when != true x == NULL x->fl ...> ( if (x == NULL) S1 | if (...) { ... when != x when forall ( return \(0\|<+...x...+>\|ptr\); | * return ...; ) } ) // </smpl> Signed-off-by: Julia Lawall <[email protected]> Acked-by: Timur Tabi <[email protected]> Signed-off-by: Kumar Gala <[email protected]>
2011-06-27powerpc: introduce the ePAPR embedded hypervisor vmpic driverAshish Kalra1-0/+302
The Freescale ePAPR reference hypervisor provides interrupt controller services via a hypercall interface, instead of emulating the MPIC controller. This is called the VMPIC. The ePAPR "virtual interrupt controller" provides interrupt controller services for external interrupts. External interrupts received by a partition can come from two sources: - Hardware interrupts - hardware interrupts come from external interrupt lines or on-chip I/O devices. - Virtual interrupts - virtual interrupts are generated by the hypervisor as part of some hypervisor service or hypervisor-created virtual device. Both types of interrupts are processed using the same programming model and same set of hypercalls. Signed-off-by: Ashish Kalra <[email protected]> Signed-off-by: Timur Tabi <[email protected]> Signed-off-by: Kumar Gala <[email protected]>