Code Monkey home page Code Monkey logo

xtrx_linux_pcie_drv's People

Contributors

chemeris avatar grandpaul avatar keno avatar mnhauke avatar rjonaitis avatar sergforce avatar trabucayre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xtrx_linux_pcie_drv's Issues

Compilation errors on gcc 7.3 on arm64 4.4.132 kernel.

I'm trying to build the driver on an arm64 4.4.132 based system using gcc 7.3, but I'm getting the compilation errors as shown below:

$uname -a
Linux rockpro64 4.4.132-1075-rockchip-ayufan-ga83beded8524 #1 SMP Thu Jul 26 08:22:22 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux

$ gcc --version
gcc (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


$ git rev-parse --short HEAD
815d890
$ make
make -C /lib/modules/4.4.132-1075-rockchip-ayufan-ga83beded8524/build M=/home/projects/sdr/xtrx/xtrx_linux_pcie_drv.git modules
make[1]: Entering directory '/usr/src/linux-headers-4.4.132-1075-rockchip-ayufan-ga83beded8524'
  CC [M]  /home/projects/sdr/xtrx/xtrx_linux_pcie_drv.git/xtrx.o
/home/projects/sdr/xtrx/xtrx_linux_pcie_drv.git/xtrx.c: In function 'xtrxfd_mmap':
/home/projects/sdr/xtrx/xtrx_linux_pcie_drv.git/xtrx.c:881:24: error: implicit declaration of function 'bus_to_virt'; did you mean 'fix_to_virt'? [-Werror=implicit-function-declaration]
    (long unsigned int)(bus_to_virt(addr)),
                        ^~~~~~~~~~~
                        fix_to_virt
/home/projects/sdr/xtrx/xtrx_linux_pcie_drv.git/xtrx.c:882:37: warning: passing argument 1 of 'virt_to_phys' makes pointer from integer without a cast [-Wint-conversion]
error, forbidden warning: xtrx.c:882
scripts/Makefile.build:283: recipe for target '/home/projects/sdr/xtrx/xtrx_linux_pcie_drv.git/xtrx.o' failed
make[2]: *** [/home/projects/sdr/xtrx/xtrx_linux_pcie_drv.git/xtrx.o] Error 1
Makefile:1471: recipe for target '_module_/home/projects/sdr/xtrx/xtrx_linux_pcie_drv.git' failed
make[1]: *** [_module_/home/projects/sdr/xtrx/xtrx_linux_pcie_drv.git] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.132-1075-rockchip-ayufan-ga83beded8524'
Makefile:10: recipe for target 'modules' failed
make: *** [modules] Error 2

I've made a patch:

From a4560c255c8d8090ad34bc3a521bd3e23054ec54 Mon Sep 17 00:00:00 2001
From: Petter Gustad <[email protected]>
Date: Mon, 8 Oct 2018 21:08:41 +0200
Subject: [PATCH] Fixed compilation errors on arm64/gcc 7.3

* Removed unused function.
* Replaced bus_to_virt with phys_to_virt.
---
 xtrx.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/xtrx.c b/xtrx.c
index c7e35cf..861eb02 100644
--- a/xtrx.c
+++ b/xtrx.c
@@ -663,13 +663,6 @@ static irqreturn_t xtrx_irq_legacy(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static irqreturn_t xtrx_msi_irq_single(int irq, void *data)
-{
-	xtrx_irq_legacy(irq, data);
-	return IRQ_HANDLED;
-}
-
-
 static struct pps_source_info xtrx_pps_info = {
 	.name		= "xtrx_pps",
 	.path		= "",
@@ -876,11 +869,11 @@ static int xtrxfd_mmap(struct file *filp, struct vm_area_struct *vma)
 		printk(KERN_NOTICE PFX "mmap() call: VMA=%p vma->vm_pgoff=%lu addr=%p dev_addr=%lx bus_addr=%lx phys_addr=%lx\n",
 			vma, vma->vm_pgoff, (vma->vm_pgoff == 0) ? xtrxdev->bar0_addr : xtrxdev->bar1_addr,
 			(long unsigned int)addr,
-			(long unsigned int)(bus_to_virt(addr)),
-			(long unsigned int)(virt_to_phys(bus_to_virt(addr))) );
+			(long unsigned int)(phys_to_virt(addr)),
+			(long unsigned int)(virt_to_phys(phys_to_virt(addr))) );
 
 		if (io_remap_pfn_range(vma, vma->vm_start,
-			virt_to_phys(bus_to_virt(addr)) >> PAGE_SHIFT,
+			virt_to_phys(phys_to_virt(addr)) >> PAGE_SHIFT,
 			vma->vm_end - vma->vm_start,
 			vma->vm_page_prot))
 			return -EAGAIN;
-- 
2.17.1

Or the commit can be found here:

https://github.com/gustad/xtrx_linux_pcie_drv/commit/a4560c255c8d8090ad34bc3a521bd3e23054ec54

Note that I have not been able to make the driver work on arm64. But it's at least compiling, and the above compiles and is functional on x86_64, i.e. the driver loads and I can run test_xtrxll with the same result as 1158c4f.

DKMS build fails on a Linux 6.3.3-surface based system due to a read-only vm_area_struct member.

Hello,

I was trying to install another package which pulled in your DKMS module. The build attempt failed on 6.3.3-surface but succeeded on 6.2.10-surface. So I assume the issue is caused by a change in the upstream kernel sources between 6.2.10 and 6.3.3.

dkms console output:
Building for 6.3.3-surface
Building initial module for 6.3.3-surface
Error! Bad return status for module build on kernel: 6.3.3-surface (x86_64)
Consult /var/lib/dkms/xtrx/0.0.1+git20190320.5ae3a3e-3.2/build/make.log for more information.

dkms make.log output:
DKMS make.log for xtrx-0.0.1+git20190320.5ae3a3e-3.2 for kernel 6.3.3-surface (x86_64)
Tue May 30 12:15:07 PM EDT 2023
make: Entering directory '/usr/src/linux-headers-6.3.3-surface'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
You are using: gcc (Debian 12.2.0-14) 12.2.0
CC [M] /var/lib/dkms/xtrx/0.0.1+git20190320.5ae3a3e-3.2/build/xtrx.o
/var/lib/dkms/xtrx/0.0.1+git20190320.5ae3a3e-3.2/build/xtrx.c: In function ‘xtrxfd_mmap’:
/var/lib/dkms/xtrx/0.0.1+git20190320.5ae3a3e-3.2/build/xtrx.c:1075:31: error: assignment of read-only member ‘vm_flags’
1075 | vma->vm_flags |= VM_LOCKED;
| ^~
/var/lib/dkms/xtrx/0.0.1+git20190320.5ae3a3e-3.2/build/xtrx.c:1090:31: error: assignment of read-only member ‘vm_flags’
1090 | vma->vm_flags |= VM_IO;
| ^~
/var/lib/dkms/xtrx/0.0.1+git20190320.5ae3a3e-3.2/build/xtrx.c:1115:31: error: assignment of read-only member ‘vm_flags’
1115 | vma->vm_flags |= VM_LOCKED;
| ^~
make[1]: *** [scripts/Makefile.build:252: /var/lib/dkms/xtrx/0.0.1+git20190320.5ae3a3e-3.2/build/xtrx.o] Error 1
make: *** [Makefile:2031: /var/lib/dkms/xtrx/0.0.1+git20190320.5ae3a3e-3.2/build] Error 2
make: Leaving directory '/usr/src/linux-headers-6.3.3-surface'

Bus Error

Am getting a bus error again. This was fixed before.

/usr/local/lib/xtrx/test_xtrx -l10 -t
01:10:47.145007 DEBUG:  xt[ 5869.872606] Synchronous External Abort: synchronous external abort (0x92000210) at 0x0000ffff9dedd068
rxllpciev0_discovery:264 [PCIE] pcie: Found `pcie:///dev/xtrx0`
Bus error

it was fixed before with this commit: https://github.com/xtrx-sdr/xtrx_linux_pcie_drv/commit/0fbb716ed8ba141ed82659a230c40971abd5e870

The new board we are using is a
Gateworks, 64xx Newport, GW6905-A
OCTEONTX

EspressoBin (aarch64): SPI IRQ error 11 (3)

Hello,
I am attempting to run XTRX with Marvell EspressoBin, which uses an Armada 3720 SoC. I built xtrx.ko with the workarounds mentioned in #5 with the following results:

% sudo ./test_xtrxll
13:11:46.213652 REGS:    XTRX PCI:/dev/xtrx0: Read  [001a] = 04000013
13:11:46.213950 INFO:    XTRX PCI:/dev/xtrx0: XTRX Rev4 (04000013)
13:11:46.214029 INFO:    XTRX PCI:/dev/xtrx0: RX DMA STOP MIMO (BLK:0 TS:0); TX DMA STOP MIMO
13:11:46.214088 REGS:    XTRX PCI:/dev/xtrx0: Write [000d] = c0000000
13:11:46.214142 REGS:    XTRX PCI:/dev/xtrx0: Write [000d] = 42000000
13:11:46.214195 REGS:    XTRX PCI:/dev/xtrx0: Write [0001] = 00008fff
13:11:46.214248 INFO:    XTRX PCI:/dev/xtrx0: Device `/dev/xtrx0` was opened
13:11:46.214305 REGS:    XTRX PCI:/dev/xtrx0: Write [0000] = 002fffff
13:11:48.248301 ERROR:   XTRX PCI:/dev/xtrx0: SPI IRQ error 11 (3)

Any thoughts on why the SPI IRQ error might be occurring? I will double-check that the device tree registers interrupts properly. The following is a lot of hopefully helpful diagnostic information:

% dmesg
<...>
[  177.983618] xtrx: Initializing 0000:00:00.0
[  177.985733] pps pps0: new PPS source xtrx_pps
[  177.993690] xtrx: buf[0]=7b000000 [virt 00000000bd8b3e84] => 7b0007ff
[  177.997660] xtrx: buf[1]=7b008000 [virt 000000003d095088] => 7b0087ff
[  178.004130] xtrx: buf[2]=7b010000 [virt 00000000c3a4b19b] => 7b0107ff
[  178.010800] xtrx: buf[3]=7b018000 [virt 000000003d8141d9] => 7b0187ff
[  178.017424] xtrx: buf[4]=7b020000 [virt 00000000f365c7f1] => 7b0207ff
[  178.024012] xtrx: buf[5]=7b028000 [virt 00000000d9c1cab4] => 7b0287ff
[  178.030663] xtrx: buf[6]=7b030000 [virt 000000005662bd8b] => 7b0307ff
[  178.037302] xtrx: buf[7]=7b038000 [virt 00000000c57d5ada] => 7b0387ff
[  178.043904] xtrx: buf[8]=7b040000 [virt 00000000367f10ff] => 7b0407ff
[  178.050553] xtrx: buf[9]=7b048000 [virt 000000005d95491c] => 7b0487ff
[  178.057191] xtrx: buf[10]=7b050000 [virt 00000000dfe3db47] => 7b0507ff
[  178.063886] xtrx: buf[11]=7b058000 [virt 00000000203e9bfb] => 7b0587ff
[  178.070623] xtrx: buf[12]=7b060000 [virt 0000000050d70d95] => 7b0607ff
[  178.077351] xtrx: buf[13]=7b068000 [virt 0000000045cdfe1a] => 7b0687ff
[  178.084045] xtrx: buf[14]=7b070000 [virt 000000001b49dc53] => 7b0707ff
[  178.090785] xtrx: buf[15]=7b078000 [virt 00000000956fd556] => 7b0787ff
[  178.097521] xtrx: buf[16]=7b080000 [virt 000000007ecec6fc] => 7b0807ff
[  178.104204] xtrx: buf[17]=7b088000 [virt 0000000030f4f040] => 7b0887ff
[  178.110945] xtrx: buf[18]=7b090000 [virt 00000000c4570789] => 7b0907ff
[  178.117669] xtrx: buf[19]=7b098000 [virt 000000000fb3e9e3] => 7b0987ff
[  178.124365] xtrx: buf[20]=7b0a0000 [virt 000000008f7d4502] => 7b0a07ff
[  178.131105] xtrx: buf[21]=7b0a8000 [virt 00000000e4b6d133] => 7b0a87ff
[  178.137832] xtrx: buf[22]=7b0b0000 [virt 00000000da15bbd7] => 7b0b07ff
[  178.144525] xtrx: buf[23]=7b0b8000 [virt 00000000f5aa8e31] => 7b0b87ff
[  178.151279] xtrx: buf[24]=7b0c0000 [virt 000000009abef9d4] => 7b0c07ff
[  178.157993] xtrx: buf[25]=7b0c8000 [virt 000000006f1f9c78] => 7b0c87ff
[  178.164685] xtrx: buf[26]=7b0d0000 [virt 00000000bad88ffe] => 7b0d07ff
[  178.171424] xtrx: buf[27]=7b0d8000 [virt 00000000f715dcb1] => 7b0d87ff
[  178.178153] xtrx: buf[28]=7b0e0000 [virt 000000000b54a943] => 7b0e07ff
[  178.184845] xtrx: buf[29]=7b0e8000 [virt 00000000a0b9d10c] => 7b0e87ff
[  178.191584] xtrx: buf[30]=7b0f0000 [virt 0000000027370929] => 7b0f07ff
[  178.198311] xtrx: buf[31]=7b0f8000 [virt 00000000f2ca8eba] => 7b0f87ff
[  178.205538] xtrx: buf[0]=7b100000 [virt 00000000004a2e3e] => 7b1007ff
[  178.211656] xtrx: buf[1]=7b108000 [virt 0000000044ca2047] => 7b1087ff
[  178.218291] xtrx: buf[2]=7b110000 [virt 00000000049ab720] => 7b1107ff
[  178.224896] xtrx: buf[3]=7b118000 [virt 000000007249b4e7] => 7b1187ff
[  178.231546] xtrx: buf[4]=7b120000 [virt 00000000846dde76] => 7b1207ff
[  178.238189] xtrx: buf[5]=7b128000 [virt 00000000f4d0127e] => 7b1287ff
[  178.244787] xtrx: buf[6]=7b130000 [virt 00000000d14a3f1b] => 7b1307ff
[  178.251435] xtrx: buf[7]=7b138000 [virt 00000000145e0860] => 7b1387ff
[  178.258087] xtrx: buf[8]=7b140000 [virt 00000000be557579] => 7b1407ff
[  178.264678] xtrx: buf[9]=7b148000 [virt 000000009b895660] => 7b1487ff
[  178.271331] xtrx: buf[10]=7b150000 [virt 00000000d953a50e] => 7b1507ff
[  178.278062] xtrx: buf[11]=7b158000 [virt 000000001c0ac5bb] => 7b1587ff
[  178.284749] xtrx: buf[12]=7b160000 [virt 0000000046585044] => 7b1607ff
[  178.291487] xtrx: buf[13]=7b168000 [virt 00000000b13c5e5a] => 7b1687ff
[  178.298216] xtrx: buf[14]=7b170000 [virt 00000000c664e730] => 7b1707ff
[  178.304909] xtrx: buf[15]=7b178000 [virt 00000000b41044c5] => 7b1787ff
[  178.311647] xtrx: buf[16]=7b180000 [virt 00000000d7333fa0] => 7b1807ff
[  178.318376] xtrx: buf[17]=7b188000 [virt 0000000019b47feb] => 7b1887ff
[  178.325069] xtrx: buf[18]=7b190000 [virt 000000008550e39d] => 7b1907ff
[  178.331808] xtrx: buf[19]=7b198000 [virt 00000000e4730166] => 7b1987ff
[  178.338535] xtrx: buf[20]=7b1a0000 [virt 00000000f7dd8ad5] => 7b1a07ff
[  178.345229] xtrx: buf[21]=7b1a8000 [virt 00000000b745660c] => 7b1a87ff
[  178.351966] xtrx: buf[22]=7b1b0000 [virt 00000000ad51071a] => 7b1b07ff
[  178.358694] xtrx: buf[23]=7b1b8000 [virt 00000000d6cca93d] => 7b1b87ff
[  178.365390] xtrx: buf[24]=7b1c0000 [virt 00000000c025592b] => 7b1c07ff
[  178.372126] xtrx: buf[25]=7b1c8000 [virt 0000000088e27a44] => 7b1c87ff
[  178.378855] xtrx: buf[26]=7b1d0000 [virt 00000000d00d4f2d] => 7b1d07ff
[  178.385549] xtrx: buf[27]=7b1d8000 [virt 000000002f31ac71] => 7b1d87ff
[  178.392287] xtrx: buf[28]=7b1e0000 [virt 00000000fbf00c4c] => 7b1e07ff
[  178.399016] xtrx: buf[29]=7b1e8000 [virt 000000001fa88d09] => 7b1e87ff
[  178.405735] xtrx: buf[30]=7b1f0000 [virt 00000000a39d4655] => 7b1f07ff
[  178.412429] xtrx: buf[31]=7b1f8000 [virt 0000000060f74f77] => 7b1f87ff
[  178.419227] xtrx: Port config: 0 (1)
[  178.422806] xtrx: Port request: 0
[  178.426318] 0000:00:00.0: ttyXTRX0 at MMIO 0x0 (irq = 0, base_baud = 9600) is a xtrx_uart
[  178.435129] xtrx: Port config: 1 (1)
[  178.438447] xtrx: Port request: 1
[  178.441719] 0000:00:00.0: ttyXTRX1 at MMIO 0x0 (irq = 0, base_baud = 9600) is a xtrx_uart
[  178.450233] xtrx: SIM mctrl=0
[  201.604351] xtrx: call: VMA=00000000ddb92d1f vma->vm_pgoff=0
[  201.607410] xtrx: mmap() call: VMA=00000000ddb92d1f vma->vm_pgoff=0 addr=000000007614b410 dev_addr=e8010000 bus_addr=ffff8000e8010000 phys_addr=e8010000
[  201.621435] xtrx: VMA open, virt ffffb45d9000, phys 0
[  201.626665] xtrx: call: VMA=00000000e58fa9b1 vma->vm_pgoff=1024
[  201.632687] xtrx: VMA open, virt ffffb45d8000, phys 400000
[  201.699280] xtrx: VMA close.
[  201.699404] xtrx: VMA close.
[  204.999250] xtrx: call: VMA=000000004d8d897c vma->vm_pgoff=0
[  205.002235] xtrx: mmap() call: VMA=000000004d8d897c vma->vm_pgoff=0 addr=000000007614b410 dev_addr=e8010000 bus_addr=ffff8000e8010000 phys_addr=e8010000
[  205.016379] xtrx: VMA open, virt ffffa3454000, phys 0
[  205.021527] xtrx: call: VMA=00000000e8e9fe0a vma->vm_pgoff=1024
[  205.027623] xtrx: VMA open, virt ffffa3453000, phys 400000
[  207.106294] xtrx: VMA close.
[  207.106409] xtrx: VMA close.
[  564.952044] xtrx: call: VMA=000000001ecc14c3 vma->vm_pgoff=0
[  564.955029] xtrx: mmap() call: VMA=000000001ecc14c3 vma->vm_pgoff=0 addr=000000007614b410 dev_addr=e8010000 bus_addr=ffff8000e8010000 phys_addr=e8010000
[  564.969182] xtrx: VMA open, virt ffffb8f69000, phys 0
[  564.974364] xtrx: call: VMA=00000000f200aed2 vma->vm_pgoff=1024
[  564.980381] xtrx: VMA open, virt ffffb8f68000, phys 400000
[  567.021726] xtrx: VMA close.
[  567.021840] xtrx: VMA close.
% sudo lspci -vvv
00:00.0 Memory controller: Xilinx Corporation Device 7012
	Subsystem: Xilinx Corporation Device 0007
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 32 bytes
	Interrupt: pin A routed to IRQ 69
	Region 0: Memory at e8010000 (32-bit, non-prefetchable) [size=4K]
	Region 1: Memory at e8000000 (32-bit, non-prefetchable) [size=64K]
	Capabilities: [40] Power Management version 3
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-)
		Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [48] MSI: Enable+ Count=4/16 Maskable- 64bit+
		Address: 0000000077071778  Data: 0045
	Capabilities: [60] Express (v2) Endpoint, MSI 04
		DevCap:	MaxPayload 256 bytes, PhantFunc 0, Latency L0s <64ns, L1 unlimited
			ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 0.000W
		DevCtl:	CorrErr- NonFatalErr- FatalErr- UnsupReq-
			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
			MaxPayload 256 bytes, MaxReadReq 2048 bytes
		DevSta:	CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr- TransPend-
		LnkCap:	Port #0, Speed 5GT/s, Width x2, ASPM L0s, Exit Latency L0s unlimited
			ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk-
			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 5GT/s (ok), Width x1 (downgraded)
			TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
		DevCap2: Completion Timeout: Range B, TimeoutDis-, LTR-, OBFF Not Supported
			 AtomicOpsCap: 32bit- 64bit- 128bitCAS-
		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled
			 AtomicOpsCtl: ReqEn-
		LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
			 Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
			 Compliance De-emphasis: -6dB
		LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete-, EqualizationPhase1-
			 EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
	Capabilities: [100 v1] Device Serial Number 00-00-00-00-12-34-56-78
	Kernel driver in use: xtrx

Encountering errors on transfers every 90 seconds or so

Not sure if this is the correct place to raise this issue.

If I do a 2 channel, 4Ms/s collection I get the follwing errors:

[INFO] SoapyXTRX::activateStream(RX) 0 Samples per packet; res = 0
Using avx for xtrxdsp_iq16_ic16i
10:01:02.358642 ERROR:  [BPCI] PCI:/dev/xtrx0: RX DMA STAT O- 00000000 Bytes -R03 00/32 I:33
10:01:02.358956 INFO:   [BPCI] PCI:/dev/xtrx0: BUF_OVF TS:396496896 WTS:396510465 WTS_NXT:396513280 TS_NXT:397561856 SKIP 260 buffers INT_S:0
10:01:02.358982 INFO:   [CTRL] PCI:/dev/xtrx0: Placing TC @397561856 on 0 data: 0 stat:21
10:01:02.622903 WARN:   [XTRX] PCI:/dev/xtrx0: Total=32768 Processed=0 UserTotal=2097152 UserProcessed=1048576 BUFTS=397561856+0 OURTS=396496896
10:02:35.472012 ERROR:  [BPCI] PCI:/dev/xtrx0: RX DMA STAT O- 00000000 Bytes -R03 32/00 I:33
10:02:35.472307 INFO:   [BPCI] PCI:/dev/xtrx0: BUF_OVF TS:768888832 WTS:768962097 WTS_NXT:768966656 TS_NXT:770015232 SKIP 275 buffers INT_S:0
10:02:35.472328 INFO:   [CTRL] PCI:/dev/xtrx0: Placing TC @770015232 on 0 data: 0 stat:22
10:02:35.736649 WARN:   [XTRX] PCI:/dev/xtrx0: Total=32768 Processed=0 UserTotal=2097152 UserProcessed=1048576 BUFTS=770015232+0 OURTS=768888832
10:04:07.855558 ERROR:  [BPCI] PCI:/dev/xtrx0: RX DMA STAT O- 00000000 Bytes -R03 00/32 I:33
10:04:07.855830 INFO:   [BPCI] PCI:/dev/xtrx0: BUF_OVF TS:1138458624 WTS:1138494733 WTS_NXT:1138499584 TS_NXT:1139548160 SKIP 266 buffers INT_S:0
10:04:07.855859 INFO:   [CTRL] PCI:/dev/xtrx0: Placing TC @1139548160 on 0 data: 0 stat:23
10:04:08.120284 WARN:   [XTRX] PCI:/dev/xtrx0: Total=32768 Processed=0 UserTotal=2097152 UserProcessed=1048576 BUFTS=1139548160+0 OURTS=1138458624
10:06:41.323252 ERROR:  [BPCI] PCI:/dev/xtrx0: RX DMA STAT O- 00000000 Bytes -R03 32/00 I:33
10:06:41.323548 INFO:   [BPCI] PCI:/dev/xtrx0: BUF_OVF TS:1752309760 WTS:1752363710 WTS_NXT:1752367104 TS_NXT:1753415680 SKIP 270 buffers INT_S:0
10:06:41.323566 INFO:   [CTRL] PCI:/dev/xtrx0: Placing TC @1753415680 on 0 data: 0 stat:24
10:06:41.587617 WARN:   [XTRX] PCI:/dev/xtrx0: Total=32768 Processed=0 UserTotal=2097152 UserProcessed=1048576 BUFTS=1753415680+0 OURTS=1752309760
10:07:36.935631 ERROR:  [BPCI] PCI:/dev/xtrx0: RX DMA STAT O- 00000000 Bytes -R03 00/32 I:33
10:07:36.935921 INFO:   [BPCI] PCI:/dev/xtrx0: BUF_OVF TS:1974796288 WTS:1974812644 WTS_NXT:1974816768 TS_NXT:1975865344 SKIP 261 buffers INT_S:0
10:07:36.935937 INFO:   [CTRL] PCI:/dev/xtrx0: Placing TC @1975865344 on 0 data: 0 stat:25
10:07:37.200174 WARN:   [XTRX] PCI:/dev/xtrx0: Total=32768 Processed=0 UserTotal=2097152 UserProcessed=1048576 BUFTS=1975865344+0 OURTS=1974796288
10:07:37.256576 ERROR:  [BPCI] PCI:/dev/xtrx0: RX DMA STAT O- 00000000 Bytes YR03 33/00 I:32
10:07:37.256777 INFO:   [BPCI] PCI:/dev/xtrx0: BUF_OVF TS:1975996416 WTS:1976096065 WTS_NXT:1976098816 TS_NXT:1977147392 SKIP 281 buffers INT_S:0
10:07:37.256797 INFO:   [CTRL] PCI:/dev/xtrx0: Placing TC @1977147392 on 0 data: 0 stat:26
10:07:37.520685 WARN:   [XTRX] PCI:/dev/xtrx0: Total=32768 Processed=0 UserTotal=2097152 UserProcessed=1048576 BUFTS=1977147392+0 OURTS=1975996416
10:07:51.778468 ERROR:  [BPCI] PCI:/dev/xtrx0: RX DMA STAT O- 00000000 Bytes -R03 00/32 I:33
10:07:51.778761 INFO:   [BPCI] PCI:/dev/xtrx0: BUF_OVF TS:2034163712 WTS:2034183868 WTS_NXT:2034188288 TS_NXT:2035236864 SKIP 262 buffers INT_S:0
10:07:51.778777 INFO:   [CTRL] PCI:/dev/xtrx0: Placing TC @2035236864 on 0 data: 0 stat:27
10:07:52.043089 WARN:   [XTRX] PCI:/dev/xtrx0: Total=32768 Processed=0 UserTotal=2097152 UserProcessed=1048576 BUFTS=2035236864+0 OURTS=2034163712
10:08:45.782112 ERROR:  [BPCI] PCI:/dev/xtrx0: RX DMA STAT O- 00000000 Bytes -R03 32/00 I:33
10:08:45.782382 INFO:   [BPCI] PCI:/dev/xtrx0: BUF_OVF TS:2250063872 WTS:-2044769411 WTS_NXT:-2044764160 TS_NXT:2251251712 SKIP 290 buffers INT_S:0
10:08:45.782398 INFO:   [CTRL] PCI:/dev/xtrx0: Placing TC @-2043715584 on 0 data: 0 stat:28
10:08:46.046922 WARN:   [XTRX] PCI:/dev/xtrx0: Total=32768 Processed=0 UserTotal=2097152 UserProcessed=1048576 BUFTS=2251251712+0 OURTS=2250063872
10:09:16.937402 ERROR:  [BPCI] PCI:/dev/xtrx0: RX DMA STAT O- 00000000 Bytes -R03 00/32 I:33
10:09:16.937696 INFO:   [BPCI] PCI:/dev/xtrx0: BUF_OVF TS:2374590464 WTS:-1920148404 WTS_NXT:-1920143360 TS_NXT:2375872512 SKIP 313 buffers INT_S:0
10:09:16.937715 INFO:   [CTRL] PCI:/dev/xtrx0: Placing TC @-1919094784 on 0 data: 0 stat:29
10:09:17.202199 WARN:   [XTRX] PCI:/dev/xtrx0: Total=32768 Processed=0 UserTotal=2097152 UserProcessed=1048576 BUFTS=2375872512+0 OURTS=2374590464
10:09:23.155773 ERROR:  [BPCI] PCI:/dev/xtrx0: RX DMA STAT O- 00000000 Bytes -R03 32/00 I:33
10:09:23.156076 INFO:   [BPCI] PCI:/dev/xtrx0: BUF_OVF TS:2399596544 WTS:-1895274931 WTS_NXT:-1895272448 TS_NXT:2400743424 SKIP 280 buffers INT_S:0
10:09:23.156096 INFO:   [CTRL] PCI:/dev/xtrx0: Placing TC @-1894223872 on 0 data: 0 stat:2a
10:09:23.419939 WARN:   [XTRX] PCI:/dev/xtrx0: Total=32768 Processed=0 UserTotal=2097152 UserProcessed=1048576 BUFTS=2400743424+0 OURTS=2399596544
10:09:54.675398 ERROR:  [BPCI] PCI:/dev/xtrx0: RX DMA STAT O- 00000000 Bytes -R03 00/32 I:33
10:09:54.675690 INFO:   [BPCI] PCI:/dev/xtrx0: BUF_OVF TS:2525655040 WTS:-1769196711 WTS_NXT:-1769193472 TS_NXT:2526822400 SKIP 285 buffers INT_S:0
10:09:54.675710 INFO:   [CTRL] PCI:/dev/xtrx0: Placing TC @-1768144896 on 0 data: 0 stat:2b
10:09:54.939740 WARN:   [XTRX] PCI:/dev/xtrx0: Total=32768 Processed=0 UserTotal=2097152 UserProcessed=1048576 BUFTS=2526822400+0 OURTS=2525655040
10:10:19.947162 ERROR:  [BPCI] PCI:/dev/xtrx0: RX DMA STAT O- 00000000 Bytes -R03 32/00 I:33
10:10:19.947449 INFO:   [BPCI] PCI:/dev/xtrx0: BUF_OVF TS:2626830336 WTS:-1668109847 WTS_NXT:-1668104192 TS_NXT:2627911680 SKIP 264 buffers INT_S:0
10:10:19.947466 INFO:   [CTRL] PCI:/dev/xtrx0: Placing TC @-1667055616 on 0 data: 0 stat:2c
10:10:20.212083 WARN:   [XTRX] PCI:/dev/xtrx0: Total=32768 Processed=0 UserTotal=2097152 UserProcessed=1048576 BUFTS=2627911680+0 OURTS=2626830336

When I process the data I see a number of issues every so often - so I'm expecting the errors above cause a glitch in the output data stream.

This is running on an old'ish i7 writing to a SSD running Debian unstable. I can do the same capture on a LimeSDR on USB3 on the same machine with no issues.

The script I'm running to do the capture is:

#!/bin/bash

dt=`date -u "+%Y%m%d_%H%M%S"`
freq=1574.92
srate=4000

rx_sdr -d driver=xtrx -f ${freq}M -F CS16 -N2 --gain0 90 --gain1 90 -n 4000M -A LNAH -B3.5M -s 4M gps_xtrx_${dt}_4000_${freq}_ch0.ci16 gps_xtrx_${dt}_4000_${freq}_ch1.ci16

and the rx_sdr program can be found here

Thanks,

Matt

Compilation fails with the kernel versions 4.11 and later

Build fails on Ubuntu 17.04 x64.

Output of the build:

make -C /lib/modules/4.12.8-041208-generic/build M=/home/ipse/work/xtrx/images.git/sources/xtrx_linux_pcie_drv modules
make[1]: Entering directory '/usr/src/linux-headers-4.12.8-041208-generic'
  CC [M]  /home/ipse/work/xtrx/images.git/sources/xtrx_linux_pcie_drv/xtrx.o
/home/ipse/work/xtrx/images.git/sources/xtrx_linux_pcie_drv/xtrx.c: In function ‘xtrx_probe’:
/home/ipse/work/xtrx/images.git/sources/xtrx_linux_pcie_drv/xtrx.c:1061:8: error: implicit declaration of function ‘pci_enable_msi_range’ [-Werror=implicit-function-declaration]
  err = pci_enable_msi_range(pdev, XTRX_MSI_COUNT, XTRX_MSI_COUNT);
        ^~~~~~~~~~~~~~~~~~~~
At top level:
/home/ipse/work/xtrx/images.git/sources/xtrx_linux_pcie_drv/xtrx.c:702:20: warning: ‘xtrx_msi_irq_single’ defined but not used [-Wunused-function]
 static irqreturn_t xtrx_msi_irq_single(int irq, void *data)
                    ^~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:308: recipe for target '/home/ipse/work/xtrx/images.git/sources/xtrx_linux_pcie_drv/xtrx.o' failed
make[2]: *** [/home/ipse/work/xtrx/images.git/sources/xtrx_linux_pcie_drv/xtrx.o] Error 1
Makefile:1515: recipe for target '_module_/home/ipse/work/xtrx/images.git/sources/xtrx_linux_pcie_drv' failed
make[1]: *** [_module_/home/ipse/work/xtrx/images.git/sources/xtrx_linux_pcie_drv] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.12.8-041208-generic'
Makefile:10: recipe for target 'modules' failed
make: *** [modules] Error 2

Timer API changes at some point

This allows to build with the newer timer API which has been in the kernel for a while.
And so this re-enabled the disabled uart_timer code.

Patch both in attachement and inline.

xtrx-fix-timer-api.txt

diff --git a/xtrx.c b/xtrx.c
index 00ad862..3a41a7b 100644
--- a/xtrx.c
+++ b/xtrx.c
@@ -410,10 +410,10 @@ txq_empty:
 // 20ms timer
 #define XTRX_UART_DELAY_TIME ((HZ/100)+1)
 
-static void xtrx_uart_timer(unsigned long data)
+static void xtrx_uart_timer(struct timer_list *tl)
 {
+	struct xtrx_dev* dev = from_timer(dev, tl, uart_timer);
 	unsigned tx_fifo_used;
-	struct xtrx_dev* dev = (struct xtrx_dev*)data;
 
 	spin_lock(&dev->port_gps.lock);
 	if (dev->gps_ctrl_state) {
@@ -511,20 +511,17 @@ static int xtrx_uart_init(struct xtrx_dev* dev)
 
 	dev->sim_ctrl_state = 0;
 
-	//init_timer(&dev->uart_timer);
-	dev->uart_timer.data = (unsigned long )dev;
-	dev->uart_timer.function = xtrx_uart_timer;
+	timer_setup(&dev->uart_timer, xtrx_uart_timer, 0);
 	dev->uart_timer.expires = jiffies + XTRX_UART_DELAY_TIME;
-	//add_timer(&dev->uart_timer);
+	add_timer(&dev->uart_timer);
 	return 0;
 }
 
 static void xtrx_uart_deinit(struct xtrx_dev* dev)
 {
-	//del_timer(&dev->uart_timer);
+	del_timer(&dev->uart_timer);
 	uart_remove_one_port(&xtrx_uart_driver, &dev->port_gps);
 	uart_remove_one_port(&xtrx_uart_driver, &dev->port_sim);
-
 }
 
 // DMA functions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.