pci_request_regions() failure
Ravi Gupta
dceravigupta at gmail.com
Mon Sep 6 22:52:33 EST 2010
Hi,
I am facing a problem while requesting pci resource. I have some data that I
am hopeful will help address the issue.
I am currently running on a MPC837xERDB board(powerpc) with a 2.6.35 kernel.
The problem is that whenever I insert the card (LatticeECP2M PCI Express
Development Kit<http://www.latticesemi.com/products/developmenthardware/developmentkits/pciexpressdevkitecp2m/index.cfm>)
in pci-express slot 0 and try to load my driver module, I get a
pci_request_regions() failure(error -EBUSY). The interesting thing is the
region that it fails for. According to /proc/iomem, slot0 has
a8000000-b7ffffff as its memory ranges. However, the memory region requested
by my device is a8000000-a803ffff and a8040000-a807ffff which falls in the
slot0 range. But after boot up when I look at /proc/iomem, there is a
already allocated resource range present there, which overlaps with the
range refined in my device, hence the pci_request_regions() fails.
Output of lspci
0000:00:00.0 Power PC: Freescale Semiconductor Inc Unknown device 00c6 (rev
21)
0001:01:00.0 PCI bridge: Freescale Semiconductor Inc Unknown device 00c6
(rev 21)
0001:02:00.0 Non-VGA unclassified device: Lattice Semiconductor Corporation
Unknown device e250 ---> My device
Contents of /pro/iomem file
# cat /proc/iomem
80000000-8fffffff : /pci at e0008500
90000000-9fffffff : /pci at e0008500
a8000000-b7ffffff : /pcie at e0009000
a8000000-a80fffff : PCI Bus 0001:02 ---> colprit range
c8000000-d7ffffff : /pcie at e000a000
e0004500-e0004507 : serial
e0004600-e0004607 : serial
e0023000-e0023fff : usb
Now my doubt is, who is allocating this range and why? It seem to me a
kernel bug as I also tried my device on i386 machine(opensuse, linux 2.6.35
i.e the same kernel version on powerpc board) and there everything works
fine. I don't know where to start to fix it. Please suggest.
Output of lspci
scooby:~ # lspci
00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM
Controller (rev 10)
00:01.0 PCI bridge: Intel Corporation 82G33/G31/P35/P31 Express PCI Express
Root Port (rev 10)
00:02.0 VGA compatible controller: Intel Corporation 82G33/G31 Express
Integrated Graphics Controller (rev 10)
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition
Audio Controller (rev 01)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port
1 (rev 01)
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port
2 (rev 01)
00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port
3 (rev 01)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI
Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI
Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI
Controller #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI
Controller #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI
Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface
Bridge (rev 01)
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller
(rev 01)
00:1f.2 IDE interface: Intel Corporation 82801GB/GR/GH (ICH7 Family) SATA
IDE Controller (rev 01)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev
01)
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B
PCI Express Gigabit Ethernet controller (rev 01)
04:00.0 Non-VGA unclassified device: Lattice Semiconductor Corporation
Device e250 ----------> My device
05:06.0 Serial controller: Device 4348:3253 (rev 10)
Contents of /proc/iomem on i386 machine
cat /proc/iomem
.
.
.
fe900000-fe9fffff : PCI Bus 0000:04
fe900000-fe93ffff : 0000:04:00.0 ------------->My device
fe940000-fe97ffff : 0000:04:00.0 ------------->My device
fea00000-feafffff : PCI Bus 0000:03
fea00000-fea1ffff : 0000:03:00.0
fea20000-fea20fff : 0000:03:00.0
fea20000-fea20fff : r8169
.
.
.
Regards,
Ravi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20100906/5d833798/attachment-0001.html>
More information about the Linuxppc-dev
mailing list