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

    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

    Kyle Moffett
     
  • 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

    Kyle Moffett
     
  • 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

    Kyle Moffett
     

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

    Yong Zhang
     

01 Nov, 2011

1 commit


31 May, 2011

1 commit


20 May, 2011

1 commit


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

    Milton Miller
     
  • 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

    Milton Miller
     

12 May, 2011

1 commit


04 May, 2011

1 commit


29 Mar, 2011

3 commits


10 Mar, 2011

1 commit


06 Jul, 2010

1 commit


19 Feb, 2010

1 commit


17 Feb, 2010

1 commit


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

    Roman Fietze
     

24 Nov, 2009

1 commit


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

    Michael Ellerman
     

08 Jul, 2009

1 commit


21 May, 2009

1 commit


30 Mar, 2009

1 commit


14 May, 2008

1 commit


13 Mar, 2008

1 commit


31 Jan, 2008

1 commit


25 Jan, 2008

1 commit


17 Jan, 2008

1 commit


13 Sep, 2007

1 commit


07 May, 2007

1 commit


24 Apr, 2007

1 commit


13 Apr, 2007

1 commit


17 Feb, 2007

1 commit


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_defconfig

    Signed-off-by: Olaf Hering
    Signed-off-by: Paul Mackerras

    Olaf Hering
     

06 Oct, 2006

1 commit


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)

    David Howells
     

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

    Benjamin Herrenschmidt
     

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 kexec

    Signed-off-by: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Benjamin Herrenschmidt