public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Zary <linux@rainbow-software.org>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: abelay@mit.edu, "linux-kernel" <linux-kernel@vger.kernel.org>
Subject: Re: Non-requested PCI IRQs unavailable to ISA PnP devices and pci_dev_uses_irq()
Date: Sat, 13 Jun 2009 00:08:55 +0200	[thread overview]
Message-ID: <200906130008.57928.linux@rainbow-software.org> (raw)
In-Reply-To: <200906121438.17750.bjorn.helgaas@hp.com>

On Friday 12 June 2009 22:38:17 you wrote:
> On Friday 12 June 2009 01:43:57 pm Ondrej Zary wrote:
> > Hello,
> > some PCI devices have an IRQ but the driver does not use it. Such an
> > example is matroxfb. It does request_irq() only for some vblank
> > operations. Thus, the irq is not marked as used in /proc/interrupts:
> >            CPU0
> >   0:     246481    XT-PIC-XT        timer
> >   1:       3507    XT-PIC-XT        i8042
> >   2:          0    XT-PIC-XT        cascade
> >   3:          1    XT-PIC-XT
> >   4:          1    XT-PIC-XT
> >   5:       4306    XT-PIC-XT        eth0
> >   6:          5    XT-PIC-XT        floppy
> >   7:          1    XT-PIC-XT        parport0
> >   8:          1    XT-PIC-XT        rtc
> >   9:          0    XT-PIC-XT        acpi
> >  11:      13748    XT-PIC-XT        pata_it821x, uhci_hcd:usb1
> >  12:      65539    XT-PIC-XT        i8042
> >  14:          0    XT-PIC-XT        ata_piix
> >  15:      33052    XT-PIC-XT        ata_piix
> > NMI:          0   Non-maskable interrupts
> > ERR:          0
> >
> > IRQ 10 is not listed but is used by one of the two Matrox cards:
> >
> > pci 0000:00:13.0: Boot video device
> > ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 11
> > PCI: setting IRQ 11 as level-triggered
> > matroxfb 0000:00:13.0: PCI INT A -> Link[LNKB] -> GSI 11 (level, low) ->
> > IRQ 11
> > matroxfb: Matrox Mystique (PCI) detected
> > PInS memtype = 0
> > matroxfb: MTRR's turned on
> > matroxfb: 1024x768x8bpp (virtual: 1024x4096)
> > matroxfb: framebuffer at 0xE1000000, mapped to 0xd0880000, size 4194304
> > Console: switching to colour frame buffer device 128x48
> > fb0: MATROX frame buffer device
> > matroxfb 0000:00:14.0: enabling device (0000 -> 0002)
> > ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 10
> > PCI: setting IRQ 10 as level-triggered
> > matroxfb 0000:00:14.0: PCI INT A -> Link[LNKA] -> GSI 10 (level, low) ->
> > IRQ 10
> > matroxfb: Matrox Millennium II (PCI) detected
> > PInS memtype = 0
> > matroxfb: MTRR's turned on
> > matroxfb: 1024x768x8bpp (virtual: 1024x4096)
> > matroxfb: framebuffer at 0xE3000000, mapped to 0xd1100000, size 4194304
> > fb1: MATROX frame buffer device
> > fb1: initializing hardware
> >
> >
> > But this interrupt is not available to ISA PnP devices because
> > drivers/pnp/resource.c calls pci_uses_irq() function which in turn calls
> > pci_dev_uses_irq() for all PCI devices. pci_dev_uses_irq() simply checks
> > the irq field in struct pci_dev.
> >
> > I wonder if that's correct (is it a bug or a feature)?
>
> The code that tries to keep PCI and PNP IRQs from clashing is
> definitely sub-optimal.  Of course, PNP doesn't know what the
> matroxfb driver doesn't need the interrupt.  Some drivers request
> and free the IRQ dynamically, depending on whether the device is
> in use.
>
> Maybe what we should be doing here is more sharing of PCI interrupts
> to leave more available for PNP.  For example, the 00:14.0 device
> that's currently using IRQ 10 is connected to a programmable IRQ
> link (LNKA).  Possibly that link could be programmed to share IRQ 11
> instead.
>
> In the absence of an automatic mechanism, can you work around this
> with the "acpi_irq_isa=10" kernel parameter?

Great, it works - both matrox cards are now at IRQ 11. Thanks for suggestion. 
Although it should not work according do Documentation/kernel-parameters.txt:

acpi_irq_isa=   [HW,ACPI] If irq_balance, mark listed IRQs used by ISA
                Format: <irq>,<irq>...

But this should apply to my machine:
acpi_irq_nobalance [HW,ACPI]
                ACPI will not move active IRQs (default)
                default in PIC mode


>
> Bjorn
>
> > I can't use CMI8239A sound card on my machine because of this (it needs
> > two IRQs). When I comment out that check (and move eth0 to IRQ3), the
> > sound card works, allocating IRQ 10 and 3 (with some modifications to
> > cmi8330 driver - will be posted separately).



-- 
Ondrej Zary

      reply	other threads:[~2009-06-12 22:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-12 19:43 Non-requested PCI IRQs unavailable to ISA PnP devices and pci_dev_uses_irq() Ondrej Zary
2009-06-12 20:38 ` Bjorn Helgaas
2009-06-12 22:08   ` Ondrej Zary [this message]

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=200906130008.57928.linux@rainbow-software.org \
    --to=linux@rainbow-software.org \
    --cc=abelay@mit.edu \
    --cc=bjorn.helgaas@hp.com \
    --cc=linux-kernel@vger.kernel.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