linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 06/27] irq_domain/powerpc: eliminate irq_map; use irq_alloc_desc() instead
Date: Wed, 04 Apr 2012 08:40:20 -0700	[thread overview]
Message-ID: <20120404154020.40C513E09D5@localhost> (raw)
In-Reply-To: <m2y5qdow0v.fsf@igel.home>

On Tue, 03 Apr 2012 14:11:12 +0200, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Grant Likely <grant.likely@secretlab.ca> writes:
> 
> > Can you dump out /debug/powerpc/virq_mapping from both before and
> > after the irq_map patch is applied?
> 
> before:
> virq   hwirq    chip name        chip data           host name
>    16  0x00000   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    21  0x00001   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    24  0x00002   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    25  0x00019   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    26  0x0001a   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    27  0x0001b   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    28  0x0001c   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    29  0x0003d   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    30  0x0001e   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    31  0x0003c   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    39  0x00027   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    40  0x00028   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    41  0x00029   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    42  0x0002a   MPIC 2          0xc00000017a011000  /u3 at 0,f8000000/mpic at f8040000
>    47  0x0002f   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    59  0x000fb   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    60  0x000fc   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    61  0x000fd   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    62  0x000fe   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    63  0x0003f   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
> 
> after:
> virq   hwirq    chip name        chip data           host name
>    16  0x00000   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    21  0x00001   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    24  0x00002   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    25  0x00019   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    26  0x0001a   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    27  0x0001b   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    28  0x0001c   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    30  0x0001e   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    39  0x00027   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    40  0x00028   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    41  0x00029   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    42  0x0002a   MPIC 2          0xc00000017a011000  /u3 at 0,f8000000/mpic at f8040000
>    47  0x0002f   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    59  0x000fb   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    60  0x000fc   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    61  0x000fd   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    62  0x000fe   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    63  0x0003f   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    64  0x0003d   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
>    65  0x0003c   MPIC 1          0xc00000017a010000  /ht at 0,f2000000/pci at 1/mac-io at 7/mpic at 40000
> 
> But I have NR_IRQS=64.  Bounds checking missing?  Irqs 64/65 are related
> to the sound chip (headphone-detect and line-out-detect).

I bet it is NR_IRQS related.  You have SPARSE_IRQ enabled, which means
the maximum number of irq_descs is IRQ_BITMAP_BITS (NR_IRQS + 8192).
The old powerpc code was strictly limited to NR_IRQS, but the new code
uses irq_alloc_descs() which isn't.  Yet I can see places in the
powerpc code that depends specifically on the value of NR_IRQS.  The
for_each_irq() macro for instance.  I think all the users there can be
switched to using for_each_irq_desc().

Can you attach console output logs for each of configs above and also
with NR_IRQS=128?  That might give me some clues as to which specific
code is causing the issues.  Also, as a quick test, try changing
for_each_irq_desc() to use "nr_irqs" instead of "NR_IRQS".  nr_irqs is
kept up to date with the real maximum number of irqs allocated in the
system:

diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h
index cf417e51..9edf499 100644
--- a/arch/powerpc/include/asm/irq.h
+++ b/arch/powerpc/include/asm/irq.h
@@ -20,7 +20,7 @@
 
 /* Define a way to iterate across irqs. */
 #define for_each_irq(i) \
-       for ((i) = 0; (i) < NR_IRQS; ++(i))
+       for ((i) = 0; (i) < nr_irqs; ++(i))
 
 extern atomic_t ppc_n_lost_interrupts;
 

g.

> 
> When reconfiguring with NR_IRQS=128 interrupts are working again, but I
> still see a lot of spurious interrupts, and the X server is still broken
> (no input works, but I still don't know whether that is an unrelated
> bug).
> 
> This is a sample of /proc/interrupts from 3.3 (with NR_IRQS=64):
>            CPU0       CPU1       
>  16:       2039       6070   MPIC 1    Level     sata_svw
>  21:          0          0   MPIC 1    Edge      i2sbus: i2s-a (tx)
>  22:         12         20   MPIC 1    Level   
>  23:         14         18   MPIC 1    Level   
>  24:          0          0   MPIC 1    Edge      i2sbus: i2s-a (rx)
>  25:          3          0   MPIC 1    Level     VIA-PMU
>  26:         16         62   MPIC 1    Level     keywest i2c
>  27:          0          1   MPIC 1    Level     ohci_hcd:usb2
>  28:          0          1   MPIC 1    Level     ohci_hcd:usb3
>  29:          0          0   MPIC 1    Edge      headphone-detect
>  30:          0          0   MPIC 1    Level     i2sbus: i2s-a (control)
>  31:          0          0   MPIC 1    Edge      line-output-detect
>  39:         22         64   MPIC 1    Level     pata-pci-macio
>  40:          0          2   MPIC 1    Level     firewire_ohci
>  41:         52        147   MPIC 1    Level     eth0
>  42:       1732       5053   MPIC 2    Level     keywest i2c
>  47:          0          0   MPIC 1    Level     GPIO1 ADB
>  59:          0          0   MPIC 1    Edge      ipi call function
>  60:       2064       1940   MPIC 1    Edge      ipi reschedule
>  61:       3406        945   MPIC 1    Edge      ipi call function single
>  62:          0          0   MPIC 1    Edge      ipi debugger
>  63:         39         91   MPIC 1    Level     ehci_hcd:usb1, ohci_hcd:usb4, ohci_hcd:usb5
> LOC:       3503       3719   Local timer interrupts
> SPU:          2          0   Spurious interrupts
> CNT:          0          0   Performance monitoring interrupts
> MCE:          0          0   Machine check exceptions
> 
> This is a sample of /proc/interrupts from 3.4-rc1 (with NR_IRQS=128):
>            CPU0       CPU1       
>  16:       2603       7596   MPIC 1    Level     sata_svw
>  21:          1          0   MPIC 1    Edge      i2sbus: i2s-a (tx)
>  22:         13         19   MPIC 1    Level   
>  23:          8         24   MPIC 1    Level   
>  24:          0          1   MPIC 1    Edge      i2sbus: i2s-a (rx)
>  25:          2          1   MPIC 1    Level     VIA-PMU
>  26:         21         57   MPIC 1    Level     keywest i2c
>  27:          0          1   MPIC 1    Level     ohci_hcd:usb2
>  28:          0          1   MPIC 1    Level     ohci_hcd:usb3
>  30:          0          0   MPIC 1    Level     i2sbus: i2s-a (control)
>  39:         39        131   MPIC 1    Level     pata-pci-macio
>  40:          2          2   MPIC 1    Level     firewire_ohci
>  41:         93        268   MPIC 1    Level     eth0
>  42:       8569      24140   MPIC 2    Level     keywest i2c
>  47:          0          0   MPIC 1    Level     GPIO1 ADB
>  60:          1          0   MPIC 1    Edge      line-output-detect
>  61:          1          0   MPIC 1    Edge      headphone-detect
>  63:        153        502   MPIC 1    Level     ehci_hcd:usb1, ohci_hcd:usb4, ohci_hcd:usb5
> 123:          0          0   MPIC 1    Edge      ipi call function
> 124:       1978       2349   MPIC 1    Edge      ipi reschedule
> 125:       2356       1816   MPIC 1    Edge      ipi call function single
> 126:          0          0   MPIC 1    Edge      ipi debugger
> LOC:       4417       7985   Local timer interrupts
> SPU:       9586      25811   Spurious interrupts
> CNT:          0          0   Performance monitoring interrupts
> MCE:          0          0   Machine check exceptions
> 
> Andreas.
> 
> -- 
> Andreas Schwab, schwab at linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies,Ltd.

  parent reply	other threads:[~2012-04-04 15:40 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16  9:09 [PATCH v5 00/27] irq_domain generalization and rework Grant Likely
2012-02-16  9:09 ` [PATCH v5 01/27] irq_domain: add documentation and MAINTAINERS entry Grant Likely
2012-02-16  9:09 ` [PATCH v5 02/27] irq_domain: Be less verbose Grant Likely
2012-02-16  9:09 ` [PATCH v5 03/27] irq_domain: Make irq_domain structure match powerpc's irq_host Grant Likely
2012-02-16  9:09 ` [PATCH v5 04/27] irq_domain: convert microblaze from irq_host to irq_domain Grant Likely
2012-02-16  9:09 ` [PATCH v5 05/27] irq_domain/powerpc: Use common irq_domain structure instead of irq_host Grant Likely
2012-02-16  9:09 ` [PATCH v5 06/27] irq_domain/powerpc: eliminate irq_map; use irq_alloc_desc() instead Grant Likely
2012-04-01 21:27   ` Andreas Schwab
2012-04-02  4:21     ` Benjamin Herrenschmidt
2012-04-02 16:29     ` Andreas Schwab
2012-04-02 20:28       ` Grant Likely
2012-04-02 21:55         ` Russell King - ARM Linux
2012-04-02 22:33           ` Benjamin Herrenschmidt
2012-04-02 22:52             ` Russell King - ARM Linux
2012-04-02 23:38               ` Benjamin Herrenschmidt
2012-04-06 11:51                 ` Andreas Schwab
2012-04-06 23:37                   ` Benjamin Herrenschmidt
2012-04-07 12:27                     ` Andreas Schwab
2012-04-11  1:13                       ` Benjamin Herrenschmidt
2012-04-11  1:33                         ` Benjamin Herrenschmidt
2012-04-11  5:29                           ` Benjamin Herrenschmidt
2012-04-11 20:57                             ` Grant Likely
2012-04-11 21:37                               ` Benjamin Herrenschmidt
2012-04-11 21:47                                 ` Thomas Gleixner
2012-04-19 18:42                                 ` Grant Likely
2012-04-03  8:23               ` Thomas Gleixner
2012-04-03  8:20             ` Thomas Gleixner
2012-04-03 12:11         ` Andreas Schwab
2012-04-03 21:43           ` Benjamin Herrenschmidt
2012-04-04 12:51             ` Andreas Schwab
2012-04-04 15:40           ` Grant Likely [this message]
2012-04-05 10:51             ` Andreas Schwab
2012-04-06 11:12               ` Thomas Gleixner
2012-04-05 22:10             ` Andreas Schwab
2012-04-06 11:17               ` Thomas Gleixner
2012-04-06 11:25                 ` Andreas Schwab
2012-04-06 11:28                   ` Thomas Gleixner
2012-04-07  1:29                 ` Grant Likely
2012-04-02 20:52       ` Thomas Gleixner
2012-04-02 21:20         ` Benjamin Herrenschmidt
2012-04-02 21:27           ` Thomas Gleixner
2012-04-02 22:32             ` Benjamin Herrenschmidt
2012-04-02 21:22         ` Andreas Schwab
2012-04-03  0:37       ` Benjamin Herrenschmidt
2012-02-16  9:09 ` [PATCH v5 07/27] irq_domain/powerpc: Eliminate virq_is_host() Grant Likely
2012-02-16  9:09 ` [PATCH v5 08/27] irq_domain: Move irq_domain code from powerpc to kernel/irq Grant Likely
2012-02-16 13:23   ` Grant Likely
2012-02-16 17:38   ` Cousson, Benoit
2012-02-16 17:52     ` Cousson, Benoit
2012-02-16  9:09 ` [PATCH v5 09/27] irq_domain: remove NO_IRQ from irq domain code Grant Likely
2012-02-16  9:09 ` [PATCH v5 10/27] irq_domain: Remove references to old irq_host names Grant Likely
2012-02-16  9:09 ` [PATCH v5 11/27] irq_domain: Replace irq_alloc_host() with revmap-specific initializers Grant Likely
2012-02-16  9:09 ` [PATCH v5 12/27] irq_domain: Add support for base irq and hwirq in legacy mappings Grant Likely
2012-02-16  9:09 ` [PATCH v5 13/27] of/address: add empty static inlines for !CONFIG_OF Grant Likely
2012-02-16  9:09 ` [PATCH v5 14/27] mfd: twl-core.c: Fix the number of interrupts managed by twl4030 Grant Likely
2012-02-16  9:09 ` [PATCH v5 15/27] irq_domain: Remove 'new' irq_domain in favour of the ppc one Grant Likely
2012-02-16  9:09 ` [PATCH v5 16/27] irq_domain: Remove irq_domain_add_simple() Grant Likely
2012-02-16  9:09 ` [PATCH v5 17/27] irq_domain: Create common xlate functions that device drivers can use Grant Likely
2012-02-16  9:09 ` [PATCH v5 18/27] irq_domain: constify irq_domain_ops Grant Likely
2012-02-16  9:09 ` [PATCH v5 19/27] irq_domain/c6x: Convert c6x to use generic irq_domain support Grant Likely
2012-02-16  9:09 ` [PATCH v5 20/27] irq_domain/c6x: constify irq_domain structures Grant Likely
2012-02-21 15:47   ` Mark Salter
2012-02-16  9:09 ` [PATCH v5 21/27] irq_domain/c6x: Use library of xlate functions Grant Likely
2012-02-21 15:48   ` Mark Salter
2012-02-16  9:09 ` [PATCH v5 22/27] irq_domain/powerpc: constify irq_domain_ops Grant Likely
2012-02-16  9:09 ` [PATCH v5 23/27] irq_domain/powerpc: Replace custom xlate functions with library functions Grant Likely
2012-02-16  9:09 ` [PATCH v5 24/27] irq_domain/microblaze: Convert microblaze to use irq_domains Grant Likely
2012-02-16  9:09 ` [PATCH v5 25/27] irq_domain: remove "hint" when allocating irq numbers Grant Likely
2012-02-16  9:09 ` [PATCH v5 26/27] irq_domain: mostly eliminate slow-path revmap lookups Grant Likely
2012-02-16  9:09 ` [PATCH v5 27/27] irq_domain: For NOMAP revmap, allow users to specify the largest usable virq Grant Likely
2012-02-16 22:52 ` [PATCH v5 00/27] irq_domain generalization and rework Andrew Morton
2012-02-16 23:26   ` Russell King - ARM Linux
2012-02-17 18:05     ` Sam Ravnborg
2012-02-17 17:42   ` Cousson, Benoit
2012-02-17 17:55     ` Russell King - ARM Linux
2012-02-21 14:51       ` Cousson, Benoit

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=20120404154020.40C513E09D5@localhost \
    --to=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.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).