2001-11-19 16:46:32

by John Clemens

[permalink] [raw]
Subject: pci_write_config_byte question..


I've been hacking some PCI code to get USB working on my laptop. I need
to change PCI config space to use IRQ 11 for the device instead of IRQ 9.

So i call pci_write_config_byte(...), but that only appears to change the
"system" view of PCI space.. if you boot the kernel and do an lspci, it
shows up as IRQ11, but if you do a lspci -b (for "Bus" view), it still
shows up as IRQ 9.

my question: why doesn't pci_write_config_byte not seem to work as
advertised? it just seems to manipulate a data structure...?

john.c

--
John Clemens http://www.deater.net/john
[email protected] ICQ: 7175925, IM: PianoManO8
"I Hate Quotes" -- Samuel L. Clemens



2001-11-19 17:24:04

by Russell King

[permalink] [raw]
Subject: Re: pci_write_config_byte question..

On Mon, Nov 19, 2001 at 12:48:24PM -0500, John Clemens wrote:
> I've been hacking some PCI code to get USB working on my laptop. I need
> to change PCI config space to use IRQ 11 for the device instead of IRQ 9.

Changing interrupts is non-trivial, especially on x86.

> So i call pci_write_config_byte(...), but that only appears to change the
> "system" view of PCI space.. if you boot the kernel and do an lspci, it
> shows up as IRQ11, but if you do a lspci -b (for "Bus" view), it still
> shows up as IRQ 9.

The kernel caches a copy of the IRQ number register. The IRQ number
register (PCI_INTERRUPT_LINE) is just like RAM - you can read it, you
can write it. However, it has no hardware side effects however. It's
sole purpose in life is to communicate the IRQ number from the POST
(which knows how the interrupts are arranged) to the driver.

--
Russell King ([email protected]) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html

2001-11-19 17:37:54

by John Clemens

[permalink] [raw]
Subject: Re: pci_write_config_byte question..

On Mon, 19 Nov 2001, Russell King wrote:

> On Mon, Nov 19, 2001 at 12:48:24PM -0500, John Clemens wrote:
> > I've been hacking some PCI code to get USB working on my laptop. I need
> > to change PCI config space to use IRQ 11 for the device instead of IRQ 9.
>
> Changing interrupts is non-trivial, especially on x86.

nod. But it can be done in this case.. its just i have to call 'setpci'
from user space to change the interrupt line manually before i modeprobe
usb-ohci. I thought pci_write_config_byte should take care of that.

for a complete rundown of what i'm doing, please see my earlier post which
garnered no responses whatsoever:

http://www.uwsg.iu.edu/hypermail/linux/kernel/0111.2/0005.html

> The kernel caches a copy of the IRQ number register. The IRQ number
> register (PCI_INTERRUPT_LINE) is just like RAM - you can read it, you
> can write it. However, it has no hardware side effects however. It's
> sole purpose in life is to communicate the IRQ number from the POST
> (which knows how the interrupts are arranged) to the driver.

so is there a kernel call I can use to actually twiddle the bits?

john.c

--
John Clemens http://www.deater.net/john
[email protected] ICQ: 7175925, IM: PianoManO8
"I Hate Quotes" -- Samuel L. Clemens