Bug 256730

Summary: linsysfs adds duplicate pathnames on Ampere
Product: Base System Reporter: John F. Carr <jfc>
Component: kernAssignee: freebsd-emulation (Nobody) <emulation>
Status: New ---    
Severity: Affects Only Me CC: dch, emaste, mhorne
Priority: ---    
Version: 13.0-STABLE   
Hardware: arm64   
OS: Any   
Attachments:
Description Flags
dmesg output none

Description John F. Carr 2021-06-20 14:18:31 UTC
Created attachment 225948 [details]
dmesg output

On my Ampere arm64 server (but not on a Raspberry Pi 3B) I get a panic trying to load linsysfs with INVARIANTS defined.  The panic message is "pfs_add_node(): homonymous siblings".  With a debugging printf instead of a panic I see linsysfs_run_bus is trying to add several instances of "0000:00:00.0".

# ls /usr/jail/0/linux/sys/devices/pci0000:00
0000:00:00.0    0000:00:00.0    0000:00:00.0    0000:00:00.0
0000:00:00.0    0000:00:00.0    0000:00:00.0

There might be two bugs here -- bad PCI enumeration code for the Ampere server and a lack of defensive programming in the linsysfs kernel module.

I see some warnings from PCI code in attached dmesg output which might be related.
Comment 1 Ed Maste freebsd_committer 2021-06-22 00:16:47 UTC
Can you add the firmware version installed on the eMAG system?
Comment 2 John F. Carr 2021-06-22 13:52:16 UTC
(In reply to Ed Maste from comment #1)
The following is from the AMI boot screen.  Can I get it from the OS?

Version 2.19.1268
BIOS Version: 1.12 HVE104N(11/29/2019)
BMC firmware: 11.05.111