public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PCI resource allocation problem in 2.6.8
@ 2004-11-21 14:57 Dimitris Lampridis
  2004-11-23  8:22 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Dimitris Lampridis @ 2004-11-21 14:57 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2977 bytes --]

Hi,
I'm writing a driver for a PCI-based USB controller. The work is almost
done but a few days ago something very ugly happened. I've tried to
pinpoint the problem but everything is so simple and clear to be
wrong... I really hope that someone can help me!

OK, here's the problem:
I'm using kernel 2.6.8 on an i386 arch. I want to allocate region 2 of
my PCI board. Here's the output of lspci:

0000:00:0e.0 Bridge: PLX Technology, Inc.: Unknown device 5406 (rev 0b)
        Subsystem: PLX Technology, Inc.: Unknown device 9054
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 32, Cache Line Size: 0x08 (32 bytes)
        Interrupt: pin A routed to IRQ 9
        Region 0: Memory at df100000 (32-bit, non-prefetchable)
[size=256]
        Region 1: I/O ports at e400 [size=256]
        Region 2: I/O ports at e800 [size=256]
        Region 3: Memory at df000000 (32-bit, non-prefetchable)
[size=1M]
        Capabilities: [40] Power Management version 1
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [48] #06 [0000]
        Capabilities: [4c] Vital Product Data

As you can see, region 2 begins at e800 and extends up to e8ff.

When I try to claim the region, I get wrong start-end-length numbers.
I've written something simple to demonstrate this fact:

for(pci_region=0; pci_region < PCI_ROM_RESOURCE; pci_region++){  
	resource_start = pci_resource_start (dev, pci_region);
	resource_end = pci_resource_end (dev,pci_region);
	printk (KERN_DEBUG "region:%d start:%lx, end:%lx -  ", pci_region,
resource_start, resource_end);
	len = pci_resource_len (dev, pci_region);
	printk(KERN_DEBUG "length:%lx\n", len);
}

Where "dev" is a pointer to a pci device of course.
So here's what I get by running this code:

Nov 21 16:28:56 naousa kernel: PCI: Found IRQ 9 for device 0000:00:0e.0
Nov 21 16:28:56 naousa kernel: region:0	start:0, end:0 -  <7>length:0
Nov 21 16:28:56 naousa kernel: region:1	start:df1000ff, end:200 -
<7>length:20f00102
Nov 21 16:28:56 naousa kernel: region:2	start:e4ff, end:101 -
<7>length:ffff1c03
Nov 21 16:28:56 naousa kernel: region:3	start:e8ff, end:101 -
<7>length:ffff1803
Nov 21 16:28:56 naousa kernel: region:4	start:df0fffff, end:200 -
<7>length:20f00202
Nov 21 16:28:56 naousa kernel: region:5^Istart:0, end:0 -  <7>length:0

As you can see, what "start" claims to be is in reality the end of each
region, and "end", "length" are nonsense...

Any ideas? Is this something typical???
I would appreciate any help, please CC me personally as I'm not yet
subscribed to the list, or find me at the linux-usb-devel list.

Thanx in advance,
-- 
Dimitris Lampridis <labis@mhl.tuc.gr>

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PCI resource allocation problem in 2.6.8
  2004-11-21 14:57 PCI resource allocation problem in 2.6.8 Dimitris Lampridis
@ 2004-11-23  8:22 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2004-11-23  8:22 UTC (permalink / raw)
  To: Dimitris Lampridis; +Cc: linux-kernel

On Sun, Nov 21, 2004 at 02:57:27PM +0000, Dimitris Lampridis wrote:
> Hi,
> I'm writing a driver for a PCI-based USB controller.

Something other than ohci, ehci, or uhci?  What kind?

> Any ideas? Is this something typical???

We fixed a bug in this area for the 2.6.9 release.  Can you try that
kernel and let us know if it fixes your problem too?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-11-23  8:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-21 14:57 PCI resource allocation problem in 2.6.8 Dimitris Lampridis
2004-11-23  8:22 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox