why the driver of pci device tw6869 can‘t transplant on the tx2

Recently,I got a devic tw6869,and I got the driver from the kernel linux-4.7.2,I build it as a external kernel modules,but when I insmod, Segmentation fault (core dumped) occur! the information as follows:
[ 69.952035] tw6869: PCI 0000:02:00.0, IRQ 388, MMIO 0x50200000
[ 69.957926] tw686x 0000:02:00.0: enabling device (0000 -> 0002)
[ 69.965724] tw686x 0000:02:00.0: dma0: unable to allocate B-buffer
[ 69.971949] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 69.980025] pgd = ffffffc1bd401000
[ 69.983419] [00000000] *pgd=0000000000000000, *pud=0000000000000000
[ 69.989695] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[ 69.995255] Modules linked in: tw686x(+) fuse videobuf2_vmalloc bcmdhd pci_tegra bluedroid_pm
[ 70.001034] CPU: 4 PID: 1726 Comm: insmod Not tainted 4.4.38 #5
[ 70.001035] Hardware name: quill (DT)
[ 70.001037] task: ffffffc1bc130c80 ti: ffffffc1ce5e0000 task.ti: ffffffc1ce5e0000
[ 70.001047] PC is at _raw_spin_lock_irqsave+0x20/0x54
[ 70.001059] LR is at tw686x_free_dma+0x2c/0x104 [tw686x]
[ 70.001061] pc : [] lr : [] pstate: 800000c5
[ 70.001062] sp : ffffffc1ce5e3920
[ 70.001065] x29: ffffffc1ce5e3920 x28: ffffffc06df50000
[ 70.001068] x27: 00000000fffffff4 x26: 0000000000000000
[ 70.001070] x25: ffffffc06df50328 x24: ffffffbffcf773a8
[ 70.001072] x23: ffffffc1e5bcbc88 x22: ffffffc06df50390
[ 70.001074] x21: ffffffc1e5bcbc00 x20: ffffffc06df50390
[ 70.001076] x19: 0000000000000000 x18: 0000000000000032
[ 70.001078] x17: ffffffc000b21a60 x16: ffffffc000b21a60
[ 70.001080] x15: ffffffc000b21a60 x14: ffffffc000b21a60
[ 70.001083] x13: 0000000000000002 x12: 0000af2bbd6d067b
[ 70.001085] x11: ffffff8001000064 x10: 00000000000000a9
[ 70.001087] x9 : 00160000000803a8 x8 : ffffffc1eb9a4508
[ 70.001089] x7 : 0000000000000001 x6 : 000000000000002a
[ 70.001091] x5 : ffffffc1eba80070 x4 : 0000000000000000
[ 70.001092] x3 : 0000000000000001 x2 : 0000000000000040
[ 70.001094] x1 : ffffffc1ce5e0000 x0 : 0000000000000000

[ 70.001097] Process insmod (pid: 1726, stack limit = 0xffffffc1ce5e0020)
[ 70.001098] Call trace:
[ 70.001101] [] _raw_spin_lock_irqsave+0x20/0x54
[ 70.001110] [] tw686x_video_free+0x54/0x80 [tw686x]
[ 70.001117] [] tw686x_video_init+0x4a0/0x628 [tw686x]
[ 70.001124] [] tw686x_probe+0x324/0x418 [tw686x]
[ 70.001129] [] pci_device_probe+0x98/0x10c
[ 70.001133] [] driver_probe_device+0xc8/0x408
[ 70.001135] [] __driver_attach+0x9c/0xa0
[ 70.001139] [] bus_for_each_dev+0x58/0x98
[ 70.001141] [] driver_attach+0x20/0x28
[ 70.001144] [] bus_add_driver+0x1f0/0x294
[ 70.001146] [] driver_register+0x68/0x108
[ 70.001149] [] __pci_register_driver+0x40/0x48
[ 70.001156] [] tw686x_pci_driver_init+0x1c/0x40 [tw686x]
[ 70.001159] [] do_one_initcall+0xc8/0x1c0
[ 70.001164] [] do_init_module+0x64/0x1c0
[ 70.001167] [] load_module+0xda0/0x107c
[ 70.001169] [] SyS_finit_module+0x94/0xbc
[ 70.001172] [] el0_svc_naked+0x24/0x28
[ 70.001174] —[ end trace d18acad5e2c1cfff ]—
[ 70.002718] note: insmod[1726] exited with preempt_count 1]

can you help me?

I couldn’t debug it, but there is a strong chance the upstream kernel has another feature it requires which would need to be back-ported to the current kernel. One thing you might do is look at the module in the newer kernel and see what other features must be enabled for this module to be enabled.

@linuxdev
Thank you for the tips, I put the source code into the kernel, its depends and select are enabled。but the problem is the same as above

I am unable to be much help, but is it possible this can be compiled in as an integrated feature instead of as a module? Sometimes issues similar to this are for lack of module support…integration into the kernel has fewer requirements than using as a module. Even if you want to use it as a module test as directly integrated might be the next debug step (error messages may differ and be useful).