android_kernel_xiaomi_sm8350/arch/powerpc/platforms/pseries
Benjamin Herrenschmidt 6e99e45828 [PATCH] powerpc: fix trigger handling in the new irq code
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 <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-10 13:24:20 -07:00
..
eeh_cache.c spelling fixes 2006-06-26 18:35:02 +02:00
eeh_driver.c typo fixes: occuring -> occurring 2006-06-30 18:27:16 +02:00
eeh_event.c [PATCH] spin/rwlock init cleanups 2006-06-27 17:32:39 -07:00
eeh.c [PATCH] powerpc/pseries: bugfix: balance calls to pci_device_put 2006-04-13 09:34:15 -07:00
firmware.c [PATCH] powerpc: Rename and export ppc64_firmware_features 2006-03-28 16:45:20 +11:00
firmware.h [PATCH] powerpc: Move pSeries firmware feature setup into platforms/pseries 2006-02-10 16:52:03 +11:00
hvCall.S [PATCH] powerpc: Extends HCALL interface for InfiniBand usage 2006-04-01 22:37:00 +11:00
hvconsole.c [PATCH] powerpc/pseries: Change H_StudlyCaps to H_SHOUTING_CAPS 2006-04-01 22:36:57 +11:00
hvcserver.c [PATCH] powerpc/pseries: Change H_StudlyCaps to H_SHOUTING_CAPS 2006-04-01 22:36:57 +11:00
iommu.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
Kconfig powerpc: Disallow lparcfg being a module 2006-03-14 11:35:37 +11:00
lpar.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
Makefile [POWERPC] Optimise some TOC usage 2006-06-15 19:31:25 +10:00
nvram.c powerpc: move pSeries files to arch/powerpc/platforms/pseries 2005-10-10 22:03:41 +10:00
pci_dlpar.c [PATCH] powerpc: Kill _machine and hard-coded platform numbers 2006-03-28 23:15:54 +11:00
pci.c [PATCH] powerpc: Kill _machine and hard-coded platform numbers 2006-03-28 23:15:54 +11:00
plpar_wrappers.h [PATCH] powerpc: Make ppc_md.set_dabr non 64-bit specific 2005-11-07 13:31:13 +11:00
ras.c [PATCH] powerpc: fix trigger handling in the new irq code 2006-07-10 13:24:20 -07:00
ras.h [PATCH] cell: enable pause(0) in cpu_idle 2006-01-09 15:44:32 +11:00
reconfig.c Merge ../linux-2.6 2006-03-29 13:24:50 +11:00
rtasd.c [PATCH] powerpc: Quiet rtasd output at boot 2006-04-22 18:46:07 +10:00
scanlog.c [POWERPC] RTAS delay, fix module build breaks 2006-06-21 15:01:27 +10:00
setup.c [POWERPC] Add new interrupt mapping core and change platforms to use it 2006-07-03 21:36:01 +10:00
smp.c [POWERPC] Add new interrupt mapping core and change platforms to use it 2006-07-03 21:36:01 +10:00
xics.c [PATCH] powerpc: fix trigger handling in the new irq code 2006-07-10 13:24:20 -07:00
xics.h [POWERPC] Add new interrupt mapping core and change platforms to use it 2006-07-03 21:36:01 +10:00