pci hotplug problem
Hi Kenji,
I too presumed that. The board (based on MPC8315erdb from Freescale) has two PCIe controllers to which two slots are connected. The controllers are compatible with PCI Express Base Specification Revision 1.0a and the PCI Interface is compatible with PCI Local Bus Specification Rev. 2.3. The driver makes use of PCI Hotplug controller core to register/deregister hotplug slots.
Did I answer your question?
Regards,
Shivaprashanth
Quoted 398 lines · Kenji Kaneshige
Shivaprashanth,
Sorry for my delayed responding.
(I'm on vacation this week)I could not find any hotplug capable slot defined by PCIe spec in your lspci output. It should be the reason why pciehp detects no slot on your system. What kind of hotplug controller does your hotplug driver handle?
Regards,
Kenji KaneshigeQuoted 382 lines · shivprashant
below is the dmesg log after loading pciehp.ko with debug enabled
---------------------------------------------------------------------------------------------------------------------------------------------------------------
-sh-2.05b# insmod /pciehp.ko pciehp_debug=1
pciehp: PCI Express Hot Plug Controller Driver version: 0.4
-sh-2.05b# dmesg
Using MPC831x RDB machine description
Linux version 2.6.36.1 (root@shiva-desktop) (gcc version 4.1.2) #5 Thu
Jun 9 14:40:17 IST 2011
Found legacy serial port 0 for /immr@e0000000/serial@4500
memà004500, taddrà004500, irq=0, clk3333333, speed=0
Found legacy serial port 1 for /immr@e0000000/serial@4600
memà004600, taddrà004600, irq=0, clk3333333, speed=0
Found FSL PCI host bridge at0x00000000e0008500. Firmware bus number: 0->0
PCI host bridge /pci@e0008500 (primary) ranges:
MEM 0x0000000090000000..0x000000009fffffff ->0x0000000090000000
MEM 0x0000000080000000..0x000000008fffffff ->0x0000000080000000Prefetch
IO 0x00000000e0300000..0x00000000e03fffff ->0x0000000000000000
Found FSL PCI host bridge at0x00000000e0009000. Firmware bus number: 0->255
PCI host bridge /pcie@e0009000 ranges:
MEM 0x0000000040000000..0x000000004fffffff ->0x0000000040000000
IO 0x0000000051000000..0x00000000517fffff ->0x0000000000000000
Found FSL PCI host bridge at0x00000000e000a000. Firmware bus number: 0->255
PCI host bridge /pcie@e000a000 ranges:
MEM 0x0000000060000000..0x000000006fffffff ->0x0000000060000000
IO 0x0000000071000000..0x00000000717fffff ->0x0000000000000000
Top of RAM:0x10000000, Total RAM:0x10000000
Memory hole size: 0MB
Zone PFN ranges:
DMA0x00000000->0x00010000
Normal empty
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0:0x00000000->0x00010000
On node 0 totalpages: 65536free_area_init_node: node 0, pgdatc03fde3c,node_mem_mapc0441000
DMA zone: 512 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 65024 pages, LIFO batch:15
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
Kernel command line: console=ttyS0,115200 root=/dev/nfs rw nfsroot2.16.9.85:/home/shiva/Projects/AJA/pciehp-v2/aja-ltib/ro
otfs ip2.16.9.100:172.16.9.85:172.16.9.1:255.255.255.0::eth0:off
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 255496k/262144k available (3972k kernel code, 6648k reserved,
144k data, 204k bss, 176k init)
Kernel virtual memory layout:
* 0xfffdf000..0xfffff000 : fixmap
* 0xfcef8000..0xfe000000 : early ioremap
* 0xd1000000..0xfcef8000 : vmalloc& ioremap
Hierarchical RCU implementation.
RCU-based detection of stalled CPUs is disabled.
Verbose stalled-CPUs detection is disabled.
NR_IRQS:512 nr_irqs:512
IPIC (128 IRQ sources) atd1000700time_init: decrementer frequency = 33.333334 MHztime_init: processor frequency = 400.000008 MHz
clocksource: timebase mult[77ffffd] shift[22] registered
clockevent: decrementer mult[888888b] shift[32] cpu[0]
Console: colour dummy device 80x25pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
allocirq_descfor 38 on node 0
allockstat_irqson node 0
irq: irq 38 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 38
PCI: Probing PCI hardware
pci 0000:00:00.0: reg 10: [mem 0x00000000-0x000fffff]
pci 0000:00:00.0: reg 18: [mem 0x00000000-0x0fffffff 64bit pref]
pci 0000:00:00.0: supports D1 D2
pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot
pci 0000:00:00.0: PME# disabled
pci 0000:00:10.0: reg 10: [mem 0x90000000-0x900007ff]
pci 0000:00:10.0: reg 14: [mem 0x90004000-0x90007fff]
pci 0000:00:10.0: supports D1 D2
pci 0000:00:10.0: PME# supported from D0 D1 D2 D3hot
pci 0000:00:10.0: PME# disabled
allocirq_descfor 48 on node 0
allockstat_irqson node 0
irq: irq 48 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 48pci_bus0000:00: resource 0 [io 0x0000-0xfffff]pci_bus0000:00: resource 1 [mem 0x90000000-0x9fffffff]pci_bus0000:00: resource 2 [mem 0x80000000-0x8fffffff pref]pci_bus0001:01: resource 0 [io 0xff7fe000-0xffffdfff]pci_bus0001:01: resource 1 [mem 0x40000000-0x4fffffff]pci_bus0002:02: resource 0 [io 0xfeffc000-0xff7fbfff]pci_bus0002:02: resource 1 [mem 0x60000000-0x6fffffff]
Registering ipic with sysfs...
bio: create slab<bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
libata version 3.00 loaded.
Freescale Elo / Elo Plus DMA driver
Switching to clocksource timebase
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
PCI: CLS 32 bytes, default 32
allocirq_descfor 16 on node 0
allockstat_irqson node 0
irq: irq 9 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 16
allocirq_descfor 17 on node 0
allockstat_irqson node 0
irq: irq 10 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 17
allocirq_descfor 77 on node 0
allockstat_irqson node 0
irq: irq 77 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 77
allocirq_descfor 18 on node 0
allockstat_irqson node 0
irq: irq 16 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 18
allocirq_descfor 71 on node 0
allockstat_irqson node 0
irq: irq 71 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 71
of:fsl-elo-dma e00082a8.dma: #0 (fsl,elo-dma-channel), irq 71
of:fsl-elo-dma e00082a8.dma: #1 (fsl,elo-dma-channel), irq 71
of:fsl-elo-dma e00082a8.dma: #2 (fsl,elo-dma-channel), irq 71
of:fsl-elo-dma e00082a8.dma: #3 (fsl,elo-dma-channel), irq 71
allocirq_descfor 32 on node 0
allockstat_irqson node 0
irq: irq 32 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 32
allocirq_descfor 33 on node 0
allockstat_irqson node 0
irq: irq 33 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 33
allocirq_descfor 34 on node 0
allockstat_irqson node 0
irq: irq 34 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 34
allocirq_descfor 44 on node 0
allockstat_irqson node 0
irq: irq 44 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 44
allocirq_descfor 45 on node 0
allockstat_irqson node 0
irq: irq 45 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 45
allocirq_descfor 67 on node 0
allockstat_irqson node 0
irq: irq 67 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 67
allocirq_descfor 19 on node 0
allockstat_irqson node 0
irq: irq 4 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 19
allocirq_descfor 81 on node 0
allockstat_irqson node 0
irq: irq 81 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 81
allocirq_descfor 82 on node 0
allockstat_irqson node 0
irq: irq 82 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 82
allocirq_descfor 86 on node 0
allockstat_irqson node 0
irq: irq 86 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 86
allocirq_descfor 87 on node 0
allockstat_irqson node 0
irq: irq 87 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 87
allocirq_descfor 88 on node 0
allockstat_irqson node 0
irq: irq 88 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 88
allocirq_descfor 89 on node 0
allockstat_irqson node 0
irq: irq 89 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 89
Setting up Freescale MSI support
allocirq_descfor 80 on node 0
allockstat_irqson node 0
irq: irq 80 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 80
allocirq_descfor 90 on node 0
allockstat_irqson node 0
irq: irq 90 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 90
allocirq_descfor 78 on node 0
allockstat_irqson node 0
irq: irq 78 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 78
allocirq_descfor 84 on node 0
allockstat_irqson node 0
irq: irq 84 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 84
allocirq_descfor 72 on node 0
allockstat_irqson node 0
irq: irq 72 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 72
allocirq_descfor 91 on node 0
allockstat_irqson node 0
irq: irq 91 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 91
allocirq_descfor 79 on node 0
allockstat_irqson node 0
irq: irq 79 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 79
allocirq_descfor 85 on node 0
allockstat_irqson node 0
irq: irq 85 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 85
allocirq_descfor 73 on node 0
allockstat_irqson node 0
irq: irq 73 on host /immr@e0000000/interrupt-controller@700 mapped to
virtual irq 73
msgmni has been set to 499
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)pci_hotplug: PCI Hot Plug PCI Core version: 0.5
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO0xe0004500(irq = 16) is a 16550A
console [ttyS0] enabled
serial8250.0: ttyS1 at MMIO0xe0004600(irq = 17) is a 16550A
e0004500.serial: ttyS0 at MMIO0xe0004500(irq = 16) is a 16550
e0004600.serial: ttyS1 at MMIO0xe0004600(irq = 17) is a 16550
brd: module loaded
loop: module loaded
f8000000.flash: Found 1 x16 devices at0x0in 16-bit bank. Manufacturer
ID0x000001Chip ID0x002301
f8000000.flash: Found 1 x16 devices at0x4000000in 16-bit bank
Amd/Fujitsu Extended Query Table at0x0040
Amd/Fujitsu Extended Query version 1.3.
number of CFI chips: 2
RedBoot partition parsing not available
Creating 8 MTD partitions on "f8000000.flash":
0x000000000000-0x000002000000 : "AppA"
0x000002000000-0x000004000000 : "AppB"
0x000004000000-0x000006000000 : "SafeBoot"
0x000007ea0000-0x000007ec0000 : "ConfigB"
0x000007f60000-0x000007f80000 : "UserRegsA"
0x000007f80000-0x000007fa0000 : "UserRegsB"
0x000007fa0000-0x000007fc0000 : "ConfigA"
0x000006400000-0x000006420000 : "UBootShared"
of:mpc8xxx_spi e0007000.spi: at0xd103c000(irq = 18), CPU mode
Fixed MDIO Bus: probed
eth0: Gianfar Ethernet Controller Version 1.2, 00:0c:17:88:02:35
eth0: Running with NAPI enabled
eth0: RX BD ring size for Q[0]: 256
eth0: TX BD ring size for Q[0]: 256
Freescale PowerQUICC MII Bus: probed
i2c /dev entries driver
of:mpc-i2c e0003000.i2c: timeout 1000000 us
rtc-ds1307 0-0068: rtc core: registered ds1339 as rtc0
TCP cubic registered
NET: Registered protocol family 17
rtc-ds1307 0-0068: setting system clock to 2011-06-09 02:04:50 UTC
(1307585090)
IP-Config: Complete:
device=eth0, addr2.16.9.100, mask%5.255.255.0, gw2.16.9.1,
host2.16.9.100, domain=, nis-domain=(none),
bootserver2.16.9.85, rootserver2.16.9.85, rootpath>> Looking up port of RPC 100003/2 on 172.16.9.85
PHY: mdio@e0024520:01 - Link is Up - 100/Full
Looking up port of RPC 100005/1 on 172.16.9.85
VFS: Mounted root (nfs filesystem) on device 0:12.
Freeing unused kernel memory: 176k init
pciehp:pcie_port_service_register= 0
pciehp: PCI Express Hot Plug Controller Driver version: 0.4(quoted diff) +0
-3-sh-2.05b# -sh-2.05b# -sh-2.05b# lspci -vv00:00.0 Power PC: Freescale Semiconductor Inc Unknown device 00b5 (rev 12)
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B-
Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSELúst>TAbort-<TAbort- <MAbort+>SERR-<PERR-
Latency: 128, Cache Line Size: 32 bytes
Interrupt: pin A routed to IRQ 0
Region 2: Memory at<unassigned> (64-bit, prefetchable)
Region 4: Memory at<unassigned> (64-bit, non-prefetchable)
Capabilities: [48] #06 [0000]
Capabilities: [80] Power Management version 3
Flags: PMEClk+ DSI+ D1+ D2+ AuxCurrent=0mAPME(D0+,D1+,D2+,D3hot+,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-00:10.0 FireWire (IEEE 1394): Texas Instruments TSB82AA2 IEEE-1394b Link Layer Controller (rev 02) (prog-if 10 [OHCI])
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: 128 (500ns min, 1000ns max), Cache Line Size: 32 bytes
Interrupt: pin A routed to IRQ 48
Region 0: Memory at 90000000 (32-bit, non-prefetchable) [size=2K] Region 1: Memory at 90004000 (32-bit, non-prefetchable) [sizeK]
Capabilities: [44] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mAPME(D0+,D1+,D2+,D3hot+,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
---------------------------------------------------------------------------------------------------------------------------------------------------------------Quoted 71 lines · Kenji Kaneshige
Quoted 4 lines · shivprashant
i built pciehp statically. the driver gets loaded but probe is not
called. do i need to modify anything in pciehp driver to make it work with my platform?I have no idea so far.
Can you send me the following information?
- dmesg output after loading pciehp with
pciehp_debugmodule option (if you built pciehp as builtin driver, please add pciehp.pciehp_debug to kernel parameter and boot)- "lspci -vv" output (as root user).
Regards,
Kenji KaneshigeQuoted 51 lines · Kenji Kaneshige
Quoted 50 lines
Why not use pciehp?
Thanks,
Kenji KaneshigeQuoted 43 lines · shivprashant
hi,
i am writing pci express hotplug driver for mpc8315erdb(powerpc). the driver uses PCI hotplug subsystem not pcie port bus driver. i am able to do insertion and removal of pci express cards and confirm using 'lspci' command. driver is working with SATA and PATA memory cards with some minor modifications in the kernel. the problem i am facing now is when i try to repeatedly insert and remove the kernel is crashing, although non-fatal. normal insertion/removal works fine but repeated insertion/removal fails. pls guide me where am i wrong or what changes i should make to recover from pci errors.Following is the crash log when repeatedly inserting and removing the PATA cards (i am using delkin 32GB cards), scsi20 :
pata_jmicron
scsi21 :pata_jmicron
ata21: PATA max UDMA/100 cmd0xff7fa010ctl0xff7fa020bmdma0xff7fa000irq 21
ata22: PATA max UDMA/100 cmd0xff7fa018ctl0xff7fa024bmdma0xff7fa008irq 21
PCIE Card Removed from Slot 0Oops: Machine check, sig: 7 [#1] MPC831x RDB last sysfs file: /sys/devices/pci0002:02/0002:02:00.0/0002:03:00.0/class Modules linked in: NIP: c00124c4 LR: c00124b0 CTR: c0017998 REGS: cfad3cb0 TRAP: 0200 Not tainted (2.6.36.1) MSR: 00049030<EE,ME,IR,DR> CR: 22204084 XER: 20000000TASK = cfa9c030[1282] '
scsi_eh_20' THREAD:cfad2000
GPR00: 00000000cfad3d60cfa9c03000000000cfad3d0800e00000a91e4fb900000001
GPR08:c03fd688fdef7000fd6f7000c042a0e000005a0700020d78c02fbd0cffffffff
GPR16: 00000000 00000000 00000000 00000004c01ff49800000001cfac94c8cfac8000
GPR24:c01fa87c00000003ffff2a2dcfac801c00000001 00000000cfac9430fd6f8012NIP [c00124c4]ioread8+0x2c/0x328
LR [c00124b0]ioread8+0x18/0x328Call Trace: [cfad3d60] [c002bccc] msleep+0x1c/0x34 (unreliable) [cfad3d70] [c01fa77c] ata_sff_wait_after_reset+0x6c/0x16c [cfad3da0] [c01fa934] ata_sff_softreset+0xb8/0x204 [cfad3de0] [c01f2604] ata_do_reset+0xa0/0xb4 [cfad3e00] [c01f33ac] ata_eh_reset+0x3e4/0xcf4 [cfad3e80] [c01f59e8] ata_eh_recover+0x284/0x10e0 [cfad3f00] [c01f6a0c] ata_do_eh+0x4c/0xb0 [cfad3f20] [c01f926c] ata_sff_error_handler+0x110/0x140 [cfad3f40] [c01f7680] ata_scsi_error+0x2ec/0x4e0 [cfad3f70] [c01d2664] scsi_error_handler+0xc4/0x39c [cfad3fb0] [c0039d4c] kthread+0x7c/0x80 [cfad3ff0] [c000f200] kernel_thread+0x4c/0x68 Instruction dump: 4e800020 9421fff0 7c0802a6 93e1000c 7c7f1b78 90010014 481835f5 2f830000 38600000 419e0018 7c0004ac 881f0000<0c000000> 4c00012c 5403063e 80010014 ---[ end trace fb9766f858e66ef2 ]---
Signature · 2 lines
With Regards, Shivaprashanth H