aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/sysdev/mpic.c
AgeCommit message (Collapse)AuthorFilesLines
2012-02-23powerpc/mpic: Remove MPIC_BROKEN_FRR_NIRQS and duplicate irq_countKyle Moffett1-11/+6
The mpic->irq_count variable is only used as a software error-checking limit to determine whether or not an IRQ number is valid. In board code which does not manually specify an IRQ count to mpic_alloc(), i.e. 0, it is automatically detected from the number of ISUs and the ISU size. In practice, all hardware ends up with irq_count == num_sources, so all of the runtime checks on mpic->irq_count should just check the value of mpic->num_sources instead. When platform hardware does not correctly report the number of IRQs, which only happens on the MPC85xx/MPC86xx, the MPIC_BROKEN_FRR_NIRQS flag is used to override the detected value of num_sources with the manual irq_count parameter. Since there's no need to manually specify the number of IRQs except in this case, the extra flag can be eliminated and the test changed to "irq_count != 0". Signed-off-by: Kyle Moffett <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2012-02-23fsl/mpic: Create and document the "single-cpu-affinity" device-tree flagKyle Moffett1-0/+2
The Freescale MPIC (and perhaps others in the future) is incapable of routing non-IPI interrupts to more than once CPU at a time. Currently all of the Freescale boards msut pass the MPIC_SINGLE_DEST_CPU flag to mpic_alloc(), but that information should really be present in the device-tree. Older board code can't rely on the device-tree having the property set, but newer platforms won't need it manually specified in the code. [BenH: Remove unrelated changes, folded in a different patch] Signed-off-by: Kyle Moffett <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2012-02-23powerpc/mpic: Fix use of "flags" variable in mpic_alloc()Kyle Moffett1-24/+22
The mpic_alloc() function takes a "flags" parameter and assigns it into the mpic->flags variable fairly early on, but several later pieces of code detect various device-tree properties and save them into the "mpic->flags" variable (EG: "big-endian" => MPIC_BIG_ENDIAN). Unfortunately, a number of codepaths (including several which test the flag MPIC_BIG_ENDIAN!) test "flags" instead of "mpic->flags", and get wrong answers as a result. Consolidate the device-tree flag tests early in mpic_alloc() and change all of the checks after "mpic->flags" is init'ed to use "mpic->flags". [BenH: Fixed up use of mpic->node before it's initialized] Signed-off-by: Kyle Moffett <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2012-02-16irq_domain: Replace irq_alloc_host() with revmap-specific initializersGrant Likely1-5/+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-6/+6
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-12-07powerpc/mpic: Add in-core support for cascaded MPICsKyle Moffett1-2/+28
The Cell and PowerMac platforms use virtually identical cascaded-IRQ setup code, so just merge it into the core. Ideally this code would trigger automatically when an MPIC device-node specifies an "interrupts" property, perhaps even enabling MPIC_SECONDARY along the way. Unfortunately, Benjamin Herrenschmidt has had bad experiences in the past with the quality of Apple PowerMac device-trees, so to be safe we will only try to parse out an IRQ if the MPIC_SECONDARY flag is set by the caller. Signed-off-by: Kyle Moffett <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-12-07powerpc/mpic: Cache the device-tree node in "struct mpic"Kyle Moffett1-17/+16
Store the node pointer in the MPIC during initialization so that all of the later operational code can just reuse the cached pointer. Signed-off-by: Kyle Moffett <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-12-07powerpc/mpic: Put "pic-no-reset" test back into the MPIC codeKyle Moffett1-6/+1
There's not really any reason to have this one-liner in a separate static inline function, given that all the other similar tests are already in the alloc_mpic() code. Signed-off-by: Kyle Moffett <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-12-07powerpc/mpic: Don't open-code dcr_resource_startKyle Moffett1-5/+2
Don't open-code the OpenFirmware "dcr-reg" property lookup trying to map DCR resources. This makes the code a bit easier to read. Signed-off-by: Kyle Moffett <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-12-07powerpc/mpic: Invert the meaning of MPIC_PRIMARYKyle Moffett1-7/+7
It turns out that there are only 2 in-tree platforms which use MPICs which are not "primary": IBM Cell and PowerMac. To reduce the complexity of the typical board setup code, invert the MPIC_PRIMARY bit into MPIC_SECONDARY. Signed-off-by: Kyle Moffett <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-12-07powerpc/mpic: Search for open-pic device-tree node if NULLKyle Moffett1-4/+30
Almost all PowerPC platforms use a standard "open-pic" device node so the mpic_alloc() function now accepts NULL for the device-node. This will cause it to perform a default search with of_find_matching_node(). Signed-off-by: Kyle Moffett <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-12-07powerpc/mpic: Save computed phys_addr for board-specific codeKyle Moffett1-5/+6
The MPIC code can already perform an automatic OF address translation step as part of mpic_alloc(), but several boards need to use that base address when they perform mpic_assign_isu(). The easiest solution is to save the computed physical address into the "struct mpic" for later use by the board code. Signed-off-by: Kyle Moffett <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-12-07powerpc/mpic: Assume a device-node was passed in mpic_alloc()Kyle Moffett1-29/+21
All of the existing callers of mpic_alloc() pass in a non-NULL device-node pointer, so the checks for a NULL device-node may be removed. Signed-off-by: Kyle Moffett <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-12-07powerpc: Consolidate mpic_alloc() OF address translationKyle Moffett1-27/+34
Instead of using the open-coded "reg" property lookup and address translation in mpic_alloc(), directly call of_address_to_resource(). This includes various workarounds for special cases which the naive of_address_translate() does not. Afterwards it is possible to remove the copiously copy-pasted calls to of_address_translate() from the 85xx/86xx/powermac platforms. Signed-off-by: Kyle Moffett <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Grant Likely <[email protected]> Cc: Kumar Gala <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-11-25powerpc/mpic: Remove extra semicolon.Justin P. Mattock1-1/+1
The patch below removes an extra semicolon. Signed-off-by: Justin P. Mattock <[email protected]> CC: [email protected] CC: Paul Mackerras <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-11-08powerpc/irq: Remove IRQF_DISABLEDYong Zhang1-2/+0
Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled], We run all interrupt handlers with interrupts disabled and we even check and yell when an interrupt handler returns with interrupts enabled (see commit [b738a50a: genirq: Warn when handler enables interrupts]). So now this flag is a NOOP and can be removed. Signed-off-by: Yong Zhang <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Acked-by: Geoff Levand <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-11-03powerpc/85xx: issue 15 EOI after core reset for FSL CoreNet devicesMatthew McClintock1-0/+10
This is listed as a requirement for Freescale CoreNet based devices (e.g p4080ds with MPIC v4.x) after issuing a core reset to properly clear pending interrupts. Signed-off-by: Matthew McClintock <[email protected]> Signed-off-by: Kumar Gala <[email protected]>
2011-09-20powerpc/mpic: Add support for discontiguous coresTimur Tabi1-9/+15
There is one place in the MPIC driver that assumes that the cores are numbered from 0 to n-1. However, this is not true if the CPUs are not numbered sequentially. This can happen on a eight-core SOC where cores two and three are removed in the device tree. So instead of blindly looping, we iterate over the discovered CPUs and use the SMP ID as the index. This means that we no longer ask the MPIC how many CPUs there are, so we also delete mpic->num_cpus. We also catch if the number of CPUs in the SOC exceeds the number that the MPIC supports. This should never happen, of course, but it's good to be sure. Signed-off-by: Timur Tabi <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-06-30Merge remote branch 'origin/master' into nextBenjamin Herrenschmidt1-6/+5
2011-06-29arch/powerpc: use printk_ratelimited instead of printk_ratelimitChristian Dietrich1-6/+5
Since printk_ratelimit() shouldn't be used anymore (see comment in include/linux/printk.h), replace it with printk_ratelimited. Signed-off-by: Christian Dietrich <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-06-22powerpc: make irq_choose_cpu() available to all PIC driversStuart Yoder1-36/+0
Move irq_choose_cpu() into arch/powerpc/kernel/irq.c so that it can be used by other PIC drivers. The function is not MPIC-specific. Signed-off-by: Stuart Yoder <[email protected]> Signed-off-by: Timur Tabi <[email protected]> Signed-off-by: Kumar Gala <[email protected]>
2011-06-20powerpc/mpic: Support compiling with DEBUG enabledDmitry Eremin-Solenikov1-1/+1
Support compilation of mpic.c with DEBUG defined, as now we have irq_desc and not irq number. Signed-off-by: Dmitry Eremin-Solenikov <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-05-20Merge remote branch 'origin/master' into mergeBenjamin Herrenschmidt1-22/+26
Manual merge of arch/powerpc/kernel/smp.c and add missing scheduler_ipi() call to arch/powerpc/platforms/cell/interrupt.c Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-05-20Merge remote branch 'kumar/next' into nextBenjamin Herrenschmidt1-7/+122
2011-05-19powerpc/mpic: add the mpic global timer supportScott Wood1-6/+86
Add support for MPIC timers as requestable interrupt sources. Based on http://patchwork.ozlabs.org/patch/20941/ by Dave Liu. Signed-off-by: Dave Liu <[email protected]> Signed-off-by: Scott Wood <[email protected]> Signed-off-by: Kumar Gala <[email protected]>
2011-05-19powerpc/mpic: parse 4-cell intspec types other than zeroScott Wood1-1/+36
Signed-off-by: Scott Wood <[email protected]> Signed-off-by: Kumar Gala <[email protected]>
2011-05-19powerpc/mpic: Simplify ipi cpu mask handlingMilton Miller1-13/+11
Now that MSG_ALL and MSG_ALL_BUT_SELF have been eliminated, smp_mpic_mesage_pass no longer needs to lookup the cpumask just to have mpic_send_ipi extract part of it and recode it in a NR_CPUS loop by mpic_physmask. Signed-off-by: Milton Miller <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-05-19powerpc: Remove checks for MSG_ALL and MSG_ALL_BUT_SELFMilton Miller1-18/+2
Now that smp_ops->smp_message_pass is always called with an (online) cpu number for the target remove the checks for MSG_ALL and MSG_ALL_BUT_SELF. Signed-off-by: Milton Miller <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-05-19powerpc/mpic: Break cpumask abstraction earlierMilton Miller1-7/+3
mpic_set_affinity is allocating and freeing a cpumask var even though it was breaking the cpumask abstraction when passing the mask to mpic_physmask. It also didn't have any check for allocatin failure. Break the cpumask abstraction earlier and use simple bitwise and of the bits from the mask with the bits of cpu_online_mask. Signed-off-by: Milton Miller <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-05-19powerpc/mpic: Limit NR_CPUS loop to 32 bitMilton Miller1-1/+1
mpic_physmask was looping NR_CPUS times over a mask that was passed as a u32. Since mpic is architecturaly limited to 32 physical cpus, clamp the logical cpus to 32 when compiling (we could also clamp at runtime to nr_cpu_ids). Signed-off-by: Milton Miller <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-05-11PM / PowerPC: Use struct syscore_ops instead of sysdevs for PMRafael J. Wysocki1-22/+26
Make some PowerPC architecture's code use struct syscore_ops objects for power management instead of sysdev classes and sysdevs. This simplifies the code and reduces the kernel's memory footprint. It also is necessary for removing sysdevs from the kernel entirely in the future. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]>
2011-05-04powerpc/irq: Stop exporting irq_mapGrant Likely1-15/+13
First step in eliminating irq_map[] table entirely Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-03-29powerpc: Convert to new irq_* function namesThomas Gleixner1-7/+7
Scripted with coccinelle. Signed-off-by: Thomas Gleixner <[email protected]>
2011-03-29powerpc: mpic: Cleanup flow type handlingThomas Gleixner1-17/+12
The core irq_set_type() function updates the flow type when the chip callback returns 0. So setting the type is bogus. The new core code allows to update the type in irq_data and return IRQ_SET_MASK_OK_NOCOPY, so the core code will not touch it, except for setting the IRQ_LEVEL flag. Retrieve the IRQ_LEVEL information from irq_data which avoids a redundant sparse irq lookup as well. Signed-off-by: Thomas Gleixner <[email protected]>
2011-03-21powerpc: Factoring mpic cpu id fetching into a functionMeador Inge1-17/+14
The following code snippet: unsigned int cpu = 0; if (mpic->flags & MPIC_PRIMARY) cpu = hard_smp_processor_id(); is seen in several places in the 'mpic.c' code. This changeset factors that pattern out into a helper function called 'mpic_processor_id'. Signed-off-by: Meador Inge <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-03-21powerpc: Make MPIC honor the "pic-no-reset" device tree propertyMeador Inge1-11/+55
This property, defined in the Open PIC binding, tells the kernel not to use the reset bit in the global configuration register. Additionally, its presence mandates that only sources which are actually used (i.e. appear in the device tree) should have their VECPRI bits initialized. Although, "pic-no-reset" can be used for the same use cases that "protected-sources" is covering, the "protected-sources" implementation was left completely intact. This is a more pragmatic approach as there are already several existing systems which use protected sources. If "pic-no-reset" *and* "protected-sources" are both used, however, then "pic-no-reset" takes precedence in terms of the init behavior and the sanity checks done by protected sources will still take place. Signed-off-by: Meador Inge <[email protected]> Cc: Hollis Blanchard <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-03-10powerpc: mpic irq_data conversion.Lennert Buytenhek1-65/+72
Signed-off-by: Lennert Buytenhek <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-01-21powerpc/mpic: Fix mask/unmask timeout messageScott Wood1-2/+4
Don't say that enable timed out when it was disable, and show which IRQ had the problem. Signed-off-by: Scott Wood <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2010-07-09powerpc/mpic: Add ability to reset a core via MPICMatthew McClintock1-0/+18
We need the ability to reset cores for use with kexec/kdump for SMP systems. Calling this function with the specific core you want to reset will cause the CPU to spin in reset. Signed-off-by: Matthew McClintock <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2010-06-15powerpc: Fix mpic_resume on early G5 macsAlastair Bridgewater1-1/+1
mpic_resume() on G5 macs blindly dereferences mpic->fixups, but it may legitimately be NULL (as on PowerMac7,2). Add an explicit check. This fixes suspend-to-disk with one processor (maxcpus=1) for me. Signed-off-by: Alastair Bridgewater <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2010-05-06powerpc/cpumask: Convert mpic driver to new cpumask APIBenjamin Herrenschmidt1-33/+39
Convert to the new cpumask API. irq_choose_cpu can be simplified by using cpumask_next and cpumask_first. smp_mpic_message_pass was doing open coded cpumask manipulation and passing an int for a cpumask into mpic_send_ipi. Since mpic_send_ipi is only used locally, make it static and convert it to take a cpumask. This allows us to clean up the mess in smp_mpic_message_pass. Signed-off-by: Anton Blanchard <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo1-0/+1
implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <[email protected]> Guess-its-ok-by: Christoph Lameter <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Lee Schermerhorn <[email protected]>
2010-02-19powerpc: Convert mpic locks to raw_spinlockThomas Gleixner1-19/+19
mpic_lock, irq_rover_lock and fixup_lock need to be real spinlocks in RT. Convert them to raw_spinlock. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2010-02-09powerpc: Remove trailing space in messagesFrans Pop1-1/+1
Signed-off-by: Frans Pop <[email protected]> Cc: [email protected] Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2009-12-18powerpc/mpic: Fix problem that affinity is not updatedYang Li1-13/+6
Since commit 57b150cce8e004ddd36330490a68bfb59b7271e9, desc->affinity of an irq is changed after calling desc->chip->set_affinity. Therefore we need to fix the irq_choose_cpu() not to depend on the desc->affinity for new mask. Signed-off-by: Jiajun Wu <[email protected]> Signed-off-by: Li Yang <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2009-12-09powerpc: Make "intspec" pointers in irq_host->xlate() constRoman Fietze1-1/+1
Writing a driver using SCLPC on the MPC5200B I detected, that the intspec arrays to map irqs to Linux virq cannot be const, because the mapping and xlate functions only take non const pointers. All those functions do not modify the intspec, so a const pointer could be used. Signed-off-by: Roman Fietze <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2009-11-24powerpc: Fixup last users of irq_chip->typenameThomas Gleixner1-3/+3
The typename member of struct irq_chip was kept for migration purposes and is obsolete since more than 2 years. Fix up the leftovers. Signed-off-by: Thomas Gleixner <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: [email protected] Acked-by: Geoff Levand <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2009-10-30powerpc: Remove get_irq_desc()Michael Ellerman1-9/+9
get_irq_desc() is a powerpc-specific version of irq_to_desc(). That is reason enough to remove it, but it also doesn't know about sparse irq_desc support which irq_to_desc() does (when we enable it). Signed-off-by: Michael Ellerman <[email protected]> Acked-by: Grant Likely <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2009-08-20powerpc/mpic: Fix MPIC_BROKEN_REGREAD on non broken MPICsMichael Ellerman1-5/+8
The workaround enabled by CONFIG_MPIC_BROKEN_REGREAD does not work on non-broken MPICs. The symptom is no interrupts being received. The fix is twofold. Firstly the code was broken for multiple isus, we need to index into the shadow array with the src_no, not the idx. Secondly, we always do the read, but only use the VECPRI_MASK and VECPRI_ACTIVITY bits from the hardware, the rest of "val" comes from the shadow. Signed-off-by: Michael Ellerman <[email protected]> Signed-off-by: Olof Johansson <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2009-07-08powerpc: Don't use alloc_bootmem() in init_IRQ() pathAnton Vorontsov1-5/+4
This patch fixes various badnesses like this for all interrupt controllers: ------------[ cut here ]------------ Badness at c04db9dc [verbose debug info unavailable] NIP: c04db9dc LR: c04db9ac CTR: 00000000 REGS: c053de30 TRAP: 0700 Not tainted (2.6.31-rc1-00432-ge69b2b5-dirty) MSR: 00021000 <ME,CE> CR: 22020084 XER: 00000000 TASK = c0500480[0] 'swapper' THREAD: c053c000 GPR00: 00000001 c053dee0 c0500480 00000000 00000050 00000020 3fffffff 00000000 GPR08: 00000001 c0540000 e0080080 00000000 22000084 64183600 3ff8f800 00000000 GPR16: 841b0240 449a0303 00000000 00000000 00000000 00000000 00000000 c04f5bf4 GPR24: 00000000 00000000 00000000 00000050 00000020 00000000 3fffffff 00000050 NIP [c04db9dc] alloc_arch_preferred_bootmem+0x48/0x74 LR [c04db9ac] alloc_arch_preferred_bootmem+0x18/0x74 Call Trace: [c053dee0] [c000a5a4] __of_address_to_resource+0x44/0xd0 (unreliable) [c053def0] [c04dba58] ___alloc_bootmem_nopanic+0x50/0x108 [c053df20] [c04dbb28] ___alloc_bootmem+0x18/0x50 [c053df30] [c04d5de0] qe_ic_init+0x5c/0x1b0 [c053df70] [c04d77b0] mpc85xx_mds_pic_init+0xb8/0x10c [c053dfb0] [c04cf374] init_IRQ+0x28/0x3c p.s. commit 85355bb272db31a3f2dd99d547eef794805e1319 ("powerpc: Fix mpic alloc warning") missed some alloc_bootmem() instances, this is now fixed. Signed-off-by: Anton Vorontsov <[email protected]> Acked-by: Timur Tabi <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>