linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Olof Johansson <olof@lixom.net>
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH] [7/9] pasemi: Configure DMA controller interrupts
Date: Mon, 05 Feb 2007 10:53:49 +1100	[thread overview]
Message-ID: <1170633229.2620.54.camel@localhost.localdomain> (raw)
In-Reply-To: <20070202045509.170129000@lixom.net>>

On Thu, 2007-02-01 at 22:54 -0600, Olof Johansson wrote:
> plain text document attachment (pasemi-dma-irqs)
> The DMA controller on PWRficient is somewhat special -- has a PCI header
> so it looks like it's on the root PCI (-Express) root bus, but it uses
> more than the default number of interrupts (and they are hardwired).
> 
> We need to wire up all interrupts for the DMA controller. The generic
> IRQ code will only map the primary interrupt from the PCI header (128),
> so add 129->211 by hand.

Or you can have them in the device-tree ... the generic code only maps
PCI IRQ index 0 but nothing prevents your fixup code to map the other
ones.

However, I do wonder what is the point of creating a mapping and nor
storing the resulting virq anywhere ? When are those IRQs actually
used ?

That is the place where the mapping should happen... There is no
guarantee that the resulting virq from irq_create_mapping() will be the
same as the HW irq you passed in (it will in -most- cases with the
current code, but it's a bug to rely on that behaviour). Thus you should
store the result of irq_create_mapping() and use that. I see no
advantage in "pre-mapping" things that way.

Ben.
 
> 
> Signed-off-by: Olof Johansson <olof@lixom.net>
> 
> Index: merge/arch/powerpc/platforms/pasemi/pci.c
> ===================================================================
> --- merge.orig/arch/powerpc/platforms/pasemi/pci.c
> +++ merge/arch/powerpc/platforms/pasemi/pci.c
> @@ -163,6 +163,19 @@ static void __init pas_fixup_phb_resourc
>  }
>  
> 
> +void __devinit pas_pci_irq_fixup(struct pci_dev *dev)
> +{
> +	/* DMA is special, 84 interrupts (128 -> 211), all but 128
> +	 * need to be mapped by hand here.
> +	 */
> +	if (dev->vendor == 0x1959 && dev->device == 0xa007) {
> +		int i;
> +		for (i = 129; i < 212; i++)
> +			irq_create_mapping(NULL, i);
> +	}
> +}
> +
> +
>  void __init pas_pci_init(void)
>  {
>  	struct device_node *np, *root;
> Index: merge/arch/powerpc/platforms/pasemi/setup.c
> ===================================================================
> --- merge.orig/arch/powerpc/platforms/pasemi/setup.c
> +++ merge/arch/powerpc/platforms/pasemi/setup.c
> @@ -242,4 +242,5 @@ define_machine(pas) {
>  	.check_legacy_ioport    = pas_check_legacy_ioport,
>  	.progress		= pas_progress,
>  	.machine_check_exception = pas_machine_check_handler,
> +	.pci_irq_fixup		= pas_pci_irq_fixup,
>  };
> Index: merge/arch/powerpc/platforms/pasemi/pasemi.h
> ===================================================================
> --- merge.orig/arch/powerpc/platforms/pasemi/pasemi.h
> +++ merge/arch/powerpc/platforms/pasemi/pasemi.h
> @@ -3,6 +3,7 @@
>  
>  extern unsigned long pas_get_boot_time(void);
>  extern void pas_pci_init(void);
> +extern void __devinit pas_pci_irq_fixup(struct pci_dev *dev);
>  
>  extern void __init pasemi_idle_init(void);
>  
> 
> --
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

  reply	other threads:[~2007-02-04 23:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-02  4:54 [PATCH] [0/9] PA Semi patches Olof Johansson
2007-02-02  4:54 ` [PATCH] [1/9] pasemi: Default root device Olof Johansson
2007-02-02 22:28   ` Geoff Levand
2007-02-04 22:18     ` Olof Johansson
2007-02-04 22:37       ` Olof Johansson
2007-02-02  4:54 ` [PATCH] [2/9] pasemi: UART udbg support Olof Johansson
2007-02-02  4:54 ` [PATCH] [3/9] pasemi: Machine check handler Olof Johansson
2007-02-04 23:49   ` Benjamin Herrenschmidt
2007-02-05  4:19     ` Olof Johansson
2007-02-02  4:54 ` [PATCH] [4/9] pasemi: Idle loops Olof Johansson
2007-02-03  8:27   ` Arnd Bergmann
2007-02-04 22:25     ` Olof Johansson
2007-02-02  4:54 ` [PATCH] [5/9] pasemi: Implement restart Olof Johansson
2007-02-02  6:07   ` Kumar Gala
2007-02-02 18:46     ` Olof Johansson
2007-02-02  4:54 ` [PATCH] [6/9] pasemi: SMP timebase sync Olof Johansson
2007-02-02  4:54 ` [PATCH] [7/9] pasemi: Configure DMA controller interrupts Olof Johansson
2007-02-04 23:53   ` Benjamin Herrenschmidt [this message]
2007-02-05  4:52     ` Olof Johansson
2007-02-02  4:54 ` [PATCH] [8/9] pasemi: iommu support Olof Johansson
2007-02-02  4:54 ` [PATCH] [9/9] pasemi: defconfig Olof Johansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1170633229.2620.54.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=olof@lixom.net \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).