Fixed
Created: Jun 27, 2018
Updated: Jul 8, 2020
Resolved Date: Aug 5, 2018
Found In Version: 8.0.0.26
Fix Version: 8.0.0.27
Severity: Severe
Applicable for: Wind River Linux 8
Component/s: BSP
On a EBB7804 board some invalid PCIe device memory regions appear when running lspci on WRL8 RCPL26. Instead of a region size 0, as would be expected, a region size of 2 is calculated and 3 invalid regions appear.
Maybe the resource size calculation goes wrong because of this code:
include/linux/ioport.h
static inline resource_size_t resource_size(const struct resource *res)
{
return res->end - res->start + 1;
}
#define HAVE_ARCH_PCI_RESOURCE_TO_USER
determines that the kernel uses the function above to calculate the resource size.
The size calculation works correctly on Cavium Linux - SDK version: Cavium Inc. OCTEON SDK version 3.1.2-p13, build 610
I've attached the logs from WRL8 and Cavium Linux for comparison.
Configure log:
configure --enable-board=cav-octeon3 --enable-kernel=preempt-rt --enable-rootfs=glibc_small+initramfs-integrated --enable-multilib=lib64 --enable-build=production --enable-jobs=1 --enable-parallel-pkgbuilds=1 --enable-reconfig --enable-checkout-all-layers=yes --enable-ccache=no --enable-rm-oldimgs=yes --with-init=systemd --enable-rm-work=no --with-rcpl-version=0026
WRL8 RCPL26 output:
root@localhost:~# lspci -nn -vv -xx -s 03:00.0
03:00.0 Ethernet controller [0200]: Intel Corporation 82572EI Gigabit Ethernet Controller (Copper) [8086:10b9] (rev 06)
Subsystem: Intel Corporation PRO/1000 PT Desktop Adapter [8086:1083]
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-
Interrupt: pin A routed to IRQ 369
Region 0: Memory at 11b00f0200000 (32-bit, non-prefetchable) [disabled] [size=128K]
Region 1: Memory at 11b00f0220000 (32-bit, non-prefetchable) [disabled] [size=128K]
Region 2: I/O ports at 1000 [disabled] [size=33]
Region 3: Memory at <unassigned> (32-bit, non-prefetchable) [disabled] [size=2]
Region 4: Memory at <unassigned> (32-bit, non-prefetchable) [disabled] [size=2]
Region 5: Memory at <unassigned> (32-bit, non-prefetchable) [disabled] [size=2]
[virtual] Expansion ROM at 11b00f0240000 [disabled] [size=128K]
[...]
Regions 3-5 should not appear above.
Expected output (Cavium linux SDK version 3.1.2-p13 :
~ # lspci -nn -vv -xx -s 03:00.0
03:00.0 Ethernet controller [0200]: Intel Corporation 82572EI Gigabit Ethernet Controller (Copper) [8086:10b9] (rev 06)
Subsystem: Intel Corporation PRO/1000 PT Desktop Adapter [8086:1083]
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: 64 bytes
Interrupt: pin A routed to IRQ 113
Region 0: Memory at 11b00f0a00000 (32-bit, non-prefetchable) [size=128K]
Region 1: Memory at 11b00f0a20000 (32-bit, non-prefetchable) [size=128K]
Region 2: I/O ports at 1000 [disabled] [size=32]
[virtual] Expansion ROM at 11b0140400000 [disabled] [size=128K]
[...]