16 Dec, 2011
1 commit
-
In the old days, we treated all interrupts from the legacy Apple home made
interrupt controllers as level, with a trick reading the "level" register
along with the "event" register to work arounds bugs where it would
occasionally fail to latch some events.Doing so appeared to work fine for both level and edge interrupts.
Later on, we discovered in Darwin source the magic masks that define which
interrupts are actually level and which are edge, and implemented a
different algorithm, more similar to what Apple does, that treats those
differently.I recently discovered however that this caused problems (including loss
of interrupts) with an old Wallstreet PowerBook when trying to use the
internal modem (connected to a cascaded controller).It looks like some interrupts are treated as edge while they are really
level and I'm starting to seriously doubt the correctness of the Darwin
code (which has other obvious bugs when you read it, so ...)This patch reverts to our original behaviour of treating everything as
a level interrupt. It appears to solve the problems with the modem on
the Wallstreet and everything else seems to be working properly as well.Signed-off-by: Benjamin Herrenschmidt
07 Dec, 2011
3 commits
-
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
Signed-off-by: Benjamin Herrenschmidt -
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
Signed-off-by: Benjamin Herrenschmidt -
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
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: Grant Likely
Cc: Kumar Gala
Signed-off-by: Benjamin Herrenschmidt
08 Nov, 2011
1 commit
-
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
Acked-by: Arnd Bergmann
Acked-by: Geoff Levand
Signed-off-by: Benjamin Herrenschmidt
01 Nov, 2011
1 commit
-
None of the files touched here are modules, and they are not
exporting any symbols either -- so there is no need to be including
the module.h. Builds of all the files remains successful.Even kernel/module.c does not need to include it, since it includes
linux/moduleloader.h instead.Signed-off-by: Paul Gortmaker
31 May, 2011
1 commit
-
The Apple custom PIC only exist in some earlier machine models,
anything with an MPIC will crash on suspend if we register those
syscore ops unconditionally.This is a regression caused by commit f5a592f7d74e ("PM / PowerPC: Use
struct syscore_ops instead of sysdevs for PM")Signed-off-by: Benjamin Herrenschmidt
Signed-off-by: Linus Torvalds
20 May, 2011
1 commit
-
Manual merge of arch/powerpc/kernel/smp.c and add missing scheduler_ipi()
call to arch/powerpc/platforms/cell/interrupt.cSigned-off-by: Benjamin Herrenschmidt
19 May, 2011
2 commits
-
Create a dummy irq_host using the generic dummy irq chip for the secondary
cpus to use. Create a direct irq mapping for the ipi and register the
ipi action handler against it. If for some unlikely reason part of this
fails then don't detect the secondary cpus.This removes another instance of NO_IRQ_IGNORE, records the ipi stats
for the secondary cpus, and runs the ipi on the interrupt stack.Signed-off-by: Milton Miller
Signed-off-by: Benjamin Herrenschmidt -
Compile the new smp ipi mux and demux code only if a platform
will make use of it. The new config is selected as required.The new cause_ipi smp op is only available conditionally to point out
configs where the select is required; this makes setting the op an
immediate fail instead of a deferred unresolved symbol at link.This also creates a new config for power surge powermac upgrade support
that can be disabled in expert mode but is default on.I also removed the depends / default y on CONFIG_XICS since it is selected
by PSERIES.Signed-off-by: Milton Miller
Signed-off-by: Benjamin Herrenschmidt
12 May, 2011
1 commit
-
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
Acked-by: Greg Kroah-Hartman
04 May, 2011
1 commit
-
First step in eliminating irq_map[] table entirely
Signed-off-by: Benjamin Herrenschmidt
29 Mar, 2011
3 commits
-
Scripted with coccinelle.
Signed-off-by: Thomas Gleixner
-
No need for a redundant sparse irq lookup. irqdata provides the same
information.Signed-off-by: Thomas Gleixner
-
Use the proper accessors instead of open access to irq_desc.
Converted with coccinelle.Signed-off-by: Thomas Gleixner
10 Mar, 2011
1 commit
-
Signed-off-by: Lennert Buytenhek
Signed-off-by: Benjamin Herrenschmidt
06 Jul, 2010
1 commit
-
The code that figures out what is wrong with the powermac irq device
tree data belongs with the rest of the powermac irq code. This patch
moves it out of prom_parse.c and into powermac/pic.c so that it is only
compiled in when actually needed.Signed-off-by: Grant Likely
Cc: Benjamin Herrenschmidt
Cc: Stephen Rothwell
19 Feb, 2010
1 commit
-
pmac_pic_lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.Signed-off-by: Thomas Gleixner
Signed-off-by: Benjamin Herrenschmidt
17 Feb, 2010
1 commit
-
Now we use printf style alignment there is no need to manually space
these fields.Signed-off-by: Anton Blanchard
Signed-off-by: Benjamin Herrenschmidt
09 Dec, 2009
1 commit
-
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
Signed-off-by: Benjamin Herrenschmidt
24 Nov, 2009
1 commit
-
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
Cc: Benjamin Herrenschmidt
Cc: linuxppc-dev@ozlabs.org
Acked-by: Geoff Levand
Signed-off-by: Benjamin Herrenschmidt
30 Oct, 2009
1 commit
-
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
Acked-by: Grant Likely
Signed-off-by: Benjamin Herrenschmidt
08 Jul, 2009
1 commit
-
Signed-off-by: Joe Perches
Acked-by: Geoff Levand
Signed-off-by: Benjamin Herrenschmidt
21 May, 2009
1 commit
-
Don't call __do_IRQ() directly in gatwick_action(), use
generic_handle_irq().Signed-off-by: Michael Ellerman
Signed-off-by: Benjamin Herrenschmidt
30 Mar, 2009
1 commit
-
Impact: cleanup
It's unused, since about 1995. So remove all initialization of it in
preparation for actually removing the field.Signed-off-by: Rusty Russell
Acked-by: Thomas Gleixner
14 May, 2008
1 commit
-
The typdef for irqreturn_t was moved into its own header a
while back, so there's no reason we can't move xmon_irq()
into xmon.h now.Signed-off-by: Michael Ellerman
Signed-off-by: Paul Mackerras
13 Mar, 2008
1 commit
-
When building arch/powerpc/platforms/powermac/pic.c when !CONFIG_ADB_PMU
we get the following warnings:arch/powerpc/platforms/powermac/pic.c: In function 'pmacpic_find_viaint':
arch/powerpc/platforms/powermac/pic.c:623: warning: label 'not_found' defined but not usedThis fixes it.
Signed-off-by: Tony Breeds
Signed-off-by: Paul Mackerras
31 Jan, 2008
1 commit
25 Jan, 2008
1 commit
-
All kobjects require a dynamically allocated name now. We no longer
need to keep track if the name is statically assigned, we can just
unconditionally free() all kobject names on cleanup.Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
17 Jan, 2008
1 commit
-
Signed-off-by: Grant Likely
Signed-off-by: Paul Mackerras
13 Sep, 2007
1 commit
-
The majority of irq_host implementations (3 out of 4) are associated
with a device_node, and need to stash it somewhere. Rather than having
it somewhere different for each host, add an optional device_node pointer
to the irq_host structure.Signed-off-by: Michael Ellerman
Signed-off-by: Paul Mackerras
07 May, 2007
1 commit
-
for consistency with other Open Firmware interfaces (and Sparc).
This is just a straight replacement.
This leaves the compatibility define in place.
Signed-off-by: Stephen Rothwell
Signed-off-by: Paul Mackerras
24 Apr, 2007
1 commit
-
Rename MPIC_BROKEN_U3 to something a little more descriptive. Its
effect is to enable support for HT irqs behind the PCI-X/HT bridge on
U3/U4 (aka. CPC9x5) parts.Signed-off-by: Michael Ellerman
Signed-off-by: Paul Mackerras
13 Apr, 2007
1 commit
-
Signed-off-by: Stephen Rothwell
Acked-by: Benjamin Herrenschmidt
Signed-off-by: Paul Mackerras
17 Feb, 2007
1 commit
-
Now that disable_irq() defaults to delayed-disable semantics, the IRQ_DISABLED
flag is not needed anymore.Signed-off-by: Ingo Molnar
Cc: Thomas Gleixner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
07 Oct, 2006
1 commit
-
Remove struct pt_regs * from all handlers.
Also remove the regs argument from get_irq() functions.
Compile tested with arch/powerpc/config/* and
arch/ppc/configs/prep_defconfigSigned-off-by: Olaf Hering
Signed-off-by: Paul Mackerras
06 Oct, 2006
1 commit
-
Fix up some of the buildbreaks from the irq handler changes.
Signed-off-by: Olof Johansson
Signed-off-by: Linus Torvalds
05 Oct, 2006
1 commit
-
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:struct pt_regs *old_regs = set_irq_regs(regs);
And put the old one back at the end:
set_irq_regs(old_regs);
Don't pass regs through to generic_handle_irq() or __do_IRQ().
In timer_interrupt(), this sort of change will be necessary:
- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().Some notes on the interrupt handling in the drivers:
(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.Signed-Off-By: David Howells
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
02 Sep, 2006
1 commit
-
The port to genirq & the new powerpc interrupt model in 2.6.18 introduced a
bug in the legacy PowerMac PIC code (used on older machines) because of a
typo potentially causing hangs due to interrupt storms. This fixes it,
along with a performance issue causing us to do spurrious retriggers after
masking an interrupt.Signed-off-by: Benjamin Herrenschmidt
Cc: "Antonino A. Daplas"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
11 Jul, 2006
1 commit
-
This patch slightly reworks the new irq code to fix a small design error. I
removed the passing of the trigger to the map() calls entirely, it was not a
good idea to have one call do two different things. It also fixes a couple of
corner cases.Mapping a linux virtual irq to a physical irq now does only that. Setting the
trigger is a different action which has a different call.The main changes are:
- I no longer call host->ops->map() for an already mapped irq, I just return
the virtual number that was already mapped. It was called before to give an
opportunity to change the trigger, but that was causing issues as that could
happen while the interrupt was in use by a device, and because of the
trigger change, map would potentially muck around with things in a racy way.
That was causing much burden on a given's controller implementation of
map() to get it right. This is much simpler now. map() is only called on
the initial mapping of an irq, meaning that you know that this irq is _not_
being used. You can initialize the hardware if you want (though you don't
have to).- Controllers that can handle different type of triggers (level/edge/etc...)
now implement the standard irq_chip->set_type() call as defined by the
generic code. That means that you can use the standard set_irq_type() to
configure an irq line manually if you wish or (though I don't like that
interface), pass explicit trigger flags to request_irq() as defined by the
generic kernel interfaces. Also, using those interfaces guarantees that
your controller set_type callback is called with the descriptor lock held,
thus providing locking against activity on the same interrupt (including
mask/unmask/etc...) automatically. A result is that, for example, MPIC's
own map() implementation calls irq_set_type(NONE) to configure the hardware
to the default triggers.- To allow the above, the irq_map array entry for the new mapped interrupt
is now set before map() callback is called for the controller.- The irq_create_of_mapping() (also used by irq_of_parse_and_map()) function
for mapping interrupts from the device-tree now also call the separate
set_irq_type(), and only does so if there is a change in the trigger type.- While I was at it, I changed pci_read_irq_line() (which is the helper I
would expect most archs to use in their pcibios_fixup() to get the PCI
interrupt routing from the device tree) to also handle a fallback when the
DT mapping fails consisting of reading the PCI_INTERRUPT_PIN to know wether
the device has an interrupt at all, and the the PCI_INTERRUPT_LINE to get an
interrupt number from the device. That number is then mapped using the
default controller, and the trigger is set to level low. That default
behaviour works for several platforms that don't have a proper interrupt
tree like Pegasos. If it doesn't work for your platform, then either
provide a proper interrupt tree from the firmware so that fallback isn't
needed, or don't call pci_read_irq_line()- Add back a bit that got dropped by my main rework patch for properly
clearing pending IPIs on pSeries when using a kexecSigned-off-by: Benjamin Herrenschmidt
Cc: Paul Mackerras
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds