PCIe device driver loading fails on Jetson TX2

Hi,

I found a device driver for the DVP-7641E PCIe device on internet.
and i build a driver without any problem.
but, the device driver does not works correctly.

please, let me know. what shall i do first for debugging.

Many thanks,
Namsu

------ dmesg ------
[ 353.366410] [LINUXV4L2] : FAF86DD63BEE049469391C62866E9E0BB(), 1.1.0.120.879, 2020.07.15 PAL
[ 353.366736] [LINUXV4L2] : [00] F0251D2D952114606BEF15BFE3B8A3F85( 01:000000:12AB:0381:23CA:12AB (12AB:0381:23CA:12AB) )
[ 353.366740] [LINUXV4L2] : [00] F0251D2D952114606BEF15BFE3B8A3F85() primary(0x0)
[ 353.366743] [LINUXV4L2] : [00] F0251D2D952114606BEF15BFE3B8A3F85() pm_cap(0x40)
[ 353.366745] [LINUXV4L2] : [00] F0251D2D952114606BEF15BFE3B8A3F85() current_state(0x5)
[ 353.366766] [LINUXV4L2] : [00] F0251D2D952114606BEF15BFE3B8A3F85() - w_bar0(0x0)
[ 353.366768] [LINUXV4L2] : m_nAnalogCrossbarVideoInputProperty(0d5)
[ 353.366770] [LINUXV4L2] : m_nCustomCompanyMedicalProperty(0d1)
[ 353.366789] LINUXV4L20380 0000:01:00.0: can’t enable device: BAR 0 [mem 0x00000000-0x00ffffff] not claimed
[ 353.376500] [LINUXV4L2] : [00] F0251D2D952114606BEF15BFE3B8A3F85() - pci_enable_device() - [FAIL]
[ 353.385483] Trying to free nonexistent resource <0000000000000000-0000000000ffffff>
[ 353.393177] Trying to free nonexistent resource <0000000000000000-0000000000000fff>
[ 353.400879] LINUXV4L20380 0000:01:00.0: disabling already-disabled device
[ 353.400912] ------------[ cut here ]------------
[ 353.405534] WARNING: CPU: 5 PID: 9292 at drivers/pci/pci.c:1700 pci_disable_device+0xd4/0xe8
[ 353.413959] Modules linked in: LXV4L2D_MZ0380(O) bnep fuse bcmdhd zram cfg80211 ov5693 spidev overlay nvgpu bluedroid_pm ip_tables x_tables

[ 353.414027] CPU: 5 PID: 9292 Comm: Init_pci_driver Tainted: G O 4.9.140-tegra #8
[ 353.414033] Hardware name: quill (DT)
[ 353.414040] task: ffffffc1ebbfd400 task.stack: ffffffc1646f0000
[ 353.414050] PC is at pci_disable_device+0xd4/0xe8
[ 353.414058] LR is at pci_disable_device+0xd4/0xe8
[ 353.414066] pc : [] lr : [] pstate: 60400045
[ 353.414071] sp : ffffffc1646f3a60
[ 353.414076] x29: ffffffc1646f3a60 x28: ffffffc131800320
[ 353.414091] x27: ffffffc131800000 x26: ffffffc1318138e0
[ 353.414104] x25: 00000000000d8000 x24: 0000000000000000
[ 353.414117] x23: ffffffc1e94540a0 x22: ffffffc1e94540a0
[ 353.414129] x21: ffffffc1318138e0 x20: ffffffc1e94540a0
[ 353.414142] x19: ffffffc1e9454000 x18: 0000000000000010
[ 353.414154] x17: 0000000000000000 x16: 0000000000000000
[ 353.414166] x15: ffffffffffffffff x14: 3030302d30303030
[ 353.414179] x13: 3030303030303030 x12: 303030303c206563
[ 353.414191] x11: 72756f7365722074 x10: 00000000000003fe
[ 353.414204] x9 : 6f6e206565726620 x8 : 69642d7964616572
[ 353.414216] x7 : 6c6120676e696c62 x6 : ffffff800a1780dd
[ 353.414228] x5 : 0000000000000000 x4 : 0000000000000000
[ 353.414240] x3 : ffffffffffffffff x2 : 00000041ecf91000
[ 353.414253] x1 : ffffffc1ebbfd400 x0 : 000000000000003d

[ 353.414271] —[ end trace 5edf8d048c2155da ]—
[ 353.418892] Call trace:
[ 353.418899] [] pci_disable_device+0xd4/0xe8
[ 353.418953] [] F0251D2D952114606BEF15BFE3B8A3F85+0x28a8/0x2b90 [LXV4L2D_MZ0380]
[ 353.418960] [] pci_device_probe+0xa4/0x140
[ 353.418970] [] driver_probe_device+0xd8/0x408
[ 353.418974] [] __driver_attach+0xdc/0x128
[ 353.418979] [] bus_for_each_dev+0x5c/0xa8
[ 353.418982] [] driver_attach+0x30/0x40
[ 353.418986] [] bus_add_driver+0x20c/0x2a8
[ 353.418989] [] driver_register+0x6c/0x110
[ 353.418994] [] __pci_register_driver+0x50/0x60
[ 353.419031] [] Init_pci_driver+0x28/0x68 [LXV4L2D_MZ0380]
[ 353.419039] [] kthread+0xec/0xf0
[ 353.419044] [] ret_from_fork+0x10/0x30
[ 353.419181] LINUXV4L20380: probe of 0000:01:00.0 failed with error -22

lspci -v

00:01.0 PCI bridge: NVIDIA Corporation Device 10e5 (rev a1) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 381
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
Memory behind bridge: 40800000-41ffffff
Capabilities:
Kernel driver in use: pcieport

01:00.0 Non-VGA unclassified device: YUAN High-Tech Development Co., Ltd. Device 0381
Subsystem: Device 23ca:12ab
Flags: fast devsel, IRQ 381
Memory at (32-bit, non-prefetchable) [disabled] [size=16M]
I/O ports at [disabled]
Memory at (32-bit, non-prefetchable) [disabled] [size=4K]
Capabilities:
Kernel modules: LXV4L2D_MZ0380

For some reason BAR is not allocated for the device. Check PCIe subsystem logs during PCIe enumeration at boot.

Dear Manikanta,

i became know, my PCIe Capture card is configured two mode by it’s Firmware. one is for x86 system, and the other is for Arm(Embedded) system.

Now my PCIe Capture card works normally after installing a F/W for Arm system.

Thanks,