aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/sysdev/mpic.c
AgeCommit message (Collapse)AuthorFilesLines
2012-04-23powerpc/mpic: Fix confusion between hw_irq and virqBenjamin Herrenschmidt1-8/+4
mpic_is_ipi() takes a virq and immediately converts it to a hw_irq. However, one of the two call sites calls it with a ... hw_irq. The other call site also happens to have the hw_irq at hand, so let's change it to just take that as an argument. Also change mpic_is_tm() for consistency. Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2012-03-21Merge branch 'next' of ↵Linus Torvalds1-49/+55
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc Pull powerpc merge from Benjamin Herrenschmidt: "Here's the powerpc batch for this merge window. It is going to be a bit more nasty than usual as in touching things outside of arch/powerpc mostly due to the big iSeriesectomy :-) We finally got rid of the bugger (legacy iSeries support) which was a PITA to maintain and that nobody really used anymore. Here are some of the highlights: - Legacy iSeries is gone. Thanks Stephen ! There's still some bits and pieces remaining if you do a grep -ir series arch/powerpc but they are harmless and will be removed in the next few weeks hopefully. - The 'fadump' functionality (Firmware Assisted Dump) replaces the previous (equivalent) "pHyp assisted dump"... it's a rewrite of a mechanism to get the hypervisor to do crash dumps on pSeries, the new implementation hopefully being much more reliable. Thanks Mahesh Salgaonkar. - The "EEH" code (pSeries PCI error handling & recovery) got a big spring cleaning, motivated by the need to be able to implement a new backend for it on top of some new different type of firwmare. The work isn't complete yet, but a good chunk of the cleanups is there. Note that this adds a field to struct device_node which is not very nice and which Grant objects to. I will have a patch soon that moves that to a powerpc private data structure (hopefully before rc1) and we'll improve things further later on (hopefully getting rid of the need for that pointer completely). Thanks Gavin Shan. - I dug into our exception & interrupt handling code to improve the way we do lazy interrupt handling (and make it work properly with "edge" triggered interrupt sources), and while at it found & fixed a wagon of issues in those areas, including adding support for page fault retry & fatal signals on page faults. - Your usual random batch of small fixes & updates, including a bunch of new embedded boards, both Freescale and APM based ones, etc..." I fixed up some conflicts with the generalized irq-domain changes from Grant Likely, hopefully correctly. * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (141 commits) powerpc/ps3: Do not adjust the wrapper load address powerpc: Remove the rest of the legacy iSeries include files powerpc: Remove the remaining CONFIG_PPC_ISERIES pieces init: Remove CONFIG_PPC_ISERIES powerpc: Remove FW_FEATURE ISERIES from arch code tty/hvc_vio: FW_FEATURE_ISERIES is no longer selectable powerpc/spufs: Fix double unlocks powerpc/5200: convert mpc5200 to use of_platform_populate() powerpc/mpc5200: add options to mpc5200_defconfig powerpc/mpc52xx: add a4m072 board support powerpc/mpc5200: update mpc5200_defconfig to fit for charon board Documentation/powerpc/mpc52xx.txt: Checkpatch cleanup powerpc/44x: Add additional device support for APM821xx SoC and Bluestone board powerpc/44x: Add support PCI-E for APM821xx SoC and Bluestone board MAINTAINERS: Update PowerPC 4xx tree powerpc/44x: The bug fixed support for APM821xx SoC and Bluestone board powerpc: document the FSL MPIC message register binding powerpc: add support for MPIC message register API powerpc/fsl: Added aliased MSIIR register address to MSI node in dts powerpc/85xx: mpc8548cds - add 36-bit dts ...
2012-02-27powerpc/mpic: Fix allocation of reverse-map for multi-ISU mpicsBenjamin Herrenschmidt1-2/+6
When using a multi-ISU MPIC, we can interrupts up to isu_size * MPIC_MAX_ISU, not just isu_size, so allocate the right size reverse map. Without this, the code will constantly fallback to a linear search. Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2012-02-23powerpc/mpic: Remove duplicate MPIC_WANTS_RESET flagKyle Moffett1-1/+1
There are two separate flags controlling whether or not the MPIC is reset during initialization, which is completely unnecessary, and only one of them can be specified in the device tree. Also, most platforms in-tree right now do actually want to reset the MPIC during initialization anyways, which means lots of duplicate code passing the MPIC_WANTS_RESET flag. Fix all of the callers which currently do not pass the MPIC_WANTS_RESET flag to pass the MPIC_NO_RESET flag, then remove the MPIC_WANTS_RESET flag and make the code reset the MPIC by default. Signed-off-by: Kyle Moffett <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2012-02-23powerpc/mpic: Add "last-interrupt-source" property to override hardwareKyle Moffett1-20/+26
The FreeScale PowerQUICC-III-compatible (mpc85xx/mpc86xx) MPICs do not correctly report the number of hardware interrupt sources, so software needs to override the detected value with "256". To avoid needing to write custom board-specific code to detect that scenario, allow it to be easily overridden in the device-tree. Signed-off-by: Kyle Moffett <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
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]>