We're using Pericom's 608GP extender. Using the same, we're able to read the configuration space of the every PCIe device. However, we're not able to access the BAR regions of any device.
Whenever we try to read/write to this BAR regions the same through the kernel driver, we're getting following bus error:
Machine check in kernel mode.
Caused by (from MCSR=a000): Load Error Report
Guarded Load Error Report
Oops: Machine check, sig: 7 [#1]
SMP NR_CPUS=8 CoreNet Generic
Modules linked in: emapci(PO) nfsd exportfs
CPU: 3 PID: 1625 Comm: ddccm Tainted: P O 3.12.37-rt51+g43cecda #2
task: e911ca30 ti: effd8000 task.ti: e9af8000
NIP: f94bc410 LR: f94ba430 CTR: 00000000
REGS: effd9f10 TRAP: 0204 Tainted: P O (3.12.37-rt51+g43cecda)
MSR: 00029002 <CE,EE,ME> CR: 28002422 XER: 00000000
GPR00: f94ba320 e9af9d10 e911ca30 f94bfc70 00000000 f91fe804 e011f000 00000e01
GPR08: 00020000 00000100 f91fe000 1f541215 c0018350 10024a5c 10100000 00000000
GPR16: 00000001 e96d60f0 00000000 00000000 00000000 00000000 00000000 e9af9e38
GPR24: 00000000 00000000 f94bfc70 00000000 00000000 00000000 00000000 00000000
NIP [f94bc410] ddcReadReg32+0x40/0x80 [emapci]
LR [f94ba430] emapci_open+0x430/0x560 [emapci]
Call Trace:
[e9af9d10] [f94ba320] emapci_open+0x320/0x560 [emapci] (unreliable)
[e9af9d50] [c0101b9c] chrdev_open+0xbc/0x1b0
[e9af9d80] [c00fa9e0] do_dentry_open.isra.15+0x1c0/0x2c0
[e9af9da0] [c00fab0c] finish_open+0x2c/0x60
[e9af9db0] [c010c32c] do_last.isra.46+0x3fc/0xc60
[e9af9e20] [c010cc44] path_openat+0xb4/0x660
[e9af9e80] [c010e160] do_filp_open+0x30/0xb0
[e9af9f00] [c00fbf70] do_sys_open+0x150/0x290
[e9af9f40] [c000fe24] ret_from_syscall+0x0/0x3c
--- Exception: c01 at 0xfef43d0
LR = 0x100023fc
Instruction dump:
3929fc70 7c691a14 812307f0 752a4000 812300b4 8143001c 40c20028 7c8449d6
54a5103a 7ca52214 7ca55214 7c0004ac <7c602c2c> 0c030000 4c00012c 4e800020
---[ end trace 2a777fae257abea4 ]---
Bus error
We've written the driver in following way:
res = pci_enable_device(pdev);
if (res) {
PERR("pci device enable failed\n");
return -EFAULT;
}
basePhys = pci_resource_start(pdev,0);
baseLength = pci_resource_len(pdev,0);
if(pci_request_region(pdev,0,DRIVER_NAME)==0) {
PINFO("GOT The Resource\n");
}
if((pci_resource_flags(pdev,0) & IORESOURCE_MEM) != IORESOURCE_MEM) {
PINFO("Not Equal to IORESOURCE_MEM\n");
}
else {
PINFO("Equal to IORESOURCE_MEM\n");
}
actVirtAddr = (unsigned long) bus_to_virt(basePhys); //for PowerPC p2041 architecture we have to do this function call
//because p2041 supports 36Byte addressing
virtAddress = (unsigned long) ioremap(actVirtAddr,baseLength);
elpc_adc_comm_address = virtAddress;
The PCI Configuration dump is in attachments: